Browse Source

(*) 大屏功能完善

master
peng.peng 2 years ago
parent
commit
dbca113402
  1. 6
      api/app/lib/controllers/metadataAcquisition/log.js
  2. 6
      web/client/src/sections/homePage/components/abnormalMonitoring.js
  3. 12
      web/client/src/sections/homePage/components/dataShare.js
  4. 11
      web/client/src/sections/memberManagement/nav-item.js

6
api/app/lib/controllers/metadataAcquisition/log.js

@ -4,7 +4,7 @@ function getAcquisitionLog(opts) {
return async function (ctx, next) { return async function (ctx, next) {
const models = ctx.fs.dc.models; 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: '获取采集任务失败' } let errMsg = { message: '获取采集任务失败' }
const Op = ctx.fs.dc.ORM.Op; const Op = ctx.fs.dc.ORM.Op;
try { try {
@ -32,6 +32,10 @@ function getAcquisitionLog(opts) {
searchWhere.success = logState == 'true' ? true : false searchWhere.success = logState == 'true' ? true : false
} }
if (startTime && endTime) {
searchWhere.startTime = { [Op.between]: [startTime, endTime] }
}
option.where = searchWhere option.where = searchWhere
let limit_ = limit || 10; let limit_ = limit || 10;

6
web/client/src/sections/homePage/components/abnormalMonitoring.js

@ -8,9 +8,11 @@ function AbnormalMonitoring(props) {
const { data: logs = {} } = useFsRequest({ const { data: logs = {} } = useFsRequest({
url: ApiTable.getLogs, url: ApiTable.getLogs,
query: { 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 => { const dataSource = logs?.rows ? logs?.rows?.map(s => {

12
web/client/src/sections/homePage/components/dataShare.js

@ -7,15 +7,21 @@ function DataShare(props) {
return <div className='_item_content'> return <div className='_item_content'>
<div className={'_item_icon' + s.key} /> <div className={'_item_icon' + s.key} />
<div className='_item_text'> <div className='_item_text'>
接口访问次数 {s.title}
<div className='number_container'> <div className='number_container'>
<span className='_number'>{s.data}</span>{s.unit} <span className='_number'>{s.data}</span>{s.unit}
</div> </div>
</div> </div>
</div> </div>
} }
const leftData = [{ key: '1', data: 2000, unit: '条' }, { key: '2', data: 2000, unit: '次' }, { key: '3', data: 2000, unit: '个' }] const leftData = [
const rightData = [{ key: '2', data: 2000, unit: '次' }, { key: '3', data: 2000, unit: '个' }] { 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 <Box title={"数据共享"} > return <Box title={"数据共享"} >
<div className='data_share'> <div className='data_share'>
<div className='_left_content'> <div className='_left_content'>

11
web/client/src/sections/memberManagement/nav-item.js

@ -7,11 +7,14 @@ const SubMenu = Menu.SubMenu;
export function getNavItem(user) { export function getNavItem(user) {
return ( return (
user?.role == '系统管理员' && <SubMenu key="memberManagement" icon={<UserOutlined />} title='用户管理'> user?.role == '系统管理员' && <Menu.Item icon={<UserOutlined />} key="auth">
<Menu.Item key="auth"> <Link to="/memberManagement/auth">用户管理</Link>
<Link to="/memberManagement/auth">用户权限</Link>
</Menu.Item> </Menu.Item>
</ SubMenu > // user?.role == '系统管理员' && <SubMenu key="memberManagement" icon={<UserOutlined />} title='用户管理'>
// <Menu.Item key="auth">
// <Link to="/memberManagement/auth">用户权限</Link>
// </Menu.Item>
// </ SubMenu >
) )
} }
Loading…
Cancel
Save