服务器脚本策略
This commit is contained in:
@@ -301,7 +301,8 @@ aside {
|
||||
.el-textarea.is-disabled .el-textarea__inner , .el-input.is-disabled .el-input__inner {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
color: #C0C4CC;
|
||||
color: #606266;
|
||||
font-weight: 700;
|
||||
cursor: not-allowed;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-width="config && config.labelWidth || '130px'" :key="config && config.key" class="demo-ruleForm">
|
||||
<template v-for="(formItem,index) of formList">
|
||||
<h4 v-if="formItem && formItem.config && formItem.config.title" style="color: #000;" class="form-header h4">{{formItem.config.title}}</h4>
|
||||
<el-row>
|
||||
<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">
|
||||
<el-form-item
|
||||
:key="config && config.key ? `${config && config.key}-${key}` : `${key}`"
|
||||
@@ -23,7 +23,7 @@
|
||||
</template>
|
||||
<template v-if="formVal.type === 'textarea'">
|
||||
<div v-if="toBoolean(formVal.disabled || formItem.config.readonly)">
|
||||
<span style="color: #C0C4CC;">{{ruleForm[key]}}</span>
|
||||
<span style="color: #606266;font-weight: 700;padding-left: 15px;">{{ruleForm[key]}}</span>
|
||||
</div>
|
||||
<el-input
|
||||
v-else
|
||||
@@ -54,14 +54,32 @@
|
||||
</template>
|
||||
|
||||
<template v-else-if="formVal.type === 'radio'">
|
||||
<el-radio-group v-model="ruleForm[key]" :disabled="toBoolean(formVal.disabled || formItem.config.readonly)" @[formVal.eventName]="(val) => handleChange(key,val,formVal)">
|
||||
<el-radio
|
||||
v-for="option in formVal.options"
|
||||
:key="option.value"
|
||||
:label="option.value">
|
||||
{{ option.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<template v-if="toBoolean(formVal.disabled || formItem.config.readonly)">
|
||||
<el-select
|
||||
v-model="ruleForm[key]"
|
||||
:multiple="formVal.multiple"
|
||||
:collapse-tags="formVal.collapseTags"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请选择${formVal.label}`"
|
||||
:clearable="formVal.clearable !== false"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)">
|
||||
<el-option
|
||||
v-for="option in formVal.options"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-radio-group v-model="ruleForm[key]" :disabled="toBoolean(formVal.disabled || formItem.config.readonly)" @[formVal.eventName]="(val) => handleChange(key,val,formVal)">
|
||||
<el-radio
|
||||
v-for="option in formVal.options"
|
||||
:key="option.value"
|
||||
:label="option.value">
|
||||
{{ option.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<br/><span class="warningCol">{{formVal.warningTitle}}</span>
|
||||
</template>
|
||||
|
||||
@@ -79,6 +97,7 @@
|
||||
<template v-else-if="formVal.type === 'time'">
|
||||
<el-time-picker
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"
|
||||
@@ -88,6 +107,7 @@
|
||||
<template v-else-if="formVal.type === 'date'">
|
||||
<el-date-picker
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="date"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"
|
||||
@@ -99,6 +119,7 @@
|
||||
<template v-else-if="formVal.type === 'datetime'">
|
||||
<el-date-picker
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="datetime"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请输入${formVal.label}`"
|
||||
@@ -111,6 +132,7 @@
|
||||
<template v-else-if="formVal.type === 'month'">
|
||||
<el-date-picker
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="month"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:format="formVal.format || 'yyyy-MM'"
|
||||
@@ -122,6 +144,7 @@
|
||||
<template v-else-if="formVal.type === 'daterange'">
|
||||
<el-date-picker
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="daterange"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:format="formVal.format || 'yyyy-MM-dd'"
|
||||
@@ -134,7 +157,9 @@
|
||||
</template>
|
||||
|
||||
<template v-else-if="formVal.type === 'monthrange'">
|
||||
<el-date-picker v-model="ruleForm[key]"
|
||||
<el-date-picker
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="monthrange"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:format="formVal.format || 'yyyy-MM'"
|
||||
@@ -315,6 +340,7 @@
|
||||
cursor: auto!important;
|
||||
}
|
||||
::v-deep .el-form-item__label {
|
||||
color: #C0C4CC;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -322,5 +348,8 @@
|
||||
.warningCol {
|
||||
color: #ED7B2F;
|
||||
}
|
||||
::v-deep .timeSty .el-input__inner{
|
||||
padding-left: 15px!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ export const dynamicRoutes = [
|
||||
{
|
||||
path: 'index/:id?',
|
||||
component: () => import('@/views/resource/serverMonitorStrat/monitorStrategy'),
|
||||
name: 'serverMonitorStratdit',
|
||||
name: 'serverMonitorStratEdit',
|
||||
meta: { title: '服务器监控策略信息', activeMenu: '/resource/serverMonitorStrat' }
|
||||
}
|
||||
]
|
||||
@@ -459,6 +459,21 @@ export const dynamicRoutes = [
|
||||
}
|
||||
]
|
||||
},
|
||||
// 服务器脚本策略
|
||||
{
|
||||
path: '/resource/serverScriptStrat/details',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['resource:serverScriptStrat:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:id?',
|
||||
component: () => import('@/views/resource/serverScriptStrat/details'),
|
||||
name: 'switchMonitorStatEdit',
|
||||
meta: { title: '服务器脚本策略信息', activeMenu: '/resource/serverScriptStrat' }
|
||||
}
|
||||
]
|
||||
},
|
||||
// 监控模版
|
||||
{
|
||||
path: '/resource/monitorTemp/details',
|
||||
|
||||
@@ -72,12 +72,21 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-collapse v-model="activeTwoName">
|
||||
<template v-for="(item,index) of firstData">
|
||||
<template v-for="(item,key,index) of firstData">
|
||||
<el-collapse-item v-if="item.checkList && item.checkList.length > 0" :title="'监控项'" :name="index">
|
||||
<template slot="title">
|
||||
<span><span v-if="ruleFormData.priority === '1'">监控项>></span>{{item.title}}</span>
|
||||
</template>
|
||||
<div v-for="(item,key,index) of firstData">
|
||||
<div v-if="key === 'cpu'" class="plr-50">
|
||||
<div class="plr-50">
|
||||
<div>当前所有子项的采集周期均为{{item.timeLabel}}</div>
|
||||
<div v-for="city of item.checkList" class="w50 mt10 mb10 disInlineBlock fontSize15">
|
||||
<span style="width: 250px" class="disInlineBlock">{{city.metricKey}}</span>
|
||||
<span>{{city.metricName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="plr-50">
|
||||
<div v-for="city of item.checkList" class="w100 mt10 mb10 disInlineBlock fontSize15">
|
||||
<div class="disInlineBlock w50">
|
||||
@@ -109,8 +118,9 @@
|
||||
</el-collapse>
|
||||
</template>
|
||||
</div>
|
||||
<el-button style="float: right;margin-top: 12px;margin-left: 10px;" @click="cancel">取消</el-button>
|
||||
<el-button type="primary" style="float: right;margin-top: 12px;" @click="submit">提交</el-button>
|
||||
<el-button v-if="!(paramsData && paramsData.readonly)" style="float: right;margin-top: 12px;margin-left: 10px;" @click="cancel">取消</el-button>
|
||||
<el-button v-if="!(paramsData && paramsData.readonly)" type="primary" style="float: right;margin-top: 12px;" @click="submit">提交</el-button>
|
||||
<el-button v-if="paramsData && paramsData.readonly" style="float: right;margin-top: 12px;margin-left: 10px;" @click="cancel">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -118,7 +128,7 @@
|
||||
import Form from '@/components/form/index.vue';
|
||||
import {addResourcePolicy, updateResourcePolicy,getMonitorTempList, getMonitorPolicy, listAllSwitchName, getResMonitorGroup} from "@/api/disRevenue/resource"
|
||||
export default {
|
||||
name: "serverMonitorStratdit",
|
||||
name: "LinuxMonitorStratEdit",
|
||||
components: {Form},
|
||||
dicts: ['collection_cycle', 'policy_status'],
|
||||
props: {
|
||||
@@ -142,7 +152,7 @@
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
activeTwoName: [0,1,2,3,4],
|
||||
activeTwoName: [0,1,2,3,4,5],
|
||||
timeOptions: [],
|
||||
ruleFormData: {},
|
||||
formList: [],
|
||||
@@ -175,7 +185,6 @@
|
||||
created() {
|
||||
this.timeOptions = this.dict.type.collection_cycle;
|
||||
this.paramsData = this.$route && this.$route.query;
|
||||
console.log('paramsData===',this.paramsData);
|
||||
if (this.paramsData && this.paramsData.id) {
|
||||
this.getFormDataList(this.paramsData.id);
|
||||
} else {
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
queryParams: {
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
status: ''
|
||||
},
|
||||
// 列显隐信息
|
||||
columns: {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<div style="padding: 8px 20px 20px;">
|
||||
<div class="w100 plr-20" style="font-size: 14px">
|
||||
<div v-for="(item, key, index) of formData['formFirst']" class="w50 disInlineBlock p10">
|
||||
<span class="w50 disInlineBlock">{{item}}</span><span class="w50">{{formData['formValue'] && formData['formValue'][key]}}</span>
|
||||
<div class="disInlineBlock" style="width: 120px;">{{item}}</div>
|
||||
<div style="width: calc(100% - 120px);vertical-align: top;" class="disInlineBlock">{{formData['formValue'] && formData['formValue'][key]}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-for="item of chartList" class="w100 mt10 mb10" style="height: 200px;border-top: 1px solid #d8dce5">
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="添加监控策略" :visible.sync="stratOpen" width="1000px" append-to-body>
|
||||
<el-dialog title="添加监控策略" :visible.sync="stratOpen" width="1200px" append-to-body>
|
||||
<MonitorStrategy :open="`type_${stratOpen}`" @dialogResult="fnDialogResult"></MonitorStrategy>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -266,7 +266,6 @@
|
||||
this.stratOpen = false;
|
||||
},
|
||||
callback(result, rowData, selectChange) {
|
||||
console.log('result==',result);
|
||||
if (result && result.fnCode) {
|
||||
switch (result.fnCode) {
|
||||
case 'add':
|
||||
@@ -306,12 +305,12 @@
|
||||
config: {title: '',labelWidth: '140px', colSpan: 'disBlock m0Auto'},
|
||||
controls: {
|
||||
id: {label: 'ID',hidden: true},
|
||||
clientId: {label: '任务名称', span: 18, type: 'input', required: true},
|
||||
name: {label: '业务名称', span: 18, type: 'select',options: [], required: true},
|
||||
taskName: {label: '任务名称', span: 18, type: 'input', required: true},
|
||||
businessName: {label: '业务名称', span: 18, type: 'select',options: [], required: true},
|
||||
scriptName: {label: '脚本名称', span: 18, type: 'select',options: [], required: true},
|
||||
adress: {label: '脚本文件地址', span: 18, type: 'input', disabled: true, required: true},
|
||||
params: {label: '脚本参数', span: 18, type: 'input',options: [], required: true},
|
||||
machineCode: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
|
||||
deployDevice: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
|
||||
}
|
||||
}];
|
||||
this.ruleForm = {
|
||||
@@ -339,11 +338,11 @@
|
||||
controls: {
|
||||
id: {label: 'ID',hidden: true},
|
||||
clientId: {label: '策略名称', span: 18, type: 'input', required: true},
|
||||
remarks: {label: '描述', span: 18, type: 'textarea', required: true},
|
||||
machineCode: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
|
||||
description: {label: '描述', span: 18, type: 'textarea', required: true},
|
||||
deployDevice: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
|
||||
scriptName: {label: '脚本名称', span: 18, type: 'select',options: [], required: true},
|
||||
adress: {label: '脚本文件地址', span: 18, type: 'input', disabled: true, required: true},
|
||||
params: {label: '脚本参数', span: 18, type: 'input',options: [], required: true},
|
||||
scriptPath: {label: '脚本文件地址', span: 18, type: 'input', disabled: true, required: true},
|
||||
scriptParams: {label: '脚本参数', span: 18, type: 'input', required: true},
|
||||
executionMethod: {label: '执行方式', span: 18, type: 'select',eventName:'change', options: this.dict.type.policy_method},
|
||||
scheduledTime: {label: '定时时间', span: 18, type: 'date', hidden: true},
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
// 第一栏
|
||||
firstChartTrans: {},
|
||||
formFirst: {
|
||||
sysDescr: '总内存', sysLocation: '操作系统', sysObjectID: '操作系统架构', hwStackSystemMac: '最大进程数', sysUpTime: '硬盘',
|
||||
entPhysicalName: '系统启动时间', sysContact: '系统描述', entPhysicalSoftwareRev: '系统正确运行时间', sysName: '系统本地时间', cpuNum: 'CPU数量'
|
||||
cpuNum: 'CPU数量', sysLocation: '操作系统', sysObjectID: '操作系统架构', hwStackSystemMac: '最大进程数', sysUpTime: '硬盘',
|
||||
entPhysicalName: '系统启动时间', sysContact: '系统描述', entPhysicalSoftwareRev: '系统正确运行时间', sysName: '系统本地时间', sysDescr: '总内存'
|
||||
},
|
||||
formData: {},
|
||||
firstChartList: [],
|
||||
@@ -411,7 +411,7 @@
|
||||
if (res && res.data) {
|
||||
this.eventDataMap['interfaceName'] = false;
|
||||
netEcharts.title = `${interfaceName}的丢包数`;
|
||||
console.log('');
|
||||
|
||||
netEcharts.dataVal.lineXData = res.data?.xData.length > 0 ? res.data.xData : this.firstChartTrans?.timeList || [];
|
||||
// 入
|
||||
netEcharts.dataVal.dataList[0] = {
|
||||
|
||||
@@ -1,239 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div style="width: 80%; margin: auto;">
|
||||
<Form ref="formRef" :formList="formList" :config="{labelWidth: '140px',buttonGroup: []}" :ruleFormData="ruleFormData" @fnClick="callback"></Form>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="background: #d4e3fc;padding: 15px 10px;">策略内容</h3>
|
||||
<el-tabs v-model="activeName" class="plr-20">
|
||||
<el-tab-pane label="监控项" name="first">
|
||||
<div v-for="item of firstData">
|
||||
<div class="plr-50">
|
||||
<div v-for="city of item.checkList" class="w100 mt10 mb10 disInlineBlock fontSize15">
|
||||
<div class="disInlineBlock w50">
|
||||
<span style="width: 200px" class="disInlineBlock">{{ city.metricKey }}</span>
|
||||
<span>{{city.metricName}}</span>
|
||||
</div>
|
||||
<div class="disInlineBlock" style="color: #606266">
|
||||
采集周期:<el-select v-model="city['time']" placeholder="请选择" clearable>
|
||||
<el-option v-for="val in timeOptions" :key="val.value" :label="val.label" :value="val.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="自动发现项" name="second">
|
||||
<el-collapse v-model="activeTwoName">
|
||||
<el-collapse-item v-for="(item,key,index) of secondData" :title="item.title" :name="index">
|
||||
<template slot="title">
|
||||
<span class="disInlineBlock" style="width: 15%;">{{item.title}}</span>
|
||||
<div style="font-size: 13px;margin-left: 10%;">
|
||||
采集周期:<el-select v-model="item['time']" id="selDisabled" :disabled="key === 'switchNet' ? true : false" clearable placeholder="请选择">
|
||||
<el-option v-for="val in timeOptions" :key="val.value" :label="val.label" :value="val.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
<div class="plr-50">
|
||||
<div v-for="city of item.checkList" class="w100 mt10 mb10 disBlock fontSize15">
|
||||
<span style="width: 300px" class="disInlineBlock">{{city.metricKey}}</span>
|
||||
<span>{{city.metricName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<el-button style="float: right;margin-top: 12px;margin-left: 10px;" @click="cancel">取消</el-button>
|
||||
<el-button type="primary" style="float: right;margin-top: 12px;" @click="submit">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Form from '@/components/form/index.vue';
|
||||
export default {
|
||||
name: "MonitorStrategy",
|
||||
components: {Form},
|
||||
dicts: ['rm_register_resource_type', 'collection_cycle'],
|
||||
props: {
|
||||
open: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
open: {
|
||||
handler(val) {
|
||||
if (!val) {
|
||||
// 清空form
|
||||
this.$refs['formRef'].$refs.ruleForm.resetFields();
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
activeTwoName: [0,1,2,3,4],
|
||||
timeOptions: [],
|
||||
ruleFormData: {},
|
||||
formList: [],
|
||||
firstData: [
|
||||
{checkList: [
|
||||
{id: '1', metricKey: 'sysDescr', metricName: '系统描述', time: ''},
|
||||
{id: '2', metricKey: 'sysObjectID', metricName: '系统ObjectID', time: ''},
|
||||
{id: '3', metricKey: 'sysUpTime', metricName: '系统运行时间', time: ''},
|
||||
{id: '4', metricKey: 'hwStackSystemMac', metricName: '系统MAC地址', time: ''},
|
||||
{id: '5', metricKey: 'entPhysicalSoftwareRev', metricName: '设备软件版本', time: ''},
|
||||
{id: '6', metricKey: 'hwEntityMemUsage', metricName: '设备内存使用率(%)', time: ''},
|
||||
]}
|
||||
],
|
||||
secondData: {
|
||||
switchNet: {title: '网络端口发现', time: '300',
|
||||
checkList: [
|
||||
{id: '11', metricKey: 'ifIndex', metricName: '端口索引'},
|
||||
{id: '12', metricKey: 'ifHCOutOctets', metricName: '端口发送Bites总数'},
|
||||
{id: '13', metricKey: 'ifRevRate', metricName: '端口实时接收速率(bites/sec)'},
|
||||
{id: '14', metricKey: 'ifSentRate', metricName: '端口实时发送速率(bites/sec)'},
|
||||
]
|
||||
},
|
||||
switchModule: {title: '光模块发现', time: '',
|
||||
checkList: [
|
||||
{id: '15', metricKey: 'fiberEntIndex', metricName: '光模块端口索引'},
|
||||
{id: '16', metricKey: 'hwEntityOpticalTxLowThreshold', metricName: '光模块发送光衰阈值(dBm)'},
|
||||
{id: '17', metricKey: 'hwEntityOpticalRxLowThreshold', metricName: '光模块接收光衰阈值(dBm)'},
|
||||
{id: '18', metricKey: 'hwEntityOpticalTxPower', metricName: '光模块发送功率(dBm)'},
|
||||
]
|
||||
},
|
||||
switchMpu: {title: 'MPU发现', time: '',
|
||||
checkList: [
|
||||
{id: '19', metricKey: 'mpuEntIndex', metricName: 'MPU索引'},
|
||||
{id: '20', metricKey: 'mpuEntityCpuUsage', metricName: 'MPU的CPU使用率'},
|
||||
{id: '21', metricKey: 'mpuEntityMemUsage', metricName: 'MPU的内存使用率'},
|
||||
{id: '22', metricKey: 'mpuPhysicalSoftwareRev', metricName: 'MPU的操作系统'},
|
||||
]
|
||||
},
|
||||
switchPwr: {title: '电源发现', time: '',
|
||||
checkList: [
|
||||
{id: '23', metricKey: 'pwrEntIndex', metricName: '电源索引'},
|
||||
{id: '24', metricKey: 'pwrName', metricName: '电源名称'},
|
||||
{id: '25', metricKey: 'pwrEntityPwrState', metricName: '电源状态'},
|
||||
{id: '26', metricKey: 'pwrEntityPwrCurrent', metricName: '电源电流(mA)'},
|
||||
]
|
||||
},
|
||||
switchFan: {title: '风扇发现', time: '',
|
||||
checkList: [
|
||||
{id: '27', metricKey: 'fanEntIndex', metricName: '风扇索引'},
|
||||
{id: '28', metricKey: 'pwrEntityPwrState', metricName: '电源状态'},
|
||||
{id: '29', metricKey: 'pwrEntityPwrCurrent', metricName: '电源电流(mA)'},
|
||||
{id: '30', metricKey: 'pwrEntityPwrVoltage', metricName: '电源电压(mV)'},
|
||||
]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log('dddd===');
|
||||
this.timeOptions = this.dict.type.collection_cycle;
|
||||
this.fnFormList();
|
||||
},
|
||||
methods: {
|
||||
// formList集合
|
||||
fnFormList(objVal) {
|
||||
this.formList = [{
|
||||
config: {},
|
||||
controls: {
|
||||
id: {label: 'ID',hidden: true},
|
||||
switchName: {label: '策略名称', span: 24, type: 'input', required: true},
|
||||
hardwareSn: {label: '描述', span: 24, type: 'textarea'},
|
||||
resourceType: {label: '交换机类型', span: 24, type: 'select', required: true, options: this.dict.type.rm_register_resource_type},
|
||||
bushu: {label: '部署设备', span: 24, type: 'textarea', rows: 15},
|
||||
}
|
||||
}];
|
||||
},
|
||||
// form验证
|
||||
fnFormValid() {
|
||||
return new Promise((resolve) => {
|
||||
this.ruleFormData = {};
|
||||
const formValid = this.$refs.formRef.$refs.ruleForm;
|
||||
// 3. 操作form(如验证)
|
||||
formValid.validate((valid) => {
|
||||
if (valid) {
|
||||
this.ruleFormData = formValid.model;
|
||||
resolve(true);
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
async submit() {
|
||||
if (!await this.fnFormValid()) return;
|
||||
// 监控项
|
||||
let idsList = [];
|
||||
this.firstData.forEach(item => {
|
||||
item && item.checkList.forEach(ids => {
|
||||
if (ids && ids.time) {
|
||||
idsList.push({id: ids.id, collectionCycle: ids.time});
|
||||
}
|
||||
});
|
||||
});
|
||||
// 自动发现项
|
||||
let autoIds = [];
|
||||
Object.keys(this.secondData).forEach(key => {
|
||||
if (this.secondData[key].time) {
|
||||
this.secondData[key] && this.secondData[key].checkList.forEach(ids => {
|
||||
autoIds.push({id: ids.id, collectionCycle: this.secondData[key].time});
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log('ruleFormData===',this.ruleFormData);
|
||||
console.log('idsList===',idsList);
|
||||
console.log('autoIds===',autoIds);
|
||||
this.$emit("dialogResult", {open: false});
|
||||
},
|
||||
cancel() {
|
||||
this.$emit("dialogResult", {open: false});
|
||||
},
|
||||
// 监听事件
|
||||
callback(result, dataVal, formVal) {
|
||||
if (result && result.fnCode) {
|
||||
switch (result.fnCode) {
|
||||
case 'submit':
|
||||
let fnType = addHandle;
|
||||
if (dataVal && dataVal.id) {
|
||||
fnType = updateHandle;
|
||||
}
|
||||
fnType(dataVal).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.$router.push("/resource/switchRegister");
|
||||
}).catch(() => {
|
||||
this.$modal.msgError("操作失败")
|
||||
});
|
||||
break;
|
||||
case 'cancel':
|
||||
this.$router.push("/resource/switchRegister");
|
||||
break;
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep #selDisabled{
|
||||
color: #303133!important;
|
||||
}
|
||||
::v-deep .el-collapse-item__header {
|
||||
background-color: #d4e3fc!important;
|
||||
/*color: #fff!important;*/
|
||||
padding-left: 20px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
</style>
|
||||
125
src/views/resource/serverScriptStrat/details.vue
Normal file
125
src/views/resource/serverScriptStrat/details.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<Form ref="formRef" :formList="formList" :ruleFormData="ruleForm" :config="this.paramsData && this.paramsData.readonly ? {labelWidth: '140px', buttonGroup: []} : {labelWidth: '140px'}" @fnClick="callback"></Form>
|
||||
<el-button v-if="this.paramsData && this.paramsData.readonly" style="float: right;margin-top: 12px;margin-left: 10px;" @click="callback({fnCode: 'cancel'})">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Form from '@/components/form/index.vue';
|
||||
import {getPolicy, addPolicy, updatePolicy} from "@/api/disRevenue/resource"
|
||||
import {getAllBusScriptName} from "@/api/disRevenue/earnManage"
|
||||
export default {
|
||||
name: 'PortRemarks',
|
||||
components: {Form},
|
||||
dicts: ['policy_method', 'policy_status'],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
ruleForm: {},
|
||||
formList: [],
|
||||
paramsData: {},
|
||||
scriptList: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.paramsData = this.$route && this.$route.query;
|
||||
if (this.paramsData && this.paramsData.id) {
|
||||
this.getFormDataList(this.paramsData.id);
|
||||
}
|
||||
this.fnFormList();
|
||||
this.getBusScriptNames();
|
||||
},
|
||||
methods: {
|
||||
// formList集合
|
||||
fnFormList(objVal) {
|
||||
this.formList = [{
|
||||
config: {title: '',labelWidth: '140px', readonly: this.paramsData && this.paramsData.readonly, colSpan: 'disBlock m0Auto'},
|
||||
controls: {
|
||||
id: {label: 'ID',hidden: true},
|
||||
policyName: {label: '策略名称', span: 18, type: 'input', required: true},
|
||||
description: {label: '描述', span: 18, type: 'textarea'},
|
||||
task: {label: '关联业务下发任务', span: 18, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
|
||||
deployDevice: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
|
||||
scriptName: {label: '脚本名称', span: 18, type: 'select', eventName: 'change', options: [], required: true},
|
||||
scriptPath: {label: '脚本文件地址', span: 18, type: 'input', disabled: true, required: true},
|
||||
defaultParams: {label: '脚本参数', span: 18, type: 'input'},
|
||||
executionMethod: {label: '执行方式', span: 18, type: 'select', eventName:'change', options: this.dict.type.policy_method},
|
||||
scheduledTime: {label: '定时时间', span: 18, type: 'datetime', hidden: true},
|
||||
policyStatus: {label: '策略状态', span: 18, type: 'select', options: this.dict.type.policy_status, hidden: !(this.paramsData && this.paramsData.readonly)},
|
||||
deployTime: {label: '下发策略时间', span: 18, type: 'datetime', hidden: !(this.paramsData && this.paramsData.readonly)},
|
||||
createBy: {label: '创建人', span: 18, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
|
||||
createTime: {label: '创建时间', span: 18, type: 'datetime', hidden: !(this.paramsData && this.paramsData.readonly)},
|
||||
updateTime: {label: '修改时间', span: 18, type: 'datetime', hidden: !(this.paramsData && this.paramsData.readonly)},
|
||||
}
|
||||
}];
|
||||
},
|
||||
// 脚本名称
|
||||
getBusScriptNames() {
|
||||
getAllBusScriptName().then(val => {
|
||||
this.formList[0].controls.scriptName['options'] = val && val.data.map(item => {
|
||||
this.scriptList[item.id] = item;
|
||||
return Object.assign({label: item.scriptName, value: item.id});
|
||||
});
|
||||
});
|
||||
},
|
||||
// 获取详情
|
||||
getFormDataList(id) {
|
||||
getPolicy(id).then(val => {
|
||||
if (val && val.data) {
|
||||
if (val.data.executionMethod === 1) {
|
||||
this.formList[0].controls.scheduledTime['hidden'] = false;
|
||||
}
|
||||
val.data.executionMethod = val && val.data.executionMethod.toString();
|
||||
val.data['scriptName'] = Number(val.data['scriptName']);
|
||||
this.ruleForm = val && val.data;
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
// 监听事件
|
||||
callback(result, dataVal, formVal) {
|
||||
if (result && result.fnCode) {
|
||||
switch (result.fnCode) {
|
||||
case 'scriptName':
|
||||
this.ruleForm = Object.assign({}, this.ruleForm, this.$refs.formRef.$refs.ruleForm.model);
|
||||
if (dataVal) {
|
||||
let dataListVal = this.scriptList[dataVal];
|
||||
this.$set(this.ruleForm, 'scriptPath', dataListVal['scriptPath']);
|
||||
this.$set(this.ruleForm, 'defaultParams', dataListVal['defaultParams']);
|
||||
}
|
||||
break;
|
||||
case 'executionMethod':
|
||||
if (dataVal && dataVal === '1') {
|
||||
this.formList[0].controls.scheduledTime['hidden'] = false;
|
||||
} else {
|
||||
this.formList[0].controls.scheduledTime['hidden'] = true;
|
||||
}
|
||||
break;
|
||||
case 'submit':
|
||||
let fnType = addPolicy;
|
||||
if (dataVal && dataVal.id) {
|
||||
fnType = updatePolicy;
|
||||
}
|
||||
if(this.loading) return;
|
||||
this.loading = true;
|
||||
fnType(dataVal).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.$router.push("/resource/serverScriptStrat");
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$modal.msgError("操作失败")
|
||||
});
|
||||
break;
|
||||
case 'cancel':
|
||||
this.$router.push("/resource/serverScriptStrat");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
272
src/views/resource/serverScriptStrat/serverScriptStrat.vue
Normal file
272
src/views/resource/serverScriptStrat/serverScriptStrat.vue
Normal file
@@ -0,0 +1,272 @@
|
||||
<template>
|
||||
<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="policyName">
|
||||
<el-input
|
||||
v-model="queryParams.policyName"
|
||||
placeholder="请输入策略名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="策略状态" prop="policyStatus">
|
||||
<el-select
|
||||
v-model="queryParams.policyStatus"
|
||||
placeholder="请选择策略状态"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.policy_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item class="lastBtnSty">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
|
||||
<template #tempFirst="{ row, column }">
|
||||
<div @click="fnDetails(1,row)">
|
||||
<a href="javascript:;" style="color: #51afff;text-decoration: underline;">{{row.timestamp}}</a>
|
||||
</div>
|
||||
</template>
|
||||
<template #tempSecond="{ row, column }">
|
||||
<div @click="fnDetails(2,row)">
|
||||
<a href="javascript:;" style="color: #51afff;text-decoration: underline;">{{row.timestamp}}</a>
|
||||
</div>
|
||||
</template>
|
||||
<template #tempThird="{ row, column }">
|
||||
<div @click="fnDetails(3,row)">
|
||||
<a href="javascript:;" style="color: #51afff;text-decoration: underline;">{{row.timestamp}}</a>
|
||||
</div>
|
||||
</template>
|
||||
<template #tmpExecution="{ row, column }">
|
||||
<dict-tag :options="dict.type.policy_method" :value="row.executionMethod"/>
|
||||
</template>
|
||||
<template #tempStatus="{ row, column }">
|
||||
<dict-tag :options="dict.type.policy_status" :value="row.policyStatus"/>
|
||||
</template>
|
||||
</TableList>
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-checkbox-group v-model="checkboxGroup" size="min" disabled>
|
||||
<el-checkbox-button style="margin-right: 10px;" v-for="city in cities" :label="city.label" :key="city.id">{{city.label}}</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
<div v-if="dialogData['timeline']" class="block mt10">
|
||||
<el-timeline :reverse="true">
|
||||
<el-timeline-item v-for="item of dialogData.timelineList" :timestamp="item.createTime" placement="top">
|
||||
<pre>{{item.content}}</pre>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import TableList from "@/components/table/index.vue"
|
||||
import {listPolicy, delPolicy} from "@/api/disRevenue/resource"
|
||||
export default {
|
||||
name: 'serverMonitorStrat',
|
||||
components: {TableList},
|
||||
dicts: ['policy_status', 'policy_method'],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
tableList: [],
|
||||
queryParams: {
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
status: ''
|
||||
},
|
||||
// 列显隐信息
|
||||
columns: {
|
||||
id: { label: `ID`,width: '50'},
|
||||
policyName: { label: `策略名称`, minWidth: '250', visible: true },
|
||||
description: { label: `描述`,minWidth: '200'},
|
||||
task: { label: `关联业务下发`,minWidth: '200',visible: true},
|
||||
deployDevice: { label: `部署设备`,minWidth: '200'},
|
||||
scriptName: { label: `脚本名称`,minWidth: '150'},
|
||||
scriptPath: { label: `脚本地址`,minWidth: '200'},
|
||||
scriptParams: { label: `脚本参数`,minWidth: '200'},
|
||||
executionMethod: { label: `执行方式`,minWidth: '200', slotName: 'tmpExecution'},
|
||||
noNum: { label: `不在线数量`,minWidth: '100', slotName: 'tempFirst', visible: true},
|
||||
successNum: { label: `执行成功数量`,minWidth: '120', slotName: 'tempSecond', visible: true},
|
||||
dangerNum: { label: `执行失败数量`,minWidth: '120', slotName: 'tempThird', visible: true},
|
||||
policyStatus: { label: `策略状态`, minWidth: '100', slotName: 'tempStatus', visible: true },
|
||||
deployTime: { label: `下发策略时间`,minWidth: '160'},
|
||||
createBy:{ label: `创建人`,minWidth: '100'},
|
||||
createTime: { label: `创建时间`,minWidth: '160'},
|
||||
updateTime: { label: `修改时间`,minWidth: '160'},
|
||||
},
|
||||
config: {
|
||||
tableButton: {
|
||||
top: [
|
||||
{content: '新增', fnCode: 'add', type: 'primary', icon: 'el-icon-plus', hasPermi: 'resource:serverScriptStrat:add'},
|
||||
{content: '删除', fnCode: 'delete', type: 'danger', icon: 'el-icon-delete', hasPermi: 'resource:serverScriptStrat:detele'},
|
||||
{content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'resource:serverScriptStrat:export'},
|
||||
],
|
||||
line: [
|
||||
{content: '修改', fnCode: 'edit', type: 'text', showName: 'policyStatus', showVal: '0', icon: 'el-icon-edit', hasPermi: 'resource:serverScriptStrat:edit'},
|
||||
{content: '详情', fnCode: 'details', type: 'text', icon: 'el-icon-view', hasPermi: 'resource:serverScriptStrat:details'},
|
||||
{content: '删除', fnCode: 'delete', type: 'text', showName: 'policyStatus', showVal: '0', icon: 'el-icon-delete', hasPermi: 'resource:serverScriptStrat:detele'},
|
||||
]
|
||||
}
|
||||
},
|
||||
open: false,
|
||||
checkboxGroup: [],
|
||||
title: '',
|
||||
dialogData: {
|
||||
timeline: false,
|
||||
timelineList: [
|
||||
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-12 12:12:12'},
|
||||
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-11 12:12:12'},
|
||||
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-10 12:12:12'}
|
||||
]
|
||||
},
|
||||
cities: [{id: 1, label: 'aa'}, {id: 2, label: 'bb'},{id: 3, label: 'cc'}],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
activated() {
|
||||
this.$nextTick(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
// this.$modal.loading();
|
||||
listPolicy(this.queryParams).then(response => {
|
||||
this.tableList = response.rows;
|
||||
this.queryParams.total = response.total;
|
||||
// this.$modal.closeLoading();
|
||||
}).catch(err => {
|
||||
// this.$modal.closeLoading();
|
||||
})
|
||||
},
|
||||
// 处理子组件传递的新值
|
||||
handleValueChange(newValue) {
|
||||
// 父组件更新自身数据,实现同步
|
||||
this.showSearch = newValue;
|
||||
// console.log('父组件拿到新值:', newValue);
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryRef");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
fnDetails(num, row){
|
||||
this.open = true;
|
||||
if (num === 1) {
|
||||
this.title = '不在线设备';
|
||||
this.dialogData['timeline'] = false;
|
||||
} else if (num === 2) {
|
||||
this.title = '执行成功设备';
|
||||
this.dialogData['timeline'] = true;
|
||||
} else {
|
||||
this.title = '执行失败设备';
|
||||
this.dialogData['timeline'] = true;
|
||||
}
|
||||
},
|
||||
|
||||
callback(result, rowData, selectChange, selectList) {
|
||||
if (result && result.fnCode) {
|
||||
switch (result.fnCode) {
|
||||
case 'add':
|
||||
this.$router.push({
|
||||
path:'/resource/serverScriptStrat/details/index'});
|
||||
break;
|
||||
case 'edit':
|
||||
this.$router.push({
|
||||
path:'/resource/serverScriptStrat/details/index',
|
||||
query:{
|
||||
id: rowData.id
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'details':
|
||||
this.$router.push({
|
||||
path:'/resource/serverScriptStrat/details/index',
|
||||
query:{
|
||||
id: rowData.id,
|
||||
readonly: true
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'delete':
|
||||
let ids;
|
||||
if (rowData && rowData.id) {
|
||||
ids = rowData.id;
|
||||
} else {
|
||||
if (selectList && selectList.length <= 0) {
|
||||
this.$modal.msgWarning("请选择数据!");
|
||||
return;
|
||||
}
|
||||
ids = selectChange;
|
||||
}
|
||||
this.$modal.confirm('是否确认删除数据项?').then(function() {
|
||||
return delPolicy(ids)
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {});
|
||||
break;
|
||||
case 'export':
|
||||
// let dataList = [];
|
||||
// Object.keys(this.columns).forEach(item => {
|
||||
// if (item.visible) {
|
||||
// dataList.push(item.prop);
|
||||
// }
|
||||
// });
|
||||
// this.download("/system/monitorStategy/export", {properties: dataList,}, `拓扑管理_${new Date().getTime()}.xlsx`);
|
||||
let paramsList = Object.assign({}, this.queryParams,rowData);
|
||||
this.download("rocketmq/policy/export", paramsList, `服务器脚本策略_${new Date().getTime()}.xlsx`, null, 'json');
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .lastBtnSty .el-form-item__content{
|
||||
margin-left: 10px!important;
|
||||
}
|
||||
::v-deep .el-checkbox-button__inner{
|
||||
border-radius: 4px!important;
|
||||
border-left: 1px solid #DCDFE6!important;
|
||||
}
|
||||
::v-deep .el-checkbox-button.is-checked .el-checkbox-button__inner{
|
||||
box-shadow: none!important;
|
||||
}
|
||||
::v-deep .el-checkbox-button.is-focus .el-checkbox-button__inner{
|
||||
border-color: #1890ff!important;
|
||||
}
|
||||
::v-deep .el-timeline .el-timeline-item:last-child .el-timeline-item__tail {
|
||||
display: block!important;
|
||||
}
|
||||
::v-deep .el-dialog{
|
||||
min-height: 300px;
|
||||
}
|
||||
</style>
|
||||
@@ -59,8 +59,8 @@
|
||||
<div class="plr-50">
|
||||
<div v-for="city of item.checkList" class="w100 mt10 mb10 disInlineBlock fontSize15">
|
||||
<div class="disInlineBlock w50">
|
||||
<span style="width: 200px" class="disInlineBlock">{{ city.metricKey }}</span>
|
||||
<span>{{city.metricName}}</span>
|
||||
<span style="width: 150px;color: #C0C4CC;" class="disInlineBlock">{{ city.metricName }}</span>
|
||||
<span>{{city.metricKey}}</span>
|
||||
</div>
|
||||
<div class="disInlineBlock" style="color: #606266">
|
||||
采集周期为{{city.timeLabel}}
|
||||
@@ -78,8 +78,8 @@
|
||||
<div class="plr-50">
|
||||
当前所有子项的采集周期均为{{item.timeLabel}}
|
||||
<div v-for="city of item.checkList" class="w100 mt10 mb10 disBlock fontSize15">
|
||||
<span style="width: 300px" class="disInlineBlock">{{city.metricKey}}</span>
|
||||
<span>{{city.metricName}}</span>
|
||||
<span style="width: 300px;color: #C0C4CC;" class="disInlineBlock">{{city.metricName}}</span>
|
||||
<span>{{city.metricKey}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
@@ -87,8 +87,9 @@
|
||||
</el-collapse>
|
||||
</template>
|
||||
</div>
|
||||
<el-button style="float: right;margin-top: 12px;margin-left: 10px;" @click="cancel">取消</el-button>
|
||||
<el-button type="primary" style="float: right;margin-top: 12px;" @click="submit">提交</el-button>
|
||||
<el-button v-if="!(paramsData && paramsData.readonly)" style="float: right;margin-top: 12px;margin-left: 10px;" @click="cancel">取消</el-button>
|
||||
<el-button v-if="!(paramsData && paramsData.readonly)" type="primary" style="float: right;margin-top: 12px;" @click="submit">提交</el-button>
|
||||
<el-button v-if="paramsData && paramsData.readonly" style="float: right;margin-top: 12px;margin-left: 10px;" @click="cancel">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -196,7 +197,7 @@
|
||||
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},
|
||||
deployTime: {label: '下发策略时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
createTime: {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},
|
||||
createBy: {label: '创建人', span: 12, type: 'input',hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
deployDevice: {label: '部署设备', span: 12, type: 'select', options:[], multiple: true, required: true},
|
||||
@@ -212,6 +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);
|
||||
this.ruleFormData = val.data.policy;
|
||||
}
|
||||
this.tempContent = val.data['switch'];
|
||||
|
||||
@@ -81,9 +81,9 @@
|
||||
{content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'resource:switchMonitorStrat:export'},
|
||||
],
|
||||
line: [
|
||||
{content: '修改', fnCode: 'edit', type: 'text', showName: 'status', showVal: '0', icon: 'el-icon-edit', hasPermi: 'resource:switchMonitorStrat:edit'},
|
||||
{content: '修改', fnCode: 'edit', type: 'text', showName: 'priority', showVal: '1', icon: 'el-icon-edit', hasPermi: 'resource:switchMonitorStrat:edit'},
|
||||
{content: '详情', fnCode: 'details', type: 'text', icon: 'el-icon-view', hasPermi: 'resource:switchMonitorStrat:details'},
|
||||
{content: '删除', fnCode: 'delete', type: 'text', showName: 'status', showVal: '0', icon: 'el-icon-delete', hasPermi: 'resource:switchMonitorStrat:detele'},
|
||||
{content: '删除', fnCode: 'delete', type: 'text', showName: 'priority', showVal: '1', icon: 'el-icon-delete', hasPermi: 'resource:switchMonitorStrat:detele'},
|
||||
{}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<div style="padding: 8px 20px 20px;">
|
||||
<div class="w100 plr-20" style="font-size: 14px">
|
||||
<div v-for="(item, key, index) of formData['formFirst']" class="w50 disInlineBlock p10">
|
||||
<span class="w50 disInlineBlock">{{item}}</span><span class="w50">{{formData['formValue'] && formData['formValue'][key]}}</span>
|
||||
<div class="disInlineBlock" style="width: 120px;">{{item}}</div>
|
||||
<div class="disInlineBlock" style="width: calc(100% - 120px); vertical-align: top;">{{formData['formValue'] && formData['formValue'][key]}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-for="item of chartList" class="w100 mt10 mb10" style="height: 200px;border-top: 1px solid #d8dce5">
|
||||
|
||||
@@ -113,10 +113,10 @@
|
||||
snmpPort: {label: 'SNMP采集端口', span: 12, type: 'input',required: true, hidden: objVal && objVal.switchType === '1' ? false : true},
|
||||
switchUser: {label: '用户名', span: 12, type: 'input', hidden: objVal && objVal.snmpVersion === '1' ? true : false},
|
||||
switchPassword: {label: '密码', span: 12, type: 'input', hidden: objVal && objVal.snmpVersion === '1' ? true : false},
|
||||
updateTime: {label: '修改时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
createTime: {label: '创建时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
updateTime: {label: '修改时间', span: 12, type: 'datetime', hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
createTime: {label: '创建时间', span: 12, type: 'datetime', hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
onlineStatus: {label: '在线状态', span: 12, type: 'select', options: this.dict.type.rm_register_online_state, hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
upTime: {label: '上机时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
upTime: {label: '上机时间', span: 12, type: 'datetime', hidden: this.paramsData && this.paramsData.readonly ? false : true},
|
||||
}
|
||||
}];
|
||||
},
|
||||
|
||||
@@ -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="queryName">
|
||||
<el-input
|
||||
v-model="queryParams.switchName"
|
||||
v-model="queryParams.queryName"
|
||||
placeholder="请输入交换机名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
@@ -114,10 +114,8 @@
|
||||
{content: '图形监控', fnCode: 'echartView', type: 'text', icon: 'el-icon-data-analysis', hasPermi: 'resource:switchRegister:graphicAnalysis'},
|
||||
{content: '修改', fnCode: 'edit', type: 'text', icon: 'el-icon-edit', hasPermi: 'resource:switchRegister:edit'},
|
||||
{content: '详情', fnCode: 'details', type: 'text', icon: 'el-icon-view', hasPermi: 'resource:switchRegister:details'},
|
||||
{title: ' 执行策略', more: [
|
||||
{content: '执行监控策略', fnCode: 'monitorStrategy', type: 'text', icon: 'el-icon-circle-check', hasPermi: 'resource:switchRegister:monitorStrategy'},
|
||||
]
|
||||
},{},{}
|
||||
{content: '执行监控策略', fnCode: 'monitorStrategy', type: 'text', icon: 'el-icon-document-checked', hasPermi: 'resource:switchRegister:monitorStrategy'},
|
||||
{},{}
|
||||
// {content: '注册', fnCode: 'enroll', showName: 'registrationStatus', showVal: '0', type: 'text', icon: 'el-icon-circle-check', hasPermi: 'resource:register:enroll'},
|
||||
// {content: '取消注册', fnCode: 'unenroll', showName: 'registrationStatus', showVal: '1', type: 'text', icon: 'el-icon-circle-close', hasPermi: 'resource:register:unenroll'},
|
||||
]
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
// 第一栏
|
||||
firstChartTrans: {},
|
||||
formFirst: {
|
||||
sysDescr: '系统描述', sysLocation: '系统位置', sysObjectID: '系统Object ID', hwStackSystemMac: '系统MAC地址',
|
||||
sysUpTime: '系统运行时间', entPhysicalName: '设备名称', sysContact: '系统联系信息', entPhysicalSoftwareRev: '设备软件版本', sysName: '系统名称'
|
||||
sysName: '系统名称', sysLocation: '系统位置', sysObjectID: '系统Object ID', hwStackSystemMac: '系统MAC地址',
|
||||
sysUpTime: '系统运行时间', entPhysicalName: '设备名称', sysContact: '系统联系信息', entPhysicalSoftwareRev: '设备软件版本', sysDescr: '系统描述'
|
||||
},
|
||||
formData: {},
|
||||
firstChartList: [],
|
||||
@@ -124,7 +124,7 @@
|
||||
{title: 'GE1/0/1的丢包数', oneName: '入站丢包', twoName: '出站丢包'},
|
||||
{title: 'GE1/0/1的Bites总数', oneName: '端口发送Bites总数', twoName: '端口接收Bites总数'},
|
||||
{title: 'GE1/0/1的错误包数量', oneName: '错误的入站数据包数量', twoName: '错误的出战数据包数量'},
|
||||
{title: 'GE1/0/1的网络速率(bites/sec)', oneName: '端口实时接收速率(bites/sec)', twoName: '端口实时发送速率(bites/sec)'},
|
||||
{title: 'GE1/0/1的网络速率', oneName: '端口实时接收速率', twoName: '端口实时发送速率'},
|
||||
],
|
||||
echartList: []
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user