diff --git a/console/client/assets/env.js b/console/client/assets/env.js
index 48039f9..a7647fe 100644
--- a/console/client/assets/env.js
+++ b/console/client/assets/env.js
@@ -1 +1 @@
-window.FS_API_ROOT = 'http://10.8.30.183:4100'
\ No newline at end of file
+window.FS_API_ROOT = 'http://127.0.0.1:4100'
\ No newline at end of file
diff --git a/console/client/src/sections/console/containers/index.js b/console/client/src/sections/console/containers/index.js
index efb92da..28810de 100644
--- a/console/client/src/sections/console/containers/index.js
+++ b/console/client/src/sections/console/containers/index.js
@@ -573,62 +573,66 @@ function Index (props) {
if (
res.success
) {
- setVideo(res.payload.data)
- const container = document.getElementById('video-play');
- console.log(`准备播放`);
- // 播放方式 1
- // const jessibuca = new window.Jessibuca({
- // container: container,
- // videoBuffer: 0.2, // 缓存时长
- // isResize: false,
- // text: "",
- // loadingText: "加载中",
- // debug: true,
- // showBandwidth: false, // 显示网速
- // operateBtns: {
- // fullscreen: false,
- // screenshot: false,
- // play: false,
- // audio: false,
- // },
- // forceNoOffscreen: false,
- // controlAutoHide: true,
- // isNotMute: false,
- // });
- // jessibucas.current = jessibuca
- // jessibuca.play(
- // `${res.payload.data.ws_flv}`
- // );
-
- // 播放方式 2
- const flv = flvjs.createPlayer({
- type: 'flv',
- url: `${res.payload.data.ws_flv}`,
- isLive: true,
- hasAudio: false,
- hasVideo: true,
- }, {
- enableWorker: false,
- enalleStashBuffer: true,
- stashInitialSize: 128,
- lazyLoadMaxDuration: 3 * 60,
- seekType: 'range',
- autoCleanupSourceBuffer: true,
- cors: true,
- });
- flv.attachMediaElement(container);
- flv.load();
-
- // 初始化 _remuxer
- let controller = flv._transmuxer._controller
- controller._remuxer = {
- flushStashedSamples: function () {
- console.log("flushStashedSamples")
+ try {
+ setVideo(res.payload.data)
+ const container = document.getElementById('video-play');
+ console.log(`准备播放`);
+ // 播放方式 1
+ // const jessibuca = new window.Jessibuca({
+ // container: container,
+ // videoBuffer: 0.2, // 缓存时长
+ // isResize: false,
+ // text: "",
+ // loadingText: "加载中",
+ // debug: true,
+ // showBandwidth: false, // 显示网速
+ // operateBtns: {
+ // fullscreen: false,
+ // screenshot: false,
+ // play: false,
+ // audio: false,
+ // },
+ // forceNoOffscreen: false,
+ // controlAutoHide: true,
+ // isNotMute: false,
+ // });
+ // jessibucas.current = jessibuca
+ // jessibuca.play(
+ // `${res.payload.data.ws_flv}`
+ // );
+
+ // 播放方式 2
+ const flv = flvjs.createPlayer({
+ type: 'flv',
+ url: `${res.payload.data.ws_flv}`,
+ isLive: true,
+ hasAudio: false,
+ hasVideo: true,
+ }, {
+ enableWorker: false,
+ enalleStashBuffer: true,
+ stashInitialSize: 128,
+ lazyLoadMaxDuration: 3 * 60,
+ seekType: 'range',
+ autoCleanupSourceBuffer: true,
+ cors: true,
+ });
+ flv.attachMediaElement(container);
+ flv.load();
+
+ // 初始化 _remuxer
+ let controller = flv?._transmuxer?._controller
+ controller._remuxer = {
+ flushStashedSamples: function () {
+ console.log("flushStashedSamples")
+ }
}
+
+ flv.play();
+ flvPlayer.current = flv
+ } catch (error) {
+ console.error(error);
}
-
- flv.play();
- flvPlayer.current = flv
}
})
@@ -819,7 +823,7 @@ function Index (props) {
{
s.dataFrom === 'live' ?
(
- craneParams[s.v]?.Value || '-'
+ craneParams[s.v]?.Value || craneParams[s.v]?.Value == 0 ? craneParams[s.v]?.Value : '-'
) + (
craneParams[s.v] && s.unit ? s.unit : ''
)
diff --git a/console/client/src/sections/console/containers/setUp.js b/console/client/src/sections/console/containers/setUp.js
index daccdec..79731bd 100644
--- a/console/client/src/sections/console/containers/setUp.js
+++ b/console/client/src/sections/console/containers/setUp.js
@@ -2,14 +2,14 @@ import React, { useEffect, useState, useRef } from 'react'
import { push } from 'react-router-redux';
import request from 'superagent';
import { connect } from 'react-redux';
-import { editCrane } from '../actions'
+import { editCrane, getCrane } from '../actions'
import {
BorderlessTableOutlined, BlockOutlined, RollbackOutlined, SaveOutlined
} from '@ant-design/icons';
-import { Col, Row, Button, Modal, Form, Input, InputNumber, message } from 'antd';
+import { Col, Row, Button, Modal, Form, Input, InputNumber, message, Switch } from 'antd';
import '../style.less'
-function SetUp ({ dispatch }) {
+function SetUp ({ dispatch, craneData }) {
const [form] = Form.useForm();
const [renderMenu, setRenderMenu] = useState([])
const [renderForm, setRenderForm] = useState(false)
@@ -24,7 +24,40 @@ function SetUp ({ dispatch }) {
}
}, {
n: '限位告警参数',
- ic: