diff --git a/package.json b/package.json index 09087e9..5348aa4 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "cropperjs": "^1.6.2", "dayjs": "^1.11.11", "echarts": "^5.5.0", + "echarts-gl": "^2.0.9", "el-table-infinite-scroll": "^3.0.3", "element-plus": "2.7.1", "intro.js": "^7.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e8e057..0cd5506 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,6 +71,9 @@ importers: echarts: specifier: ^5.5.0 version: 5.5.1 + echarts-gl: + specifier: ^2.0.9 + version: 2.0.9(echarts@5.5.1) el-table-infinite-scroll: specifier: ^3.0.3 version: 3.0.6(typescript@5.5.4) @@ -2049,6 +2052,9 @@ packages: cjs-module-lexer@1.4.0: resolution: {integrity: sha512-N1NGmowPlGBLsOZLPvm48StN04V4YvQRL0i6b7ctrVY3epjP/ct7hFLOItz6pDIvRjwpfPxi52a2UWV2ziir8g==} + claygl@1.3.0: + resolution: {integrity: sha512-+gGtJjT6SSHD2l2yC3MCubW/sCV40tZuSs5opdtn79vFSGUgp/lH139RNEQ6Jy078/L0aV8odCw8RSrUcMfLaQ==} + cli-boxes@3.0.0: resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} engines: {node: '>=10'} @@ -2602,6 +2608,11 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + echarts-gl@2.0.9: + resolution: {integrity: sha512-oKeMdkkkpJGWOzjgZUsF41DOh6cMsyrGGXimbjK2l6Xeq/dBQu4ShG2w2Dzrs/1bD27b2pLTGSaUzouY191gzA==} + peerDependencies: + echarts: ^5.1.2 + echarts@5.5.1: resolution: {integrity: sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==} @@ -7912,6 +7923,8 @@ snapshots: cjs-module-lexer@1.4.0: {} + claygl@1.3.0: {} + cli-boxes@3.0.0: {} cli-cursor@3.1.0: @@ -8511,6 +8524,12 @@ snapshots: eastasianwidth@0.2.0: {} + echarts-gl@2.0.9(echarts@5.5.1): + dependencies: + claygl: 1.3.0 + echarts: 5.5.1 + zrender: 5.6.0 + echarts@5.5.1: dependencies: tslib: 2.3.0 diff --git a/src/api/v1/actuator.ts b/src/api/v1/actuator.ts index 274508d..5da76b2 100644 --- a/src/api/v1/actuator.ts +++ b/src/api/v1/actuator.ts @@ -14,3 +14,23 @@ export const fetchSystemInfo = () => { export const fetchSystemCaches = () => { return http.request('get', 'actuator/caches'); }; + +/** actuator断端点-CPU占用 */ +export const fetchSystemCPU = () => { + return http.request('get', 'actuator/metrics/system.cpu.usage'); +}; + +/** actuator断端点-CPU占用 */ +export const fetchSystemProcessCPU = () => { + return http.request('get', 'actuator/metrics/process.cpu.usage'); +}; + +/** actuator断端点-磁盘可用 */ +export const fetchSystemDiskFree = () => { + return http.request('get', 'actuator/metrics/disk.free'); +}; + +/** actuator断端点-磁盘总量 */ +export const fetchSystemDiskTotal = () => { + return http.request('get', 'actuator/metrics/disk.total'); +}; diff --git a/src/main.ts b/src/main.ts index b329152..1eac530 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,7 @@ import router from './router'; import { useElementPlus } from '@/plugins/elementPlus'; import { injectResponsiveStorage } from '@/utils/responsive'; import { createApp, type Directive } from 'vue'; +import * as echarts from 'echarts'; import Table from '@pureadmin/table'; // import PureDescriptions from "@pureadmin/descriptions"; @@ -45,7 +46,7 @@ app.component('IconifyIconOnline', IconifyIconOnline); app.component('FontIcon', FontIcon); app.component('Auth', Auth); app.component('Perms', Perms); - +app.config.globalProperties.$echarts = echarts; app.use(VueTippy); getPlatformConfig(app).then(async config => { diff --git a/src/plugins/echarts.ts b/src/plugins/echarts.ts index cb62d96..ba53c1e 100644 --- a/src/plugins/echarts.ts +++ b/src/plugins/echarts.ts @@ -1,36 +1,26 @@ -import type { App } from "vue"; -import * as echarts from "echarts/core"; -import { PieChart, BarChart, LineChart } from "echarts/charts"; -import { CanvasRenderer, SVGRenderer } from "echarts/renderers"; -import { - GridComponent, - TitleComponent, - PolarComponent, - LegendComponent, - GraphicComponent, - ToolboxComponent, - TooltipComponent, - DataZoomComponent, - VisualMapComponent -} from "echarts/components"; +import type { App } from 'vue'; +import * as echarts from 'echarts/core'; +import { BarChart, LineChart, PieChart } from 'echarts/charts'; +import { CanvasRenderer, SVGRenderer } from 'echarts/renderers'; +import { DataZoomComponent, GraphicComponent, GridComponent, LegendComponent, PolarComponent, TitleComponent, ToolboxComponent, TooltipComponent, VisualMapComponent } from 'echarts/components'; const { use } = echarts; use([ - PieChart, - BarChart, - LineChart, - CanvasRenderer, - SVGRenderer, - GridComponent, - TitleComponent, - PolarComponent, - LegendComponent, - GraphicComponent, - ToolboxComponent, - TooltipComponent, - DataZoomComponent, - VisualMapComponent + PieChart, + BarChart, + LineChart, + CanvasRenderer, + SVGRenderer, + GridComponent, + TitleComponent, + PolarComponent, + LegendComponent, + GraphicComponent, + ToolboxComponent, + TooltipComponent, + DataZoomComponent, + VisualMapComponent, ]); /** @@ -38,7 +28,7 @@ use([ * @see 温馨提示:必须将 `$echarts` 添加到全局 `globalProperties` ,具体看 https://pure-admin-utils.netlify.app/hooks/useECharts/useECharts#%E4%BD%BF%E7%94%A8%E5%89%8D%E6%8F%90 */ export function useEcharts(app: App) { - app.config.globalProperties.$echarts = echarts; + app.config.globalProperties.$echarts = echarts; } export default echarts; diff --git a/src/views/account-settings/profile.vue b/src/views/account-settings/profile.vue index 82ea45f..0141c74 100644 --- a/src/views/account-settings/profile.vue +++ b/src/views/account-settings/profile.vue @@ -35,7 +35,6 @@ const onChange = (uploadFile: any) => { reader.onload = e => { imgBase64Src.value = e.target.result as string; isShow.value = true; - console.log(imgBase64Src.value); }; reader.readAsDataURL(uploadFile.raw); }; diff --git a/src/views/monitor/server/index.vue b/src/views/monitor/server/index.vue index 76bf600..7068c9a 100644 --- a/src/views/monitor/server/index.vue +++ b/src/views/monitor/server/index.vue @@ -4,6 +4,9 @@ import SystemInfo from '@/views/monitor/server/system-info.vue'; import { svg } from '@/views/monitor/server/utils/columns'; import { info, loading, onSearch } from '@/views/monitor/server/utils/hooks'; import SystemServer from '@/views/monitor/server/system-server.vue'; +import SystemCpu from '@/views/monitor/server/system-cpu.vue'; +import SystemJvmCpu from '@/views/monitor/server/system-jvm-cpu.vue'; +import SystemDisk from '@/views/monitor/server/system-disk.vue'; onMounted(() => { onSearch(); @@ -15,6 +18,9 @@ onMounted(() => { + + + diff --git a/src/views/monitor/server/system-cpu.vue b/src/views/monitor/server/system-cpu.vue new file mode 100644 index 0000000..8444ecb --- /dev/null +++ b/src/views/monitor/server/system-cpu.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/src/views/monitor/server/system-disk.vue b/src/views/monitor/server/system-disk.vue new file mode 100644 index 0000000..cbae08b --- /dev/null +++ b/src/views/monitor/server/system-disk.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/views/monitor/server/system-jvm-cpu.vue b/src/views/monitor/server/system-jvm-cpu.vue new file mode 100644 index 0000000..453e5c9 --- /dev/null +++ b/src/views/monitor/server/system-jvm-cpu.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/views/system/adminUser/utils/hooks.tsx b/src/views/system/adminUser/utils/hooks.tsx index 00a6766..530f74a 100644 --- a/src/views/system/adminUser/utils/hooks.tsx +++ b/src/views/system/adminUser/utils/hooks.tsx @@ -272,6 +272,8 @@ export const onResetPassword = (row: any) => { // 更新成功关闭弹窗 if (!result) return; + restPasswordForm.password = ''; + restPasswordForm.userId = undefined; done(); } });