From 1474f796fc29051b7e0813839dbb6bdc22293990 Mon Sep 17 00:00:00 2001 From: Sun <95302870@qq.com> Date: Thu, 4 Jan 2024 16:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=A4=A7=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E5=B0=8F=E5=9B=BE=E6=A0=87=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/systemMonitor.ts | 19 ++ .../AppIconSystemMonitor/CPU.vue | 83 +++++ .../AppIconSystemMonitor/Disk.vue | 93 ++++++ .../AppIconSystemMonitor/Memory.vue | 87 ++++++ .../AppIconSystemMonitor/index.vue | 148 +++++++++ .../deskModule/SystemMonitor/index copy.vue | 171 +++++++++++ .../deskModule/SystemMonitor/index.vue | 286 ++++++++---------- .../deskModule/SystemMonitor/typings.ts | 22 ++ src/views/home/index.vue | 9 +- 9 files changed, 759 insertions(+), 159 deletions(-) create mode 100644 src/components/deskModule/SystemMonitor/AppIconSystemMonitor/CPU.vue create mode 100644 src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue create mode 100644 src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Memory.vue create mode 100644 src/components/deskModule/SystemMonitor/AppIconSystemMonitor/index.vue create mode 100644 src/components/deskModule/SystemMonitor/index copy.vue create mode 100644 src/components/deskModule/SystemMonitor/typings.ts diff --git a/src/api/system/systemMonitor.ts b/src/api/system/systemMonitor.ts index c7f6b20..684c90b 100644 --- a/src/api/system/systemMonitor.ts +++ b/src/api/system/systemMonitor.ts @@ -5,3 +5,22 @@ export function getAll() { url: '/system/monitor/getAll', }) } + +export function getCpuState() { + return post({ + url: '/system/monitor/getCpuState', + }) +} + +export function getDiskStateByPath(path: string) { + return post({ + url: '/system/monitor/getDiskStateByPath', + data: { path }, + }) +} + +export function getMemonyState() { + return post({ + url: '/system/monitor/getMemonyState', + }) +} diff --git a/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/CPU.vue b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/CPU.vue new file mode 100644 index 0000000..cd98588 --- /dev/null +++ b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/CPU.vue @@ -0,0 +1,83 @@ + + + diff --git a/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue new file mode 100644 index 0000000..15fc9c5 --- /dev/null +++ b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue @@ -0,0 +1,93 @@ + + + diff --git a/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Memory.vue b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Memory.vue new file mode 100644 index 0000000..222bb08 --- /dev/null +++ b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Memory.vue @@ -0,0 +1,87 @@ + + + diff --git a/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/index.vue b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/index.vue new file mode 100644 index 0000000..4dda5ec --- /dev/null +++ b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/index.vue @@ -0,0 +1,148 @@ + + + diff --git a/src/components/deskModule/SystemMonitor/index copy.vue b/src/components/deskModule/SystemMonitor/index copy.vue new file mode 100644 index 0000000..7c80e28 --- /dev/null +++ b/src/components/deskModule/SystemMonitor/index copy.vue @@ -0,0 +1,171 @@ + + + diff --git a/src/components/deskModule/SystemMonitor/index.vue b/src/components/deskModule/SystemMonitor/index.vue index d2ccc9a..e11e219 100644 --- a/src/components/deskModule/SystemMonitor/index.vue +++ b/src/components/deskModule/SystemMonitor/index.vue @@ -1,176 +1,152 @@ + + diff --git a/src/components/deskModule/SystemMonitor/typings.ts b/src/components/deskModule/SystemMonitor/typings.ts new file mode 100644 index 0000000..0aee70f --- /dev/null +++ b/src/components/deskModule/SystemMonitor/typings.ts @@ -0,0 +1,22 @@ +export enum MonitorType { + 'cpu' = 'cpu', // 图标风格 + 'memory' = 'memory', // 详情风格 + 'disk' = 'disk', +} + +export interface CardStyle { + background: string +} + +export interface MonitorData { + monitorType: MonitorType + extendParam?: { [key: string]: [value:any] } | any + description?: string + cardStyle: CardStyle +} + +export interface ProgressStyle { + color: string + railColor: string + height: number +} diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 0ee1f6d..9b81d90 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -333,9 +333,6 @@ function handleAddItem(itemIconGroupId?: number) { />
-
- -
--> +
+ +
+