@attraccess/plugin-rabbitmq 0.1.0-nightly.1089.1 → 0.1.0-nightly.1106.2

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.
@@ -110,10 +110,10 @@ var identities = globalThis;
110
110
  identities[identityKey] ??= createContext(null);
111
111
  //#endregion
112
112
  //#region ../../../libs/plugins-frontend-sdk/src/lib/frontend.standard-drawer.tsx
113
- var { DrawerBackdrop, DrawerContent, DrawerDialog } = await importShared("@heroui/react");
113
+ var { StandardDrawer: SharedStandardDrawer } = await importShared("@attraccess/plugins-frontend-ui");
114
114
  //#endregion
115
115
  //#region ../../../libs/plugins-frontend-sdk/src/lib/frontend.standard-modal.tsx
116
- var { Modal: Modal$3, ModalBackdrop: ModalBackdrop$3, ModalContainer: ModalContainer$3, ModalDialog: ModalDialog$3 } = await importShared("@heroui/react");
116
+ var { StandardModal: SharedStandardModal } = await importShared("@attraccess/plugins-frontend-ui");
117
117
  //#endregion
118
118
  //#region frontend/src/detection/detection.ts
119
119
  var { useCallback: useCallback$1, useEffect: useEffect$3, useState: useState$3 } = await importShared("react");
@@ -351,7 +351,8 @@ var useRabbitmqTranslations = () => useTranslations({
351
351
  }, { escapeValues: false });
352
352
  //#endregion
353
353
  //#region frontend/src/detection/RabbitmqStatusPanel.tsx
354
- var { Alert: Alert$4, AlertContent: AlertContent$4, AlertDescription: AlertDescription$4, Button: Button$5, Card: Card$2, Chip: Chip$1, Spinner: Spinner$2 } = await importShared("@heroui/react");
354
+ var { Button: Button$4 } = await importShared("@attraccess/plugins-frontend-ui");
355
+ var { Alert: Alert$2, AlertContent: AlertContent$2, AlertDescription: AlertDescription$2, Card: Card$2, Chip: Chip$1 } = await importShared("@heroui/react");
355
356
  var { CheckCircle2Icon, RabbitIcon, RefreshCwIcon: RefreshCwIcon$1, XCircleIcon } = await importShared("lucide-react");
356
357
  function StatusRow({ ok, label, value }) {
357
358
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -392,15 +393,15 @@ function RabbitmqStatusPanel({ mqttServerId }) {
392
393
  children: t("status.detected")
393
394
  })
394
395
  ]
395
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$5, {
396
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$4, {
396
397
  isIconOnly: true,
397
398
  size: "sm",
398
399
  variant: "ghost",
399
400
  "aria-label": t("status.refresh"),
400
401
  "data-cy": `rabbitmq-status-refresh-${mqttServerId}`,
401
402
  onPress: refresh,
402
- isDisabled: loading,
403
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner$2, { size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCwIcon$1, { className: "rmq:w-4 rmq:h-4" })
403
+ isPending: loading,
404
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCwIcon$1, { className: "rmq:w-4 rmq:h-4" })
404
405
  })]
405
406
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card$2.Content, {
406
407
  className: "rmq:flex rmq:flex-col rmq:gap-1",
@@ -445,10 +446,10 @@ function RabbitmqStatusPanel({ mqttServerId }) {
445
446
  children: result.managementApi || "—"
446
447
  })]
447
448
  }),
448
- result.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$4, {
449
+ result.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$2, {
449
450
  status: result.reachable ? "warning" : "danger",
450
451
  className: "rmq:mt-2",
451
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$4, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$4, { children: result.error }) })
452
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$2, { children: result.error }) })
452
453
  })
453
454
  ]
454
455
  })]
@@ -488,7 +489,8 @@ function clearPermissions(mqttServerId, username, vhost) {
488
489
  }
489
490
  //#endregion
490
491
  //#region frontend/src/users/permissions/RabbitmqPermissionsModal.tsx
