diff --git a/web/html/index.html b/web/html/index.html
index 0250f564..3cd21677 100644
--- a/web/html/index.html
+++ b/web/html/index.html
@@ -185,7 +185,7 @@
-
+
{{ i18n "pages.index.updatePanel" }}
@@ -323,35 +323,36 @@
- panelUpdateModal.visible = false" :class="themeSwitcher.currentTheme" footer="">
+
+
+
+ {{ i18n "pages.index.currentPanelVersion" }}
+ v[[ panelUpdateModal.info.currentVersion || '{{ .cur_ver }}' ]]
+
+
+ {{ i18n "pages.index.latestPanelVersion" }}
+
+ [[ panelUpdateModal.info.latestVersion || '-' ]]
+
+
+
+ {{ i18n "pages.index.panelUpToDate" }}
+ {{ i18n "pages.index.upToDate" }}
+
+
+
+
+ {{ i18n "pages.index.updatePanel" }}
+
+
+
+ versionModal.visible = false" :class="themeSwitcher.currentTheme" footer="">
versionModal.activeKey = key">
-
-
-
-
- {{ i18n "pages.index.currentPanelVersion" }}
- v[[ versionModal.panelUpdate.currentVersion || '{{ .cur_ver }}' ]]
-
-
- {{ i18n "pages.index.latestPanelVersion" }}
-
- [[ versionModal.panelUpdate.latestVersion || '-' ]]
-
-
-
- {{ i18n "pages.index.panelUpToDate" }}
- {{ i18n "pages.index.xrayStatusRunning" }}
-
-
-
-
- {{ i18n "pages.index.updatePanel" }}
-
-
-
@@ -833,17 +834,27 @@
visible: false,
activeKey: '1',
versions: [],
- panelUpdate: {
+ show(versions, activeKey = '1') {
+ this.visible = true;
+ this.activeKey = activeKey;
+ this.versions = versions;
+ },
+ hide() {
+ this.visible = false;
+ },
+ };
+
+ const panelUpdateModal = {
+ visible: false,
+ info: {
currentVersion: '{{ .cur_ver }}',
latestVersion: '',
updateAvailable: false,
},
- show(versions, panelUpdate, activeKey = '1') {
+ show(info) {
this.visible = true;
- this.activeKey = activeKey;
- this.versions = versions;
- if (panelUpdate) {
- this.panelUpdate = panelUpdate;
+ if (info) {
+ this.info = info;
}
},
hide() {
@@ -1000,11 +1011,12 @@
spinning: false
},
status: new Status(),
- cpuHistory: [], // small live widget history
- cpuHistoryLong: [], // aggregated points from backend
- cpuHistoryLabels: [],
- cpuHistoryModal: { visible: false, bucket: 2 },
+ cpuHistory: [], // small live widget history
+ cpuHistoryLong: [], // aggregated points from backend
+ cpuHistoryLabels: [],
+ cpuHistoryModal: { visible: false, bucket: 2 },
versionModal,
+ panelUpdateModal,
logModal,
xraylogModal,
backupModal,
@@ -1093,17 +1105,23 @@
},
async openSelectV2rayVersion(activeKey = '1') {
this.loading(true);
- const [xrayMsg, panelMsg] = await Promise.all([
- HttpUtil.get('/panel/api/server/getXrayVersion'),
- HttpUtil.get('/panel/api/server/getPanelUpdateInfo'),
- ]);
+ const msg = await HttpUtil.get('/panel/api/server/getXrayVersion');
this.loading(false);
- if (!xrayMsg.success && !panelMsg.success) {
+ if (!msg.success) {
return;
}
- versionModal.show(xrayMsg.success ? xrayMsg.obj : [], panelMsg.success ? panelMsg.obj : null, activeKey);
+ versionModal.show(msg.obj, activeKey);
this.loadCustomGeo();
},
+ async openPanelUpdate() {
+ this.loading(true);
+ const msg = await HttpUtil.get('/panel/api/server/getPanelUpdateInfo');
+ this.loading(false);
+ if (!msg.success) {
+ return;
+ }
+ panelUpdateModal.show(msg.obj);
+ },
customGeoFormatTime(ts) {
if (!ts) return '';
return typeof moment !== 'undefined' ? moment(ts * 1000).format('YYYY-MM-DD HH:mm') : String(ts);
@@ -1244,12 +1262,12 @@
this.$confirm({
title: '{{ i18n "pages.index.panelUpdateDialog" }}',
content: '{{ i18n "pages.index.panelUpdateDialogDesc" }}'
- .replace('#version#', versionModal.panelUpdate.latestVersion || ''),
+ .replace('#version#', panelUpdateModal.info.latestVersion || ''),
okText: '{{ i18n "confirm"}}',
class: themeSwitcher.currentTheme,
cancelText: '{{ i18n "cancel"}}',
onOk: async () => {
- versionModal.hide();
+ panelUpdateModal.hide();
this.loading(true, '{{ i18n "pages.index.dontRefresh"}}');
const msg = await HttpUtil.post('/panel/api/server/updatePanel');
if (!msg.success) {
diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml
index 837b3875..49c9f952 100644
--- a/web/translation/translate.en_US.toml
+++ b/web/translation/translate.en_US.toml
@@ -124,6 +124,7 @@
"stopXray" = "Stop"
"restartXray" = "Restart"
"xraySwitch" = "Version"
+"xrayUpdates" = "Xray Updates"
"xraySwitchClick" = "Choose the version you want to switch to."
"xraySwitchClickDesk" = "Choose carefully, as older versions may not be compatible with current configurations."
"updatePanel" = "Update Panel"
@@ -131,6 +132,7 @@
"currentPanelVersion" = "Current panel version"
"latestPanelVersion" = "Latest panel version"
"panelUpToDate" = "Panel is up to date"
+"upToDate" = "Up to date"
"xrayStatusUnknown" = "Unknown"
"xrayStatusRunning" = "Running"
"xrayStatusStop" = "Stop"