Browse Source

大屏优化

dev
wenlele 1 year ago
parent
commit
abc0dffa51
  1. 2
      api/app/lib/controllers/project/group.js
  2. 21
      web/client/src/sections/projectGroup/containers/statistic.jsx

2
api/app/lib/controllers/project/group.js

@ -336,7 +336,7 @@ async function groupStatisticOnline (ctx) {
{
"range": {
"collect_time": {
"gte": `${moment().subtract(24, 'hours').format('YYYY-MM-DDTHH:mm:ss.SSS')}Z`,
"gte": `${moment().subtract(32, 'hours').format('YYYY-MM-DDTHH:mm:ss.SSS')}Z`,
// "gte": "2023-08-24T08:00:00.000Z",
}
}

21
web/client/src/sections/projectGroup/containers/statistic.jsx

@ -69,6 +69,27 @@ const Statistic = ({ dispatch, actions, user, history, loading, groupStatistic,
title: '中断时长',
dataIndex: "maxOffLineTime",
key: 'maxOffLineTime',
render: (text, row) => {
let title
if (text) {
if (text >= 1440 && Math.floor(text / 1440)) title = Math.floor(text / 1440) + "天"
if ((text % 1440) >= 60 && Math.floor(text % 1440 / 60)) {
if (title) {
title = title + Math.floor(text % 1440 / 60) + "时"
} else {
title = Math.floor(text % 1440 / 60) + "时"
}
}
if (text % 1440 % 60) {
if (title) {
title = title + text % 1440 % 60 + "分"
} else {
title = text % 1440 % 60 + "分"
}
}
}
return title || "--"
}
}, {
title: '今日告警个数',
dataIndex: "todayAlarms",

Loading…
Cancel
Save