491
- var { Alert: Alert$3, AlertContent: AlertContent$3, AlertDescription: AlertDescription$3, Button: Button$4, Input: Input$1, Label: Label$1, Modal: Modal$2, ModalBackdrop: ModalBackdrop$2, ModalBody: ModalBody$2, ModalContainer: ModalContainer$2, ModalDialog: ModalDialog$2, ModalFooter: ModalFooter$2, ModalHeader: ModalHeader$2, ModalHeading: ModalHeading$2, TextField: TextField$1 } = await importShared("@heroui/react");
492
+ var { Button: Button$3, EmptyState, StandardModal: StandardModal$1 } = await importShared("@attraccess/plugins-frontend-ui");
493
+ var { Alert: Alert$1, AlertContent: AlertContent$1, AlertDescription: AlertDescription$1, Input: Input$1, Label: Label$1, ModalBody: ModalBody$1, ModalFooter: ModalFooter$1, ModalHeader: ModalHeader$1, ModalHeading: ModalHeading$1, TextField: TextField$1 } = await importShared("@heroui/react");
492
494
  var { PlusIcon: PlusIcon$1, Trash2Icon: Trash2Icon$1 } = await importShared("lucide-react");
493
495
  var { useEffect: useEffect$2, useState: useState$2 } = await importShared("react");
494
496
  function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
@@ -506,7 +508,7 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
506
508
  " ",
507
509
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: row.vhost })
508
510
  ]
509
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$4, {
511
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$3, {
510
512
  isIconOnly: true,
511
513
  size: "sm",
512
514
  variant: "ghost",
@@ -557,7 +559,7 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
557
559
  }),
558
560
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
559
561
  className: "rmq:flex rmq:flex-wrap rmq:justify-end rmq:gap-2",
560
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$4, {
562
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$3, {
561
563
  size: "sm",
562
564
  variant: "ghost",
563
565
  onPress: () => onChange({
@@ -567,7 +569,7 @@ function PermissionEditor({ row, busy, onChange, onSave, onRemove }) {
567
569
  isDisabled: busy,
568
570
  "data-cy": `rabbitmq-permissions-mqtt-defaults-button-${row.vhost}`,
569
571
  children: t("permissions.defaults")
570
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$4, {
572
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$3, {
571
573
  size: "sm",
572
574
  variant: "primary",
573
575
  onPress: onSave,
@@ -658,65 +660,62 @@ function RabbitmqPermissionsModal({ mqttServerId, isOpen, user, vhosts, onClose,
658
660
  setError(null);
659
661
  };
660
662
  const unusedVhosts = vhosts.filter((vhost) => !rows.some((row) => row.vhost === vhost));
661
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal$2, {
663
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandardModal$1, {
664
+ size: "lg",
662
665
  isOpen,
663
666
  onOpenChange: (open) => {
664
667
  if (!open) onClose();
665
668
  },
666
669
  "data-cy": `rabbitmq-permissions-modal-${mqttServerId}`,
667
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalBackdrop$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalContainer$2, {
668
- size: "lg",
669
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalDialog$2, { children: [
670
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading$2, { children: t("permissions.title", { name: user.name }) }) }),
671
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody$2, {
672
- className: "rmq:flex rmq:flex-col rmq:gap-4 rmq:w-full",
673
- children: [
674
- rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
675
- className: "rmq:text-sm rmq:text-default-500",
676
- "data-cy": "rabbitmq-permissions-empty",
677
- children: t("permissions.empty")
678
- }),
679
- rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PermissionEditor, {
680
- row,
681
- busy: busyVhost === row.vhost,
682
- onChange: (next) => updateRow(index, next),
683
- onSave: () => saveRow(index),
684
- onRemove: () => removeRow(index)
685
- }, row.vhost)),
686
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
687
- className: "rmq:flex rmq:items-end rmq:gap-2",
688
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField$1, {
689
- value: newVhost,
690
- onChange: setNewVhost,
691
- className: "rmq:flex-1",
692
- 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, {
693
- placeholder: "/",
694
- autoComplete: "off",
695
- "data-cy": "rabbitmq-permissions-add-vhost-input"
696
- })]
697
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$4, {
698
- variant: "secondary",
699
- onPress: addVhost,
700
- isDisabled: newVhost.trim().length === 0,
701
- "data-cy": "rabbitmq-permissions-add-vhost-button",
702
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlusIcon$1, { className: "rmq:w-4 rmq:h-4" }), t("permissions.add")]
670
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
671
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading$1, { children: t("permissions.title", { name: user.name }) }) }),
672
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody$1, {
673
+ className: "rmq:flex rmq:flex-col rmq:gap-4 rmq:w-full",
674
+ children: [
675
+ rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
676
+ "data-cy": "rabbitmq-permissions-empty",
677
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, { message: t("permissions.empty") })
678
+ }),
679
+ rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PermissionEditor, {
680
+ row,
681
+ busy: busyVhost === row.vhost,
682
+ onChange: (next) => updateRow(index, next),
683
+ onSave: () => saveRow(index),
684
+ onRemove: () => removeRow(index)
685
+ }, row.vhost)),
686
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
687
+ className: "rmq:flex rmq:items-end rmq:gap-2",
688
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField$1, {
689
+ value: newVhost,
690
+ onChange: setNewVhost,
691
+ className: "rmq:flex-1",
692
+ 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, {
693
+ placeholder: "/",
694
+ autoComplete: "off",
695
+ "data-cy": "rabbitmq-permissions-add-vhost-input"
703
696
  })]
