From 13d66010df4f651d05a0520eb03acba1739871ae Mon Sep 17 00:00:00 2001 From: hi2hi Date: Thu, 6 Feb 2025 06:00:11 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=84=20=E6=B7=BB=E5=8A=A0=20Popover=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=B8=B2=E6=9F=93=E7=9A=84=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=A1=86=EF=BC=8C=E6=94=AF=E6=8C=81=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E4=B8=8E=20PC=20=E7=AB=AF=E4=B8=8D=E5=90=8C=E7=9A=84=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/popover.vue | 292 ++++++++++++++++++ src/use.js | 2 + src/utils/zIndexManager.js | 13 + .../server-detail/server-info-box.vue | 31 +- .../server-detail/server-monitor.vue | 64 ++-- 5 files changed, 359 insertions(+), 43 deletions(-) create mode 100644 src/components/popover.vue create mode 100644 src/utils/zIndexManager.js diff --git a/src/components/popover.vue b/src/components/popover.vue new file mode 100644 index 0000000..b3ad88a --- /dev/null +++ b/src/components/popover.vue @@ -0,0 +1,292 @@ + + + + + diff --git a/src/use.js b/src/use.js index 0ba70d4..6d4ecf1 100644 --- a/src/use.js +++ b/src/use.js @@ -5,11 +5,13 @@ import store from './store'; import config from './config'; import DotDotBox from './components/dot-dot-box.vue'; +import Popover from './components/popover.vue'; export default (app) => { app.use(router); app.use(store); app.component('DotDotBox', DotDotBox); + app.component('Popover', Popover); app.config.globalProperties.$hasSarasaTerm = !import.meta.env.VITE_DISABLE_SARASA_TERM_SC; app.config.globalProperties.$config = config; diff --git a/src/utils/zIndexManager.js b/src/utils/zIndexManager.js new file mode 100644 index 0000000..d10cc8a --- /dev/null +++ b/src/utils/zIndexManager.js @@ -0,0 +1,13 @@ +const BASE_Z_INDEX = 1000; +let zIndexCounter = BASE_Z_INDEX; + +export const getNextZIndex = () => { + zIndexCounter += 1; + return zIndexCounter; +}; + +export const getCurrentZIndex = () => zIndexCounter; + +export const resetZIndex = () => { + zIndexCounter = BASE_Z_INDEX; +}; diff --git a/src/views/components/server-detail/server-info-box.vue b/src/views/components/server-detail/server-info-box.vue index 3a16c8a..a8bda78 100644 --- a/src/views/components/server-detail/server-info-box.vue +++ b/src/views/components/server-detail/server-info-box.vue @@ -68,23 +68,26 @@
- - - {{ ttItem.label }} - - - {{ ttItem.value }} - - + + + +
diff --git a/src/views/components/server-detail/server-monitor.vue b/src/views/components/server-detail/server-monitor.vue index 3aa610d..1cacf47 100644 --- a/src/views/components/server-detail/server-monitor.vue +++ b/src/views/components/server-detail/server-monitor.vue @@ -67,38 +67,44 @@
-
- - - {{ cateItem.name }} - - - {{ cateItem.avg }}ms - - - -ms - -
+ + + +