20230324
This commit is contained in:
commit
42cc1844d3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -51,7 +51,7 @@ export const update = (data,params)=>{
|
|||
}
|
||||
// 备份服务器设置
|
||||
export const configBackup = () =>{
|
||||
return axios.get('api/ConfigBackup')
|
||||
return axios.get('api/ConfigBackup',{timeout: 360000})
|
||||
}
|
||||
// 还原服务器设置
|
||||
export const configRestore = (data,params)=>{
|
||||
|
@ -60,3 +60,9 @@ export const configRestore = (data,params)=>{
|
|||
headers:{'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
//重启指定服务
|
||||
export const getResetService = params => {
|
||||
return axios.get('api/ResetService', {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
|
@ -213,17 +213,10 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.drawBar(this.typeValue);
|
||||
// this.drawBar(this.typeValue);
|
||||
},
|
||||
watch: {
|
||||
typeValue: {
|
||||
handler(newVal) {
|
||||
if (newVal) {
|
||||
this.drawBar(newVal);
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -70,6 +70,7 @@ export default {
|
|||
// }
|
||||
// },
|
||||
color: color,
|
||||
animation: false,
|
||||
legend: {
|
||||
top: 20,
|
||||
right: 'center',
|
||||
|
|
|
@ -111,11 +111,11 @@ export default {
|
|||
path: '/test1/CustomOperations',
|
||||
|
||||
},
|
||||
{
|
||||
title : '健康检测',
|
||||
path: '/test1/HealthCheck',
|
||||
// {
|
||||
// title : '健康检测',
|
||||
// path: '/test1/HealthCheck',
|
||||
|
||||
},
|
||||
// },
|
||||
{
|
||||
title : '接口与服务器证书',
|
||||
path: '/test1/InterfaceServerCertificates',
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</div>
|
||||
<div style="font-size: 30px; font-weight: bold" v-if="title == '排队数'">
|
||||
<span style="font-size: 15px;">排队数</span><br />
|
||||
<span style="font-size: 30px; font-weight: bold">{{ newDataArr[0].n_queue }}</span>
|
||||
<span style="font-size: 30px; font-weight: bold">{{ queue }}</span>
|
||||
</div>
|
||||
<div style="font-size: 30px; font-weight: bold" v-if="title == '检测数'">
|
||||
<span style="font-size: 15px;">检测数</span><br />
|
||||
|
@ -144,6 +144,7 @@ export default {
|
|||
// 流量数值
|
||||
flow: 0,
|
||||
isRefer: true,
|
||||
|
||||
valueShow: {},
|
||||
//排队数
|
||||
queue: '',
|
||||
|
@ -158,8 +159,8 @@ export default {
|
|||
methods: {
|
||||
// 计算类型数量的总和
|
||||
getDataArr(val) {
|
||||
|
||||
this.getNewQueue(val)
|
||||
this.newDataArr = val
|
||||
this.getNewQueue(this.newDataArr)
|
||||
},
|
||||
getTotal(dataArr) {
|
||||
if (this.title == '类型') {
|
||||
|
@ -168,16 +169,15 @@ export default {
|
|||
}, 0);
|
||||
}
|
||||
},
|
||||
// 计算类型的数值
|
||||
getNewQueue(val) {
|
||||
this.newDataArr = val
|
||||
|
||||
if (val[0].n_queue) {
|
||||
this.newDataArr[0].n_queue = val[0].n_queue;
|
||||
this.queue = val[0].n_queue;
|
||||
}
|
||||
if (val[0].ave_queue) {
|
||||
this.newDataArr[0].n_queue = val[0].ave_queue;
|
||||
if (val[0].ave_queue) {
|
||||
this.queue = val[0].ave_queue;
|
||||
}
|
||||
if (val[0].headway) {
|
||||
if (val[0].headway) {
|
||||
this.newDataArr[0].headway = val[0].headway;
|
||||
}
|
||||
if (val[0].ave_headway) {
|
||||
|
@ -189,7 +189,6 @@ export default {
|
|||
if (val[0].ave_stay) {
|
||||
this.newDataArr[0].n_stay = val[0].ave_stay;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
|
|
|
@ -24,7 +24,12 @@ export default {
|
|||
//编辑保存组件弹窗传参
|
||||
setHostName: 'http://172.16.1.168:5000/api/SetHostName',
|
||||
setHostTime: 'http://172.16.1.168:5000/api/SetHostTime',
|
||||
changePassowrd:'http://172.16.1.168:5000/api/ChangePassword'
|
||||
changePassowrd:'http://172.16.1.168:5000/api/ChangePassword',
|
||||
//还原服务器设置上传
|
||||
postConfigRestore:'http://172.16.1.168:5000/api/ConfigRestore',
|
||||
//更新软件版本
|
||||
postConfigUpdate:'http://172.16.1.168:5000/api/Update'
|
||||
|
||||
// `http://${ipUurl}:5000/api/AddShipjk`
|
||||
// dataUrl: `http://${ipUurl}:5000/api/AddShipjk`,
|
||||
// getSpareElementOrder: `http://${ipUurl}:5000/api/Upload`,
|
||||
|
@ -41,5 +46,10 @@ export default {
|
|||
// saveSetFtppz: `http://${ipUurl}:5000/api/SetFtppz`,
|
||||
// //编辑保存组件弹窗传参
|
||||
// setHostName: `http://${ipUurl}:5000/api/SetHostName`,
|
||||
// setHostTime: `http://${ipUurl}:5000/api/SetHostTime`
|
||||
// setHostTime: `http://${ipUurl}:5000/api/SetHostTime`,
|
||||
// changePassowrd:`http://${ipUurl}:5000/api/ChangePassword`,
|
||||
// //还原服务器设置上传
|
||||
// postConfigRestore:`http://${ipUurl}:5000/api/ConfigRestore`,
|
||||
// //更新软件版本
|
||||
// postConfigUpdate:`http://${ipUurl}:5000/api/Update`
|
||||
};
|
||||
|
|
|
@ -70,15 +70,16 @@ export default new VueRouter({
|
|||
},
|
||||
component: () =>
|
||||
import ('@/views/general/CustomOperations.vue'),
|
||||
}, {
|
||||
path: 'HealthCheck',
|
||||
name: 'HealthCheck',
|
||||
meta: {
|
||||
title: '健康检测'
|
||||
},
|
||||
component: () =>
|
||||
import ('@/views/general/HealthCheck.vue'),
|
||||
},
|
||||
// {
|
||||
// path: 'HealthCheck',
|
||||
// name: 'HealthCheck',
|
||||
// meta: {
|
||||
// title: '健康检测'
|
||||
// },
|
||||
// component: () =>
|
||||
// import ('@/views/general/HealthCheck.vue'),
|
||||
// },
|
||||
{
|
||||
path: 'AboutMachine',
|
||||
name: 'AboutMachine',
|
||||
|
@ -111,15 +112,16 @@ export default new VueRouter({
|
|||
},
|
||||
component: () =>
|
||||
import('@/views/general/CustomOperations.vue'),
|
||||
}, {
|
||||
path: 'HealthCheck',
|
||||
name: 'HealthCheck',
|
||||
meta: {
|
||||
title: '健康检测'
|
||||
},
|
||||
component: () =>
|
||||
import('@/views/general/HealthCheck.vue'),
|
||||
},
|
||||
// {
|
||||
// path: 'HealthCheck',
|
||||
// name: 'HealthCheck',
|
||||
// meta: {
|
||||
// title: '健康检测'
|
||||
// },
|
||||
// component: () =>
|
||||
// import('@/views/general/HealthCheck.vue'),
|
||||
// },
|
||||
{
|
||||
path: 'StateOperation',
|
||||
name: 'StateOperation',
|
||||
|
|
|
@ -36,8 +36,8 @@ class mqttHandle {
|
|||
//配置链接
|
||||
const { host, port, endpoint, ...options } = this.connect;
|
||||
console.log("this.connect.host",this.connect.host)
|
||||
const connectUrl = 'ws://172.16.1.168:10087/';
|
||||
// const connectUrl = `ws://${this.connect.host}:${this.connect.port}`;
|
||||
// const connectUrl = 'ws://172.16.1.168:10087/';
|
||||
const connectUrl = `ws://${this.connect.host}:${this.connect.port}`;
|
||||
// if (!client.connected) {
|
||||
// client.on('connect', function () {
|
||||
// console.log('连接成功')
|
||||
|
|
|
@ -1,34 +1,35 @@
|
|||
// import axios from 'axios';
|
||||
// import store from '@/store/index.js';
|
||||
// import { Message } from 'element-ui';
|
||||
import axios from 'axios';
|
||||
import store from '@/store/index.js';
|
||||
import { Message } from 'element-ui';
|
||||
|
||||
// // 创建 axios 实例
|
||||
// const service = axios.create({
|
||||
// baseURL: 'https://api.example.com',
|
||||
// // withCredentials: true,
|
||||
// timeout: 60000
|
||||
// });
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
baseURL: process.env.BASE_API, // api 的 base_url
|
||||
withCredentials: true,
|
||||
// withCredentials: true,
|
||||
timeout: 600000
|
||||
});
|
||||
|
||||
// // 请求拦截器
|
||||
// service.interceptors.request.use(config => {
|
||||
// config.headers['authToken'] = store.state.authToken;
|
||||
// config.headers['ms_username'] = localStorage.getItem('ms_username');
|
||||
// return config;
|
||||
// }, error => {
|
||||
// console.log('request error',error);
|
||||
// return Promise.reject(error);
|
||||
// });
|
||||
// 请求拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
config.headers['authToken'] = store.state.authToken;
|
||||
config.headers['ms_username'] = localStorage.getItem('ms_username');
|
||||
return config;
|
||||
}, error => {
|
||||
console.log('request error',error);
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
// // 响应拦截器
|
||||
// service.interceptors.response.use(response => {
|
||||
// return response;
|
||||
// }, error => {
|
||||
// console.log('response error', error);
|
||||
// Message({
|
||||
// message: error.message,
|
||||
// type: 'error'
|
||||
// });
|
||||
// return Promise.reject(error);
|
||||
// });
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(response => {
|
||||
return response;
|
||||
}, error => {
|
||||
console.log('response error', error);
|
||||
Message({
|
||||
message: error.message,
|
||||
type: 'error'
|
||||
});
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
// export default service;
|
||||
export default service;
|
|
@ -582,7 +582,7 @@ this.getVideoList()
|
|||
for (var i = 0; i < count; i++) {
|
||||
let formData = new FormData();//new一个formData事件
|
||||
formData.append("file", arrFile[i].File); //将file属性添加到formData里
|
||||
var url = serverUrl.getSpareElementOrder+"?Name=" + filename + "&Number=" + i + "&BufferSize=" + bufferSize + "&Count=" + count + "&Start=" + arrFile[i].Start + "&End=" + arrFile[i].End + "&Size=" + size;
|
||||
var url = serverUrl.getSpareElementOrder+"?Name=" + filename + "&Number=" + i + "&BufferSize=" + bufferSize + "&Count=" + count + "&Start=" + arrFile[i].Start + "&End=" + arrFile[i].End + "&Size=" + size + "&FolderName=OfflineVideo";
|
||||
axios.post(url, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data;",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<el-table-column align="center" label="操作" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="edit(scope.row)" type="text" size="small" class="">编辑</el-button>
|
||||
<el-button style="color:red" @click="clickDelete(scope.row)" type="text" size="small">删除</el-button>
|
||||
<el-button style="color:red" @click="clickDelete(scope.row)" type="text" size="small" v-if="scope.row.userName!='admin'">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<el-input :disabled="dialogTitle == '编辑'" v-model="formLabelAlign.account"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码:">
|
||||
<el-input v-model="formLabelAlign.passWord"></el-input>
|
||||
<el-input v-model="formLabelAlign.passWord" type="password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色:">
|
||||
<el-select
|
||||
|
|
|
@ -1347,6 +1347,10 @@ export default {
|
|||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
p {
|
||||
width: 95%;
|
||||
font-size: 25px;
|
||||
|
|
|
@ -508,6 +508,7 @@ export default {
|
|||
if (itemTypeChart.componentName.includes('OD') && itemTypeChart.$refs.ODChartRef != undefined && itemTypeChart.dataArr[0].ob_data.length != 0) {
|
||||
itemTypeChart.$refs.ODChartRef.drawThermalChart(itemTypeChart.dataArr[0].ob_data, itemTypeChart.startEndData)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,18 +21,39 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="还原服务器设置:">
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" size="small" @click="restoreHandle()">备份</el-button>
|
||||
<el-button type="primary" size="small" @click="restoreHandle()">还原</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/"
|
||||
<el-col :span="8">
|
||||
<!-- <el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/"
|
||||
:on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" multiple
|
||||
:limit="3" :on-exceed="handleExceed" :file-list="fileList">
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-upload> -->
|
||||
<!-- <el-upload class="upload-demo"
|
||||
:on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" multiple
|
||||
@change="handleFileChange"
|
||||
:limit="3" :on-exceed="handleExceed" :file-list="fileList">
|
||||
<el-button size="small" type="primary" @click="load">点击上传</el-button>
|
||||
</el-upload> -->
|
||||
<!-- <el-upload
|
||||
class="upload-demo"
|
||||
ref="upload"
|
||||
:action="action"
|
||||
:on-preview="handlePreview"
|
||||
:on-remove="handleRemove"
|
||||
:on-progress="load"
|
||||
:file-list="fileList"
|
||||
:auto-upload="false">
|
||||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="load" >上传</el-button>
|
||||
<div slot="tip" class="el-upload__tip">只能上传zip/png文件</div>
|
||||
</el-upload> -->
|
||||
<input type="file" id="fileExport" @change="handleFileChange" ref="inputer" style="display:none">
|
||||
<el-button size="small" type="primary" @click="load">点击上传</el-button>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<p>出厂默认值</p>
|
||||
<el-form-item label="还原服务器设置:">
|
||||
<p>恢复出厂设置</p>
|
||||
<el-form-item label="出厂默认值:">
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" @click="handleReset()" size="small">重置默认值</el-button>
|
||||
</el-col>
|
||||
|
@ -45,7 +66,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="分别重启:">
|
||||
<el-col :span="3">
|
||||
<el-select v-model="value1" multiple placeholder="请选择">
|
||||
<el-select v-model="resetServiceData" placeholder="请选择服务" @change='changeResetService'>
|
||||
<el-option
|
||||
v-for="item in optionsruan"
|
||||
:key="item.value"
|
||||
|
@ -54,18 +75,23 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/"
|
||||
<el-col :span="4" style="margin-left:10%">
|
||||
<!-- <el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/"
|
||||
:on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" multiple
|
||||
:limit="3" :on-exceed="handleExceed" :file-list="fileList">
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-upload> -->
|
||||
<el-button type="primary" @click="handresetService()" size="small">重新启动</el-button>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<p>更正软件</p>
|
||||
<p>更新软件</p>
|
||||
<el-form-item label="更新软件版本:">
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" @click="handleagain()" size="small">重新启动</el-button>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" size="small" @click="changeUpdata()">更新</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<input type="file" id="fileExport" @change="handleFileChangeUpdate" ref="inputerUpdate">
|
||||
<el-button size="small" type="primary" @click="loadUpdate">点击上传</el-button>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<p>全局设置</p>
|
||||
|
@ -89,7 +115,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getHostInfoApi, initData, configBackup,configRestore, ResetFactory,RestartComputer } from '../../api/aboutMachine';
|
||||
import { getHostInfoApi, initData, configBackup,configRestore, RestartComputer ,getResetService} from '../../api/aboutMachine';
|
||||
import { getQuanjszData } from '../../api/index';
|
||||
import serverUrl from '../../config/apiurl.js';
|
||||
import { setQuanjsz } from '@/api/index';
|
||||
|
@ -108,7 +134,10 @@ export default {
|
|||
resource: '',
|
||||
desc: ''
|
||||
},
|
||||
action:'',
|
||||
fileList: [],
|
||||
file:'',
|
||||
fileUpdate:'',
|
||||
videoNumber: 6,
|
||||
FPS: '0',
|
||||
id: '',
|
||||
|
@ -126,25 +155,39 @@ export default {
|
|||
label: '4'
|
||||
}
|
||||
],
|
||||
//,视频算法:cxx_SP 交通算法:cxx_JT 网络服务:cxx_PY 接口服务:zy_API 计算服务:zy_TrafficData ftp备份服务:zy_FtpData 网站:nginx
|
||||
optionsruan: [{
|
||||
value: '选项1',
|
||||
label: '软件1'
|
||||
value: 'cxx_SP',
|
||||
label: '视频算法'
|
||||
}, {
|
||||
value: '选项2',
|
||||
label: '软件2'
|
||||
value: '交通算法:cxx_JT',
|
||||
label: '交通算法'
|
||||
}, {
|
||||
value: '选项3',
|
||||
label: '软件3'
|
||||
value: 'cxx_PY',
|
||||
label: '网络服务'
|
||||
}, {
|
||||
value: '选项4',
|
||||
label: '软件4'
|
||||
value: 'zy_API',
|
||||
label: '接口服务'
|
||||
}, {
|
||||
value: 'zy_TrafficData',
|
||||
label: '计算服务'
|
||||
}, {
|
||||
value: 'zy_FtpData',
|
||||
label: 'ftp备份服务'
|
||||
}, {
|
||||
value: 'nginx',
|
||||
label: '网站'
|
||||
}],
|
||||
value1: [],
|
||||
resetServiceData: [],
|
||||
newNumber:0,
|
||||
figRestoreData:'',
|
||||
pathData:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getShipjkDatalist();
|
||||
this.getInfo();
|
||||
// this.action=serverUrl.postConfigRestore
|
||||
},
|
||||
methods: {
|
||||
//保存主机时间
|
||||
|
@ -169,6 +212,186 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
handleFileChange(e) {
|
||||
let inputDOM = this.$refs.inputer;
|
||||
this.file = inputDOM.files[0];// 通过DOM取文件数据
|
||||
let size = this.file.size;//文件大小
|
||||
let maxZrea = 8; //设置每个分区大小 MB
|
||||
let bufferSize = maxZrea * (1024 * 1024);
|
||||
let fileStart = 0;
|
||||
let fileEnd = bufferSize;
|
||||
let arrFile = [];
|
||||
|
||||
while (fileStart < size) {
|
||||
var fileInfo = {
|
||||
File: this.file.slice(fileStart, fileEnd),
|
||||
Start: fileStart,
|
||||
End: fileEnd
|
||||
}
|
||||
arrFile.push(fileInfo);
|
||||
fileStart = fileEnd;
|
||||
fileEnd = fileStart + bufferSize;
|
||||
}
|
||||
|
||||
console.log("this.file.name",this.file.name)
|
||||
var dateLength = this.file.name.length;
|
||||
var key = this.file.name.substring(dateLength-4,dateLength);
|
||||
console.log(key);
|
||||
if(this.file.name.indexOf("(") != -1||this.file.name.indexOf(")") != -1 ||this.file.name.indexOf("(") != -1 ||this.file.name.indexOf(")") != -1||key!='.zip' ){
|
||||
this.$message({
|
||||
message: '文件名不符合规范!',
|
||||
type: 'warning'
|
||||
});
|
||||
}else{
|
||||
let newNumber= 0
|
||||
var loadingN = this.$loading({
|
||||
lock: true,
|
||||
text: newNumber +'/'+arrFile.length,
|
||||
target: '.el-dialog',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
console.log("loadingN",loadingN.text)
|
||||
let count = arrFile.length;
|
||||
let filename = this.file.name + "~" + this.guid();
|
||||
for (var i = 0; i < count; i++) {
|
||||
let formData = new FormData();//new一个formData事件
|
||||
formData.append("file", arrFile[i].File); //将file属性添加到formData里
|
||||
this.action = serverUrl.getSpareElementOrder+"?Name=" + filename + "&Number=" + i + "&BufferSize=" + bufferSize + "&Count=" + count + "&Start=" + arrFile[i].Start + "&End=" + arrFile[i].End + "&Size=" + size+ "&FolderName=Backfile";
|
||||
axios.post(this.action, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data;",
|
||||
}
|
||||
}).then(r => {
|
||||
if (r.data.code!=200) {
|
||||
loadingN.close();
|
||||
this.$message({
|
||||
message: r.data.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}else{
|
||||
if(r.data.data==null){
|
||||
this.dis = true
|
||||
// var newN = i
|
||||
this.newNumber = newNumber++
|
||||
loadingN.text = this.newNumber +'/'+arrFile.length
|
||||
}else{
|
||||
this.dis = false
|
||||
loadingN.close();
|
||||
this.$message({
|
||||
message: r.data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
this.figRestoreData = r.data.data
|
||||
|
||||
// this.form.videoStreamAddress=r.data.data
|
||||
// this.fileList.push(r.data.data)
|
||||
}
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
handleFileChangeUpdate(e) {
|
||||
let inputDOM = this.$refs.inputerUpdate;
|
||||
this.fileUpdate = inputDOM.files[0];// 通过DOM取文件数据
|
||||
|
||||
},
|
||||
S4() {
|
||||
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
||||
},
|
||||
guid() {
|
||||
return (this.S4() + this.S4() + "-" + this.S4() + "-" + this.S4() + "-" + this.S4() + "-" + this.S4() + this.S4() + this.S4());
|
||||
},
|
||||
//还原服务器
|
||||
load() {
|
||||
this.$refs.inputer.dispatchEvent(new MouseEvent('click'))
|
||||
|
||||
|
||||
},
|
||||
//
|
||||
//更新软件版本
|
||||
loadUpdate(){
|
||||
let size = this.fileUpdate.size;//文件大小
|
||||
let maxZrea = 8; //设置每个分区大小 MB
|
||||
let bufferSize = maxZrea * (1024 * 1024);
|
||||
let fileStart = 0;
|
||||
let fileEnd = bufferSize;
|
||||
let arrFile = [];
|
||||
|
||||
while (fileStart < size) {
|
||||
var fileInfo = {
|
||||
File: this.fileUpdate.slice(fileStart, fileEnd),
|
||||
Start: fileStart,
|
||||
End: fileEnd
|
||||
}
|
||||
arrFile.push(fileInfo);
|
||||
fileStart = fileEnd;
|
||||
fileEnd = fileStart + bufferSize;
|
||||
}
|
||||
var dateLength = this.fileUpdate.name.length;
|
||||
var key = this.fileUpdate.name.substring(dateLength-4,dateLength);
|
||||
console.log(key);
|
||||
if(this.fileUpdate.name.indexOf("(") != -1||this.fileUpdate.name.indexOf(")") != -1 ||this.fileUpdate.name.indexOf("(") != -1 ||this.fileUpdate.name.indexOf(")") != -1||key!='.zip' ){
|
||||
this.$message({
|
||||
message: '文件名不符合规范!',
|
||||
type: 'warning'
|
||||
});
|
||||
}else{
|
||||
let newNumber= 0
|
||||
var loadingN = this.$loading({
|
||||
lock: true,
|
||||
text: newNumber +'/'+arrFile.length,
|
||||
target: '.el-dialog',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
console.log("loadingN",loadingN.text)
|
||||
let count = arrFile.length;
|
||||
let filename = this.fileUpdate.name + "~" + this.guid();
|
||||
for (var i = 0; i < count; i++) {
|
||||
let formData = new FormData();//new一个formData事件
|
||||
formData.append("file", arrFile[i].File); //将file属性添加到formData里
|
||||
var url = serverUrl.getSpareElementOrder+"?Name=" + filename + "&Number=" + i + "&BufferSize=" + bufferSize + "&Count=" + count + "&Start=" + arrFile[i].Start + "&End=" + arrFile[i].End + "&Size=" + size+ "&FolderName=VersionFile";
|
||||
axios.post(url, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data;",
|
||||
}
|
||||
}).then(r => {
|
||||
if (r.data.code!=200) {
|
||||
loadingN.close();
|
||||
this.$message({
|
||||
message: r.data.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}else{
|
||||
if(r.data.data==null){
|
||||
this.dis = true
|
||||
// var newN = i
|
||||
this.newNumber = newNumber++
|
||||
loadingN.text = this.newNumber +'/'+arrFile.length
|
||||
}else{
|
||||
this.dis = false
|
||||
loadingN.close();
|
||||
this.$message({
|
||||
message: r.data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
// this.form.videoStreamAddress=r.data.data
|
||||
// this.fileList.push(r.data.data)
|
||||
this.pathData = r.data.data
|
||||
|
||||
}
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
//保存主机名称
|
||||
saveHostName(value) {
|
||||
let formData = new FormData();
|
||||
|
@ -225,6 +448,43 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
changeResetService(val){
|
||||
console.log("val",val)
|
||||
this.resetServiceData = val
|
||||
},
|
||||
handresetService(){
|
||||
console.log("this.resetServiceData",this.resetServiceData)
|
||||
if(this.resetServiceData ==''){
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '请选择指定服务'
|
||||
});
|
||||
}else{
|
||||
this.$confirm('此操作将重新启动指定, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
this.changeNew(this.resetServiceData)
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消重启指定服务'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
changeNew(val){
|
||||
getResetService({ServiceName:val}).then(res => {
|
||||
this.$message.success(res.data.msg);
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error(res.data.msg);
|
||||
});
|
||||
},
|
||||
// 备份服务器事件
|
||||
backupHandle() {
|
||||
this.$confirm('此操作将备份操作, 是否继续?', '提示', {
|
||||
|
@ -233,15 +493,27 @@ export default {
|
|||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
configBackup().then(res => {
|
||||
this.$message({
|
||||
// configBackup().then(res => {
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
// message: '备份' + res.data.msg
|
||||
// });
|
||||
// }).catch(() => {
|
||||
// this.$message.error(res.data.msg);
|
||||
// })
|
||||
var url = window.location.origin + '/api/ConfigBackup'
|
||||
// console.log(url, '地址');
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = '_home_nvidia_Desktop_zy_backup.zip' // 下载后文件名
|
||||
a.style.display = 'none'
|
||||
document.body.appendChild(a)
|
||||
a.click() // 点击下载
|
||||
document.body.removeChild(a)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '备份' + res.data.msg
|
||||
message: '请等待下载'
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message.error(res.data.msg);
|
||||
})
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
|
@ -259,18 +531,38 @@ export default {
|
|||
})
|
||||
.then(() => {
|
||||
// 出厂默认设置
|
||||
ConfigRestore().then(res => {
|
||||
// configRestore().then(res => {
|
||||
|
||||
console.log(res.data, '还原服务器设置');
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '还原'
|
||||
});
|
||||
// console.log(res.data, '还原服务器设置');
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
// message: '还原'
|
||||
// });
|
||||
|
||||
|
||||
}).catch(() => {
|
||||
this.$message.error(res.data.msg);
|
||||
})
|
||||
// }).catch(() => {
|
||||
// this.$message.error(res.data.msg);
|
||||
// })
|
||||
let formData = new FormData();//new一个formData事件
|
||||
formData.append("path", this.figRestoreData);
|
||||
var url = serverUrl.postConfigRestore;
|
||||
axios.post(url,formData,{
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data;",
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.data.code!=200) {
|
||||
this.$message({
|
||||
message: res.data.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}else{
|
||||
this.$message({
|
||||
message: res.data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -280,6 +572,45 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
//更新软件按钮
|
||||
changeUpdata(){
|
||||
this.$confirm('此操作将更新软件版本, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
let formData = new FormData();//new一个formData事件
|
||||
formData.append("path", this.pathData);
|
||||
var urlNew = serverUrl.postConfigUpdate;
|
||||
axios.post(urlNew,formData,{
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data;",
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.data.code!=200) {
|
||||
|
||||
this.$message({
|
||||
message: res.data.msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}else{
|
||||
|
||||
this.$message({
|
||||
message: res.data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消更新'
|
||||
});
|
||||
});
|
||||
},
|
||||
// 重置默认值
|
||||
handleReset() {
|
||||
this.$confirm('此操作将重置默认值, 是否继续?', '提示', {
|
||||
|
@ -407,7 +738,10 @@ export default {
|
|||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
overflow-y: scroll;
|
||||
&::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
p {
|
||||
width: 95%;
|
||||
font-size: 25px;
|
||||
|
|
|
@ -10,6 +10,14 @@
|
|||
<el-button type="primary" style="margin-left: 10px" size="small" @click="handleagain">启动</el-button>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<p class="title">健康检测 </p>
|
||||
<h3>网络状态</h3>
|
||||
<el-form-item label="检查网络服务的状态:">
|
||||
<div class="state">
|
||||
<div class="Badge" style="background-color: pink;"></div>
|
||||
<span>忙碌</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -79,4 +87,25 @@ export default {
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
width: 95%;
|
||||
font-size: 25px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid black;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.test-div i {
|
||||
font-size: 25px;
|
||||
}
|
||||
.state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.state .Badge {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
margin: 20px 5px 0 0;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -830,8 +830,8 @@ export default {
|
|||
OnSceneN() {
|
||||
var ip = window.location.host;
|
||||
this.ipData = 'http://' + ip.split(':')[0] + ':5000';
|
||||
// document.getElementById('mapModule').contentWindow.getIpData(this.ipData);
|
||||
document.getElementById('mapModule').contentWindow.getIpData('http://172.16.1.168:5000');
|
||||
document.getElementById('mapModule').contentWindow.getIpData(this.ipData);
|
||||
// document.getElementById('mapModule').contentWindow.getIpData('http://172.16.1.168:5000');
|
||||
if (this.$route.query.type == '离线视频') {
|
||||
document.getElementById('mapModule').contentWindow.lixianVideo(JSON.stringify(this.analysis));
|
||||
document.getElementById('mapModule').contentWindow.getDestination(JSON.stringify(this.vleNew));
|
||||
|
|
Loading…
Reference in New Issue