704
- }),
705
- error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$3, {
706
- status: "danger",
707
- "data-cy": "rabbitmq-permissions-error-alert",
708
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$3, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$3, { children: tMessage(error) }) })
709
- })
710
- ]
711
- }),
712
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalFooter$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$4, {
713
- variant: "secondary",
714
- onPress: onClose,
715
- "data-cy": "rabbitmq-permissions-close-button",
716
- children: t("common.close")
717
- }) })
718
- ] })
719
- }) })
697
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$3, {
698
+ variant: "secondary",
699
+ onPress: addVhost,
700
+ isDisabled: newVhost.trim().length === 0,
701
+ "data-cy": "rabbitmq-permissions-add-vhost-button",
702
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlusIcon$1, { className: "rmq:w-4 rmq:h-4" }), t("permissions.add")]
703
+ })]
704
+ }),
705
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$1, {
706
+ status: "danger",
707
+ "data-cy": "rabbitmq-permissions-error-alert",
708
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$1, { children: tMessage(error) }) })
709
+ })
710
+ ]
711
+ }),
712
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalFooter$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$3, {
713
+ variant: "secondary",
714
+ onPress: onClose,
715
+ "data-cy": "rabbitmq-permissions-close-button",
716
+ children: t("common.close")
717
+ }) })
718
+ ] })
720
719
  });
721
720
  }
722
721
  //#endregion
