@attraccess/plugin-rabbitmq 0.1.0-nightly.1006.1 → 0.1.0-nightly.1016.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frontend/{__federation_expose_Plugin-ytcRKNWl.js → __federation_expose_Plugin-DGTGfene.js} +282 -83
- package/frontend/host-shared-placeholder-BvRk9kiK.js +0 -0
- package/frontend/remoteEntry.js +68 -2
- package/frontend/style.css +8 -0
- package/package.json +4 -3
- package/frontend/jsx-runtime-B9Qmn8k7.js +0 -42
- package/frontend/preload-helper-DxWiKyOd.js +0 -68
- package/frontend/react-D5kF5LxZ.js +0 -383
- package/frontend/rolldown-runtime-EAsCxrDo.js +0 -14
package/frontend/{__federation_expose_Plugin-ytcRKNWl.js → __federation_expose_Plugin-DGTGfene.js}
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { r as importShared } from "./_virtual___federation_fn_import-BXODRNto.js";
|
|
2
|
-
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
4
|
+
//#endregion
|
|
3
5
|
//#region ../../../libs/plugins-frontend-sdk/src/lib/frontend.api-client.ts
|
|
4
6
|
var BASE_URL_GLOBAL = "__ATTRACCESS_API_BASE_URL__";
|
|
5
7
|
/** The API origin the host is talking to. Falls back to the current origin. */
|
|
@@ -60,6 +62,50 @@ function createPluginApiClient(basePath = "") {
|
|
|
60
62
|
};
|
|
61
63
|
}
|
|
62
64
|
//#endregion
|
|
65
|
+
//#region ../../../node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
66
|
+
/**
|
|
67
|
+
* @license React
|
|
68
|
+
* react-jsx-runtime.production.js
|
|
69
|
+
*
|
|
70
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the MIT license found in the
|
|
73
|
+
* LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/
|
|
75
|
+
var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
76
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
|
|
77
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
78
|
+
function jsxProd(type, config, maybeKey) {
|
|
79
|
+
var key = null;
|
|
80
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
81
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
82
|
+
if ("key" in config) {
|
|
83
|
+
maybeKey = {};
|
|
84
|
+
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
|
85
|
+
} else maybeKey = config;
|
|
86
|
+
config = maybeKey.ref;
|
|
87
|
+
return {
|
|
88
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
89
|
+
type,
|
|
90
|
+
key,
|
|
91
|
+
ref: void 0 !== config ? config : null,
|
|
92
|
+
props: maybeKey
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
96
|
+
exports.jsx = jsxProd;
|
|
97
|
+
exports.jsxs = jsxProd;
|
|
98
|
+
}));
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region ../../../libs/plugins-frontend-sdk/src/lib/frontend.standard-drawer.tsx
|
|
101
|
+
var import_jsx_runtime = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
102
|
+
module.exports = require_react_jsx_runtime_production();
|
|
103
|
+
})))();
|
|
104
|
+
var { DrawerBackdrop, DrawerContent, DrawerDialog } = await importShared("@heroui/react");
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region ../../../libs/plugins-frontend-sdk/src/lib/frontend.standard-modal.tsx
|
|
107
|
+
var { Modal: Modal$3, ModalBackdrop: ModalBackdrop$3, ModalContainer: ModalContainer$3, ModalDialog: ModalDialog$3 } = await importShared("@heroui/react");
|
|
108
|
+
//#endregion
|
|
63
109
|
//#region frontend/src/detection.ts
|
|
64
110
|
var { useCallback: useCallback$1, useEffect: useEffect$3, useState: useState$3 } = await importShared("react");
|
|
65
111
|
var api$1 = createPluginApiClient("/api/rabbitmq/detection");
|
|
@@ -134,7 +180,6 @@ function useDetection(mqttServerId) {
|
|
|
134
180
|
}
|
|
135
181
|
//#endregion
|
|
136
182
|
//#region frontend/src/RabbitmqListBadge.tsx
|
|
137
|
-
var import_jsx_runtime = require_jsx_runtime();
|
|
138
183
|
var { Chip: Chip$2 } = await importShared("@heroui/react");
|
|
139
184
|
var { RabbitIcon: RabbitIcon$2 } = await importShared("lucide-react");
|
|
140
185
|
function RabbitmqListBadge({ mqttServerId }) {
|
|
@@ -148,6 +193,155 @@ function RabbitmqListBadge({ mqttServerId }) {
|
|
|
148
193
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RabbitIcon$2, { className: "rmq:w-3.5 rmq:h-3.5" }), "RabbitMQ"]
|
|
149
194
|
});
|
|
150
195
|
}
|
|
196
|
+
var en_default = {
|
|
197
|
+
page: { "description": "RabbitMQ management plugin. RabbitMQ MQTT servers show a detection badge and connection-status panel in the MQTT settings, and broker users can be managed (create, edit, permissions, delete) from the MQTT server detail view." },
|
|
198
|
+
status: {
|
|
199
|
+
"detected": "detected",
|
|
200
|
+
"refresh": "Refresh RabbitMQ status",
|
|
201
|
+
"reachable": "Management API reachable",
|
|
202
|
+
"auth": "Authentication",
|
|
203
|
+
"yes": "Yes",
|
|
204
|
+
"no": "No",
|
|
205
|
+
"ok": "OK",
|
|
206
|
+
"failed": "Failed",
|
|
207
|
+
"managementVersion": "Management API version",
|
|
208
|
+
"version": "RabbitMQ version",
|
|
209
|
+
"api": "Management API"
|
|
210
|
+
},
|
|
211
|
+
users: {
|
|
212
|
+
"title": "RabbitMQ users",
|
|
213
|
+
"reload": "Reload RabbitMQ users",
|
|
214
|
+
"add": "Add user",
|
|
215
|
+
"username": "Username",
|
|
216
|
+
"tags": "Tags",
|
|
217
|
+
"access": "Vhost access",
|
|
218
|
+
"actions": "Actions",
|
|
219
|
+
"none": "none",
|
|
220
|
+
"edit": "Edit user {{name}}",
|
|
221
|
+
"permissions": "Edit permissions of {{name}}",
|
|
222
|
+
"delete": "Delete user {{name}}",
|
|
223
|
+
"deleteTitle": "Delete user",
|
|
224
|
+
"deleteDescription": "Delete the RabbitMQ user {{name}}? Connected clients using this account will be disconnected and its permissions removed.",
|
|
225
|
+
"loadError": "Loading users failed.",
|
|
226
|
+
"deleteError": "Deleting the user failed."
|
|
227
|
+
},
|
|
228
|
+
form: {
|
|
229
|
+
"editTitle": "Edit user \"{{name}}\"",
|
|
230
|
+
"createTitle": "Create RabbitMQ user",
|
|
231
|
+
"usernamePlaceholder": "e.g. shop-floor-sensor",
|
|
232
|
+
"newPassword": "New password (leave blank to keep current)",
|
|
233
|
+
"password": "Password",
|
|
234
|
+
"tags": "Tags (comma-separated, e.g. management, administrator)",
|
|
235
|
+
"grant": "Grant default MQTT permissions",
|
|
236
|
+
"defaults": "Allows the user to publish and subscribe over MQTT: configure {{configure}}, write/read {{write}}.",
|
|
237
|
+
"vhost": "Vhost",
|
|
238
|
+
"available": " (available: {{vhosts}})",
|
|
239
|
+
"save": "Save changes",
|
|
240
|
+
"create": "Create user",
|
|
241
|
+
"usernameRequired": "Username is required.",
|
|
242
|
+
"passwordRequired": "Password is required when creating a user.",
|
|
243
|
+
"saveError": "Saving the user failed."
|
|
244
|
+
},
|
|
245
|
+
permissions: {
|
|
246
|
+
"title": "Permissions of \"{{name}}\"",
|
|
247
|
+
"remove": "Remove permissions on {{vhost}}",
|
|
248
|
+
"configure": "Configure",
|
|
249
|
+
"write": "Write",
|
|
250
|
+
"read": "Read",
|
|
251
|
+
"defaults": "Use MQTT defaults",
|
|
252
|
+
"empty": "This user has no permissions on any vhost — it cannot connect yet.",
|
|
253
|
+
"addVhost": "Add vhost",
|
|
254
|
+
"add": "Add",
|
|
255
|
+
"saveError": "Saving permissions failed.",
|
|
256
|
+
"removeError": "Removing permissions failed.",
|
|
257
|
+
"duplicate": "Permissions for vhost \"{{vhost}}\" are already listed.",
|
|
258
|
+
"summary": "configure: {{configure}}\nwrite: {{write}}\nread: {{read}}"
|
|
259
|
+
},
|
|
260
|
+
common: {
|
|
261
|
+
"cancel": "Cancel",
|
|
262
|
+
"close": "Close",
|
|
263
|
+
"save": "Save",
|
|
264
|
+
"delete": "Delete"
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
var de_default = {
|
|
268
|
+
page: { "description": "Plugin zur Verwaltung von RabbitMQ. RabbitMQ-MQTT-Server zeigen in den MQTT-Einstellungen eine Erkennungsmarkierung und ihren Verbindungsstatus. Broker-Benutzer können in der Detailansicht des MQTT-Servers angelegt, bearbeitet und gelöscht sowie ihre Berechtigungen verwaltet werden." },
|
|
269
|
+
status: {
|
|
270
|
+
"detected": "erkannt",
|
|
271
|
+
"refresh": "RabbitMQ-Status aktualisieren",
|
|
272
|
+
"reachable": "Management-API erreichbar",
|
|
273
|
+
"auth": "Authentifizierung",
|
|
274
|
+
"yes": "Ja",
|
|
275
|
+
"no": "Nein",
|
|
276
|
+
"ok": "OK",
|
|
277
|
+
"failed": "Fehlgeschlagen",
|
|
278
|
+
"managementVersion": "Version der Management-API",
|
|
279
|
+
"version": "RabbitMQ-Version",
|
|
280
|
+
"api": "Management-API"
|
|
281
|
+
},
|
|
282
|
+
users: {
|
|
283
|
+
"title": "RabbitMQ-Benutzer",
|
|
284
|
+
"reload": "RabbitMQ-Benutzer neu laden",
|
|
285
|
+
"add": "Benutzer hinzufügen",
|
|
286
|
+
"username": "Benutzername",
|
|
287
|
+
"tags": "Tags",
|
|
288
|
+
"access": "Vhost-Zugriff",
|
|
289
|
+
"actions": "Aktionen",
|
|
290
|
+
"none": "keine",
|
|
291
|
+
"edit": "Benutzer {{name}} bearbeiten",
|
|
292
|
+
"permissions": "Berechtigungen von {{name}} bearbeiten",
|
|
293
|
+
"delete": "Benutzer {{name}} löschen",
|
|
294
|
+
"deleteTitle": "Benutzer löschen",
|
|
295
|
+
"deleteDescription": "RabbitMQ-Benutzer {{name}} löschen? Verbundene Clients mit diesem Konto werden getrennt und seine Berechtigungen entfernt.",
|
|
296
|
+
"loadError": "Benutzer konnten nicht geladen werden.",
|
|
297
|
+
"deleteError": "Benutzer konnte nicht gelöscht werden."
|
|
298
|
+
},
|
|
299
|
+
form: {
|
|
300
|
+
"editTitle": "Benutzer \"{{name}}\" bearbeiten",
|
|
301
|
+
"createTitle": "RabbitMQ-Benutzer erstellen",
|
|
302
|
+
"usernamePlaceholder": "z. B. werkstatt-sensor",
|
|
303
|
+
"newPassword": "Neues Passwort (leer lassen, um das aktuelle beizubehalten)",
|
|
304
|
+
"password": "Passwort",
|
|
305
|
+
"tags": "Tags (kommagetrennt, z. B. management, administrator)",
|
|
306
|
+
"grant": "Standard-MQTT-Berechtigungen vergeben",
|
|
307
|
+
"defaults": "Erlaubt Veröffentlichen und Abonnieren über MQTT: Konfigurieren {{configure}}, Schreiben/Lesen {{write}}.",
|
|
308
|
+
"vhost": "Vhost",
|
|
309
|
+
"available": " (verfügbar: {{vhosts}})",
|
|
310
|
+
"save": "Änderungen speichern",
|
|
311
|
+
"create": "Benutzer erstellen",
|
|
312
|
+
"usernameRequired": "Ein Benutzername ist erforderlich.",
|
|
313
|
+
"passwordRequired": "Zum Erstellen eines Benutzers ist ein Passwort erforderlich.",
|
|
314
|
+
"saveError": "Benutzer konnte nicht gespeichert werden."
|
|
315
|
+
},
|
|
316
|
+
permissions: {
|
|
317
|
+
"title": "Berechtigungen von \"{{name}}\"",
|
|
318
|
+
"remove": "Berechtigungen für {{vhost}} entfernen",
|
|
319
|
+
"configure": "Konfigurieren",
|
|
320
|
+
"write": "Schreiben",
|
|
321
|
+
"read": "Lesen",
|
|
322
|
+
"defaults": "MQTT-Standardwerte verwenden",
|
|
323
|
+
"empty": "Dieser Benutzer hat keine Berechtigungen für einen Vhost und kann sich noch nicht verbinden.",
|
|
324
|
+
"addVhost": "Vhost hinzufügen",
|
|
325
|
+
"add": "Hinzufügen",
|
|
326
|
+
"saveError": "Berechtigungen konnten nicht gespeichert werden.",
|
|
327
|
+
"removeError": "Berechtigungen konnten nicht entfernt werden.",
|
|
328
|
+
"duplicate": "Berechtigungen für Vhost \"{{vhost}}\" sind bereits aufgeführt.",
|
|
329
|
+
"summary": "Konfigurieren: {{configure}}\nSchreiben: {{write}}\nLesen: {{read}}"
|
|
330
|
+
},
|
|
331
|
+
common: {
|
|
332
|
+
"cancel": "Abbrechen",
|
|
333
|
+
"close": "Schließen",
|
|
334
|
+
"save": "Speichern",
|
|
335
|
+
"delete": "Löschen"
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region frontend/src/i18n.ts
|
|
340
|
+
var { useTranslations } = await importShared("@attraccess/plugins-frontend-ui");
|
|
341
|
+
var useRabbitmqTranslations = () => useTranslations({
|
|
342
|
+
en: en_default,
|
|
343
|
+
de: de_default
|
|
344
|
+
}, { escapeValues: false });
|
|
151
345
|
//#endregion
|
|
152
346
|
//#region frontend/src/RabbitmqStatusPanel.tsx
|
|
153
347
|
var { Alert: Alert$3, AlertContent: AlertContent$3, AlertDescription: AlertDescription$3, Button: Button$3, Card: Card$2, Chip: Chip$1, Spinner: Spinner$1 } = await importShared("@heroui/react");
|
|
@@ -168,6 +362,7 @@ function StatusRow({ ok, label, value }) {
|
|
|
168
362
|
});
|
|
169
363
|
}
|
|
170
364
|
function RabbitmqStatusPanel({ mqttServerId }) {
|
|
365
|
+
const { t } = useRabbitmqTranslations();
|
|
171
366
|
const { result, loading, refresh } = useDetection(mqttServerId);
|
|
172
367
|
if (!result?.isRabbitMQ) return null;
|
|
173
368
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card$2, {
|
|
@@ -187,14 +382,14 @@ function RabbitmqStatusPanel({ mqttServerId }) {
|
|
|
187
382
|
color: "accent",
|
|
188
383
|
variant: "soft",
|
|
189
384
|
size: "sm",
|
|
190
|
-
children: "detected"
|
|
385
|
+
children: t("status.detected")
|
|
191
386
|
})
|
|
192
387
|
]
|
|
193
388
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$3, {
|
|
194
389
|
isIconOnly: true,
|
|
195
390
|
size: "sm",
|
|
196
391
|
variant: "ghost",
|
|
197
|
-
"aria-label": "
|
|
392
|
+
"aria-label": t("status.refresh"),
|
|
198
393
|
"data-cy": `rabbitmq-status-refresh-${mqttServerId}`,
|
|
199
394
|
onPress: refresh,
|
|
200
395
|
isDisabled: loading,
|
|
@@ -205,19 +400,19 @@ function RabbitmqStatusPanel({ mqttServerId }) {
|
|
|
205
400
|
children: [
|
|
206
401
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusRow, {
|
|
207
402
|
ok: result.reachable,
|
|
208
|
-
label: "
|
|
209
|
-
value: result.reachable ? "
|
|
403
|
+
label: t("status.reachable"),
|
|
404
|
+
value: t(result.reachable ? "status.yes" : "status.no")
|
|
210
405
|
}),
|
|
211
406
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusRow, {
|
|
212
407
|
ok: result.authOk,
|
|
213
|
-
label: "
|
|
214
|
-
value: result.authOk ? "
|
|
408
|
+
label: t("status.auth"),
|
|
409
|
+
value: t(result.authOk ? "status.ok" : "status.failed")
|
|
215
410
|
}),
|
|
216
411
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
217
412
|
className: "rmq:flex rmq:items-center rmq:justify-between rmq:gap-3 rmq:py-1.5",
|
|
218
413
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
219
414
|
className: "rmq:text-sm rmq:text-default-600",
|
|
220
|
-
children: "
|
|
415
|
+
children: t("status.managementVersion")
|
|
221
416
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
222
417
|
className: "rmq:text-sm rmq:font-medium rmq:text-default-700",
|
|
223
418
|
children: result.managementVersion ?? "—"
|
|
@@ -227,7 +422,7 @@ function RabbitmqStatusPanel({ mqttServerId }) {
|
|
|
227
422
|
className: "rmq:flex rmq:items-center rmq:justify-between rmq:gap-3 rmq:py-1.5",
|
|
228
423
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
229
424
|
className: "rmq:text-sm rmq:text-default-600",
|
|
230
|
-
children: "
|
|
425
|
+
children: t("status.version")
|
|
231
426
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
232
427
|
className: "rmq:text-sm rmq:font-medium rmq:text-default-700",
|
|
233
428
|
children: result.rabbitmqVersion ?? "—"
|
|
@@ -237,7 +432,7 @@ function RabbitmqStatusPanel({ mqttServerId }) {
|
|
|
237
432
|
className: "rmq:flex rmq:items-center rmq:justify-between rmq:gap-3 rmq:py-1.5",
|
|
238
433
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
239
434
|
className: "rmq:text-sm rmq:text-default-600",
|
|
240
|
-
children: "
|
|
435
|
+
children: t("status.api")
|
|
241
436
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
242
437
|
className: "rmq:text-xs rmq:text-default-500",
|
|
243
438
|
children: result.managementApi || "—"
|
|
@@ -290,6 +485,7 @@ var { Alert: Alert$2, AlertContent: AlertContent$2, AlertDescription: AlertDescr
|
|
|
290
485
|
var { PlusIcon: PlusIcon$1, Trash2Icon: Trash2Icon$1 } = await importShared("lucide-react");
|
|
291
486
|
var { useEffect: useEffect$2, useState: useState$2 } = await importShared("react");
|
|
292
487
|
function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
|
|
488
|
+
const { t } = useRabbitmqTranslations();
|
|
293
489
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
294
490
|
className: "rmq:flex rmq:flex-col rmq:gap-3 rmq:rounded-lg rmq:border rmq:border-default-200 rmq:dark:border-default-100 rmq:p-3",
|
|
295
491
|
"data-cy": `rabbitmq-permissions-row-${row.vhost}`,
|
|
@@ -298,12 +494,16 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
|
|
|
298
494
|
className: "rmq:flex rmq:items-center rmq:justify-between rmq:gap-2",
|
|
299
495
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
300
496
|
className: "rmq:text-sm rmq:font-semibold rmq:text-default-700",
|
|
301
|
-
children: [
|
|
497
|
+
children: [
|
|
498
|
+
t("form.vhost"),
|
|
499
|
+
" ",
|
|
500
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: row.vhost })
|
|
501
|
+
]
|
|
302
502
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$2, {
|
|
303
503
|
isIconOnly: true,
|
|
304
504
|
size: "sm",
|
|
305
505
|
variant: "ghost",
|
|
306
|
-
"aria-label":
|
|
506
|
+
"aria-label": t("permissions.remove", { vhost: row.vhost }),
|
|
307
507
|
onPress: onRemove,
|
|
308
508
|
isDisabled: busy,
|
|
309
509
|
"data-cy": `rabbitmq-permissions-remove-button-${row.vhost}`,
|
|
@@ -319,7 +519,7 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
|
|
|
319
519
|
...row,
|
|
320
520
|
configure: v
|
|
321
521
|
}),
|
|
322
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label$1, { children: "
|
|
522
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label$1, { children: t("permissions.configure") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input$1, {
|
|
323
523
|
autoComplete: "off",
|
|
324
524
|
"data-cy": `rabbitmq-permissions-configure-input-${row.vhost}`
|
|
325
525
|
})]
|
|
@@ -330,7 +530,7 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
|
|
|
330
530
|
...row,
|
|
331
531
|
write: v
|
|
332
532
|
}),
|
|
333
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label$1, { children: "
|
|
533
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label$1, { children: t("permissions.write") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input$1, {
|
|
334
534
|
autoComplete: "off",
|
|
335
535
|
"data-cy": `rabbitmq-permissions-write-input-${row.vhost}`
|
|
336
536
|
})]
|
|
@@ -341,7 +541,7 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
|
|
|
341
541
|
...row,
|
|
342
542
|
read: v
|
|
343
543
|
}),
|
|
344
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label$1, { children: "
|
|
544
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label$1, { children: t("permissions.read") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input$1, {
|
|
345
545
|
autoComplete: "off",
|
|
346
546
|
"data-cy": `rabbitmq-permissions-read-input-${row.vhost}`
|
|
347
547
|
})]
|
|
@@ -349,7 +549,7 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
|
|
|
349
549
|
]
|
|
350
550
|
}),
|
|
351
551
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
352
|
-
className: "rmq:flex rmq:justify-end rmq:gap-2",
|
|
552
|
+
className: "rmq:flex rmq:flex-wrap rmq:justify-end rmq:gap-2",
|
|
353
553
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$2, {
|
|
354
554
|
size: "sm",
|
|
355
555
|
variant: "ghost",
|
|
@@ -359,20 +559,21 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
|
|
|
359
559
|
}),
|
|
360
560
|
isDisabled: busy,
|
|
361
561
|
"data-cy": `rabbitmq-permissions-mqtt-defaults-button-${row.vhost}`,
|
|
362
|
-
children: "
|
|
562
|
+
children: t("permissions.defaults")
|
|
363
563
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$2, {
|
|
364
564
|
size: "sm",
|
|
365
565
|
variant: "primary",
|
|
366
566
|
onPress: onSave,
|
|
367
567
|
isPending: busy,
|
|
368
568
|
"data-cy": `rabbitmq-permissions-save-button-${row.vhost}`,
|
|
369
|
-
children: "
|
|
569
|
+
children: t("common.save")
|
|
370
570
|
})]
|
|
371
571
|
})
|
|
372
572
|
]
|
|
373
573
|
});
|
|
374
574
|
}
|
|
375
575
|
function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose, onSaved }) {
|
|
576
|
+
const { t, tMessage } = useRabbitmqTranslations();
|
|
376
577
|
const [rows, setRows] = useState$2([]);
|
|
377
578
|
const [newVhost, setNewVhost] = useState$2("");
|
|
378
579
|
const [busyVhost, setBusyVhost] = useState$2(null);
|
|
@@ -408,7 +609,7 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
|
|
|
408
609
|
});
|
|
409
610
|
onSaved();
|
|
410
611
|
} catch (err) {
|
|
411
|
-
setError(err instanceof Error ? err.message : "
|
|
612
|
+
setError(err instanceof Error ? err.message : { key: "permissions.saveError" });
|
|
412
613
|
} finally {
|
|
413
614
|
setBusyVhost(null);
|
|
414
615
|
}
|
|
@@ -426,7 +627,7 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
|
|
|
426
627
|
setRows((current) => current.filter((_, i) => i !== index));
|
|
427
628
|
onSaved();
|
|
428
629
|
} catch (err) {
|
|
429
|
-
setError(err instanceof Error ? err.message : "
|
|
630
|
+
setError(err instanceof Error ? err.message : { key: "permissions.removeError" });
|
|
430
631
|
} finally {
|
|
431
632
|
setBusyVhost(null);
|
|
432
633
|
}
|
|
@@ -435,7 +636,10 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
|
|
|
435
636
|
const vhost = newVhost.trim();
|
|
436
637
|
if (vhost.length === 0) return;
|
|
437
638
|
if (rows.some((row) => row.vhost === vhost)) {
|
|
438
|
-
setError(
|
|
639
|
+
setError({
|
|
640
|
+
key: "permissions.duplicate",
|
|
641
|
+
data: { vhost }
|
|
642
|
+
});
|
|
439
643
|
return;
|
|
440
644
|
}
|
|
441
645
|
setRows((current) => [...current, {
|
|
@@ -456,18 +660,14 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
|
|
|
456
660
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalBackdrop$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalContainer$2, {
|
|
457
661
|
size: "lg",
|
|
458
662
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalDialog$2, { children: [
|
|
459
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
460
|
-
"Permissions of \"",
|
|
461
|
-
user.name,
|
|
462
|
-
"\""
|
|
463
|
-
] }) }),
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading$2, { children: t("permissions.title", { name: user.name }) }) }),
|
|
464
664
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody$2, {
|
|
465
665
|
className: "rmq:flex rmq:flex-col rmq:gap-4 rmq:w-full",
|
|
466
666
|
children: [
|
|
467
667
|
rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
468
668
|
className: "rmq:text-sm rmq:text-default-500",
|
|
469
669
|
"data-cy": "rabbitmq-permissions-empty",
|
|
470
|
-
children: "
|
|
670
|
+
children: t("permissions.empty")
|
|
471
671
|
}),
|
|
472
672
|
rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PermissionEditor, {
|
|
473
673
|
row,
|
|
@@ -482,7 +682,7 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
|
|
|
482
682
|
value: newVhost,
|
|
483
683
|
onChange: setNewVhost,
|
|
484
684
|
className: "rmq:flex-1",
|
|
485
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label$1, { children: ["
|
|
685
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label$1, { children: [t("permissions.addVhost"), unusedVhosts.length > 0 ? t("form.available", { vhosts: unusedVhosts.join(", ") }) : ""] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input$1, {
|
|
486
686
|
placeholder: "/",
|
|
487
687
|
autoComplete: "off",
|
|
488
688
|
"data-cy": "rabbitmq-permissions-add-vhost-input"
|
|
@@ -492,13 +692,13 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
|
|
|
492
692
|
onPress: addVhost,
|
|
493
693
|
isDisabled: newVhost.trim().length === 0,
|
|
494
694
|
"data-cy": "rabbitmq-permissions-add-vhost-button",
|
|
495
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlusIcon$1, { className: "rmq:w-4 rmq:h-4" }), "
|
|
695
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlusIcon$1, { className: "rmq:w-4 rmq:h-4" }), t("permissions.add")]
|
|
496
696
|
})]
|
|
497
697
|
}),
|
|
498
698
|
error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$2, {
|
|
499
699
|
status: "danger",
|
|
500
700
|
"data-cy": "rabbitmq-permissions-error-alert",
|
|
501
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$2, { children: error }) })
|
|
701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$2, { children: tMessage(error) }) })
|
|
502
702
|
})
|
|
503
703
|
]
|
|
504
704
|
}),
|
|
@@ -506,7 +706,7 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
|
|
|
506
706
|
variant: "secondary",
|
|
507
707
|
onPress: onClose,
|
|
508
708
|
"data-cy": "rabbitmq-permissions-close-button",
|
|
509
|
-
children: "
|
|
709
|
+
children: t("common.close")
|
|
510
710
|
}) })
|
|
511
711
|
] })
|
|
512
712
|
}) })
|
|
@@ -520,6 +720,7 @@ function parseTags(value) {
|
|
|
520
720
|
return value.split(",").map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
521
721
|
}
|
|
522
722
|
function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, onSaved }) {
|
|
723
|
+
const { t, tMessage } = useRabbitmqTranslations();
|
|
523
724
|
const isEdit = user !== null;
|
|
524
725
|
const [username, setUsername] = useState$1("");
|
|
525
726
|
const [password, setPassword] = useState$1("");
|
|
@@ -545,11 +746,11 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
545
746
|
e.preventDefault();
|
|
546
747
|
const name = username.trim();
|
|
547
748
|
if (name.length === 0) {
|
|
548
|
-
setError(
|
|
749
|
+
setError({ key: "form.usernameRequired" });
|
|
549
750
|
return;
|
|
550
751
|
}
|
|
551
752
|
if (!isEdit && password.length === 0) {
|
|
552
|
-
setError(
|
|
753
|
+
setError({ key: "form.passwordRequired" });
|
|
553
754
|
return;
|
|
554
755
|
}
|
|
555
756
|
const body = { tags: parseTags(tags) };
|
|
@@ -565,7 +766,7 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
565
766
|
onSaved();
|
|
566
767
|
onClose();
|
|
567
768
|
} catch (err) {
|
|
568
|
-
setError(err instanceof Error ? err.message :
|
|
769
|
+
setError(err instanceof Error ? err.message : { key: "form.saveError" });
|
|
569
770
|
} finally {
|
|
570
771
|
setSaving(false);
|
|
571
772
|
}
|
|
@@ -578,7 +779,7 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
578
779
|
"data-cy": `rabbitmq-user-form-modal-${mqttServerId}`,
|
|
579
780
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalBackdrop$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalContainer$1, {
|
|
580
781
|
size: "md",
|
|
581
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalDialog$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading$1, { children: isEdit ?
|
|
782
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalDialog$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading$1, { children: isEdit ? t("form.editTitle", { name: user.name }) : t("form.createTitle") }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Form, {
|
|
582
783
|
onSubmit: handleSubmit,
|
|
583
784
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody$1, {
|
|
584
785
|
className: "rmq:flex rmq:flex-col rmq:gap-4 rmq:w-full",
|
|
@@ -588,9 +789,9 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
588
789
|
onChange: setUsername,
|
|
589
790
|
className: "rmq:w-full",
|
|
590
791
|
isDisabled: isEdit,
|
|
591
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: "
|
|
792
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t("users.username") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
592
793
|
name: "rabbitmq-username",
|
|
593
|
-
placeholder: "
|
|
794
|
+
placeholder: t("form.usernamePlaceholder"),
|
|
594
795
|
autoComplete: "off",
|
|
595
796
|
"data-cy": "rabbitmq-user-form-username-input"
|
|
596
797
|
})]
|
|
@@ -599,7 +800,7 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
599
800
|
value: password,
|
|
600
801
|
onChange: setPassword,
|
|
601
802
|
className: "rmq:w-full",
|
|
602
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: isEdit ? "
|
|
803
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t(isEdit ? "form.newPassword" : "form.password") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
603
804
|
name: "rabbitmq-password",
|
|
604
805
|
type: "password",
|
|
605
806
|
autoComplete: "new-password",
|
|
@@ -610,9 +811,9 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
610
811
|
value: tags,
|
|
611
812
|
onChange: setTags,
|
|
612
813
|
className: "rmq:w-full",
|
|
613
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: "
|
|
814
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t("form.tags") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
614
815
|
name: "rabbitmq-tags",
|
|
615
|
-
placeholder: "none",
|
|
816
|
+
placeholder: t("users.none"),
|
|
616
817
|
autoComplete: "off",
|
|
617
818
|
"data-cy": "rabbitmq-user-form-tags-input"
|
|
618
819
|
})]
|
|
@@ -624,25 +825,23 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
624
825
|
isSelected: grantMqttDefaults,
|
|
625
826
|
onChange: setGrantMqttDefaults,
|
|
626
827
|
"data-cy": "rabbitmq-user-form-mqtt-defaults-checkbox",
|
|
627
|
-
children:
|
|
828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Checkbox.Content, {
|
|
829
|
+
className: "rmq:items-start",
|
|
830
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Control, {
|
|
831
|
+
className: "rmq:mt-0.5",
|
|
832
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Indicator, {})
|
|
833
|
+
}), t("form.grant")]
|
|
834
|
+
})
|
|
628
835
|
}),
|
|
629
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
836
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
630
837
|
className: "rmq:text-xs rmq:text-default-500",
|
|
631
|
-
children:
|
|
632
|
-
"Allows the user to publish and subscribe over MQTT: configure",
|
|
633
|
-
" ",
|
|
634
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: DEFAULT_MQTT_PERMISSIONS.configure }),
|
|
635
|
-
", write/read",
|
|
636
|
-
" ",
|
|
637
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: DEFAULT_MQTT_PERMISSIONS.write }),
|
|
638
|
-
"."
|
|
639
|
-
]
|
|
838
|
+
children: t("form.defaults", DEFAULT_MQTT_PERMISSIONS)
|
|
640
839
|
}),
|
|
641
840
|
grantMqttDefaults && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
|
|
642
841
|
value: vhost,
|
|
643
842
|
onChange: setVhost,
|
|
644
843
|
className: "rmq:w-full",
|
|
645
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label, { children: ["
|
|
844
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Label, { children: [t("form.vhost"), vhosts.length > 0 ? t("form.available", { vhosts: vhosts.join(", ") }) : ""] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
646
845
|
name: "rabbitmq-vhost",
|
|
647
846
|
placeholder: "/",
|
|
648
847
|
autoComplete: "off",
|
|
@@ -654,20 +853,20 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
|
|
|
654
853
|
error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$1, {
|
|
655
854
|
status: "danger",
|
|
656
855
|
"data-cy": "rabbitmq-user-form-error-alert",
|
|
657
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$1, { children: error }) })
|
|
856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$1, { children: tMessage(error) }) })
|
|
658
857
|
})
|
|
659
858
|
]
|
|
660
859
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalFooter$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
661
860
|
variant: "secondary",
|
|
662
861
|
onPress: onClose,
|
|
663
862
|
"data-cy": "rabbitmq-user-form-cancel-button",
|
|
664
|
-
children: "
|
|
863
|
+
children: t("common.cancel")
|
|
665
864
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
666
865
|
variant: "primary",
|
|
667
866
|
type: "submit",
|
|
668
867
|
isPending: saving,
|
|
669
868
|
"data-cy": "rabbitmq-user-form-save-button",
|
|
670
|
-
children: isEdit ? "
|
|
869
|
+
children: t(isEdit ? "form.save" : "form.create")
|
|
671
870
|
})] })]
|
|
672
871
|
})] })
|
|
673
872
|
}) })
|
|
@@ -679,21 +878,23 @@ var { Alert, AlertContent, AlertDescription, Button, Card: Card$1, Chip, Modal,
|
|
|
679
878
|
var { KeyRoundIcon, PencilIcon, PlusIcon, RefreshCwIcon, Trash2Icon, UsersIcon } = await importShared("lucide-react");
|
|
680
879
|
var { useCallback, useEffect, useRef, useState } = await importShared("react");
|
|
681
880
|
function PermissionChips({ user }) {
|
|
881
|
+
const { t } = useRabbitmqTranslations();
|
|
682
882
|
if (user.permissions.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
683
883
|
className: "rmq:text-xs rmq:text-default-400",
|
|
684
|
-
children: "none"
|
|
884
|
+
children: t("users.none")
|
|
685
885
|
});
|
|
686
886
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
687
887
|
className: "rmq:flex rmq:flex-wrap rmq:gap-1",
|
|
688
888
|
children: user.permissions.map((permission) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Chip, {
|
|
689
889
|
size: "sm",
|
|
690
890
|
variant: "soft",
|
|
691
|
-
title:
|
|
891
|
+
title: t("permissions.summary", { ...permission }),
|
|
692
892
|
children: permission.vhost
|
|
693
893
|
}, permission.vhost))
|
|
694
894
|
});
|
|
695
895
|
}
|
|
696
896
|
function RabbitmqUserPanel({ mqttServerId }) {
|
|
897
|
+
const { t, tMessage, language } = useRabbitmqTranslations();
|
|
697
898
|
const { result } = useDetection(mqttServerId);
|
|
698
899
|
const [data, setData] = useState(null);
|
|
699
900
|
const [loading, setLoading] = useState(false);
|
|
@@ -721,7 +922,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
721
922
|
setPermissionsUser((current) => current ? list.users.find((user) => user.name === current.name) ?? current : null);
|
|
722
923
|
}
|
|
723
924
|
} catch (err) {
|
|
724
|
-
if (mounted.current) setLoadError(err instanceof Error ? err.message : "
|
|
925
|
+
if (mounted.current) setLoadError(err instanceof Error ? err.message : { key: "users.loadError" });
|
|
725
926
|
} finally {
|
|
726
927
|
if (mounted.current) setLoading(false);
|
|
727
928
|
}
|
|
@@ -740,7 +941,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
740
941
|
setUserToDelete(null);
|
|
741
942
|
reload();
|
|
742
943
|
} catch (err) {
|
|
743
|
-
setDeleteError(err instanceof Error ? err.message :
|
|
944
|
+
setDeleteError(err instanceof Error ? err.message : { key: "users.deleteError" });
|
|
744
945
|
} finally {
|
|
745
946
|
setDeleting(false);
|
|
746
947
|
}
|
|
@@ -755,7 +956,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
755
956
|
className: "rmq:flex rmq:items-center rmq:gap-2",
|
|
756
957
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsersIcon, { className: "rmq:w-5 rmq:h-5 rmq:text-accent-soft-foreground" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
757
958
|
className: "rmq:text-base rmq:font-semibold rmq:text-default-700",
|
|
758
|
-
children: "
|
|
959
|
+
children: t("users.title")
|
|
759
960
|
})]
|
|
760
961
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
761
962
|
className: "rmq:flex rmq:items-center rmq:gap-2",
|
|
@@ -763,7 +964,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
763
964
|
isIconOnly: true,
|
|
764
965
|
size: "sm",
|
|
765
966
|
variant: "ghost",
|
|
766
|
-
"aria-label": "
|
|
967
|
+
"aria-label": t("users.reload"),
|
|
767
968
|
onPress: () => void reload(),
|
|
768
969
|
isDisabled: loading,
|
|
769
970
|
"data-cy": `rabbitmq-user-panel-reload-${mqttServerId}`,
|
|
@@ -776,7 +977,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
776
977
|
setFormOpen(true);
|
|
777
978
|
},
|
|
778
979
|
"data-cy": `rabbitmq-user-panel-create-button-${mqttServerId}`,
|
|
779
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlusIcon, { className: "rmq:w-4 rmq:h-4" }), "
|
|
980
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlusIcon, { className: "rmq:w-4 rmq:h-4" }), t("users.add")]
|
|
780
981
|
})]
|
|
781
982
|
})]
|
|
782
983
|
}),
|
|
@@ -786,7 +987,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
786
987
|
loadError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert, {
|
|
787
988
|
status: "danger",
|
|
788
989
|
"data-cy": "rabbitmq-user-panel-error-alert",
|
|
789
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: loadError }) })
|
|
990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: tMessage(loadError) }) })
|
|
790
991
|
}),
|
|
791
992
|
!data && !loadError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
792
993
|
className: "rmq:flex rmq:items-center rmq:justify-center rmq:p-4",
|
|
@@ -795,17 +996,18 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
795
996
|
data && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table, {
|
|
796
997
|
"data-cy": "rabbitmq-user-panel-table",
|
|
797
998
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableScrollContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableContent, {
|
|
798
|
-
"aria-label": "
|
|
999
|
+
"aria-label": t("users.title"),
|
|
799
1000
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableHeader, { children: [
|
|
800
1001
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableColumn, {
|
|
801
1002
|
isRowHeader: true,
|
|
802
|
-
children: "
|
|
1003
|
+
children: t("users.username")
|
|
803
1004
|
}),
|
|
804
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableColumn, { children: "
|
|
805
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableColumn, { children: "
|
|
806
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableColumn, { children: "
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableColumn, { children: t("users.tags") }),
|
|
1006
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableColumn, { children: t("users.access") }),
|
|
1007
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableColumn, { children: t("users.actions") })
|
|
807
1008
|
] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableBody, {
|
|
808
1009
|
items: data.users,
|
|
1010
|
+
dependencies: [language],
|
|
809
1011
|
children: (user) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
|
|
810
1012
|
id: user.name,
|
|
811
1013
|
children: [
|
|
@@ -815,7 +1017,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
815
1017
|
}),
|
|
816
1018
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: user.tags.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
817
1019
|
className: "rmq:text-xs rmq:text-default-400",
|
|
818
|
-
children: "none"
|
|
1020
|
+
children: t("users.none")
|
|
819
1021
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
820
1022
|
className: "rmq:flex rmq:flex-wrap rmq:gap-1",
|
|
821
1023
|
children: user.tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Chip, {
|
|
@@ -833,7 +1035,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
833
1035
|
isIconOnly: true,
|
|
834
1036
|
size: "sm",
|
|
835
1037
|
variant: "ghost",
|
|
836
|
-
"aria-label":
|
|
1038
|
+
"aria-label": t("users.edit", { name: user.name }),
|
|
837
1039
|
onPress: () => {
|
|
838
1040
|
setFormUser(user);
|
|
839
1041
|
setFormOpen(true);
|
|
@@ -845,7 +1047,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
845
1047
|
isIconOnly: true,
|
|
846
1048
|
size: "sm",
|
|
847
1049
|
variant: "ghost",
|
|
848
|
-
"aria-label":
|
|
1050
|
+
"aria-label": t("users.permissions", { name: user.name }),
|
|
849
1051
|
onPress: () => setPermissionsUser(user),
|
|
850
1052
|
"data-cy": `rabbitmq-user-permissions-button-${user.name}`,
|
|
851
1053
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KeyRoundIcon, { className: "rmq:w-4 rmq:h-4" })
|
|
@@ -854,7 +1056,7 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
854
1056
|
isIconOnly: true,
|
|
855
1057
|
size: "sm",
|
|
856
1058
|
variant: "ghost",
|
|
857
|
-
"aria-label":
|
|
1059
|
+
"aria-label": t("users.delete", { name: user.name }),
|
|
858
1060
|
onPress: () => {
|
|
859
1061
|
setDeleteError(null);
|
|
860
1062
|
setUserToDelete(user);
|
|
@@ -896,30 +1098,26 @@ function RabbitmqUserPanel({ mqttServerId }) {
|
|
|
896
1098
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalBackdrop, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalContainer, {
|
|
897
1099
|
size: "sm",
|
|
898
1100
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalDialog, { children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
899
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading, { children: "
|
|
1101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading, { children: t("users.deleteTitle") }) }),
|
|
900
1102
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody, {
|
|
901
1103
|
className: "rmq:flex rmq:flex-col rmq:gap-3",
|
|
902
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.
|
|
903
|
-
"Delete the RabbitMQ user ",
|
|
904
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: userToDelete?.name }),
|
|
905
|
-
"? Connected clients using this account will be disconnected and its permissions removed."
|
|
906
|
-
] }), deleteError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert, {
|
|
1104
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: t("users.deleteDescription", { name: userToDelete?.name }) }), deleteError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert, {
|
|
907
1105
|
status: "danger",
|
|
908
1106
|
"data-cy": "rabbitmq-user-delete-error-alert",
|
|
909
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: deleteError }) })
|
|
1107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: tMessage(deleteError) }) })
|
|
910
1108
|
})]
|
|
911
1109
|
}),
|
|
912
1110
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalFooter, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
913
1111
|
variant: "secondary",
|
|
914
1112
|
onPress: close,
|
|
915
1113
|
"data-cy": "rabbitmq-user-delete-cancel-button",
|
|
916
|
-
children: "
|
|
1114
|
+
children: t("common.cancel")
|
|
917
1115
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
918
1116
|
variant: "danger",
|
|
919
1117
|
onPress: () => void confirmDelete(),
|
|
920
1118
|
isPending: deleting,
|
|
921
1119
|
"data-cy": "rabbitmq-user-delete-confirm-button",
|
|
922
|
-
children: "
|
|
1120
|
+
children: t("common.delete")
|
|
923
1121
|
})] })
|
|
924
1122
|
] }) })
|
|
925
1123
|
}) })
|
|
@@ -942,6 +1140,7 @@ function RabbitmqDetailSlot({ mqttServerId }) {
|
|
|
942
1140
|
});
|
|
943
1141
|
}
|
|
944
1142
|
function RabbitmqPage() {
|
|
1143
|
+
const { t } = useRabbitmqTranslations();
|
|
945
1144
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
946
1145
|
className: "rmq:flex rmq:flex-col rmq:gap-6 rmq:p-6 rmq:max-w-4xl rmq:mx-auto",
|
|
947
1146
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -954,7 +1153,7 @@ function RabbitmqPage() {
|
|
|
954
1153
|
className: "rmq:border rmq:border-default-200 rmq:dark:border-default-100",
|
|
955
1154
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
956
1155
|
className: "rmq:text-sm rmq:text-default-500",
|
|
957
|
-
children: "
|
|
1156
|
+
children: t("page.description")
|
|
958
1157
|
}) })
|
|
959
1158
|
})]
|
|
960
1159
|
});
|