Agent Zero AI framework
use toastFrontend for error msgs in plugins
Alessandroa9722e70fd62
diff --git a/plugins/_plugin_installer/webui/install-detail.html b/plugins/_plugin_installer/webui/install-detail.htmlindex f3ed44437..bbe2efa6f 100644--- a/plugins/_plugin_installer/webui/install-detail.html+++ b/plugins/_plugin_installer/webui/install-detail.html@@ -148,10 +148,6 @@</template></div>- <div x-show="$store.pluginInstallStore.error" class="pi-message pi-message-error">- <span x-text="$store.pluginInstallStore.error"></span>- </div>-<div class="pi-readme-section" x-show="$store.pluginInstallStore.readmeContent || $store.pluginInstallStore.readmeLoading"><div class="pi-readme-header">Readme</div><div x-show="$store.pluginInstallStore.readmeLoading" class="pi-loading-text">@@ -466,21 +462,6 @@padding: 0.75rem 0;}- .pi-message {- display: flex;- align-items: center;- gap: 0.75rem;- padding: 1rem;- border-radius: 8px;- margin-bottom: 1rem;- }-- .pi-message-error {- background: rgba(239,68,68,0.1);- border: 1px solid rgba(239,68,68,0.3);- color: var(--color-error);- }-.pi-screenshots-section {margin: var(--spacing-lg) 0;padding-top: var(--spacing-lg);diff --git a/plugins/_plugin_installer/webui/install-git.html b/plugins/_plugin_installer/webui/install-git.htmlindex 0d3ce3fcb..569454802 100644--- a/plugins/_plugin_installer/webui/install-git.html+++ b/plugins/_plugin_installer/webui/install-git.html@@ -45,10 +45,6 @@</button></div>- <div x-show="$store.pluginInstallStore.error" class="pi-error">- <span x-text="$store.pluginInstallStore.error"></span>- </div>-<div x-show="$store.pluginInstallStore.result" class="pi-result"><div class="pi-result-icon"><span class="material-symbols-outlined">check_circle</span>@@ -109,14 +105,6 @@gap: 0.5rem;}- .pi-error {- color: var(--color-error);- padding: 0.75rem;- background: var(--color-error-bg, rgba(239,68,68,0.1));- border-radius: 4px;- margin-top: 0.75rem;- }-.pi-result {display: flex;align-items: center;diff --git a/plugins/_plugin_installer/webui/install-index.html b/plugins/_plugin_installer/webui/install-index.htmlindex cfe0e4d22..5c1215e4f 100644--- a/plugins/_plugin_installer/webui/install-index.html+++ b/plugins/_plugin_installer/webui/install-index.html@@ -62,14 +62,6 @@</div></div>- <div x-show="$store.pluginInstallStore.error && !$store.pluginInstallStore.loading" class="pi-state-card pi-state-error">- <span class="material-symbols-outlined">error</span>- <div>- <div class="pi-state-title">Marketplace unavailable</div>- <div class="pi-state-text" x-text="$store.pluginInstallStore.error"></div>- </div>- </div>-<div x-show="$store.pluginInstallStore.index && !$store.pluginInstallStore.loading && $store.pluginInstallStore.filteredPlugins.length > 0"class="pi-grid"><template x-for="plugin in $store.pluginInstallStore.paginatedPlugins" :key="plugin.key">@@ -343,12 +335,6 @@color: var(--color-highlight);}- .pi-state-error {- border-color: rgba(239, 68, 68, 0.28);- background: rgba(239, 68, 68, 0.1);- color: var(--color-error);- }-.pi-state-empty .material-symbols-outlined {color: var(--color-text-muted);}diff --git a/plugins/_plugin_installer/webui/install-zip.html b/plugins/_plugin_installer/webui/install-zip.htmlindex 75798cd3c..79799c068 100644--- a/plugins/_plugin_installer/webui/install-zip.html+++ b/plugins/_plugin_installer/webui/install-zip.html@@ -35,10 +35,6 @@<span x-text="$store.pluginInstallStore.loadingMessage || 'Processing...'"></span></div>- <div x-show="$store.pluginInstallStore.error" class="pi-error">- <span x-text="$store.pluginInstallStore.error"></span>- </div>-<div x-show="$store.pluginInstallStore.result" class="pi-result"><div class="pi-result-icon"><span class="material-symbols-outlined">check_circle</span>@@ -94,14 +90,6 @@color: var(--color-text-secondary);}- .pi-error {- color: var(--color-error);- padding: 0.75rem;- background: var(--color-error-bg, rgba(239,68,68,0.1));- border-radius: 4px;- margin-top: 0.75rem;- }-.pi-result {display: flex;align-items: center;diff --git a/plugins/_plugin_installer/webui/main.html b/plugins/_plugin_installer/webui/main.htmlindex f667f539e..772bf7226 100644--- a/plugins/_plugin_installer/webui/main.html+++ b/plugins/_plugin_installer/webui/main.html@@ -421,13 +421,6 @@color: var(--color-highlight);}- .pi-state-error {- border-color: rgba(239, 68, 68, 0.28);- background: rgba(239, 68, 68, 0.1);- color: var(--color-error);- margin-top: 0;- }-.pi-state-empty .material-symbols-outlined {color: var(--color-text-muted);}@@ -541,14 +534,6 @@color: var(--color-text-secondary);}- .pi-error {- color: var(--color-error);- padding: 0.75rem;- background: var(--color-error-bg, rgba(239, 68, 68, 0.1));- border-radius: 4px;- margin-top: 0.75rem;- }-.pi-empty {text-align: center;padding: 2rem;diff --git a/plugins/_plugin_installer/webui/pluginInstallStore.js b/plugins/_plugin_installer/webui/pluginInstallStore.jsindex b69df537c..cc1549366 100644--- a/plugins/_plugin_installer/webui/pluginInstallStore.js+++ b/plugins/_plugin_installer/webui/pluginInstallStore.js@@ -2,7 +2,7 @@ import { createStore } from "/js/AlpineStore.js";import * as api from "/js/api.js";import { openModal } from "/js/modals.js";import { marked } from "/vendor/marked/marked.esm.js";-import { toastFrontendSuccess } from "/components/notifications/notification-store.js";+import { toastFrontendSuccess, toastFrontendError } from "/components/notifications/notification-store.js";import { showConfirmDialog } from "/js/confirmDialog.js";import { store as imageViewerStore } from "/components/modals/image-viewer/image-viewer-store.js";import { store as pluginListStore } from "/components/plugins/list/pluginListStore.js";@@ -48,7 +48,6 @@ const model = {// Shared stateloading: false,loadingMessage: "",- error: "",result: null,// README state@@ -65,7 +64,6 @@ const model = {setTab(tab) {this.activeTab = tab;- this.error = "";this.result = null;},@@ -113,13 +111,12 @@ const model = {if (!file) return;this.zipFile = file;this.zipFileName = file.name;- this.error = "";this.result = null;},async installZip() {if (!this.zipFile) {- this.error = "Please select a ZIP file first";+ void toastFrontendError("Please select a ZIP file first", "Plugin Installer");return;}@@ -129,7 +126,6 @@ const model = {try {this.loading = true;this.loadingMessage = "Installing plugin from ZIP...";- this.error = "";this.result = null;const formData = new FormData();@@ -143,7 +139,7 @@ const model = {const data = await response.json();if (!data.success) {- this.error = data.error || "Installation failed";+ void toastFrontendError(data.error || "Installation failed", "Plugin Installer");return;}@@ -155,7 +151,7 @@ const model = {);} catch (e) {const message = e instanceof Error ? e.message : String(e);- this.error = `Installation error: ${message}`;+ void toastFrontendError(`Installation error: ${message}`, "Plugin Installer");} finally {this.loading = false;this.loadingMessage = "";@@ -167,7 +163,7 @@ const model = {async installGit() {const url = (this.gitUrl || "").trim();if (!url) {- this.error = "Please enter a Git URL";+ void toastFrontendError("Please enter a Git URL", "Plugin Installer");return;}@@ -177,7 +173,6 @@ const model = {try {this.loading = true;this.loadingMessage = "Cloning repository...";- this.error = "";this.result = null;const data = await api.callJsonApi(PLUGIN_API, {@@ -187,7 +182,7 @@ const model = {});if (!data.success) {- this.error = data.error || "Clone failed";+ void toastFrontendError(data.error || "Clone failed", "Plugin Installer");return;}@@ -199,7 +194,7 @@ const model = {);} catch (e) {const message = e instanceof Error ? e.message : String(e);- this.error = `Clone error: ${message}`;+ void toastFrontendError(`Clone error: ${message}`, "Plugin Installer");} finally {this.loading = false;this.loadingMessage = "";@@ -212,15 +207,13 @@ const model = {try {this.loading = true;this.loadingMessage = "Loading plugin index...";- this.error = "";- // this.index = null;const data = await api.callJsonApi(PLUGIN_API, {action: "fetch_index",});if (!data.success) {- this.error = data.error || "Failed to load index";+ void toastFrontendError(data.error || "Failed to load index", "Plugin Installer");return;}@@ -229,7 +222,7 @@ const model = {this.page = 1;} catch (e) {const message = e instanceof Error ? e.message : String(e);- this.error = `Failed to load plugin index: ${message}`;+ void toastFrontendError(`Failed to load plugin index: ${message}`, "Plugin Installer");} finally {this.loading = false;this.loadingMessage = "";@@ -343,7 +336,6 @@ const model = {openDetail(plugin) {this.selectedPlugin = { ...plugin, name: plugin?.key || "" };- this.error = "";this.result = null;this.installedPluginInfo = null;this.readmeContent = null;@@ -387,7 +379,7 @@ const model = {async installFromIndex(plugin) {if (!plugin?.github) {- this.error = "No GitHub URL available for this plugin";+ void toastFrontendError("No GitHub URL available for this plugin", "Plugin Installer");return;}@@ -406,7 +398,6 @@ const model = {try {this.loading = true;this.loadingMessage = `Installing ${plugin.title || plugin.key}...`;- this.error = "";const data = await api.callJsonApi(PLUGIN_API, {action: "install_git",@@ -415,7 +406,7 @@ const model = {});if (!data.success) {- this.error = data.error || "Installation failed";+ void toastFrontendError(data.error || "Installation failed", "Plugin Installer");return;}@@ -438,7 +429,7 @@ const model = {);} catch (e) {const message = e instanceof Error ? e.message : String(e);- this.error = `Installation error: ${message}`;+ void toastFrontendError(`Installation error: ${message}`, "Plugin Installer");} finally {this.loading = false;this.loadingMessage = "";@@ -533,14 +524,12 @@ const model = {resetZip() {this.zipFile = null;this.zipFileName = "";- this.error = "";this.result = null;},resetGit() {this.gitUrl = "";this.gitToken = "";- this.error = "";this.result = null;},@@ -549,7 +538,6 @@ const model = {this.page = 1;this.sortBy = "stars";this.browseFilter = "all";- this.error = "";this.result = null;this.selectedPlugin = null;},