@@ -800,7 +799,8 @@ function useRabbitmqUserFormModalState({ mqttServerId, isOpen, user, vhosts, onC
800
799
  }
801
800
  //#endregion
802
801
  //#region frontend/src/users/RabbitmqUserFormModal.tsx
803
- var { Alert: Alert$2, AlertContent: AlertContent$2, AlertDescription: AlertDescription$2, Button: Button$3, Checkbox, Form, Input, Label, Modal: Modal$1, ModalBackdrop: ModalBackdrop$1, ModalBody: ModalBody$1, ModalContainer: ModalContainer$1, ModalDialog: ModalDialog$1, ModalFooter: ModalFooter$1, ModalHeader: ModalHeader$1, ModalHeading: ModalHeading$1, TextField } = await importShared("@heroui/react");
802
+ var { Button: Button$2, StandardModal } = await importShared("@attraccess/plugins-frontend-ui");
803
+ var { Alert, AlertContent, AlertDescription, Checkbox, Form, Input, Label, ModalBody, ModalFooter, ModalHeader, ModalHeading, TextField } = await importShared("@heroui/react");
804
804
  function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, onSaved }) {
805
805
  const { t, tMessage, isEdit, username, setUsername, password, setPassword, tags, setTags, grantMqttDefaults, setGrantMqttDefaults, vhost, setVhost, saving, error, handleSubmit } = useRabbitmqUserFormModalState({
806
806
  mqttServerId,
@@ -810,105 +810,103 @@ function RabbitmqUserFormModal({ mqttServerId, isOpen, user, vhosts, onClose, on
810
810
  onClose,
811
811
  onSaved
812
812
  });
813
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal$1, {
813
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandardModal, {
814
+ size: "md",
814
815
  isOpen,
815
816
  onOpenChange: (open) => {
816
817
  if (!open) onClose();
817
818
  },
818
819
  "data-cy": `rabbitmq-user-form-modal-${mqttServerId}`,
819
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalBackdrop$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalContainer$1, {
820
- size: "md",
821
- 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, {
822
- onSubmit: handleSubmit,
823
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody$1, {
824
- className: "rmq:flex rmq:flex-col rmq:gap-4 rmq:w-full",
825
- children: [
826
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
827
- value: username,
828
- onChange: setUsername,
829
- className: "rmq:w-full",
830
- isDisabled: isEdit,
831
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t("users.username") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
832
- name: "rabbitmq-username",
833
- placeholder: t("form.usernamePlaceholder"),
834
- autoComplete: "off",
835
- "data-cy": "rabbitmq-user-form-username-input"
836
- })]
837
- }),
838
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
839
- value: password,
840
- onChange: setPassword,
841
- className: "rmq:w-full",
842
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t(isEdit ? "form.newPassword" : "form.password") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
843
- name: "rabbitmq-password",
844
- type: "password",
845
- autoComplete: "new-password",
846
- "data-cy": "rabbitmq-user-form-password-input"
847
- })]
848
- }),
849
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
850
- value: tags,
851
- onChange: setTags,
852
- className: "rmq:w-full",
853
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t("form.tags") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
854
- name: "rabbitmq-tags",
855
- placeholder: t("users.none"),
856
- autoComplete: "off",
857
- "data-cy": "rabbitmq-user-form-tags-input"
858
- })]
859
- }),
860
- !isEdit && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
861
- 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",
862
- children: [
863
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox, {
864
- isSelected: grantMqttDefaults,
865
- onChange: setGrantMqttDefaults,
866
- "data-cy": "rabbitmq-user-form-mqtt-defaults-checkbox",
867
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Checkbox.Content, {
868
- className: "rmq:items-start",
869
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Control, {
870
- className: "rmq:mt-0.5",
871
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Indicator, {})
872
- }), t("form.grant")]
873
- })
874
- }),
875
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
876
- className: "rmq:text-xs rmq:text-default-500",
877
- children: t("form.defaults", DEFAULT_MQTT_PERMISSIONS)
878
- }),
879
- grantMqttDefaults && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
880
- value: vhost,
881
- onChange: setVhost,
882
- className: "rmq:w-full",
883
- 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, {
884
- name: "rabbitmq-vhost",
885
- placeholder: "/",
886
- autoComplete: "off",
887
- "data-cy": "rabbitmq-user-form-vhost-input"
888
- })]
820
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading, { children: isEdit ? t("form.editTitle", { name: user.name }) : t("form.createTitle") }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Form, {
821
+ onSubmit: handleSubmit,
822
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody, {
823
+ className: "rmq:flex rmq:flex-col rmq:gap-4 rmq:w-full",
824
+ children: [
825
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
826
+ value: username,
827
+ onChange: setUsername,
828
+ className: "rmq:w-full",
829
+ isDisabled: isEdit,
830
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t("users.username") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
831
+ name: "rabbitmq-username",
832
+ placeholder: t("form.usernamePlaceholder"),
833
+ autoComplete: "off",
834
+ "data-cy": "rabbitmq-user-form-username-input"
835
+ })]
836
+ }),
837
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
838
+ value: password,
839
+ onChange: setPassword,
840
+ className: "rmq:w-full",
841
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t(isEdit ? "form.newPassword" : "form.password") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
842
+ name: "rabbitmq-password",
843
+ type: "password",
844
+ autoComplete: "new-password",
845
+ "data-cy": "rabbitmq-user-form-password-input"
846
+ })]
847
+ }),
848
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
849
+ value: tags,
850
+ onChange: setTags,
851
+ className: "rmq:w-full",
852
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, { children: t("form.tags") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
853
+ name: "rabbitmq-tags",
854
+ placeholder: t("users.none"),
855
+ autoComplete: "off",
856
+ "data-cy": "rabbitmq-user-form-tags-input"
857
+ })]
858
+ }),
859
+ !isEdit && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
860
+ 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",
861
+ children: [
862
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox, {
863
+ isSelected: grantMqttDefaults,
864
+ onChange: setGrantMqttDefaults,
865
+ "data-cy": "rabbitmq-user-form-mqtt-defaults-checkbox",
866
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Checkbox.Content, {
867
+ className: "rmq:items-start",
868
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Control, {
869
+ className: "rmq:mt-0.5",
870
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox.Indicator, {})
871
+ }), t("form.grant")]
889
872
  })
