diff --git a/meshchatx/src/frontend/components/App.vue b/meshchatx/src/frontend/components/App.vue index fa2fe5c..3d15485 100644 --- a/meshchatx/src/frontend/components/App.vue +++ b/meshchatx/src/frontend/components/App.vue @@ -129,7 +129,7 @@ class="fixed inset-y-0 left-0 z-[70] transform transition-all duration-300 ease-in-out sm:relative sm:z-0 sm:flex sm:translate-x-0" :class="[ isSidebarOpen ? 'translate-x-0' : '-translate-x-full', - isSidebarCollapsed ? 'w-16' : 'w-72', + isSidebarCollapsed ? 'w-16' : 'w-80', ]" >
+
@@ -70,24 +75,58 @@ export default { }, methods: { add(toast) { + // Check if a toast with the same key already exists + if (toast.key) { + const existingIndex = this.toasts.findIndex((t) => t.key === toast.key); + if (existingIndex !== -1) { + const existingToast = this.toasts[existingIndex]; + + // Clear existing timeout if it exists + if (existingToast.timer) { + clearTimeout(existingToast.timer); + } + + // Update existing toast + existingToast.message = toast.message; + existingToast.type = toast.type || "info"; + existingToast.duration = toast.duration !== undefined ? toast.duration : 5000; + + if (existingToast.duration > 0) { + existingToast.timer = setTimeout(() => { + this.remove(existingToast.id); + }, existingToast.duration); + } else { + existingToast.timer = null; + } + return; + } + } + const id = this.counter++; const newToast = { id, + key: toast.key, message: toast.message, type: toast.type || "info", - duration: toast.duration || 5000, + duration: toast.duration !== undefined ? toast.duration : 5000, + timer: null, }; - this.toasts.push(newToast); if (newToast.duration > 0) { - setTimeout(() => { + newToast.timer = setTimeout(() => { this.remove(id); }, newToast.duration); } + + this.toasts.push(newToast); }, remove(id) { const index = this.toasts.findIndex((t) => t.id === id); if (index !== -1) { + const toast = this.toasts[index]; + if (toast.timer) { + clearTimeout(toast.timer); + } this.toasts.splice(index, 1); } }, diff --git a/meshchatx/src/frontend/components/about/AboutPage.vue b/meshchatx/src/frontend/components/about/AboutPage.vue index 96f440f..00343b3 100644 --- a/meshchatx/src/frontend/components/about/AboutPage.vue +++ b/meshchatx/src/frontend/components/about/AboutPage.vue @@ -402,7 +402,7 @@ > {{ appInfo.is_connected_to_shared_instance - ? "Shared Instance" + ? `Shared Instance: ${appInfo.shared_instance_address || "unknown"}` : "Main Instance" }} @@ -659,6 +659,14 @@
+
-
-
-
-
- {{ $t("interfaces.manage") }} -
-
- {{ $t("interfaces.title") }} -
-
- {{ $t("interfaces.description") }} -
+
+
+
+ {{ $t("interfaces.manage") }}
-
+
+ {{ $t("interfaces.title") }} +
+
+ {{ $t("interfaces.description") }} +
+
{{ $t("interfaces.add_interface") }} @@ -52,56 +50,34 @@ {{ $t("interfaces.export_all") }} -
+
-
-
+ +
+
+ -
-
- -
-
-