agent版本更新、服务器注册选择公网业务IP

This commit is contained in:
康冉冉
2025-10-23 18:24:02 +08:00
parent e118c58bac
commit b9f6460e02
8 changed files with 366 additions and 152 deletions

View File

@@ -405,7 +405,7 @@ export function getAgentManage(Id) {
// 新增
export function addAgentManage(data) {
return request({
url: '/rocketmq/agentManagement',
url: '/rocketmq/agentManagement/addUpdatePolicy',
method: 'post',
data: data
})
@@ -414,8 +414,8 @@ export function addAgentManage(data) {
// 修改
export function updateAgentManage(data) {
return request({
url: '/rocketmq/agentManagement',
method: 'put',
url: '/rocketmq/agentManagement/updateAgentNow',
method: 'post',
data: data
})
}
@@ -602,3 +602,82 @@ export function getRegistList(query) {
data: query
})
}
export function networkList(query) {
return request({
url: '/rocketmq/networkInterface/list',
method: 'post',
data: query
})
}
// 图形监控-基础信息
export function serverMonitorData(data) {
return request({
url: '/rocketmq/systemOtherCollectData/getSwitchMonitorMsg',
method: 'post',
data: data
})
}
// 图形监控-设备cpu使用率
export function serverCpuData(data) {
return request({
url: '/rocketmq/systemOtherCollectData/getSwitchCpuUseMsg',
method: 'post',
data: data
})
}
// 图形监控-设备内存使用率
export function serverMemData(data) {
return request({
url: '/rocketmq/systemOtherCollectData/getSwitchMemUseMsg',
method: 'post',
data: data
})
}
// 图形监控-功率
export function serverPowerData(data) {
return request({
url: '/rocketmq/systemOtherCollectData/getSwitchPowerMsg',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-基础信息
export function serverNetDetails(data) {
return request({
url: '/rocketmq/switchInfo/getSwitchNetDetailsMsg',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-丢包
export function serverNetDiscards(data) {
return request({
url: '/rocketmq/systemOtherCollectData/switchNetDiscardsEcharts',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-总流量
export function serverNeTotal(data) {
return request({
url: '/rocketmq/systemOtherCollectData/switchNetTotalEcharts',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-错误丢包
export function serverNetErrDiscard(data) {
return request({
url: '/rocketmq/systemOtherCollectData/switchNetErrDiscardsEcharts',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-实时流量
export function serverNetSpeed(data) {
return request({
url: '/rocketmq/systemOtherCollectData/switchNetSpeedEcharts',
method: 'post',
data: data
})
}

View File

@@ -5,7 +5,11 @@
<h4 v-if="formItem && formItem.config && formItem.config.title" style="color: #000;" class="form-header h4">{{formItem.config.title}}</h4>
<el-row style="color: #606266;">
<el-col v-for="(formVal,key,index) of formItem['controls']" :span="formVal.span" v-if="!formVal.hidden" :class="formItem.config.colSpan" :style="formVal.style">
<template v-if="formVal.type === 'button'">
<el-button :type="formVal.btnType || 'primary'" size="mini" class="ml10" @click="(val) => handleChange(key,val,formVal)">{{formVal.label}}</el-button>
</template>
<el-form-item
v-else
:key="config && config.key ? `${config && config.key}-${key}` : `${key}`"
:prop="key"
:required="formVal.required">
@@ -20,26 +24,31 @@
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'cursorAuto' : ''"
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"></el-input>
<br/><span v-if="!toBoolean(formVal.disabled || formItem.config.readonly)" class="warningCol">{{formVal.warningTitle}}</span>
</template>
<template v-if="formVal.type === 'textarea'">
<div v-if="toBoolean(formVal.disabled || formItem.config.readonly)">
<span style="color: #606266;font-weight: 700;padding-left: 15px;">{{ruleForm[key]}}</span>
<div style="color: #606266;font-weight: 700;padding-left: 15px;line-height: 1.5;" v-html="ruleForm[key]"></div>
</div>
<el-input
v-else
v-model="ruleForm[key]"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
type="textarea"
:rows="formVal.rows"
:clearable="formVal.clearable !== false"
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'cursorAuto' : ''"
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"></el-input>
<template v-else>
<el-input
v-model="ruleForm[key]"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
type="textarea"
:rows="formVal.rows"
:clearable="formVal.clearable !== false"
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'cursorAuto' : ''"
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"></el-input>
<br/><span v-if="!toBoolean(formVal.disabled || formItem.config.readonly)" class="warningCol">{{formVal.warningTitle}}</span>
</template>
</template>
<template v-else-if="formVal.type === 'select'">
<el-select
v-model="ruleForm[key]"
:multiple="formVal.multiple"
:multiple-limit="formVal.multipleLimit || 0"
:collapse-tags="formVal.collapseTags"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请选择${formVal.label}`"

View File

@@ -324,7 +324,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/serverRegister/monitorChart'),
name: 'SwitchRegisterChart',
name: 'ServerRegisterChart',
meta: { title: '图形监控', activeMenu: '/resource/serverRegister' }
}
]
@@ -469,7 +469,7 @@ export const dynamicRoutes = [
{
path: 'index/:id?',
component: () => import('@/views/resource/serverScriptStrat/details'),
name: 'switchMonitorStatEdit',
name: 'serverScriptStatEdit',
meta: { title: '服务器脚本策略信息', activeMenu: '/resource/serverScriptStrat' }
}
]

View File

@@ -2,10 +2,10 @@
<div class="app-container pageTopForm">
<el-form :model="queryParams" ref="queryRef" size="small" v-show="showSearch" label-width="auto">
<el-col :span="8">
<el-form-item label="资源名称" prop="queryName">
<el-form-item label="ClientID" prop="clientId">
<el-input
v-model="queryParams.queryName"
placeholder="请输入资源名称/内网IP地址"
v-model="queryParams.clientId"
placeholder="请输入ClientID"
clearable
@keyup.enter.native="handleQuery"
/>
@@ -66,13 +66,15 @@
columns: {
id: { label: `ID`,width: '50'},
hardwareSn: { label: `硬件SN`, minWidth: '150'},
resourceName: { label: `资源名称`, minWidth: '250', visible: true },
internalIp: { label: `内网IP`,minWidth: '100', visible: true},
agentVersion: { label: `AGENT版本`,minWidth: '150', visible: true },
// resourceName: { label: `资源名称`, minWidth: '250', visible: true },
// internalIp: { label: `内网IP`,minWidth: '100', visible: true},
clientId: { label: `ClientID`, minWidth: '320', visible: true },
managePublicIp: { label: `管理网-公网IP`,minWidth: '120', visible: true},
status: { label: `状态`, minWidth: '100', slotName: 'tempStatus'},
agentVersion: { label: `AGENT版本`,minWidth: '150', visible: true },
method: { label: `更新方式`,minWidth: '200'},
scheduledUpdateTime: { label: `更新时间`,minWidth: '150', visible: true },
fileUrlType: { label: `文件地址格式`,minWidth: '200'},
scheduledUpdateTime: { label: `更新时间`,minWidth: '160'},
// fileUrlType: { label: `文件地址格式`,minWidth: '200'},
fileUrl: { label: `文件地址`,minWidth: '200'},
lastUpdateResult: { label: `最后一次更新结果`,minWidth: '160', slotName: 'tempResult', visible: true},
lastUpdateTime: { label: `最后一次更新时间`,minWidth: '160', visible: true},

View File

@@ -6,7 +6,7 @@
<script setup name="Handle">
import Form from '@/components/form/index.vue';
import {addAgentManage, getAgentManage, updateAgentManage, resNameList} from "@/api/disRevenue/resource"
import {addAgentManage, getAgentManage, updateAgentManage, getRegistList} from "@/api/disRevenue/resource"
export default {
name: 'AgentUpdateView',
components: {Form},
@@ -26,7 +26,7 @@
this.getFormDataList(this.paramsData.id);
} else {
this.fnFormList();
this.getResNameList();
// this.getResNameList();
}
if (this.paramsData && this.paramsData.readonly) {
this.config = {
@@ -38,21 +38,26 @@
// formList集合
fnFormList(objVal) {
this.formList = [{
config: {title: '配置更新策略', colSpan: 'disBlock', readonly: this.paramsData.readonly},
config: {title: '配置更新策略', colSpan: '', readonly: this.paramsData.readonly},
controls: {
id: {label: 'ID',hidden: true},
hardwareSn: {label: '硬件SN', span: 12, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
resourceName: {label: '资源名称', span: 12, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
internalIp: {label: '内网IP', span: 12, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
status: {label: '状态', span: 12, type: 'select', options: this.dict.type.rm_register_online_state, disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
agentVersion: {label: 'AGENT版本', span: 12, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
method: {label: '更新方式', span: 12, type: 'select', options: this.dict.type.policy_method, eventName: 'change', required: true},
scheduledUpdateTime: {label: '更新时间', span: 12, type: 'datetime', required: true, hidden: objVal && objVal.method === '1' ? false: true},
fileUrlType: {label: '文件格式', span: 12, type: 'radio', required: true,options: [{label: '外网HTTP(S)',value: '1'}], warningTitle: '注意当文件大小超过100M时请选择【外网HTTP(S)】地址格式'},
fileUrl: {label: '文件地址', span: 12, type: 'input', required: true, placeholder: '请输入外网地址'},
includeIds: {label: '生效服务器', span: 24,required: true, type: 'transfer',options: [],hidden: this.paramsData && this.paramsData.id ? true : false},
lastUpdateResult: {label: '最后一次更新结果', span: 12, type: 'select', options: this.dict.type.agent_update_result, disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
lastUpdateTime: {label: '最后一次更新时间', span: 12, type: 'datetime', disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
hardwareSn: {label: '硬件SN', span: 18, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.readonly ? false : true},
// resourceName: {label: '资源名称', span: 18, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
// internalIp: {label: '内网IP', span: 18, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.id ? false : true},
clientId: {label: 'ClientID', span: 18, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.readonly ? false : true},
managePublicIp: {label: '管理网-公网IP', span: 18, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.readonly ? false : true},
status: {label: '状态', span: 18, type: 'select', options: this.dict.type.rm_register_online_state, disabled: true, hidden: this.paramsData && this.paramsData.readonly ? false : true},
agentVersion: {label: 'AGENT版本', span: 18, type: 'input', disabled: true, hidden: this.paramsData && this.paramsData.readonly ? false : true},
method: {label: '更新方式', span: 18, type: 'select', options: this.dict.type.policy_method, eventName: 'change', required: true, disabled: this.paramsData && this.paramsData.id ? true : false,},
scheduledUpdateTime: {label: '更新时间', span: 18, type: 'datetime', required: true, hidden: objVal && objVal.method === '1' ? false: true, disabled: this.paramsData && this.paramsData.id ? true : false,},
// fileUrlType: {label: '文件格式', span: 18, type: 'radio', required: true,options: [{label: '外网HTTP(S)',value: '1'}], warningTitle: '注意当文件大小超过100M时请选择【外网HTTP(S)】地址格式'},
fileUrl: {label: '文件地址', span: 18, type: 'input', required: true, placeholder: '请输入外网地址', warningTitle: '如http://www.tr.com/server-1.1.1.jar'},
fileMd5: {label: '文件MD5', span: 18, type: 'input', required: true},
deployDevice: {label: '部署设备', span: 18, type: 'textarea', rows:15, placeholder: '请粘贴/输入ClientID列表如\nClientID1\nClientID2\n...', required: true, disabled: this.paramsData && this.paramsData.id ? true : false, hidden: this.paramsData && this.paramsData.readonly ? true : false},
clientAllId: {label: '加载全部ClientID', span: 3, type: 'button', style: 'vertical-align: top', hidden: this.paramsData && this.paramsData.readonly ? true : this.paramsData && this.paramsData.id ? true : false},
// includeIds: {label: '生效服务器', span: 24,required: true, type: 'transfer',options: [],hidden: this.paramsData && this.paramsData.id ? true : false},
lastUpdateResult: {label: '最后一次更新结果', span: 18, type: 'select', options: this.dict.type.agent_update_result, disabled: true, hidden: this.paramsData && this.paramsData.readonly ? false : true},
lastUpdateTime: {label: '最后一次更新时间', span: 18, type: 'datetime', disabled: true, hidden: this.paramsData && this.paramsData.readonly ? false : true},
}
}];
},
@@ -61,7 +66,7 @@
getAgentManage(id).then(val => {
if (val && val.data) {
val.data['method'] = val.data['method'].toString();
val.data['fileUrlType'] = val.data['fileUrlType'].toString();
// val.data['fileUrlType'] = val.data['fileUrlType'].toString();
this.fnFormList(val.data);
this.ruleForm = val.data;
}
@@ -69,17 +74,17 @@
// this.$modal.msgError("操作失败")
});
},
// 包含设备
getResNameList() {
resNameList().then(val => {
this.formList[0].controls['includeIds']['options']= val && val.map(item => {
this.includeList[item.id] = item;
return Object.assign({label: item.resourceName, key: item.id});
});
}).catch(() => {
this.$modal.msgError("操作失败")
});
},
// // 包含设备
// getResNameList() {
// resNameList().then(val => {
// this.formList[0].controls['includeIds']['options']= val && val.map(item => {
// this.includeList[item.id] = item;
// return Object.assign({label: item.resourceName, key: item.id});
// });
// }).catch(() => {
// this.$modal.msgError("操作失败")
// });
// },
// 监听事件
callback(result, dataVal, formVal) {
if (result && result.fnCode) {
@@ -91,12 +96,26 @@
this.formList[0].controls.scheduledUpdateTime['hidden'] = true;
}
break;
case 'clientAllId':
getRegistList({resourceType: 1}).then(res => {
let str = '';
if (res && res.data) {
res && res.data.map(item => {
str+= item.clientId + '\n';
});
}
this.$set(this.ruleForm, 'deployDevice', str);
// this.formList[0].controls.clientId['options'] = res && res.data.map(item => {
// return Object.assign({label: item.clientId, value: item.id});
// });
});
break;
case 'submit':
if (dataVal && !dataVal.id) {
dataVal['includeNames'] = dataVal && dataVal['includeIds'].map(id => this.includeList[id].resourceName);
dataVal['includeIds'] = dataVal['includeIds'].join();
dataVal['includeNames'] = dataVal['includeNames'].join();
}
// if (dataVal && !dataVal.id) {
// dataVal['includeNames'] = dataVal && dataVal['includeIds'].map(id => this.includeList[id].resourceName);
// dataVal['includeIds'] = dataVal['includeIds'].join();
// dataVal['includeNames'] = dataVal['includeNames'].join();
// }
let fnType = addAgentManage;
if (dataVal && dataVal.id) {
fnType = updateAgentManage;

View File

@@ -7,11 +7,11 @@
<script setup>
import Form from '@/components/form/index.vue';
import {listHandle, resNameBtType, addMachine, getTopology, updateTopology, getRegistList} from "@/api/disRevenue/resource"
import {addMachine, getHandle, updateTopology, getRegistList} from "@/api/disRevenue/resource"
export default {
name: 'serverRegisterEdit',
components: {Form},
dicts: ['rm_topology_type'],
dicts: ['rm_register_status','rm_register_online_state'],
data() {
return {
loading: false,
@@ -27,11 +27,10 @@
created() {
this.paramsData = this.$route && this.$route.query;
if (this.paramsData && this.paramsData.id) {
// this.getFormDataList(this.paramsData.id);
this.getFormDataList(this.paramsData.id);
}
this.registList();
this.fnFormList();
},
methods: {
// formList集合
@@ -43,51 +42,51 @@
id: {label: 'ID',hidden: true},
clientId: {label: 'ClientID', span: 12, type: 'select', options:[]},
hardwareSn: {label: '设备SN', span: 12, type: 'input'},
one: {label: 'IP1-运营商', span: 12, type: 'input'},
one1: {label: 'IP1-省', span: 12, type: 'input'},
one2: {label: 'IP1-市', span: 12, type: 'input'},
one3: {label: 'IP1-业务公网', span: 12, type: 'input'},
one4: {label: 'IP1-接口名称', span: 12, type: 'input'},
one5: {label: 'IP1-mac地址', span: 12, type: 'input'},
one6: {label: 'IP1-接口类型', span: 12, type: 'input'},
one7: {label: 'IP1-IPv4地址', span: 12, type: 'input'},
one8: {label: 'IP1-网', span: 12, type: 'input'},
two: {label: 'IP2-运营商', span: 12, type: 'input'},
two1: {label: 'IP2-省', span: 12, type: 'input'},
two2: {label: 'IP2-市', span: 12, type: 'input'},
two3: {label: 'IP2-业务公网', span: 12, type: 'input'},
two4: {label: 'IP2-接口名称', span: 12, type: 'input'},
two5: {label: 'IP2-mac地址', span: 12, type: 'input'},
two6: {label: 'IP2-接口类型', span: 12, type: 'input'},
two7: {label: 'IP2-IPv4地址', span: 12, type: 'input'},
two8: {label: 'IP2-网', span: 12, type: 'input'},
three: {label: 'IP3-运营商', span: 12, type: 'input'},
three1: {label: 'IP3-省', span: 12, type: 'input'},
three2: {label: 'IP3-市', span: 12, type: 'input'},
three3: {label: 'IP3-业务公网', span: 12, type: 'input'},
three4: {label: 'IP3-接口名称', span: 12, type: 'input'},
three5: {label: 'IP3-mac地址', span: 12, type: 'input'},
three6: {label: 'IP3-接口类型', span: 12, type: 'input'},
three7: {label: 'IP3-IPv4地址', span: 12, type: 'input'},
three8: {label: 'IP3-网', span: 12, type: 'input'},
one80: {label: '管理网-运营商', span: 12, type: 'input'},
one9: {label: '管理网-省', span: 12, type: 'input'},
one10: {label: '管理网-市', span: 12, type: 'input'},
one11: {label: '管理网-公网IP', span: 12, type: 'input'},
one12: {label: '管理网-接口名称', span: 12, type: 'input'},
one13: {label: '管理网-mac地址', span: 12, type: 'input'},
one14: {label: '管理网-接口类型', span: 12, type: 'input'},
one15: {label: '管理网-IPv4地址', span: 12, type: 'input'},
one16: {label: '管理网-网关', span: 12, type: 'input'},
one17: {label: '心跳时间间隔', span: 12, type: 'input'},
one18: {label: '心跳次数', span: 12, type: 'input'},
one19: {label: '业务名称', span: 12, type: 'input'},
one20: {label: '逻辑节点标识', span: 12, type: 'input'},
one21: {label: '在线状态', span: 12, type: 'input'},
one22: {label: '注册状态', span: 12, type: 'input'},
one23: {label: '注册时间', span: 12, type: 'input'},
one24: {label: '上机时间', span: 12, type: 'input'},
one25: {label: 'agent版本', span: 12, type: 'input'},
ip1Isp: {label: 'IP1-运营商', span: 12, type: 'input'},
ip1Province: {label: 'IP1-省', span: 12, type: 'input'},
ip1City: {label: 'IP1-市', span: 12, type: 'input'},
ip1PublicIp: {label: 'IP1-业务公网', span: 12, type: 'input'},
ip1InterfaceName: {label: 'IP1-接口名称', span: 12, type: 'input'},
ip1MacAddress: {label: 'IP1-mac地址', span: 12, type: 'input'},
ip1InterfaceType: {label: 'IP1-接口类型', span: 12, type: 'input'},
ip1Ipv4Address: {label: 'IP1-IPv4地址', span: 12, type: 'input'},
ip1Gateway: {label: 'IP1-网', span: 12, type: 'input'},
ip2Isp: {label: 'IP2-运营商', span: 12, type: 'input'},
ip2Province: {label: 'IP2-省', span: 12, type: 'input'},
ip2City: {label: 'IP2-市', span: 12, type: 'input'},
ip2PublicIp: {label: 'IP2-业务公网', span: 12, type: 'input'},
ip2InterfaceName: {label: 'IP2-接口名称', span: 12, type: 'input'},
ip2MacAddress: {label: 'IP2-mac地址', span: 12, type: 'input'},
ip2InterfaceType: {label: 'IP2-接口类型', span: 12, type: 'input'},
ip2Ipv4Address: {label: 'IP2-IPv4地址', span: 12, type: 'input'},
ip2Gateway: {label: 'IP2-网', span: 12, type: 'input'},
ip3Isp: {label: 'IP3-运营商', span: 12, type: 'input'},
ip3Province: {label: 'IP3-省', span: 12, type: 'input'},
ip3City: {label: 'IP3-市', span: 12, type: 'input'},
ip3PublicIp: {label: 'IP3-业务公网', span: 12, type: 'input'},
ip3InterfaceName: {label: 'IP3-接口名称', span: 12, type: 'input'},
ip3MacAddress: {label: 'IP3-mac地址', span: 12, type: 'input'},
ip3InterfaceType: {label: 'IP3-接口类型', span: 12, type: 'input'},
ip3Ipv4Address: {label: 'IP3-IPv4地址', span: 12, type: 'input'},
ip3Gateway: {label: 'IP3-网', span: 12, type: 'input'},
mgmtIsp: {label: '管理网-运营商', span: 12, type: 'input'},
mgmtProvince: {label: '管理网-省', span: 12, type: 'input'},
mgmtCity: {label: '管理网-市', span: 12, type: 'input'},
mgmtPublicIp: {label: '管理网-公网IP', span: 12, type: 'input'},
mgmtInterfaceName: {label: '管理网-接口名称', span: 12, type: 'input'},
mgmtMacAddress: {label: '管理网-mac地址', span: 12, type: 'input'},
mgmtInterfaceType: {label: '管理网-接口类型', span: 12, type: 'input'},
mgmtIpv4Address: {label: '管理网-IPv4地址', span: 12, type: 'input'},
mgmt3Gateway: {label: '管理网-网关', span: 12, type: 'input'},
heartbeatInterval: {label: '心跳时间间隔', span: 12, type: 'input'},
heartbeatCount: {label: '心跳次数', span: 12, type: 'input'},
businessName: {label: '业务名称', span: 12, type: 'input'},
onlogicalNodeIde20: {label: '逻辑节点标识', span: 12, type: 'input'},
onlineStatus: {label: '在线状态', span: 12, type: 'select', options: this.dict.type.rm_register_online_state},
registrationStatus: {label: '注册状态', span: 12, type: 'select', options: this.dict.type.rm_register_status},
createTime: {label: '注册时间', span: 12, type: 'input'},
upTime: {label: '上机时间', span: 12, type: 'input'},
agentVersion: {label: 'agent版本', span: 12, type: 'input'},
machineCode: {label: '金山machineCode', span: 12, type: 'input'},
}
}];
@@ -111,10 +110,8 @@
},
// 获取详情
getFormDataList(id) {
getTopology(id).then(val => {
getHandle(id).then(val => {
this.ruleForm = val && val.data;
this.registList();
this.fnServerNameList();
}).catch(() => {
this.$modal.msgError("操作失败")
});

View File

@@ -2,9 +2,9 @@
<div class="app-container pageTopForm">
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" size="small" label-width="auto">
<el-col :span="6">
<el-form-item label="搜索" title="搜索" prop="switchName">
<el-form-item label="搜索" title="搜索" prop="queryParam">
<el-input
v-model="queryParams.switchName"
v-model="queryParams.queryParam"
placeholder="请输入公网IP/私网IP/设备SN"
clearable
@keyup.enter.native="handleQuery"/>
@@ -31,7 +31,7 @@
placeholder="请选择多公网IP状态"
clearable>
<el-option
v-for="dict in dict.type.rm_register_online_state"
v-for="dict in dict.type.rm_moreip_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
@@ -90,17 +90,9 @@
<!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<!-- 资源类型 -->
<template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_register_resource_type" :value="row.resourceType"/>
</template>
<!-- 端口 -->
<template #tempPort="{ row, column }">
<dict-tag :options="dict.type.rm_register_port" :value="row.resourcePort"/>
</template>
<!-- 协议 -->
<template #tempProtocol="{ row, column }">
<dict-tag :options="dict.type.rm_register_protocol" :value="row.protocol"/>
<!-- 多公网IP状态 -->
<template #tempMultipubStatus="{ row, column }">
<dict-tag :options="dict.type.rm_moreip_status" :value="row.multiPublicIpStatus"/>
</template>
<!-- 注册状态 -->
<template #tempStatus="{ row, column }">
@@ -111,7 +103,7 @@
<dict-tag :options="dict.type.rm_register_online_state" :value="row.onlineStatus"/>
</template>
</TableList>
<!-- 弹窗 -->
<!-- 查看执行结果弹窗 -->
<el-dialog title="命令执行结果" :visible.sync="open" width="800px" append-to-body>
<div class="block">
<el-timeline :reverse="true">
@@ -129,21 +121,30 @@
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
<!-- 添加监控策略 -->
<el-dialog title="添加监控策略" :visible.sync="stratOpen" width="1200px" append-to-body>
<MonitorStrategy :open="`type_${stratOpen}`" @dialogResult="fnDialogResult"></MonitorStrategy>
</el-dialog>
<!-- 选择公网业务IP -->
<el-dialog title="选择公网业务IP" :visible.sync="pubilcNetOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<Form ref="publicNetFormRef" :formList="pubilcNetFormList" :ruleFormData="pubilcNetRuleForm" :config="{labelWidth: '140px', buttonGroup: []}" @fnClick="callback"></Form>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button type="primary" style="margin-left: 10px;" @click="submitPubilc">提交</el-button>
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script setup name="Register">
import Form from '@/components/form/index.vue';
import {listSwitchManage} from '@/api/disRevenue/resource';
import {listHandle, networkList} from '@/api/disRevenue/resource';
import TableList from '@/components/table/index.vue';
import MonitorStrategy from '../serverMonitorStrat/monitorStrategy';
export default {
name: 'ServerRegister',
components: {TableList, MonitorStrategy,Form},
dicts: ['rm_register_resource_type', 'rm_register_protocol', 'rm_register_status', 'rm_register_port', 'rm_register_online_state', 'policy_method'],
dicts: ['rm_moreip_status', 'rm_register_status', 'rm_register_online_state', 'policy_method'],
data() {
return {
open: false,
@@ -157,25 +158,56 @@
// 列显隐信息
columns: {
id: { label: `ID`,width: '80'},
switchName: { label: `交换机名称`, visible: true, minWidth: '200'},
hardwareSn: { label: `硬件SN`,minWidth: '250'},
resourceType: { label: `交换机类型`, minWidth: '100', slotName: 'tempType'},
snmpAddress: { label: `SNMP采集地址`, visible: true, minWidth: '150'},
snmpPort: { label: `SNMP采集端口`, visible: true, minWidth: '150'},
clientId: { label: `clientID`, minWidth: '200'},
switchName: { label: `clientID`, minWidth: '200'},
hardwareSn: { label: `设备SN`,minWidth: '250'},
ip1Isp: { label: `IP1-运营商`, visible: true, minWidth: '150'},
ip1Province: { label: `IP1-省`, visible: true, minWidth: '150'},
ip1City: { label: `IP1-市`, minWidth: '150'},
ip1PublicIp:{ label: `IP1-业务公网`,visible: true,minWidth: '160'},
ip1InterfaceName: { label: `IP1-接口名称`, minWidth: '180'},
ip1MacAddress: { label: `IP1-mac地址`, minWidth: '150'},
ip1InterfaceType: { label: `IP1-接口类型`, minWidth: '120'},
ip1Ipv4Address: { label: `IP1-IPv4地址`, minWidth: '120'},
ip1Gateway: { label: `IP1-网关`, minWidth: '120'},
ip2Isp: { label: `IP2-运营商`, minWidth: '120'},
ip2Province: { label: `IP2-省`,minWidth: '150'},
ip2City: { label: `IP2-市`, minWidth: '150'},
ip2PublicIp:{ label: `IP2-业务公网`,minWidth: '160'},
ip2InterfaceName: { label: `IP2-接口名称`, minWidth: '180'},
ip2MacAddress: { label: `IP2-mac地址`, minWidth: '150'},
ip2InterfaceType: { label: `IP2-接口类型`, minWidth: '120'},
ip2Ipv4Address: { label: `IP2-IPv4地址`, minWidth: '120'},
ip2Gateway: { label: `IP2-网关`, minWidth: '120'},
ip3Isp: { label: `IP3-运营商`, minWidth: '120'},
ip3Province: { label: `IP3-省`, minWidth: '150'},
ip3City: { label: `IP3-市`, minWidth: '150'},
ip3PublicIp:{ label: `IP3-业务公网`,minWidth: '160'},
ip3InterfaceName: { label: `IP3-接口名称`, minWidth: '180'},
ip3MacAddress: { label: `IP3-mac地址`, minWidth: '150'},
ip3InterfaceType: { label: `IP3-接口类型`, minWidth: '120'},
ip3Ipv4Address: { label: `IP3-IPv4地址`, minWidth: '120'},
ip3Gateway: { label: `IP3-网关`, minWidth: '120'},
mgmtIsp: { label: `管理网-运营商`, minWidth: '120'},
mgmtProvince: { label: `管理网-省`,minWidth: '150'},
mgmtCity: { label: `管理网-市`, minWidth: '150'},
mgmtPublicIp:{ label: `管理网-业务公网`,minWidth: '160'},
mgmtInterfaceName: { label: `管理网-接口名称`, minWidth: '180'},
mgmtMacAddress: { label: `管理网-mac地址`, minWidth: '150'},
mgmtInterfaceType: { label: `管理网-接口类型`, minWidth: '120'},
mgmtIpv4Address: { label: `管理网-IPv4地址`, minWidth: '120'},
mgmt3Gateway: { label: `管理网-网关`, minWidth: '120'},
heartbeatInterval: { label: `心跳时间间隔`, minWidth: '180'},
heartbeatCount: { label: `心跳次数`, minWidth: '180'},
registrationStatus: { label: `注册状态`, slotName: 'tempStatus', minWidth: '120', visible: true },
businessName: { label: `业务名称`, minWidth: '180', visible: true},
logicalNodeId: { label: `逻辑节点标识`, minWidth: '180', visible: true},
onlineStatus: { label: `在线状态`, slotName: 'tempOnlineStatus', minWidth: '120', visible: true },
multiPublicIpStatus: { label: `多公网IP状态`, slotName: 'tempMultipubStatus', minWidth: '120', visible: true },
createTime:{ label: `注册时间`,minWidth: '160'},
upTime:{ label: `上机时间`,minWidth: '160'},
updateTime:{ label: `修改时间`,minWidth: '160'},
createTime:{ label: `创建时间`,minWidth: '160'},
heartbeatCount: { label: `交换机心跳检测次数`, minWidth: '180'},
heartbeatInterval: { label: `交换机心跳检测周期`, minWidth: '180'},
heartbeatOid: { label: `交换机心跳检测OID`, minWidth: '180'},
protocol: { label: `SNMP版本`, minWidth: '150'},
readWritePermission: { label: `读写权限`, minWidth: '120'},
securityLevel: { label: `安全级别`, minWidth: '120'},
encryptionMethod: { label: `加密方式`, minWidth: '120'},
communityName: { label: `团体名称`, minWidth: '120'},
resourceUserName: { label: `用户名`, minWidth: '100'},
resourcePwd: { label: `密码`, minWidth: '100'}
agentVersion:{ label: `agent版本`,minWidth: '160'},
machineCode:{ label: `金山machineCode`,minWidth: '160'},
},
config: {
tableButton: {
@@ -184,6 +216,7 @@
{content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'resource:serverRegister:export'},
],
line: [
//showName: 'multiPublicIpStatus', showVal: '0',
{content: '选择公网业务IP', fnCode: 'pubilcNet', type: 'text', icon: 'el-icon-thumb', hasPermi: 'resource:serverRegister:pubilcNet'},
{content: '图形监控', fnCode: 'echartView', type: 'text', icon: 'el-icon-data-analysis', hasPermi: 'resource:serverRegister:graphicAnalysis'},
{content: '详情', fnCode: 'details', type: 'text', icon: 'el-icon-view', hasPermi: 'resource:serverRegister:details'},
@@ -214,6 +247,19 @@
title: '',
formList: [],
ruleForm: {},
pubilcNetOpen: false,
pubilcNetFormList: [{
config: {title: '',labelWidth: '140px', colSpan: 'disBlock m0Auto'},
controls: {
id: {label: 'ID',hidden: true},
publicIp: {label: '业务公网IP', span: 18, eventName:'change', type: 'select',multiple: true, multipleLimit: 3, options: [], required: true},
descriptionOne: {label: '', span: 18, type: 'textarea',rows: 15, disabled: true},
mgmtIp: {label: '管理网-公网IP', eventName:'change', span: 18, type: 'select',options: [], required: true},
descriptionTwo: {label: '', span: 18, type: 'textarea', rows: 15, disabled: true}
}
}],
pubilcNetRuleForm: {publicIp: []},
ipContentList: {},
}
},
@@ -235,7 +281,7 @@
/** 查询角色列表 */
getList() {
this.loading = true
listSwitchManage(this.addDateRange(this.queryParams)).then(response => {
listHandle(this.addDateRange(this.queryParams)).then(response => {
this.roleList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
@@ -298,6 +344,45 @@
this.$modal.msgError("操作失败")
});
break;
case 'pubilcNet':
this.pubilcNetOpen = true;
this.pubilcNetRuleForm = {publicIp: [],mgmtIp: '', descriptionOne: '', descriptionTwo: ''};
networkList({clientId: rowData.clientId}).then(res => {
let ipList = [];
res && res.data.map(item => {
this.ipContentList[item.id] = item;
ipList.push({label: item.publicIp, value: item.id});
});
this.pubilcNetFormList[0].controls.publicIp['options'] = ipList;
this.pubilcNetFormList[0].controls.mgmtIp['options'] = ipList;
});
break;
case 'publicIp':
if (rowData && rowData.length > 0) {
this.pubilcNetRuleForm = Object.assign({}, this.pubilcNetRuleForm, this.$refs.publicNetFormRef.$refs.ruleForm.model);
let content = '';
rowData.forEach(item => {
content+= '运营商:' + this.ipContentList[item].isp + '<br>' + '省:' + this.ipContentList[item].province + '<br>'
+ '市:' + this.ipContentList[item].city + '<br>' + '公网IP' + this.ipContentList[item].publicIp + '<br>'
+ '接口名称:' + this.ipContentList[item].interfaceName + '<br>' + 'mac地址' + this.ipContentList[item].macAddress + '<br>'
+ '接口类型:' + this.ipContentList[item].interfaceType + '<br>' + 'IPv4地址' + this.ipContentList[item].ipv4Address + '<br>'
+ '网关:' + this.ipContentList[item].gateway + '<br><br>';
});
this.$set(this.pubilcNetRuleForm, 'descriptionOne', content);
}
break;
case 'mgmtIp':
if (rowData) {
this.pubilcNetRuleForm = Object.assign({}, this.pubilcNetRuleForm, this.$refs.publicNetFormRef.$refs.ruleForm.model);
let content = '';
content+= '运营商:' + this.ipContentList[rowData].isp + '<br>' + '省:' + this.ipContentList[rowData].province + '<br>'
+ '市:' + this.ipContentList[rowData].city + '<br>' + '公网IP' + this.ipContentList[rowData].publicIp + '<br>'
+ '接口名称:' + this.ipContentList[rowData].interfaceName + '<br>' + 'mac地址' + this.ipContentList[rowData].macAddress + '<br>'
+ '接口类型:' + this.ipContentList[rowData].interfaceType + '<br>' + 'IPv4地址' + this.ipContentList[rowData].ipv4Address + '<br>'
+ '网关:' + this.ipContentList[rowData].gateway + '<br><br>';
this.$set(this.pubilcNetRuleForm, 'descriptionTwo', content);
}
break;
case 'issueBusiness':
this.issueOpen = true;
this.title = '下发业务任务';
@@ -380,6 +465,7 @@
break;
case 'cancel':
this.issueOpen = false;
this.pubilcNetOpen = false;
break;
case 'export':
// let dataList = [];
@@ -398,15 +484,17 @@
}
},
// form验证
fnFormValid() {
fnFormValid(val, model) {
return new Promise((resolve) => {
this.ruleFormData = {};
const formValid = this.$refs.formRef.$refs.ruleForm;
const formValid = this.$refs[`${val}`].$refs.ruleForm;
// 3. 操作form如验证
formValid.validate((valid) => {
if (valid) {
formValid.model.deployDevice = formValid.model.deployDevice.join('/n');
this.ruleFormData = formValid.model;
if (formValid.model?.deployDevice) {
formValid.model.deployDevice = formValid.model.deployDevice.join('/n');
}
this[`${model}`] = formValid.model;
resolve(true);
} else {
resolve(false);
@@ -415,7 +503,7 @@
});
},
async submit(){
if (!await this.fnFormValid()) return;
if (!await this.fnFormValid('formRef', 'ruleFormData')) return;
let fnType = addMachine;
if (dataVal && dataVal.id) {
fnType = updateTopology;
@@ -424,12 +512,32 @@
this.loading = true;
fnType(dataVal).then(response => {
this.$modal.msgSuccess(response.msg);
this.$router.push("/resource/serverRegister");
this.issueOpen = false;
this.loading = false;
}).catch(() => {
this.$modal.msgError("操作失败")
});
}
},
async submitPubilc() {
if (!await this.fnFormValid('publicNetFormRef', 'pubilcNetRuleForm')) return;
let params = [];
this.pubilcNetRuleForm.publicIp.forEach(item => {
if (item && item === this.pubilcNetRuleForm.mgmtIp) {
params.push({id: item, status: 3, interfaceName: this.ipContentList[item].interfaceName});
delete this.pubilcNetRuleForm.mgmtIp;
} else {
params.push({id: item, status: 1, interfaceName: this.ipContentList[item].interfaceName});
}
});
if (this.pubilcNetRuleForm && this.pubilcNetRuleForm.mgmtIp) {
params.push({id: this.pubilcNetRuleForm.mgmtIp, status: 2, interfaceName: this.ipContentList[this.pubilcNetRuleForm.mgmtIp].interfaceName});
}
networkList({bindNetworkMsg: params}).then(res => {
this.$modal.msgSuccess(res.msg);
this.pubilcNetOpen = false;
this.getList();
});
},
}
}
</script>

View File

@@ -99,7 +99,7 @@
export default {
name: "MonitorStrategy",
components: {Form},
dicts: ['rm_register_resource_type', 'collection_cycle', 'switch_type', 'policy_status'],
dicts: ['policy_status', 'collection_cycle', 'switch_type'],
props: {
open: {
type: String,
@@ -195,7 +195,7 @@
id: {label: 'ID',hidden: true},
policyName: {label: '策略名称', span: 12, type: 'input', required: true},
priority: {label: '优先级', span: 12, type: 'input', hidden: this.paramsData && this.paramsData.readonly ? false : true},
status: {label: '策略状态', span: 12, type: 'select',options: this.dict.type.dicpolicy_status, hidden: this.paramsData && this.paramsData.readonly ? false : true},
status: {label: '策略状态', span: 12, type: 'select',options: this.dict.type.policy_status, hidden: this.paramsData && this.paramsData.readonly ? false : true},
deployTime: {label: '下发策略时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
createTime: {label: '创建时间', span: 12, type: 'datetime', hidden: this.paramsData && this.paramsData.readonly ? false : true},
switchType: {label: '交换机类型', span: 12, type: 'select', required: true, options: this.dict.type.switch_type},
@@ -213,7 +213,7 @@
if (val && val.data) {
if (val.data && val.data.policy){
val.data.policy['deployDevice'] = val.data.policy.deployDevice.split('/n');
val.data.policy['status'] = Number(val.data.policy.status);
// val.data.policy['status'] = Number(val.data.policy.status);
this.ruleFormData = val.data.policy;
}
this.tempContent = val.data['switch'];