890
- ]
891
- }),
892
- error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$2, {
893
- status: "danger",
894
- "data-cy": "rabbitmq-user-form-error-alert",
895
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$2, { children: tMessage(error) }) })
896
- })
897
- ]
898
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalFooter$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$3, {
899
- variant: "secondary",
900
- onPress: onClose,
901
- "data-cy": "rabbitmq-user-form-cancel-button",
902
- children: t("common.cancel")
903
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$3, {
904
- variant: "primary",
905
- type: "submit",
906
- isPending: saving,
907
- "data-cy": "rabbitmq-user-form-save-button",
908
- children: t(isEdit ? "form.save" : "form.create")
909
- })] })]
910
- })] })
911
- }) })
873
+ }),
874
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
875
+ className: "rmq:text-xs rmq:text-default-500",
876
+ children: t("form.defaults", DEFAULT_MQTT_PERMISSIONS)
877
+ }),
878
+ grantMqttDefaults && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TextField, {
879
+ value: vhost,
880
+ onChange: setVhost,
881
+ className: "rmq:w-full",
882
+ 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, {
883
+ name: "rabbitmq-vhost",
884
+ placeholder: "/",
885
+ autoComplete: "off",
886
+ "data-cy": "rabbitmq-user-form-vhost-input"
887
+ })]
888
+ })
889
+ ]
890
+ }),
891
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert, {
892
+ status: "danger",
893
+ "data-cy": "rabbitmq-user-form-error-alert",
894
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: tMessage(error) }) })
895
+ })
896
+ ]
897
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalFooter, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$2, {
898
+ variant: "secondary",
899
+ onPress: onClose,
900
+ "data-cy": "rabbitmq-user-form-cancel-button",
901
+ children: t("common.cancel")
902
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$2, {
903
+ variant: "primary",
904
+ type: "submit",
905
+ isPending: saving,
906
+ "data-cy": "rabbitmq-user-form-save-button",
907
+ children: t(isEdit ? "form.save" : "form.create")
908
+ })] })]
909
+ })] })
912
910
  });
913
911
  }
