From 76f627ac65cdf0b2f953730e331cb916fd99edee Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 8 May 2026 12:45:30 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20Phase=205c-iv=20(a)=20?= =?UTF-8?q?=E2=80=94=20panel=20update=20/=20logs=20/=20backup=20modals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds three of the six dashboard modals plus a Quick Actions card that surfaces them. The remaining three (xray logs, version picker, CPU history sparkline) ship in 5c-iv-b. - PanelUpdateModal.vue — current vs latest version, "update now" button. Confirm dialog → POST /panel/api/server/updatePanel, then poll /server/status for up to 90s until the new panel answers, then reload. - LogModal.vue — panel logs viewer. Filters: rows (10-500), level (debug/info/notice/warning/error), syslog toggle. Auto-fetches on open and on every filter change. Color-coded timestamps and levels via inline span styles. Download button writes the raw log to x-ui.log via FileManager.downloadTextFile. - BackupModal.vue — db export (window.location to /getDb) and import (FormData upload to /importDB, then panel restart + reload). - Quick Actions card surfaces Logs / Backup / Update buttons and shows an orange update badge (extra slot) when an update is available. Modal-busy pattern: long-running operations (update, import) emit a `busy` event with a tip; IndexPage flips its a-spin overlay so the user sees a loading message while the panel is restarting. AD-Vue 4 changes: - v-model on renamed to v-model:open - v-model on // uses the named v-model:value / v-model:checked pattern - dropped — explicit Ant icon imports (BarsOutlined, CloudServerOutlined, CloudDownloadOutlined, DownloadOutlined, UploadOutlined, SyncOutlined) - Modal.confirm() replaces this.$confirm() since setup() has no `this` Co-Authored-By: Claude Opus 4.7 --- frontend/src/pages/index/BackupModal.vue | 87 ++++++++++ frontend/src/pages/index/IndexPage.vue | 152 +++++++++++------ frontend/src/pages/index/LogModal.vue | 160 ++++++++++++++++++ frontend/src/pages/index/PanelUpdateModal.vue | 99 +++++++++++ 4 files changed, 442 insertions(+), 56 deletions(-) create mode 100644 frontend/src/pages/index/BackupModal.vue create mode 100644 frontend/src/pages/index/LogModal.vue create mode 100644 frontend/src/pages/index/PanelUpdateModal.vue diff --git a/frontend/src/pages/index/BackupModal.vue b/frontend/src/pages/index/BackupModal.vue new file mode 100644 index 00000000..45892035 --- /dev/null +++ b/frontend/src/pages/index/BackupModal.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/frontend/src/pages/index/IndexPage.vue b/frontend/src/pages/index/IndexPage.vue index 10385e46..8eca5521 100644 --- a/frontend/src/pages/index/IndexPage.vue +++ b/frontend/src/pages/index/IndexPage.vue @@ -1,6 +1,7 @@ @@ -140,15 +172,23 @@ function onOpenVersionSwitch() { background: transparent; } -.content-shell { - background: transparent; -} - -.content-area { - padding: 24px; -} +.content-shell { background: transparent; } +.content-area { padding: 24px; } .loading-spacer { min-height: calc(100vh - 120px); } + +.action { + cursor: pointer; + justify-content: center; +} + +.update-tag { + cursor: pointer; + margin: 0; + display: inline-flex; + align-items: center; + gap: 4px; +} diff --git a/frontend/src/pages/index/LogModal.vue b/frontend/src/pages/index/LogModal.vue new file mode 100644 index 00000000..f0f086ec --- /dev/null +++ b/frontend/src/pages/index/LogModal.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/frontend/src/pages/index/PanelUpdateModal.vue b/frontend/src/pages/index/PanelUpdateModal.vue new file mode 100644 index 00000000..cb5a2b60 --- /dev/null +++ b/frontend/src/pages/index/PanelUpdateModal.vue @@ -0,0 +1,99 @@ + + + + +