diff --git a/api/app/lib/controllers/metadataAcquisition/log.js b/api/app/lib/controllers/metadataAcquisition/log.js index 0a40efc..df6a31e 100644 --- a/api/app/lib/controllers/metadataAcquisition/log.js +++ b/api/app/lib/controllers/metadataAcquisition/log.js @@ -4,7 +4,7 @@ function getAcquisitionLog(opts) { return async function (ctx, next) { const models = ctx.fs.dc.models; - const { page, limit, taskName, logState } = ctx.query; + const { page, limit, taskName, logState, startTime, endTime } = ctx.query; let errMsg = { message: '获取采集任务失败' } const Op = ctx.fs.dc.ORM.Op; try { @@ -32,6 +32,10 @@ function getAcquisitionLog(opts) { searchWhere.success = logState == 'true' ? true : false } + if (startTime && endTime) { + searchWhere.startTime = { [Op.between]: [startTime, endTime] } + } + option.where = searchWhere let limit_ = limit || 10; diff --git a/web/client/src/sections/homePage/components/abnormalMonitoring.js b/web/client/src/sections/homePage/components/abnormalMonitoring.js index 82b7785..ecb5206 100644 --- a/web/client/src/sections/homePage/components/abnormalMonitoring.js +++ b/web/client/src/sections/homePage/components/abnormalMonitoring.js @@ -8,9 +8,11 @@ function AbnormalMonitoring(props) { const { data: logs = {} } = useFsRequest({ url: ApiTable.getLogs, query: { - logState: false + logState: false, + startTime: moment().subtract(7, 'days').format('YYYY-MM-DD HH:mm:ss'), + endTime: moment().format('YYYY-MM-DD HH:mm:ss') }, - // pollingInterval: 10000 + pollingInterval: 1000 * 60 }); const dataSource = logs?.rows ? logs?.rows?.map(s => { diff --git a/web/client/src/sections/homePage/components/dataShare.js b/web/client/src/sections/homePage/components/dataShare.js index f04e2c2..020b564 100644 --- a/web/client/src/sections/homePage/components/dataShare.js +++ b/web/client/src/sections/homePage/components/dataShare.js @@ -7,15 +7,21 @@ function DataShare(props) { return