914
912
  function parseTags(value) {
@@ -996,7 +994,8 @@ function useRabbitmqUserPanelState({ mqttServerId }) {
996
994
  }
997
995
  //#endregion
998
996
  //#region frontend/src/users/RabbitmqUserPanelCardHeader.tsx
999
- var { Button: Button$2, Card: Card$1, Spinner: Spinner$1 } = await importShared("@heroui/react");
997
+ var { Button: Button$1 } = await importShared("@attraccess/plugins-frontend-ui");
998
+ var { Card: Card$1 } = await importShared("@heroui/react");
1000
999
  var { PlusIcon, RefreshCwIcon, UsersIcon } = await importShared("lucide-react");
1001
1000
  function RabbitmqUserPanelCardHeader({ t, reload, loading, mqttServerId, setFormUser, setFormOpen }) {
1002
1001
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card$1.Header, {
@@ -1009,16 +1008,16 @@ function RabbitmqUserPanelCardHeader({ t, reload, loading, mqttServerId, setForm
1009
1008
  })]
1010
1009
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
1011
1010
  className: "rmq:flex rmq:items-center rmq:gap-2",
1012
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$2, {
1011
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
1013
1012
  isIconOnly: true,
1014
1013
  size: "sm",
1015
1014
  variant: "ghost",
1016
1015
  "aria-label": t("users.reload"),
1017
1016
  onPress: () => void reload(),
1018
- isDisabled: loading,
1017
+ isPending: loading,
1019
1018
  "data-cy": `rabbitmq-user-panel-reload-${mqttServerId}`,
1020
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner$1, { size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCwIcon, { className: "rmq:w-4 rmq:h-4" })
1021
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$2, {
1019
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCwIcon, { className: "rmq:w-4 rmq:h-4" })
1020
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
1022
1021
  size: "sm",
1023
1022
  variant: "primary",
1024
1023
  onPress: () => {
@@ -1032,39 +1031,9 @@ function RabbitmqUserPanelCardHeader({ t, reload, loading, mqttServerId, setForm
1032
1031
  });
1033
1032
  }
1034
1033
  //#endregion
1035
- //#region frontend/src/users/RabbitmqUserPanelModalBackdrop.tsx
1036
- var { Alert: Alert$1, AlertContent: AlertContent$1, AlertDescription: AlertDescription$1, Button: Button$1, ModalBackdrop, ModalBody, ModalContainer, ModalDialog, ModalFooter, ModalHeader, ModalHeading } = await importShared("@heroui/react");
1037
- function RabbitmqUserPanelModalBackdrop({ t, userToDelete, deleteError, tMessage, confirmDelete, deleting }) {
1038
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalBackdrop, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalContainer, {
1039
- size: "sm",
1040
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalDialog, { children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1041
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalHeading, { children: t("users.deleteTitle") }) }),
1042
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalBody, {
1043
- className: "rmq:flex rmq:flex-col rmq:gap-3",
1044
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: t("users.deleteDescription", { name: userToDelete?.name }) }), deleteError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert$1, {
1045
- status: "danger",
1046
- "data-cy": "rabbitmq-user-delete-error-alert",
1047
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription$1, { children: tMessage(deleteError) }) })
1048
- })]
1049
- }),
1050
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ModalFooter, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
1051
- variant: "secondary",
1052
- onPress: close,
1053
- "data-cy": "rabbitmq-user-delete-cancel-button",
1054
- children: t("common.cancel")
1055
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
1056
- variant: "danger",
1057
- onPress: () => void confirmDelete(),
1058
- isPending: deleting,
1059
- "data-cy": "rabbitmq-user-delete-confirm-button",
1060
- children: t("common.delete")
1061
- })] })
1062
- ] }) })
1063
- }) });
1064
- }
1065
- //#endregion
1066
1034
  //#region frontend/src/users/RabbitmqUserPanel.tsx
1067
- var { Alert, AlertContent, AlertDescription, Button, Card, Chip, Modal, Spinner, Table, TableBody, TableCell, TableColumn, TableContent, TableHeader, TableRow, TableScrollContainer } = await importShared("@heroui/react");
1035
+ var { StatusAlert, StatusDialog, TableDataLoadingIndicator } = await importShared("@attraccess/plugins-frontend-ui");
1036
+ var { Button, Card, Chip, Table, TableBody, TableCell, TableColumn, TableContent, TableHeader, TableRow, TableScrollContainer } = await importShared("@heroui/react");
1068
1037
  var { KeyRoundIcon, PencilIcon, Trash2Icon } = await importShared("lucide-react");
1069
1038
  function PermissionChips({ user }) {
1070
1039
  const { t } = useRabbitmqTranslations();
@@ -1082,6 +1051,9 @@ function PermissionChips({ user }) {
1082
1051
  }, permission.vhost))
1083
1052
  });
1084
1053
  }
1054
+ function errorTitle(error, title) {
1055
+ return typeof error === "string" ? title : void 0;
1056
+ }
1085
1057
  function RabbitmqUserPanel({ mqttServerId }) {
1086
1058
  const model = useRabbitmqUserPanelState({ mqttServerId });
1087
1059
  if (!model.manageable) return null;
@@ -1100,14 +1072,15 @@ function RabbitmqUserPanel({ mqttServerId }) {
1100
1072
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card.Content, {
1101
1073
  className: "rmq:flex rmq:flex-col rmq:gap-3",
1102
1074
  children: [
1103
- model.loadError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Alert, {
1075
+ model.loadError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusAlert, {
1104
1076
  status: "danger",
1077
+ title: errorTitle(model.loadError, model.t("users.loadError")),
1105
1078
  "data-cy": "rabbitmq-user-panel-error-alert",
1106
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: model.tMessage(model.loadError) }) })
1079
+ children: model.tMessage(model.loadError)
1107
1080
  }),
