Browse Source

运维监控,报表中心

dev
wenlele 2 years ago
parent
commit
0e7160203f
  1. 2
      web/client/src/layout/actions/global.js
  2. 6
      web/client/src/layout/reducers/global.js
  3. 5
      web/client/src/sections/facility/containers/monitor.jsx
  4. 9
      web/client/src/sections/service/containers/reportManagement.jsx
  5. 8
      web/config.js
  6. 2
      web/package.json
  7. 4
      web/routes/attachment/index.js

2
web/client/src/layout/actions/global.js

@ -39,6 +39,8 @@ export function initApiRoot () {
payload: {
apiRoot: res.root,
iotVcmpWeb:res.iotVcmpWeb,
pomsMonitor:res.pomsMonitor,
dcWeb:res.dcWeb,
}
})
});

6
web/client/src/layout/reducers/global.js

@ -12,6 +12,8 @@ function global (state = {
clientWidth: 1024,
apiRoot: '',
iotVcmpWeb: '',
pomsMonitor:'',
dcWeb:'',
}, action) {
const payload = action.payload;
switch (action.type) {
@ -31,7 +33,9 @@ function global (state = {
case INIT_API_ROOT:
return Immutable.fromJS(state).merge({
apiRoot: payload.apiRoot,
iotVcmpWeb: payload.iotVcmpWeb
iotVcmpWeb: payload.iotVcmpWeb,
pomsMonitor:payload.pomsMonitor,
dcWeb:payload.dcWeb,
}).toJS();
case PEPPROJECTID:
return Immutable.fromJS(state).merge({

5
web/client/src/sections/facility/containers/monitor.jsx

@ -4,7 +4,7 @@ import { connect } from 'react-redux';
const Server = (props) => {
const { dispatch, actions, user, loading, socket } = props
const { dispatch, actions, user, loading, socket,pomsMonitor } = props
useEffect(() => {
@ -16,7 +16,7 @@ const Server = (props) => {
<div>
{/* <img src="/assets/images/install/watting.png" alt="" style={{ width: 'calc(100% + 16px)', position: "relative", top: -12, left: -8, }} /> */}
{/* <iframe frameborder="0" src={`/_api/https://monitor.anxinyun.cn/login`} style={{height: '100%', width: '100%'}} /> */}
<iframe frameBorder="0" src={`https://monitor.anxinyun.cn`} style={{height: 'calc(100vh - 30px)', width: 'calc(100%)'}} />
<iframe frameBorder="0" src={pomsMonitor} style={{height: 'calc(100vh - 80px)', width: 'calc(100%)'}} />
</div>
</>
)
@ -30,6 +30,7 @@ function mapStateToProps (state) {
// actions: global.actions,
// members: members.data,
// socket: webSocket.socket
pomsMonitor:global.pomsMonitor,
};
}

9
web/client/src/sections/service/containers/reportManagement.jsx

@ -4,7 +4,7 @@ import { connect } from 'react-redux';
const Rest = (props) => {
const { dispatch, actions, user, loading, socket } = props
const { dispatch, actions, user, loading, socket, dcWeb } = props
useEffect(() => {
@ -13,9 +13,9 @@ const Rest = (props) => {
return (
<>
{/* style={{height: '100%', width: '100%',margin: '8px 12px', padding: '20px 20px 0px 20px'}} */}
{/* style={{height: '100%', width: '100%',margin: '8px 12px', padding: '20px 20px 0px 20px'}} */}
<div >
<iframe frameBorder="0" src={`https://fsiot-oamss.anxinyun.cn/dataService/download?pcode=`} style={{height: 'calc(100vh - 30px)', width: 'calc(100%)'}} />
<iframe frameBorder="0" src={`${dcWeb}/dataService/download?pcode=`} style={{ height: 'calc(100vh - 80px)', width: 'calc(100%)' }} />
</div>
</>
)
@ -28,7 +28,8 @@ function mapStateToProps (state) {
// user: auth.user,
// actions: global.actions,
// members: members.data,
// socket: webSocket.socket
// socket: webSocket.socket,
dcWeb: global.dcWeb,
};
}

8
web/config.js

@ -16,6 +16,9 @@ args.option('apiPomsUrl', 'webapi的URL 外网可访问');
args.option('apiAnxinyunUrl', '安心云 api');
args.option('apiEmisUrl', '企业管理 api');
args.option('iotVcmpWeb', 'IOT 视频服务');
args.option('pomsMonitor', '运维监控 web');
args.option('dcWeb', '报表中心web');
// 七牛
args.option('qnak', 'qiniuAccessKey');
@ -30,6 +33,8 @@ const API_POMS_URL = process.env.API_POMS_URL || flags.apiPomsUrl;
const API_EMIS_URL = process.env.API_EMIS_URL || flags.apiEmisUrl;
const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl;
const IOT_VIDEO_WEB = process.env.IOT_VIDEO_WEB || flags.iotVcmpWeb;
const POMS_MONITOR = process.env.POMS_MONITOR || flags.pomsMonitor;
const DC_WEB = process.env.DC_WEB || flags.dcWeb;
// 七牛
const ANXINCLOUD_QINIU_AK = process.env.ANXINCLOUD_QINIU_ACCESSKEY || flags.qnak;
@ -41,6 +46,7 @@ const ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMA
if (
!API_URL
|| !API_ANXINYUN_URL
|| !POMS_MONITOR || !DC_WEB
|| !ANXINCLOUD_QINIU_AK || !ANXINCLOUD_QINIU_SK || !ANXINCLOUD_QINIU_BUCKET_RESOURCE || !ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || !IOT_VIDEO_WEB) {
console.log('缺少启动参数,异常退出');
args.showHelp();
@ -85,6 +91,8 @@ const product = {
opts: {
apiUrl: API_POMS_URL,
iotVcmpWeb: IOT_VIDEO_WEB,
pomsMonitor: POMS_MONITOR,
dcWeb: DC_WEB,
staticRoot: './client',
qiniu: {
fetchUrl: '/_file-server',

2
web/package.json

@ -7,7 +7,7 @@
"test": "mocha",
"start-vite": "cross-env NODE_ENV=developmentVite npm run start-params",
"start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5600 -u http://localhost:4600 --apiPomsUrl http://localhost:4600 --apiAnxinyunUrl http://10.8.30.112:4100 --apiEmisUrl http://10.8.30.112:14000 --qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5 --qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa --qnbkt dev-highways4good --qndmn http://rhvqdivo5.hn-bkt.clouddn.com --iotVcmpWeb https://mediaconsole.ngaiot.com",
"start-params": "node server -p 5600 -u http://localhost:4600 --apiPomsUrl http://localhost:4600 --apiAnxinyunUrl http://10.8.30.112:4100 --apiEmisUrl http://10.8.30.112:14000 --qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5 --qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa --qnbkt dev-highways4good --qndmn http://rhvqdivo5.hn-bkt.clouddn.com --iotVcmpWeb https://mediaconsole.ngaiot.com --pomsMonitor https://monitor.anxinyun.cn --dcWeb https://fsiot-oamss.anxinyun.cn",
"deploy": "export NODE_ENV=production&& npm run build && node server",
"build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js",
"build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js"

4
web/routes/attachment/index.js

@ -19,12 +19,14 @@ module.exports = {
entry: function (app, router, opts) {
const getApiRoot = async function (ctx) {
const { apiUrl, iotVcmpWeb } = opts;
const { apiUrl, iotVcmpWeb, pomsMonitor, dcWeb } = opts;
ctx.status = 200;
ctx.body = {
root: apiUrl,
iotVcmpWeb: iotVcmpWeb,
pomsMonitor: pomsMonitor,
dcWeb: dcWeb,
};
};

Loading…
Cancel
Save