Browse Source

冲突

master
wenlele 1 year ago
parent
commit
5638800381
  1. 7
      api/app/lib/controllers/homepage/index.js
  2. 2
      web/client/src/sections/auth/containers/login.js
  3. 1
      web/client/src/sections/homePage/components/abnormalMonitoring.js
  4. 4
      web/client/src/sections/homePage/components/accessData.js
  5. 2
      web/client/src/sections/homePage/components/alarmList.js
  6. 2
      web/client/src/sections/homePage/components/centerTop.js
  7. 4
      web/client/src/sections/homePage/components/dataShare.js
  8. 6
      web/client/src/sections/homePage/components/hotspotData.js
  9. 2
      web/client/src/sections/homePage/components/public/carousel-list.js
  10. 2
      web/client/src/sections/homePage/components/style.less
  11. 4
      web/client/src/sections/homePage/nav-item.js

7
api/app/lib/controllers/homepage/index.js

@ -156,6 +156,7 @@ function getClusterInfo(opts) {
}
}
//获取restful统计信息
function getRestfulInfo(opts) {
return async function (ctx, next) {
const models = ctx.fs.dc.models;
@ -209,11 +210,11 @@ function getRestfulInfo(opts) {
}
}
//获取接入数据统计
function getAccessData(opts) {
return async function (ctx, next) {
const models = ctx.fs.dc.models;
try {
const projects = '1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38'
const projects = '2,35,37,45,70,111,170,187,210,275,276,279'
const url = 'https://statistics.anxinyun.cn/statistic?projects=' + projects
let res = await request.get(url)
ctx.status = 200;
@ -221,7 +222,7 @@ function getAccessData(opts) {
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = { message: '获取预警列表失败' }
ctx.body = { message: '获取接入数据统计失败' }
}
}
}

2
web/client/src/sections/auth/containers/login.js

@ -36,7 +36,7 @@ const Login = props => {
useEffect(() => {
if (user && user.authorized) {
dispatch(push('/homePage'));
user?.role == '数据消费者' ? dispatch(push('/metadataManagement/latestMetadata')) : dispatch(push('/homePage'));
}
}, [user])

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

@ -40,7 +40,6 @@ function AbnormalMonitoring(props) {
height={100}
multiellipsis
marginTop={-50}
// columnWidth={[200, 170, 120, 120]}
/>
</div>
}

4
web/client/src/sections/homePage/components/accessData.js

@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import Box from './public/table-card';
import { useFsRequest } from '$utils';
import { mathRound } from './util'
function AccessData(props) {
function AccessData() {
const { data: accessdata = [] } = useFsRequest({
url: 'homepage/accessdata',

2
web/client/src/sections/homePage/components/alarmList.js

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import Box from './public/table-card';
import CarouselList from './public/carousel-list';
import { Tooltip } from 'antd';

2
web/client/src/sections/homePage/components/centerTop.js

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import './style.less'
function CenterTop(props) {

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

@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import Box from './public/table-card';
import { ApiTable, useFsRequest } from '$utils';
import { useFsRequest } from '$utils';
import { mathRound } from './util';
function DataShare(props) {

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

@ -17,18 +17,18 @@ function HotspotData(props) {
<div className='hotspot_data_container'>
<div className='_img'></div>
<div className='_top1'>
<span className='hotspot_title' title={top3[0].name}>{top3[0].name?.length > 6 ? top3[0].name.substring(0, 6) + '...' : top3[0].name}</span>
<span className='hotspot_title' title={top3[0].name}>{top3[0].name?.length > 8 ? top3[0].name.substring(0, 8) + '...' : top3[0].name}</span>
<div className='hotspot_data_number'>{top3[0].count}</div>
</div>
<div className='_top2'>
{top3?.length > 2 && <>
<span className='hotspot_title' title={top3[2].name}>{top3[2].name?.length > 6 ? top3[2].name.substring(0, 6) + '...' : top3[2].name}</span>
<span className='hotspot_title' title={top3[2].name}>{top3[2].name?.length > 8 ? top3[2].name.substring(0, 8) + '...' : top3[2].name}</span>
<div className='hotspot_data_number'>{top3[2].count}</div>
</>}
</div>
<div className='_top3'>
{top3?.length > 1 && <>
<span className='hotspot_title' title={top3[1].name}>{top3[1].name?.length > 6 ? top3[1].name.substring(0, 6) + '...' : top3[1].name}</span>
<span className='hotspot_title' title={top3[1].name}>{top3[1].name?.length > 8 ? top3[1].name.substring(0, 8) + '...' : top3[1].name}</span>
<div className='hotspot_data_number'>{top3[1].count}</div>
</>}
</div>

2
web/client/src/sections/homePage/components/public/carousel-list.js

@ -1,7 +1,6 @@
/* 轮播列表组件 */
import React from 'react';
import ScrollBoard from './scrollBoard';
// import { ScrollBoard } from '@jiaminghi/data-view-react';
import NoData from './noData';
import './index.less';
function CarouselList(props) {
@ -26,7 +25,6 @@ function CarouselList(props) {
config={config}
style={{ height }}
className={multiellipsis ? 'scroll-board-multi' : 'scroll-board'}
// eslint-disable-next-line react/jsx-props-no-spreading
{...restProps}
/>
) : <NoData marginTop={marginTop || 0} />;

2
web/client/src/sections/homePage/components/style.less

@ -199,7 +199,7 @@
._top3 {
position: absolute;
bottom: 34%;
right: 2%;
left: 73%;
}
}

4
web/client/src/sections/homePage/nav-item.js

@ -2,9 +2,9 @@ import React from 'react';
import { Link } from 'react-router-dom';
import { Menu } from 'antd';
import { HomeOutlined } from '@ant-design/icons';
export function getNavItem() {
export function getNavItem(user) {
return (
<Menu.Item key="homePage" icon={<HomeOutlined />}>
user?.role == '系统管理员' && <Menu.Item key="homePage" icon={<HomeOutlined />}>
<Link to="/homePage">数据监控平台</Link>
</Menu.Item>
);

Loading…
Cancel
Save