1108
1081
  !model.data && !model.loadError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1109
- className: "rmq:flex rmq:items-center rmq:justify-center rmq:p-4",
1110
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { "data-cy": "rabbitmq-user-panel-loading-spinner" })
1082
+ "data-cy": "rabbitmq-user-panel-loading-spinner",
1083
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableDataLoadingIndicator, {})
1111
1084
  }),
1112
1085
  model.data && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table, {
1113
1086
  "data-cy": "rabbitmq-user-panel-table",
@@ -1205,13 +1178,29 @@ function RabbitmqUserPanel({ mqttServerId }) {
1205
1178
  onClose: () => model.setPermissionsUser(null),
1206
1179
  onSaved: () => void model.reload()
1207
1180
  }),
1208
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal, {
1181
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusDialog, {
1209
1182
  isOpen: model.userToDelete !== null,
1210
- onOpenChange: (open) => {
1211
- if (!open) model.setUserToDelete(null);
1183
+ onClose: () => model.setUserToDelete(null),
1184
+ status: "error",
1185
+ title: model.t("users.deleteTitle"),
1186
+ action: {
1187
+ label: model.t("common.delete"),
1188
+ onPress: model.confirmDelete,
1189
+ isPending: model.deleting,
1190
+ "data-cy": "rabbitmq-user-delete-confirm-button"
1212
1191
  },
1192
+ closeLabel: model.t("common.cancel"),
1193
+ closeDataCy: "rabbitmq-user-delete-cancel-button",
1213
1194
  "data-cy": `rabbitmq-user-delete-modal-${mqttServerId}`,
1214
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RabbitmqUserPanelModalBackdrop, { ...model })
1195
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
1196
+ className: "rmq:flex rmq:flex-col rmq:gap-3",
1197
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: model.t("users.deleteDescription", { name: model.userToDelete?.name }) }), model.deleteError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusAlert, {
1198
+ status: "danger",
1199
+ title: errorTitle(model.deleteError, model.t("users.deleteError")),
1200
+ "data-cy": "rabbitmq-user-delete-error-alert",
1201
+ children: model.tMessage(model.deleteError)
1202
+ })]
1203
+ })
1215
1204
  })
1216
1205
  ]
1217
1206
  });
@@ -75,7 +75,7 @@ var exportSet = /* @__PURE__ */ new Set([
75
75
  ]);
76
76
  var moduleMap = { "./plugin": () => {
77
77
  dynamicLoadingCss(["style.css"], false, "./plugin");
78
- return __federation_import("./__federation_expose_Plugin-5jDTnovW.js").then((module) => Object.keys(module).every((item) => exportSet.has(item)) ? () => module.default : () => module);
78
+ return __federation_import("./__federation_expose_Plugin-DP25IPIQ.js").then((module) => Object.keys(module).every((item) => exportSet.has(item)) ? () => module.default : () => module);
79
79
  } };
80
80
  var seen = {};
81
81
  var dynamicLoadingCss = (cssFilePaths, dontAppendStylesToHead, exposeItemName) => {
@@ -100,10 +100,6 @@
100
100
  justify-content: space-between;
101
101
  }
102
102
 
103
- .rmq\:justify-center {
104
- justify-content: center;
105
- }
106
-
107
103
  .rmq\:justify-end {
108
104
  justify-content: flex-end;
109
105
  }
@@ -137,10 +133,6 @@
137
133
  padding: calc(var(--rmq-spacing) * 3);
138
134
  }
139
135
 
140
- .rmq\:p-4 {
141
- padding: calc(var(--rmq-spacing) * 4);
142
- }
143
-
144
136
  .rmq\:py-1\.5 {
145
137
  padding-block: calc(var(--rmq-spacing) * 1.5);
146
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attraccess/plugin-rabbitmq",
3
- "version": "0.1.0-nightly.1089.1",
3
+ "version": "0.1.0-nightly.1106.2",
4
4
  "description": "Official Attraccess integration for RabbitMQ.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {