diff --git a/api/app/lib/controllers/project/group.js b/api/app/lib/controllers/project/group.js index d358602..02fd38d 100644 --- a/api/app/lib/controllers/project/group.js +++ b/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", } } diff --git a/web/client/src/sections/projectGroup/containers/statistic.jsx b/web/client/src/sections/projectGroup/containers/statistic.jsx index 421bf17..214f159 100644 --- a/web/client/src/sections/projectGroup/containers/statistic.jsx +++ b/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",