From f2d86ae69d6dc2a86b745d32c8e79d359465acbd Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 31 Mar 2023 11:17:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=91=E6=8E=A7=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=80=BB=E8=A7=88=E5=B1=95=E7=A4=BA=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/monitor/MonitorCard.js | 43 ++++++++++---------- spug_web/src/pages/monitor/index.module.less | 22 ++++------ 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/spug_web/src/pages/monitor/MonitorCard.js b/spug_web/src/pages/monitor/MonitorCard.js index 8ea07f9..79885cd 100644 --- a/spug_web/src/pages/monitor/MonitorCard.js +++ b/spug_web/src/pages/monitor/MonitorCard.js @@ -6,16 +6,16 @@ import React, { useState, useEffect } from 'react'; import { observer } from 'mobx-react'; import { Card, Input, Select, Space, Tooltip, Spin, message } from 'antd'; -import { FrownOutlined, RedoOutlined, SyncOutlined } from '@ant-design/icons'; +import { FrownOutlined, ReloadOutlined, SyncOutlined } from '@ant-design/icons'; import styles from './index.module.less'; import store from './store'; const StyleMap = { - '0': {background: '#99999933', border: '2px solid #999', color: '#999999'}, - '1': {background: '#16a98733', border: '2px solid #16a987', color: '#16a987'}, - '2': {background: '#ffba0033', border: '2px solid #ffba00', color: '#ffba00'}, - '3': {background: '#f2655d33', border: '2px solid #f2655d', color: '#f2655d'}, - '10': {background: '#99999919', border: '2px dashed #999999', color: '#999999'} + '0': {background: '#99999933', border: '1px solid #999', color: '#999999'}, + '1': {background: '#16a98733', border: '1px solid #16a987', color: '#16a987'}, + '2': {background: '#ffba0033', border: '1px solid #ffba00', color: '#ffba00'}, + '3': {background: '#f2655d33', border: '1px solid #f2655d', color: '#f2655d'}, + '10': {background: '#99999919', border: '1px dashed #999999', color: '#999999'} } const StatusMap = { @@ -27,9 +27,10 @@ const StatusMap = { } function CardItem(props) { - const {status, type, desc, name, target, latest_run_time} = props.data + const {status, type, group, desc, name, target, latest_run_time} = props.data const title = (
+
分组: {group}
类型: {type}
名称: {name}
目标: {target}
@@ -65,7 +66,7 @@ function MonitorCard() { const filteredRecords = store.ovDataSource.filter(x => !status || x.status === status) return ( -
分组:
@@ -94,21 +95,21 @@ function MonitorCard() { {Object.entries(StyleMap).map(([s, style]) => { const count = store.ovDataSource.filter(x => x.status === s).length; return count ? ( -
setStatus(s === status ? '' : s)}> - {store.ovDataSource.filter(x => x.status === s).length} -
+ +
setStatus(s === status ? '' : s)}> + {store.ovDataSource.filter(x => x.status === s).length} +
+
) : null })} -
- {autoReload ? : } -
+ +
+ {autoReload ? : } +
+
{filteredRecords.length > 0 ? ( diff --git a/spug_web/src/pages/monitor/index.module.less b/spug_web/src/pages/monitor/index.module.less index 9258725..81f01d6 100644 --- a/spug_web/src/pages/monitor/index.module.less +++ b/spug_web/src/pages/monitor/index.module.less @@ -7,8 +7,8 @@ display: flex; justify-content: center; align-items: center; - width: 40px; - height: 40px; + width: 16px; + height: 16px; font-size: 12px; color: #fff; border-radius: 2px; @@ -17,6 +17,7 @@ .header { display: flex; justify-content: flex-end; + align-items: center; margin-bottom: 12px; margin-top: -6px; @@ -25,24 +26,19 @@ justify-content: center; align-items: center; min-width: 26px; - height: 26px; - padding: 0 1px; + height: 20px; margin-left: 12px; - border-radius: 2px; + border-radius: 10px; + padding: 0 8px; color: #fff; font-weight: bold; cursor: pointer; } - .authLoad { - display: flex; - justify-content: center; - align-items: center; - width: 26px; - height: 26px; - color: #fff; + .autoLoad { margin-left: 24px; - border-radius: 2px; + font-size: 18px; + color: #999999; } }