From 5ea87995ca99c5860a3b1b5e1b3decef8c221cad Mon Sep 17 00:00:00 2001 From: shiyang Date: Sun, 29 Nov 2020 21:22:49 +0800 Subject: [PATCH 1/2] update TaskMonitor --- web/config/router.config.js | 22 +-- web/src/pages/Dashboard/TaskMonitor.js | 219 ++++++++++++++++++++++++- 2 files changed, 228 insertions(+), 13 deletions(-) diff --git a/web/config/router.config.js b/web/config/router.config.js index cb623a39..03545f85 100644 --- a/web/config/router.config.js +++ b/web/config/router.config.js @@ -36,22 +36,22 @@ export default [ }, { path: '/platform/tasks', name: 'tasks', - component: './Dashboard/Workplace', + component: './Dashboard/TaskMonitor', }, { path: '/platform/search', name: 'search', component: './Dashboard/SearchMonitor', }, - // { - // path: '/platform/analysis', - // name: 'analysis', - // component: './Dashboard/Analysis', - // }, - // { - // path: '/platform/monitor', - // name: 'monitor', - // component: './Dashboard/Monitor', - // }, + { + path: '/platform/analysis', + name: 'analysis', + component: './Dashboard/Analysis', + }, + { + path: '/platform/monitor', + name: 'monitor', + component: './Dashboard/Monitor', + }, ] }, diff --git a/web/src/pages/Dashboard/TaskMonitor.js b/web/src/pages/Dashboard/TaskMonitor.js index cbda8986..5ee39a22 100644 --- a/web/src/pages/Dashboard/TaskMonitor.js +++ b/web/src/pages/Dashboard/TaskMonitor.js @@ -1,13 +1,28 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { formatMessage, FormattedMessage } from 'umi/locale'; -import { Row, Col, Card, Tooltip } from 'antd'; +import { Row, Col, Card } from 'antd'; import numeral from 'numeral'; import { Pie, WaterWave, Gauge, TagCloud } from '@/components/Charts'; import NumberInfo from '@/components/NumberInfo'; import CountDown from '@/components/CountDown'; import ActiveChart from '@/components/ActiveChart'; import GridContent from '@/components/PageHeaderWrapper/GridContent'; +import { + G2, + Chart, + Geom, + Axis, + Tooltip, + Coord, + Label, + Legend, + View, + Guide, + Shape, + Facet, + Util +} from "bizcharts"; import Authorized from '@/utils/Authorized'; import styles from './Monitor.less'; @@ -39,8 +54,208 @@ class TaskMonitor extends PureComponent { const { monitor, loading } = this.props; const { tags } = monitor; + const taskTimedDta = [ + { + name: "node1-23", + value: 3 + }, + { + name: "node1-24", + value: 4 + }, + { + name: "node1-25", + value: 5 + }, + { + name: "node2-101", + value: 5.3 + }, + { + name: "node2-102", + value: 5.9 + }, + { + name: "node2-103", + value: 6 + }, + { + name: "node3-121", + value: 7 + }, + { + name: "node3-122", + value: 9 + }, + { + name: "node3-123", + value: 15 + } + ]; + const cols = { + value: { + min: 0, + alias:'Time(min)' + }, + name: { + range: [0.05, 0.95], + alias:'Task' + } + }; + const taskCategorydDta = [ + { + name: "索引重建任务", + value: 16 + }, + { + name: "数据导入任务", + value: 4 + }, + { + name: "数据导出任务", + value: 2 + }, + { + name: "备份任务", + value: 10 + }, + { + name: "恢复任务", + value: 6 + }, + { + name: "其他", + value: 1 + } + ]; + return ( -

task monitor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); } } From afe3a7021dd5f8ea4421cd8c643a3dd3c883e499 Mon Sep 17 00:00:00 2001 From: shiyang Date: Sun, 29 Nov 2020 21:23:28 +0800 Subject: [PATCH 2/2] update TaskMonitor --- web/config/router.config.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/web/config/router.config.js b/web/config/router.config.js index 03545f85..3da3db9a 100644 --- a/web/config/router.config.js +++ b/web/config/router.config.js @@ -42,16 +42,7 @@ export default [ name: 'search', component: './Dashboard/SearchMonitor', }, - { - path: '/platform/analysis', - name: 'analysis', - component: './Dashboard/Analysis', - }, - { - path: '/platform/monitor', - name: 'monitor', - component: './Dashboard/Monitor', - }, + ] },