From dbca113402ea8b88cc0138a0a74b76db10864332 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Tue, 27 Jun 2023 16:27:30 +0800 Subject: [PATCH] =?UTF-8?q?(*)=20=E5=A4=A7=E5=B1=8F=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/metadataAcquisition/log.js | 6 +++++- .../homePage/components/abnormalMonitoring.js | 6 ++++-- .../src/sections/homePage/components/dataShare.js | 12 +++++++++--- .../src/sections/memberManagement/nav-item.js | 13 ++++++++----- 4 files changed, 26 insertions(+), 11 deletions(-) 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
- 接口访问次数 + {s.title}
{s.data}{s.unit}
} - const leftData = [{ key: '1', data: 2000, unit: '条' }, { key: '2', data: 2000, unit: '次' }, { key: '3', data: 2000, unit: '个' }] - const rightData = [{ key: '2', data: 2000, unit: '次' }, { key: '3', data: 2000, unit: '个' }] + const leftData = [ + { key: '1', data: 2000, unit: '条', title: '共享库数据总量' }, + { key: '2', data: 2000, unit: '次', title: '访问接口总次数' }, + { key: '3', data: 2000, unit: '个', title: '访问接口用户总数' }] + const rightData = [ + { key: '2', data: 2000, unit: '次', title: '接口访问次数' }, + { key: '3', data: 2000, unit: '个', title: '访问接口用户总数' }] + return
diff --git a/web/client/src/sections/memberManagement/nav-item.js b/web/client/src/sections/memberManagement/nav-item.js index ba32aaf..56c3fd0 100644 --- a/web/client/src/sections/memberManagement/nav-item.js +++ b/web/client/src/sections/memberManagement/nav-item.js @@ -7,11 +7,14 @@ const SubMenu = Menu.SubMenu; export function getNavItem(user) { return ( - user?.role == '系统管理员' && } title='用户管理'> - - 用户权限 - - + user?.role == '系统管理员' && } key="auth"> + 用户管理 + + // user?.role == '系统管理员' && } title='用户管理'> + // + // 用户权限 + // + // ) } \ No newline at end of file