2020-03-30 21:09:34 +08:00
|
|
|
|
<template>
|
2020-12-14 20:25:24 +08:00
|
|
|
|
<div class="system">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-tabs type="border-card" @tab-click="selectTab" v-model="activeTab" class="system-tabs" >
|
|
|
|
|
|
<el-tab-pane :label="$t('config.system.basic.basic')" name="basic">
|
2020-11-19 18:20:31 +08:00
|
|
|
|
<div class="system-config-form basicForm">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form :model="basic" label-width="180px" size="small" ref="basicForm" :rules="basic.asset_ping_switch == 'on'?basicRules:basicRules2" :validate-on-rule-change="false">
|
|
|
|
|
|
<el-form-item :label="$t('config.system.basic.systemName')" prop="system_name">
|
|
|
|
|
|
<el-input v-model="basic.system_name"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.basic.curUrl')" prop="alert_api">
|
|
|
|
|
|
<el-input v-model="basic.alert_api"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.basic.assetPingSwith')" prop="asset_ping_switch">
|
|
|
|
|
|
<el-switch v-model.number="basic.asset_ping_switch" active-color="rgb(238, 157, 63)" active-value='on' inactive-value='off'>
|
|
|
|
|
|
</el-switch>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--<el-form-item :label="$t('config.system.basic.assetPingInterval')" prop="asset_ping_interval">
|
|
|
|
|
|
<el-input v-model.number="basic.asset_ping_interval" :disabled="basic.asset_ping_switch == 'off'"></el-input><span class="nz-input-append">s</span>
|
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
|
<el-form-item :label="$t('config.system.basic.defaultCabinetUsize')" prop="default_cabinet_usize">
|
|
|
|
|
|
<el-input v-model.number="basic.default_cabinet_usize" ></el-input>
|
|
|
|
|
|
</el-form-item>
|
2020-10-19 18:33:18 +08:00
|
|
|
|
<!--<el-form-item :label="$t('config.system.basic.exporterTarget')" prop="node_exporter_target_path">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-input v-model="basic.node_exporter_target_path"></el-input>
|
2020-10-19 18:33:18 +08:00
|
|
|
|
</el-form-item>-->
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form-item :label="$t('config.system.basic.scrapeInterval')" prop="scrape_interval">
|
|
|
|
|
|
<el-input v-model.number="basic.scrape_interval" ></el-input><span class="nz-input-append">{{$t('config.system.basic.second')}}</span>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.basic.storageRetention')" prop="storage_local_retention">
|
|
|
|
|
|
<el-input v-model.number="basic.storage_local_retention" ></el-input><span class="nz-input-append">{{$t('config.system.basic.day')}}</span>
|
|
|
|
|
|
</el-form-item>
|
2020-11-20 11:19:25 +08:00
|
|
|
|
<el-form-item :label="$t('config.system.basic.maxSeries')" prop="storage_local_retention">
|
|
|
|
|
|
<el-input-number v-model="basic.query_max_series" controls-position="right" :min="-1" :max="1000" :precision="0"></el-input-number>
|
|
|
|
|
|
</el-form-item>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form-item :label="$t('config.system.basic.timezone')" prop="timezone">
|
2020-11-19 18:20:31 +08:00
|
|
|
|
<!-- <el-input v-model.number="basic.timezone" ></el-input>-->
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-select v-model="basic.timezone">
|
|
|
|
|
|
<el-option v-for="(item,index) in timezoneOption" :key="index" :label="item.label" :value="item.value"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2020-12-21 14:16:13 +08:00
|
|
|
|
<button
|
|
|
|
|
|
@click="resetForm('basicForm','basic')" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" type="button"
|
|
|
|
|
|
:disabled="prevent_opt.save" :class="{'nz-btn-disabled':prevent_opt.save}"
|
|
|
|
|
|
>{{$t('overall.reset')}}</button>
|
|
|
|
|
|
<button @click="saveSetInfo('basic','basicForm')" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" type="button" v-has="'system_basic_save'" :disabled="prevent_opt.save" :class="{'nz-btn-disabled':prevent_opt.save}">{{$t('overall.submit')}}</button>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane :label="$t('config.system.email.email')" name="email" >
|
|
|
|
|
|
<div class="system-config-form">
|
|
|
|
|
|
<el-form :model="email" label-width="180px" size="small" ref="emailForm" :rules="email.email_enable=='on'?emailRules:{}" :validate-on-rule-change="false">
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.enable')" prop="email_enable">
|
|
|
|
|
|
<el-checkbox v-model="email.email_enable" true-label="on" false-label="off" @change="switchChange('emailForm')"></el-checkbox>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.smtpHost')" prop="email_smtp_host">
|
|
|
|
|
|
<el-input v-model="email.email_smtp_host" :disabled="email.email_enable == 'off'"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.smtpPort')" prop="email_smtp_port">
|
|
|
|
|
|
<el-input v-model.number="email.email_smtp_port" :disabled="email.email_enable == 'off'"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.smtpAccount')" prop="email_smtp_account">
|
2020-10-16 16:44:41 +08:00
|
|
|
|
<el-input v-model="email.email_smtp_account" :disabled="email.email_enable == 'off'"> autocomplete="off"</el-input>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-form-item>
|
2021-01-05 11:54:33 +08:00
|
|
|
|
<el-form-item :label="$t('config.system.email.smtpPwd')" prop="email_smtp_password">
|
2020-10-16 16:44:41 +08:00
|
|
|
|
<el-input v-model="email.email_smtp_password" type="password" :show-password="false" :disabled="email.email_enable == 'off'" autocomplete="off"></el-input>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<div><span>{{$t('config.system.email.pwdTip')}}</span></div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.sendAccount')" prop="email_send_account">
|
|
|
|
|
|
<el-input v-model="email.email_send_account" :disabled="email.email_enable == 'off'"></el-input>
|
|
|
|
|
|
<div><span>{{$t('config.system.email.sendAccountTip')}}</span></div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.testAccount')" prop="email_test_reciver">
|
|
|
|
|
|
<el-input v-model="email.email_test_reciver" :disabled="email.email_enable == 'off'"></el-input>
|
|
|
|
|
|
<div><span>{{$t('config.system.email.testAccountTip')}}</span></div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.useSSL')" prop="email_ssl_flag">
|
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
|
<el-col :span="5"><el-checkbox v-model="email.email_ssl_flag" true-label="on" false-label="off" :disabled="email.email_enable == 'off'"></el-checkbox></el-col>
|
|
|
|
|
|
<el-col :span="15"><div><span>{{$t('config.system.email.sslTip')}}</span></div></el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.email.useTLS')" prop="email_tls_flag">
|
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
|
<el-col :span="5"><el-checkbox v-model="email.email_tls_flag" true-label='on' false-label='off' :disabled="email.email_enable == 'off'"></el-checkbox></el-col>
|
|
|
|
|
|
<el-col :span="16"><span>{{$t('config.system.email.tlsTip')}}</span></el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2020-12-16 18:41:29 +08:00
|
|
|
|
<button @click="resetForm('emailForm','email')" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" type="button">{{$t('overall.reset')}}</button>
|
2020-12-21 14:16:13 +08:00
|
|
|
|
<button :class="{'nz-btn-disabled':email.email_enable == 'off','nz-btn-disabled':prevent_opt.save}" :disabled="email.email_enable == 'off' || prevent_opt.save" @click="testSetInfo('email','emailForm')" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" type="button">{{$t('config.system.email.testConnection')}}</button>
|
|
|
|
|
|
<button @click="saveSetInfo('email','emailForm')" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" type="button" v-has="'system_email_save'" :disabled="prevent_opt.save" :class="{'nz-btn-disabled':prevent_opt.save}">{{$t('overall.submit')}}</button>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane :label="$t('config.system.terminal.terminal')" name="terminal">
|
2020-10-16 18:11:53 +08:00
|
|
|
|
<div class="system-config-form terminal">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form :model="terminal" label-width="180px" size="small" ref="terminalForm" :rules="terminalRules">
|
|
|
|
|
|
<el-form-item :label="$t('config.system.terminal.terminalNum')" prop="max_terminal_num">
|
2020-10-20 15:11:52 +08:00
|
|
|
|
<el-input-number v-model="terminal.max_terminal_num" controls-position="right" :min="1" :max="50"></el-input-number>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2020-12-21 14:16:13 +08:00
|
|
|
|
<button @click="saveSetInfo('terminal','terminalForm')" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" type="button" v-has="'system_terminal_save'" :disabled="prevent_opt.save" :class="{'nz-btn-disabled':prevent_opt.save}">{{$t('overall.submit')}}</button>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
2020-04-01 20:47:19 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane :label="$t('config.system.ldap.ldap')" name="ldap">
|
|
|
|
|
|
<div class="system-config-form">
|
|
|
|
|
|
<el-form :model="ldap" label-width="180px" size="small" ref="ldapForm" :rules="ldap.ldap_enable == 'on'?ldapRules:{}" :validate-on-rule-change="false">
|
|
|
|
|
|
<el-form-item :label="$t('config.system.ldap.active')" prop="ldap_enable">
|
|
|
|
|
|
<el-checkbox v-model="ldap.ldap_enable" true-label='on' false-label='off' @change="switchChange('ldapForm')"></el-checkbox>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.ldap.address')" prop="ldap_address">
|
|
|
|
|
|
<el-input v-model="ldap.ldap_address"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.ldap.dn')" prop="ldap_dn">
|
|
|
|
|
|
<el-input v-model="ldap.ldap_dn"></el-input>
|
|
|
|
|
|
</el-form-item>
|
2021-01-05 11:54:33 +08:00
|
|
|
|
<el-form-item :label="$t('config.system.ldap.pwd')" prop="ldap_password">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-input v-model="ldap.ldap_password" type="password"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.ldap.ou')" prop="ldap_ou">
|
|
|
|
|
|
<el-input v-model="ldap.ldap_ou"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.ldap.filter')" prop="ldap_user_filter">
|
|
|
|
|
|
<el-input v-model="ldap.ldap_user_filter"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item :label="$t('config.system.ldap.map')" prop="ldap_mapping">
|
|
|
|
|
|
<el-input v-model="ldap.ldap_mapping"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2020-12-16 18:41:29 +08:00
|
|
|
|
<button @click="resetForm('ldapForm','ldap')" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" type="button">{{$t('overall.reset')}}</button>
|
2020-12-21 14:16:13 +08:00
|
|
|
|
<button @click="testSetInfo('ldap','ldapForm')" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" type="button" :disabled="prevent_opt.save" :class="{'nz-btn-disabled':prevent_opt.save}">{{$t('config.system.email.testConnection')}}</button>
|
|
|
|
|
|
<button @click="saveSetInfo('ldap','ldapForm')" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" type="button" v-has="'system_ldap_save'" :disabled="prevent_opt.save" :class="{'nz-btn-disabled':prevent_opt.save}">{{$t('overall.submit')}}</button>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
2020-04-08 22:31:07 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-tab-pane>
|
2020-11-21 17:56:33 +08:00
|
|
|
|
<el-tab-pane :label="$t('config.system.notification.notification')" name="notification"><!--$t('config.system.reset.reset')-->
|
2020-11-25 11:54:22 +08:00
|
|
|
|
<div class="linkBox notificationMessage">
|
|
|
|
|
|
<i class="nz-icon nz-icon-info-normal"></i>
|
|
|
|
|
|
<div style="margin-left: 15px">
|
|
|
|
|
|
<div>. Please make sure the script file exists and has executable permissions</div>
|
|
|
|
|
|
<div>. The script file receives two parameters:</div>
|
|
|
|
|
|
<div> ① Notification account</div>
|
|
|
|
|
|
<div> ② Alert message(json)
|
|
|
|
|
|
<el-tooltip placement="right" effect="light">
|
|
|
|
|
|
<pre slot="content" style="word-break: break-all">
|
|
|
|
|
|
{
|
|
|
|
|
|
"assetId": 1,
|
|
|
|
|
|
"dcId": 1,
|
|
|
|
|
|
"description": "The endpoint is down, the detailed information
|
|
|
|
|
|
Asset : 192.168.40.161, Project: system, Module: node_exporter,
|
|
|
|
|
|
Data center: center, EndpointId: 1",
|
|
|
|
|
|
"endAt": 1606240496000,
|
|
|
|
|
|
"endpointId": 1,
|
|
|
|
|
|
"hashKey": "34a17b57f289592a94ff65ee0864094b",
|
|
|
|
|
|
"id": 1,
|
|
|
|
|
|
"labels": "{\"severity\":\"P2\",\"endpoint\":\"1\",\"alertname\":\"1\",
|
|
|
|
|
|
\"module\":\"node_exporter\",\"project\":\"system\",\"datacenter\":
|
|
|
|
|
|
\"center\",\"asset\":\"192.168.40.161\"}",
|
|
|
|
|
|
"moduleId": 1,
|
|
|
|
|
|
"projectId": 1,
|
|
|
|
|
|
"ruleId": 1,
|
|
|
|
|
|
"severity": "P2",
|
|
|
|
|
|
"startAt": 1606009916000,
|
|
|
|
|
|
"state": 2,
|
|
|
|
|
|
"summary": "The endpoint is down, endpointId is 1"
|
|
|
|
|
|
}
|
|
|
|
|
|
</pre>
|
|
|
|
|
|
<span class="more">...</span>
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-11-19 18:20:31 +08:00
|
|
|
|
<div class="linkBox" >
|
|
|
|
|
|
<div class="linkTitle">
|
|
|
|
|
|
<span class="linkTitleHandle"></span>
|
|
|
|
|
|
<div class="linkTitleName">{{$t('config.system.notification.name')}}</div>
|
|
|
|
|
|
<div class="linkTitleUrl">{{$t('config.system.notification.filePath')}}</div>
|
|
|
|
|
|
<div class="linkTitleBtn">{{$t('config.system.notification.operation')}}</div>
|
|
|
|
|
|
</div>
|
2020-11-21 17:56:33 +08:00
|
|
|
|
<!--linkAdd-->
|
2020-11-19 18:20:31 +08:00
|
|
|
|
<div class="linkContent linkAddBox">
|
|
|
|
|
|
<span class="linkTitleHandle"></span>
|
|
|
|
|
|
<el-form :inline="true" :model="notificationTemp" label-width="180px" size="small" ref="notificationTempForm" :rules="notificationRules" :validate-on-rule-change="false" class="reset-form">
|
|
|
|
|
|
<el-form-item prop="name">
|
|
|
|
|
|
<el-input v-model="notificationTemp.name" class="linkName"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="filePath">
|
|
|
|
|
|
<el-input v-model="notificationTemp.filePath" class="linkUrl"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="btn">
|
2020-12-08 21:53:37 +08:00
|
|
|
|
<i @click="notificationAdd" class="nz-icon-create-square nz-icon" v-has="'system_notification_add'"></i>
|
2020-11-19 18:20:31 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
2020-11-21 17:56:33 +08:00
|
|
|
|
<!--notificationEdit-->
|
2020-12-14 20:25:24 +08:00
|
|
|
|
<div class="scrollBox">
|
2020-11-19 18:20:31 +08:00
|
|
|
|
<draggable v-model="notification"
|
|
|
|
|
|
:options="{group:'people',animation:150,ghostClass:'sortable-ghost',chosenClass:'chosenClass',scroll:true,scrollSensitivity:200}"
|
|
|
|
|
|
@change="change"
|
|
|
|
|
|
@start="start"
|
|
|
|
|
|
@end="notificationEnd"
|
|
|
|
|
|
:move="move"
|
|
|
|
|
|
handle=".handle"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div v-for="(item,index) in notification" class="linkContent" :id="'notificationDiv'+item.id">
|
|
|
|
|
|
<i class="nz-icon nz-icon-sort4 handle" style="display:none"></i>
|
|
|
|
|
|
<span style="display: inline-block;width: 26px"></span>
|
|
|
|
|
|
<el-form :inline="true" :model="notification[index]" :ref="'notificationForm'+item.id" label-width="180px" size="small" ref="resetForm" :rules="notificationRules" :validate-on-rule-change="false" class="reset-form" :key="index" v-if="item.isEdit" >
|
|
|
|
|
|
<el-form-item prop="name" class="linkName">
|
|
|
|
|
|
<el-input v-model="item.name" width="140px" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="filePath" class="linkUrl">
|
|
|
|
|
|
<el-input v-model="item.filePath" width="460px" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="btn">
|
2020-12-15 21:13:07 +08:00
|
|
|
|
<button @click="notificationUpdate(item)" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-normal-new" type="button" v-has="'system_notification_save'">Update</button>
|
2020-11-19 18:20:31 +08:00
|
|
|
|
<button type="button" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-light-new" @click="notificationCancel(item)">Cancel</button>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<div class="linkFormContent" v-else>
|
|
|
|
|
|
<div class="linkTitleName" :title="item.name">{{item.name}}</div>
|
|
|
|
|
|
<div class="linkTitleUrl">
|
2020-11-21 17:56:33 +08:00
|
|
|
|
<!--<span class="linkTitleUrlContent" @click="openUrl(item)" @dblclick.stop="linkEdit(item)">-->
|
|
|
|
|
|
<!--<el-tooltip class="item" effect="dark" :content="item.url" placement="top" popper-class="linkUrlTip">-->
|
2020-11-19 18:20:31 +08:00
|
|
|
|
<span>{{item.filePath}}</span>
|
2020-11-21 17:56:33 +08:00
|
|
|
|
<!--</el-tooltip>-->
|
|
|
|
|
|
<!--</span>-->
|
2020-11-19 18:20:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="linkFormBtn">
|
2020-12-15 21:13:07 +08:00
|
|
|
|
<i @click.stop="notificationEdit(item)" class="nz-icon nz-icon-edit" v-has="'system_notification_toEdit'"></i>
|
2020-12-08 21:53:37 +08:00
|
|
|
|
<i @click="notificationDel(item)" class="nz-icon nz-icon-delete" v-has="'system_notification_delete'"></i>
|
2020-11-19 18:20:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</draggable>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-11-21 17:56:33 +08:00
|
|
|
|
</el-tab-pane>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-tab-pane :label="$t('config.system.link.link')" name="link"><!--$t('config.system.reset.reset')-->
|
|
|
|
|
|
<div class="linkBox" >
|
|
|
|
|
|
<div class="linkTitle">
|
|
|
|
|
|
<span class="linkTitleHandle"></span>
|
|
|
|
|
|
<div class="linkTitleName">{{$t('config.system.link.name')}}</div>
|
|
|
|
|
|
<div class="linkTitleUrl">{{$t('config.system.link.url')}}</div>
|
|
|
|
|
|
<div class="linkTitleBtn">{{$t('config.system.link.operation')}}</div>
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<!--linkAdd-->
|
|
|
|
|
|
<div class="linkContent linkAddBox">
|
|
|
|
|
|
<span class="linkTitleHandle"></span>
|
|
|
|
|
|
<el-form :inline="true" :model="linkTemp" label-width="180px" size="small" ref="linkTempForm" :rules="linkRules" :validate-on-rule-change="false" class="reset-form">
|
|
|
|
|
|
<el-form-item prop="name">
|
|
|
|
|
|
<el-input v-model="linkTemp.name" class="linkName"/>
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</el-form-item>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form-item prop="url">
|
|
|
|
|
|
<el-input v-model="linkTemp.url" class="linkUrl"/>
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</el-form-item>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form-item prop="btn">
|
2020-12-08 21:53:37 +08:00
|
|
|
|
<i @click="linkAdd" class="nz-icon-create-square nz-icon" v-has="'system_link_add'"></i>
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<!--linkEdit-->
|
2020-12-14 20:25:24 +08:00
|
|
|
|
<div class="scrollBox">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<draggable v-model="link"
|
|
|
|
|
|
:options="{group:'people',animation:150,ghostClass:'sortable-ghost',chosenClass:'chosenClass',scroll:true,scrollSensitivity:200}"
|
|
|
|
|
|
@change="change"
|
|
|
|
|
|
@start="start"
|
|
|
|
|
|
@end="end"
|
|
|
|
|
|
:move="move"
|
|
|
|
|
|
handle=".handle"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div v-for="(item,index) in link" class="linkContent" :id="'linkDiv'+item.id">
|
|
|
|
|
|
<i class="nz-icon nz-icon-sort4 handle"></i>
|
|
|
|
|
|
<el-form :inline="true" :model="link[index]" :ref="'linkForm'+item.id" label-width="180px" size="small" ref="resetForm" :rules="linkRules" :validate-on-rule-change="false" class="reset-form" :key="index" v-if="item.isEdit" >
|
|
|
|
|
|
<el-form-item prop="name" class="linkName">
|
|
|
|
|
|
<el-input v-model="item.name" width="140px" />
|
2020-07-03 17:28:02 +08:00
|
|
|
|
</el-form-item>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form-item prop="url" class="linkUrl">
|
|
|
|
|
|
<el-input v-model="item.url" width="460px" />
|
2020-07-03 17:28:02 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="btn">
|
2020-12-15 21:13:07 +08:00
|
|
|
|
<button @click="linkUpdate(item)" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-normal-new" type="button" v-has="'system_link_save'">Update</button>
|
2020-10-27 16:22:29 +08:00
|
|
|
|
<button type="button" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-light-new" @click="linkCancel(item)">Cancel</button>
|
2020-07-03 17:28:02 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<div class="linkFormContent" v-else>
|
|
|
|
|
|
<div class="linkTitleName" :title="item.name">{{item.name}}</div>
|
|
|
|
|
|
<div class="linkTitleUrl">
|
2020-12-15 21:13:07 +08:00
|
|
|
|
<span @click="openUrl(item)" @dblclick.stop="linkEdit(item)" class="linkTitleUrlContent" v-has="'system_link_toEdit'">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<span>{{item.url}}</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="linkFormBtn">
|
2020-12-15 21:13:07 +08:00
|
|
|
|
<i @click.stop="linkEdit(item)" class="nz-icon nz-icon-edit" v-has="'system_link_toEdit'" v-if="item.buildIn=='0'"></i>
|
2020-12-08 21:53:37 +08:00
|
|
|
|
<i @click="linkDel(item)" class="nz-icon nz-icon-delete" v-has="'system_link_delete'" v-if="item.buildIn=='0'"></i>
|
2020-07-07 09:47:32 +08:00
|
|
|
|
</div>
|
2020-07-03 17:28:02 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</draggable>
|
2020-07-03 17:28:02 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane :label="$t('config.system.reset.reset')" name="reset">
|
|
|
|
|
|
<div class="system-config-form">
|
2020-10-16 16:11:50 +08:00
|
|
|
|
<el-form :model="reset" label-width="82px" size="small" ref="resetForm" :rules="resetRules" :validate-on-rule-change="false" class="reset-form">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<el-form-item prop="type">
|
2020-04-08 19:18:30 +08:00
|
|
|
|
<!-- <el-checkbox-group v-model="reset.type">-->
|
|
|
|
|
|
<!-- <div v-for="(item,index) in resetOptions" :key="item.value+index">-->
|
|
|
|
|
|
<!-- <el-checkbox :value="item.value" :label="item.label" :disabled="true" :checked="true"></el-checkbox>-->
|
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
<!-- </el-checkbox-group>-->
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<div class="el-checkbox-group">
|
|
|
|
|
|
<div v-for="(item,index) in resetOptions" :key="item.value+index" >
|
|
|
|
|
|
<label class="el-checkbox sys-reset-label" :for="item.value" >
|
2020-10-16 16:11:50 +08:00
|
|
|
|
<span class="el-checkbox__label" style="width: 100px;text-align: right;margin-right: 10px">{{item.label}}</span>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<span class="el-checkbox__input">
|
|
|
|
|
|
<input type="checkbox" name="resetType" :value="item.value" class="el-checkbox__original" aria-hidden="true" :id="item.value" @change="resetCheckBoxChange"/>
|
|
|
|
|
|
<span class="el-checkbox__inner"></span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</label>
|
2020-04-02 20:57:43 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2020-12-21 14:16:13 +08:00
|
|
|
|
<button @click="resetSys()" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" type="button" v-has="'system_reset_reset'" :disabled="prevent_opt.save" :class="{'nz-btn-disabled':prevent_opt.save}">{{$t('overall.reset')}}</button>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
</el-tabs>
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {positiveInteger} from '../../common/js/validate'
|
|
|
|
|
|
import {port} from '../../common/js/validate'
|
2020-05-11 17:27:53 +08:00
|
|
|
|
import {hostPlus} from '../../common/js/validate'
|
2020-03-31 20:08:33 +08:00
|
|
|
|
import {host} from '../../common/js/validate'
|
2020-04-09 16:14:32 +08:00
|
|
|
|
import {uSize} from '../../common/js/validate'
|
2020-04-06 22:11:25 +08:00
|
|
|
|
import bus from '../../../libs/bus';
|
2020-07-03 17:28:02 +08:00
|
|
|
|
import draggable from 'vuedraggable'
|
2020-03-30 21:09:34 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: "system",
|
2020-07-03 17:28:02 +08:00
|
|
|
|
components:{draggable},
|
2020-03-30 21:09:34 +08:00
|
|
|
|
data(){
|
|
|
|
|
|
return {
|
|
|
|
|
|
basic:{
|
|
|
|
|
|
alert_api:'',
|
2020-03-31 20:08:33 +08:00
|
|
|
|
asset_ping_switch:'on',//主机连通性检查开关,'on':开启,off:关闭
|
2020-03-30 21:09:34 +08:00
|
|
|
|
asset_ping_interval:null,//检查周期,单位:s
|
|
|
|
|
|
node_exporter_target_path:'',
|
|
|
|
|
|
scrape_interval:15,
|
|
|
|
|
|
storage_local_retention:15*24,
|
|
|
|
|
|
system_name:'',
|
|
|
|
|
|
current_site_url:'',
|
2020-04-07 22:30:36 +08:00
|
|
|
|
timezone:'',
|
2020-04-09 16:14:32 +08:00
|
|
|
|
default_cabinet_usize:'',
|
2020-11-20 11:19:25 +08:00
|
|
|
|
query_max_series:''
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
2020-04-17 18:58:38 +08:00
|
|
|
|
basicCopy:null,
|
2020-03-30 21:09:34 +08:00
|
|
|
|
basicRules:{
|
2020-04-01 11:12:15 +08:00
|
|
|
|
system_name:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
2020-10-19 18:33:18 +08:00
|
|
|
|
// node_exporter_target_path:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
2020-03-31 20:08:33 +08:00
|
|
|
|
alert_api:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:host,trigger: 'blur'}],
|
2020-03-30 21:09:34 +08:00
|
|
|
|
asset_ping_interval:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
|
|
|
|
|
|
scrape_interval:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
|
|
|
|
|
|
storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
|
2020-04-08 19:18:30 +08:00
|
|
|
|
timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}],
|
2020-10-12 09:43:36 +08:00
|
|
|
|
default_cabinet_usize:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}],
|
2020-11-19 18:20:31 +08:00
|
|
|
|
query_max_series:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
2020-03-31 20:08:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
basicRules2:{
|
2020-04-01 11:12:15 +08:00
|
|
|
|
system_name:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
2020-03-31 20:08:33 +08:00
|
|
|
|
node_exporter_target_path:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
|
|
|
|
|
alert_api:[{required:true,message:this.$t('validate.required'),trigger:'blur'},,{validator:host,trigger: 'blur'}],
|
|
|
|
|
|
scrape_interval:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
|
|
|
|
|
|
storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
|
2020-04-08 19:18:30 +08:00
|
|
|
|
timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}],
|
2020-04-09 16:14:32 +08:00
|
|
|
|
default_cabinet_usize:[{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}],
|
2020-11-19 18:20:31 +08:00
|
|
|
|
query_max_series:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
2020-04-08 19:18:30 +08:00
|
|
|
|
timezoneOption:[
|
|
|
|
|
|
{label:'UTC-12:00',value:'-12'},
|
|
|
|
|
|
{label:'UTC-11:00',value:'-11'},
|
|
|
|
|
|
{label:'UTC-10:00',value:'-10'},
|
|
|
|
|
|
{label:'UTC-09:00',value:'-9'},
|
|
|
|
|
|
{label:'UTC-08:00',value:'-8'},
|
|
|
|
|
|
{label:'UTC-07:00',value:'-7'},
|
|
|
|
|
|
{label:'UTC-06:00',value:'-6'},
|
|
|
|
|
|
{label:'UTC-05:00',value:'-5'},
|
|
|
|
|
|
{label:'UTC-04:00',value:'-4'},
|
|
|
|
|
|
{label:'UTC-03:00',value:'-3'},
|
|
|
|
|
|
{label:'UTC-02:00',value:'-2'},
|
|
|
|
|
|
{label:'UTC-01:00',value:'-1'},
|
|
|
|
|
|
{label:'UTC 00:00',value:'0'},
|
|
|
|
|
|
{label:'UTC+01:00',value:'1'},
|
|
|
|
|
|
{label:'UTC+02:00',value:'2'},
|
|
|
|
|
|
{label:'UTC+03:00',value:'3'},
|
|
|
|
|
|
{label:'UTC+04:00',value:'4'},
|
|
|
|
|
|
{label:'UTC+05:00',value:'5'},
|
|
|
|
|
|
{label:'UTC+06:00',value:'6'},
|
|
|
|
|
|
{label:'UTC+07:00',value:'7'},
|
|
|
|
|
|
{label:'UTC+08:00',value:'8'},
|
|
|
|
|
|
{label:'UTC+09:00',value:'9'},
|
|
|
|
|
|
{label:'UTC+10:00',value:'10'},
|
|
|
|
|
|
{label:'UTC+11:00',value:'11'},
|
|
|
|
|
|
{label:'UTC+12:00',value:'12'},
|
|
|
|
|
|
],
|
2020-03-30 21:09:34 +08:00
|
|
|
|
email:{
|
2020-03-31 20:08:33 +08:00
|
|
|
|
email_enable: 'on',
|
2020-03-30 21:09:34 +08:00
|
|
|
|
email_smtp_host: '',
|
|
|
|
|
|
email_smtp_port: 25,
|
|
|
|
|
|
email_smtp_account: "",
|
|
|
|
|
|
email_smtp_password: "",
|
|
|
|
|
|
email_send_account: "",
|
|
|
|
|
|
email_test_reciver: "",
|
2020-04-01 11:12:15 +08:00
|
|
|
|
email_ssl_flag: 'off',
|
|
|
|
|
|
email_tls_flag: 'off',
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
2020-04-17 18:58:38 +08:00
|
|
|
|
emailCopy:null,
|
2020-03-30 21:09:34 +08:00
|
|
|
|
emailRules:{
|
|
|
|
|
|
email_smtp_host: [
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'blur'},
|
2020-05-11 17:27:53 +08:00
|
|
|
|
{validator:hostPlus,trigger: 'blur'}
|
2020-03-30 21:09:34 +08:00
|
|
|
|
],
|
|
|
|
|
|
email_smtp_port: [
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'blur'},
|
|
|
|
|
|
{validator:port,trigger:'blur'}
|
|
|
|
|
|
],
|
|
|
|
|
|
email_smtp_account: [
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'blur'},
|
|
|
|
|
|
{ type: 'email', message: this.$t('validate.email'), trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
email_send_account:[{ type: 'email', message: this.$t('validate.email'), trigger: 'blur' }],
|
|
|
|
|
|
email_test_reciver: [{ type: 'email', message: this.$t('validate.email'), trigger: 'blur' }],
|
|
|
|
|
|
},
|
|
|
|
|
|
terminal:{
|
|
|
|
|
|
max_terminal_num:10
|
|
|
|
|
|
},
|
2020-04-17 18:58:38 +08:00
|
|
|
|
terminalCopy:null,
|
2020-03-30 21:09:34 +08:00
|
|
|
|
terminalRules:{
|
|
|
|
|
|
max_terminal_num:[
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'blur'},
|
|
|
|
|
|
{validator:positiveInteger,trigger:'blur'}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
ldap:{
|
|
|
|
|
|
ldap_address:'',
|
|
|
|
|
|
ldap_dn:'',
|
|
|
|
|
|
ldap_password:'',
|
|
|
|
|
|
ldap_ou:'',
|
|
|
|
|
|
ldap_user_filter:'',
|
|
|
|
|
|
ldap_mapping:'',
|
2020-03-31 20:08:33 +08:00
|
|
|
|
ldap_enable:'off',
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
2020-04-17 18:58:38 +08:00
|
|
|
|
ldapCopy:null,
|
2020-03-30 21:09:34 +08:00
|
|
|
|
ldapRules:{
|
|
|
|
|
|
ldap_address:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
|
|
|
|
|
ldap_user_filter:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
|
|
|
|
|
ldap_mapping:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
|
|
|
|
|
},
|
|
|
|
|
|
reset:{
|
2020-03-31 20:08:33 +08:00
|
|
|
|
type:[],
|
2020-03-30 21:09:34 +08:00
|
|
|
|
password:'',
|
|
|
|
|
|
},
|
2020-07-03 17:28:02 +08:00
|
|
|
|
linkTemp:{
|
|
|
|
|
|
name:'',url:''
|
|
|
|
|
|
},
|
|
|
|
|
|
link:[],
|
2020-07-07 09:47:32 +08:00
|
|
|
|
linkReserved:[],
|
|
|
|
|
|
linkRules:{
|
|
|
|
|
|
name:[
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
|
|
|
|
|
{ max: 64, message: this.$t('config.system.link.nameMaxLength'), trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
url:[
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
2020-07-22 16:33:53 +08:00
|
|
|
|
// { type: 'url', message: this.$t('config.system.link.uriRequired'), trigger: 'blur' } /*检验网址是否正确*/
|
2020-07-07 09:47:32 +08:00
|
|
|
|
]
|
|
|
|
|
|
},
|
2020-11-19 18:20:31 +08:00
|
|
|
|
notificationTemp:{
|
|
|
|
|
|
name:'',filePath:''
|
|
|
|
|
|
},
|
|
|
|
|
|
notification:[],
|
|
|
|
|
|
notificationReserved:[],
|
|
|
|
|
|
notificationRules:{
|
|
|
|
|
|
name:[
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
|
|
|
|
|
{ max: 64, message: this.$t('config.system.link.nameMaxLength'), trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
filePath:[
|
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
2020-11-22 16:51:30 +08:00
|
|
|
|
{ pattern: /^\/(.*\.*.+\/?)+$/, message: this.$t('config.system.notification.filePathReg') }
|
2020-11-19 18:20:31 +08:00
|
|
|
|
// { type: 'url', message: this.$t('config.system.link.uriRequired'), trigger: 'blur' } /*检验网址是否正确*/
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
2020-03-30 21:09:34 +08:00
|
|
|
|
resetRules:{
|
|
|
|
|
|
type:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
|
|
|
|
|
password:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
|
|
|
|
|
|
},
|
|
|
|
|
|
resetOptions:[
|
|
|
|
|
|
{
|
|
|
|
|
|
label:this.$t('config.system.reset.metric'),
|
|
|
|
|
|
value:'metric',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label:this.$t('config.system.reset.alert'),
|
|
|
|
|
|
value:'alert',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label:this.$t('config.system.reset.sysConfig'),
|
2020-04-17 15:54:35 +08:00
|
|
|
|
value:'sysconfig',
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
|
|
|
|
|
],
|
2020-07-07 09:47:32 +08:00
|
|
|
|
activeTab:'basic'
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods:{
|
|
|
|
|
|
selectTab:function(tab){
|
|
|
|
|
|
this.querySetInfo(tab.name)
|
|
|
|
|
|
},
|
2020-07-03 17:28:02 +08:00
|
|
|
|
querySetInfo:function(type){ // 切换tab
|
2020-03-30 21:09:34 +08:00
|
|
|
|
if(!type){
|
|
|
|
|
|
console.error('type is required')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
if(type == 'reset'){
|
|
|
|
|
|
return ;
|
|
|
|
|
|
}
|
2020-07-03 17:28:02 +08:00
|
|
|
|
if(type == 'link'){
|
2020-07-07 09:47:32 +08:00
|
|
|
|
this.getLinkData();
|
2020-07-03 17:28:02 +08:00
|
|
|
|
return
|
|
|
|
|
|
}
|
2020-11-19 18:20:31 +08:00
|
|
|
|
if(type == 'notification'){
|
|
|
|
|
|
this.getNotificationData();
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2020-03-30 21:09:34 +08:00
|
|
|
|
this.$get('sysConfig?type='+type).then(response=>{
|
|
|
|
|
|
if(response.code == 200){
|
|
|
|
|
|
let sets=response.data[type];
|
|
|
|
|
|
for(let key in sets){
|
|
|
|
|
|
this[type][key]=sets[key];
|
|
|
|
|
|
}
|
2020-04-21 18:48:09 +08:00
|
|
|
|
if(type == 'basic'){
|
|
|
|
|
|
localStorage.setItem('nz-sys-name',this.basic.system_name);
|
|
|
|
|
|
localStorage.setItem('nz-sys-timezone',this.basic.timezone);
|
|
|
|
|
|
localStorage.setItem('nz-sys-asset-ping-switch',this.basic.asset_ping_switch);
|
|
|
|
|
|
localStorage.setItem('nz-sys-default-cabinet-usize',this.basic.default_cabinet_usize);
|
|
|
|
|
|
}else if(type == 'terminal'){
|
|
|
|
|
|
localStorage.setItem('nz-sys-max-terminal-num',this.terminal.max_terminal_num);
|
|
|
|
|
|
}
|
2020-04-15 19:40:09 +08:00
|
|
|
|
if(type == 'email'){
|
|
|
|
|
|
this.$refs.emailForm.clearValidate();
|
|
|
|
|
|
}
|
2020-04-17 18:58:38 +08:00
|
|
|
|
this[type+"Copy"]=Object.assign({},this[type])
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
saveSetInfo:function(type,formName){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.save){ return } ;
|
|
|
|
|
|
this.prevent_opt.save=true;
|
2020-03-30 21:09:34 +08:00
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
let param={};
|
2020-04-01 11:12:15 +08:00
|
|
|
|
param[type]=Object.assign({},this[type]);
|
|
|
|
|
|
this.$set(param[type],'test','false')
|
|
|
|
|
|
let postParam=Object.assign({},param);
|
|
|
|
|
|
for (let key in postParam[type]){
|
|
|
|
|
|
postParam[type][key]=postParam[type][key]+'';
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$put('/sysConfig',postParam).then(response=>{
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-03-30 21:09:34 +08:00
|
|
|
|
if(response.code == 200){
|
2020-03-31 20:08:33 +08:00
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
2020-05-11 17:27:53 +08:00
|
|
|
|
// this.resetForm(formName);
|
2020-04-21 18:48:09 +08:00
|
|
|
|
setTimeout(()=> {
|
2020-03-30 21:09:34 +08:00
|
|
|
|
this.querySetInfo(type);
|
|
|
|
|
|
},200)
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2020-12-21 14:16:13 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
this.prevent_opt.save=true;
|
|
|
|
|
|
return false
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-03-31 20:08:33 +08:00
|
|
|
|
testSetInfo:function(type,formName){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.save){ return } ;
|
|
|
|
|
|
this.prevent_opt.save=true;
|
2020-03-31 20:08:33 +08:00
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2020-04-01 11:12:15 +08:00
|
|
|
|
let param={};
|
|
|
|
|
|
param[type]=Object.assign({},this[type]);
|
|
|
|
|
|
this.$set(param[type],'test','true')
|
|
|
|
|
|
let postParam=Object.assign({},param);
|
|
|
|
|
|
for (let key in postParam[type]){
|
|
|
|
|
|
postParam[type][key]=postParam[type][key]+'';
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$put('/sysConfig',postParam).then(response=>{
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-03-30 21:09:34 +08:00
|
|
|
|
if(response.code == 200){
|
2020-04-01 11:12:15 +08:00
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.testSuccess")});
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2020-12-21 14:16:13 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
this.prevent_opt.save=false;
|
|
|
|
|
|
return false
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}
|
2020-03-31 20:08:33 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
resetSys:function(){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.save){ return } ;
|
|
|
|
|
|
this.prevent_opt.save=true;
|
2020-04-01 21:45:05 +08:00
|
|
|
|
let $temp=this;
|
2020-03-31 20:08:33 +08:00
|
|
|
|
this.$prompt(this.$t('config.system.reset.pwdTip'), this.$t('config.system.reset.promptTitle'), {
|
|
|
|
|
|
confirmButtonText: this.$t('config.system.reset.yes'),
|
|
|
|
|
|
cancelButtonText: this.$t('config.system.reset.no'),
|
|
|
|
|
|
inputType:'password',
|
|
|
|
|
|
}).then(({ value }) => {
|
2020-04-01 21:45:05 +08:00
|
|
|
|
$temp.reset.password=value
|
|
|
|
|
|
$temp.$refs['resetForm'].validate(valid=>{
|
2020-03-31 20:08:33 +08:00
|
|
|
|
if(valid){
|
2020-04-01 21:45:05 +08:00
|
|
|
|
$temp.$put('/sysConfig/reset',$temp.reset).then(response=>{
|
2020-12-21 14:16:13 +08:00
|
|
|
|
$temp.prevent_opt.save=false;
|
2020-03-31 20:08:33 +08:00
|
|
|
|
if(response.code == 200){
|
2020-04-01 21:45:05 +08:00
|
|
|
|
$temp.$message({duration: 2000, type: 'success', message: this.$t("tip.resetSuccess")});
|
2020-03-31 20:08:33 +08:00
|
|
|
|
}else{
|
2020-04-01 21:45:05 +08:00
|
|
|
|
$temp.$message.error(response.msg);
|
2020-03-31 20:08:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2020-12-21 14:16:13 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
$temp.prevent_opt.save=false;
|
2020-03-31 20:08:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
|
|
|
|
});
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
2020-04-17 18:58:38 +08:00
|
|
|
|
resetForm(formName,type){
|
2020-03-30 21:09:34 +08:00
|
|
|
|
this.$refs[formName].resetFields();
|
2020-04-17 18:58:38 +08:00
|
|
|
|
this[type]=Object.assign({},this[type+"Copy"]);
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
2020-04-02 20:57:43 +08:00
|
|
|
|
switchChange:function(formName){
|
|
|
|
|
|
let $temp=this;
|
|
|
|
|
|
$temp.$refs[formName].clearValidate();
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
|
$temp.$refs[formName].validate();
|
|
|
|
|
|
},100)
|
|
|
|
|
|
},
|
|
|
|
|
|
resetCheckBoxChange:function(e){
|
|
|
|
|
|
if(e.target.checked == true ){
|
|
|
|
|
|
this.reset.type.push(e.target.value)
|
|
|
|
|
|
}else{
|
|
|
|
|
|
let index = this.reset.type.indexOf(e.target.value);
|
|
|
|
|
|
this.reset.type.splice(index,1);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-03-30 21:09:34 +08:00
|
|
|
|
jumpTo(data, id) {
|
2020-04-06 22:11:25 +08:00
|
|
|
|
bus.$emit("menu-change", data);
|
2020-03-30 21:09:34 +08:00
|
|
|
|
this.$router.push({
|
|
|
|
|
|
path: "/" + data,
|
|
|
|
|
|
query: {
|
|
|
|
|
|
t: +new Date()
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-07-03 17:28:02 +08:00
|
|
|
|
// link 移动
|
|
|
|
|
|
change: function (evt) {
|
|
|
|
|
|
// console.log(evt)
|
|
|
|
|
|
},
|
|
|
|
|
|
//start ,end ,add,update, sort, remove 得到的都差不多
|
|
|
|
|
|
start: function (evt) {
|
|
|
|
|
|
// console.log(evt)
|
|
|
|
|
|
},
|
2020-11-19 18:20:31 +08:00
|
|
|
|
notificationEnd: function (evt) {
|
|
|
|
|
|
let length=this.notification.length;
|
|
|
|
|
|
if(evt.newIndex==evt.oldIndex){ // 如果没有移动返回
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
let parmas={
|
|
|
|
|
|
id:this.notification[evt.newIndex].id,
|
|
|
|
|
|
prev:0,
|
|
|
|
|
|
next:-1
|
|
|
|
|
|
}
|
|
|
|
|
|
if(evt.newIndex==length-1){
|
|
|
|
|
|
parmas.prev=this.notification[evt.newIndex-1].id;
|
|
|
|
|
|
}else if(evt.newIndex==0){
|
|
|
|
|
|
parmas.next=this.notification[evt.newIndex+1].id;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
parmas.prev=this.notification[evt.newIndex-1].id;
|
|
|
|
|
|
parmas.next=this.notification[evt.newIndex+1].id;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$put('/alert/script/modify',parmas).then((response)=>{
|
|
|
|
|
|
// this.$store.commit('setLinkData',this.link);
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2020-07-03 17:28:02 +08:00
|
|
|
|
end: function (evt) {
|
2020-07-07 09:47:32 +08:00
|
|
|
|
let length=this.link.length;
|
|
|
|
|
|
if(evt.newIndex==evt.oldIndex){ // 如果没有移动返回
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
let parmas={
|
|
|
|
|
|
id:this.link[evt.newIndex].id,
|
|
|
|
|
|
prev:0,
|
|
|
|
|
|
next:-1
|
|
|
|
|
|
}
|
|
|
|
|
|
if(evt.newIndex==length-1){
|
|
|
|
|
|
parmas.prev=this.link[evt.newIndex-1].id;
|
|
|
|
|
|
}else if(evt.newIndex==0){
|
|
|
|
|
|
parmas.next=this.link[evt.newIndex+1].id;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
parmas.prev=this.link[evt.newIndex-1].id;
|
|
|
|
|
|
parmas.next=this.link[evt.newIndex+1].id;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$put('/link/modify',parmas).then((response)=>{
|
|
|
|
|
|
this.$store.commit('setLinkData',this.link);
|
|
|
|
|
|
})
|
2020-07-03 17:28:02 +08:00
|
|
|
|
},
|
|
|
|
|
|
move: function (evt, originalEvent) {
|
|
|
|
|
|
// console.log(evt)
|
|
|
|
|
|
// console.log(originalEvent) //鼠标位置
|
|
|
|
|
|
},
|
2020-07-07 09:47:32 +08:00
|
|
|
|
getLinkData(){
|
|
|
|
|
|
this.linkTemp={name:'',url:''};
|
|
|
|
|
|
this.$refs['linkTempForm'].clearValidate();
|
|
|
|
|
|
this.$get('/link').then(response=>{
|
|
|
|
|
|
this.link=response.data;
|
|
|
|
|
|
this.linkReserved=[...this.link];
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-07-03 17:28:02 +08:00
|
|
|
|
// link add
|
2020-07-07 09:47:32 +08:00
|
|
|
|
linkAdd(){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.save){ return } ;
|
|
|
|
|
|
this.prevent_opt.save=true;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
this.$refs['linkTempForm'].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
this.$post('/link',this.linkTemp).then(response=>{//新增link
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
if(response.code == 200){
|
|
|
|
|
|
this.linkTemp={name:'',url:''};
|
|
|
|
|
|
this.linkAddCallBack();
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.addSuccess")});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
linkAddCallBack(){
|
|
|
|
|
|
this.$get('/link').then(response=>{
|
|
|
|
|
|
this.link.push(response.data[response.data.length-1]);
|
|
|
|
|
|
this.linkReserved.push(response.data[response.data.length-1]);
|
|
|
|
|
|
this.$store.commit('setLinkData',this.link);
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-07-03 17:28:02 +08:00
|
|
|
|
// link edit
|
|
|
|
|
|
linkEdit(item){
|
|
|
|
|
|
let index=this.link.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
this.$set(this.link,index,{...this.link[index],isEdit:true});
|
|
|
|
|
|
},
|
|
|
|
|
|
// link update
|
2020-07-07 09:47:32 +08:00
|
|
|
|
linkUpdate(item){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.save){ return } ;
|
|
|
|
|
|
this.prevent_opt.save=true;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
this.$refs['linkForm'+item.id][0].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2020-07-07 16:33:16 +08:00
|
|
|
|
let params={
|
|
|
|
|
|
id:item.id,
|
|
|
|
|
|
name:item.name,
|
|
|
|
|
|
url:item.url,
|
|
|
|
|
|
};
|
|
|
|
|
|
this.$put('/link',params).then(response=>{
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
if(response.code == 200){
|
|
|
|
|
|
let index=this.link.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
this.$set(this.link,index,{...this.link[index],isEdit:false});
|
2020-07-07 16:56:47 +08:00
|
|
|
|
this.linkReserved=[...this.link];
|
2020-07-07 09:47:32 +08:00
|
|
|
|
this.$store.commit('setLinkData',this.link);
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// link cancel
|
|
|
|
|
|
linkCancel(item){
|
|
|
|
|
|
let index=this.link.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
let indexReserved=this.linkReserved.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
this.$set(this.link,index,{...this.linkReserved[indexReserved],isEdit:false});
|
|
|
|
|
|
},
|
2020-07-03 17:28:02 +08:00
|
|
|
|
// link del
|
2020-07-07 09:47:32 +08:00
|
|
|
|
linkDel(item){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.query){ return } ;
|
|
|
|
|
|
this.prevent_opt.query=true;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
this.$delete('/link?ids='+item.id).then((response)=>{
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.query=false;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
if(response.code == 200){
|
|
|
|
|
|
this.link=this.link.filter((item1)=>item.id!==item1.id);
|
|
|
|
|
|
this.linkReserved=this.linkReserved.filter((item1)=>item.id!==item1.id);
|
|
|
|
|
|
this.$store.commit('setLinkData',this.link);
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-11-19 18:20:31 +08:00
|
|
|
|
|
|
|
|
|
|
getNotificationData(){
|
|
|
|
|
|
this.notificationTemp={name:'',filePath:''};
|
|
|
|
|
|
this.$refs['notificationTempForm'].clearValidate();
|
|
|
|
|
|
this.$get('/alert/script').then(response=>{
|
|
|
|
|
|
this.notification=response.data.list;
|
|
|
|
|
|
this.notificationReserved=[...this.notification];
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// link add
|
|
|
|
|
|
notificationAdd(){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.save){ return } ;
|
|
|
|
|
|
this.prevent_opt.save=true;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
this.$refs['notificationTempForm'].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.$post('/alert/script',this.notificationTemp).then(response=>{//新增notification
|
|
|
|
|
|
this.prevent_opt.save=false;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
if(response.code == 200){
|
|
|
|
|
|
this.notificationTemp={name:'',filePath:''};
|
|
|
|
|
|
this.notificationAddCallBack();
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.addSuccess")});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
notificationAddCallBack(){
|
2020-12-01 17:57:47 +08:00
|
|
|
|
this.$get('/alert/script').then(response=>{
|
|
|
|
|
|
this.notification.push(response.data.list[response.data.list.length-1]);
|
|
|
|
|
|
this.notificationReserved.push(response.data.list[response.data.list.length-1]);
|
2020-11-19 18:20:31 +08:00
|
|
|
|
// this.$store.commit('setLinkData',this.link);
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// link edit
|
|
|
|
|
|
notificationEdit(item){
|
|
|
|
|
|
let index=this.notification.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
this.$set(this.notification,index,{...this.notification[index],isEdit:true});
|
|
|
|
|
|
},
|
|
|
|
|
|
// link update
|
|
|
|
|
|
notificationUpdate(item){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.save){ return } ;
|
|
|
|
|
|
this.prevent_opt.save=true;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
this.$refs['notificationForm'+item.id][0].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
let params={
|
|
|
|
|
|
id:item.id,
|
|
|
|
|
|
name:item.name,
|
|
|
|
|
|
filePath:item.filePath,
|
|
|
|
|
|
};
|
|
|
|
|
|
this.$put('/alert/script',params).then(response=>{
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
if(response.code == 200){
|
|
|
|
|
|
let index=this.notification.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
this.$set(this.notification,index,{...this.notification[index],isEdit:false});
|
|
|
|
|
|
this.notificationReserved=[...this.notification];
|
|
|
|
|
|
// this.$store.commit('setLinkData',this.notification);
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.save=false;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// link cancel
|
|
|
|
|
|
notificationCancel(item){
|
|
|
|
|
|
let index=this.notification.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
let indexReserved=this.notificationReserved.findIndex((item1)=>item.id==item1.id);
|
|
|
|
|
|
this.$set(this.notification,index,{...this.notificationReserved[indexReserved],isEdit:false});
|
|
|
|
|
|
},
|
|
|
|
|
|
// link del
|
|
|
|
|
|
notificationDel(item){
|
2020-12-21 14:16:13 +08:00
|
|
|
|
if(this.prevent_opt.query){ return } ;
|
|
|
|
|
|
this.prevent_opt.query=true;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
this.$delete('/alert/script?ids='+item.id).then((response)=>{
|
2020-12-21 14:16:13 +08:00
|
|
|
|
this.prevent_opt.query=false;
|
2020-11-19 18:20:31 +08:00
|
|
|
|
if(response.code == 200){
|
|
|
|
|
|
this.notification=this.notification.filter((item1)=>item.id!==item1.id);
|
|
|
|
|
|
this.notificationReserved=this.notificationReserved.filter((item1)=>item.id!==item1.id);
|
|
|
|
|
|
// this.$store.commit('setLinkData',this.link);
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-07-07 09:47:32 +08:00
|
|
|
|
//openUrl 跳转页面
|
|
|
|
|
|
openUrl(item){
|
2020-07-07 13:43:33 +08:00
|
|
|
|
// window.open(item.url)
|
2020-07-07 09:47:32 +08:00
|
|
|
|
}
|
2020-03-30 21:09:34 +08:00
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
2020-07-03 17:28:02 +08:00
|
|
|
|
this.querySetInfo('basic');
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.system{
|
|
|
|
|
|
height: 100%;
|
2020-08-27 17:05:10 +08:00
|
|
|
|
position: relative;
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
.system-config-form{
|
|
|
|
|
|
width: 61.8% !important;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
2020-07-03 17:28:02 +08:00
|
|
|
|
.linkBox{
|
2020-08-27 17:05:10 +08:00
|
|
|
|
max-height: 800px;
|
2020-07-03 17:28:02 +08:00
|
|
|
|
width: 800px;
|
|
|
|
|
|
}
|
2020-07-07 09:47:32 +08:00
|
|
|
|
.scrollBox{
|
|
|
|
|
|
position: relative;
|
2020-08-06 16:13:04 +08:00
|
|
|
|
height: 600px;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
}
|
2020-07-03 17:28:02 +08:00
|
|
|
|
.linkTitle{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items:center;
|
|
|
|
|
|
border-bottom: 2px solid #dfe1e6;
|
|
|
|
|
|
color: #6b778c;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
line-height: 24px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.handle{
|
|
|
|
|
|
cursor: move !important;
|
|
|
|
|
|
padding:0 5px;
|
|
|
|
|
|
line-height: 34px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkBtn{
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
line-height: 0px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkTitleHandle{
|
|
|
|
|
|
padding: 0 13px;
|
|
|
|
|
|
}
|
2020-07-07 09:47:32 +08:00
|
|
|
|
.linkAddBox{
|
2020-07-03 17:28:02 +08:00
|
|
|
|
display: flex;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
padding: 10px 0px;
|
2020-07-03 17:28:02 +08:00
|
|
|
|
border-bottom: 1px solid #dfe1e6;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
line-height: 34px;
|
|
|
|
|
|
}
|
2020-07-07 09:47:32 +08:00
|
|
|
|
.linkContent{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
padding: 10px 0px;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
line-height: 34px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkContent:not(:last-child){
|
|
|
|
|
|
border-bottom: 1px solid #dfe1e6;
|
|
|
|
|
|
}
|
2020-07-03 17:28:02 +08:00
|
|
|
|
.linkFormContent{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
line-height: 34px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkTitleName{
|
|
|
|
|
|
width: 100px;
|
|
|
|
|
|
margin-right: 12px;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
height: 31px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkTitleUrl{
|
2020-07-07 09:47:32 +08:00
|
|
|
|
width: 462px;
|
2020-07-03 17:28:02 +08:00
|
|
|
|
margin-right: 12px;
|
|
|
|
|
|
height: 31px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkTitleUrlContent{
|
|
|
|
|
|
display: inline-block;
|
2020-07-07 13:56:23 +08:00
|
|
|
|
width: 460px;
|
2020-07-03 17:28:02 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
height: 31px;
|
2020-07-07 09:47:32 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
outline: none;
|
|
|
|
|
|
}
|
2020-07-07 13:56:23 +08:00
|
|
|
|
.linkFormBtn .nz-icon-delete{
|
2020-07-07 13:43:33 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
color: #ee6723;
|
2020-07-07 13:56:23 +08:00
|
|
|
|
margin-left: 10px;
|
2020-07-03 17:28:02 +08:00
|
|
|
|
}
|
2020-07-07 13:43:33 +08:00
|
|
|
|
/*.linkTitleUrlContent:hover{*/
|
|
|
|
|
|
/*text-decoration:underline;*/
|
|
|
|
|
|
/*}*/
|
2020-07-07 13:56:23 +08:00
|
|
|
|
.linkFormBtn .nz-icon-edit{
|
|
|
|
|
|
font-size: 14px;
|
2020-07-03 17:28:02 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
2020-07-07 13:43:33 +08:00
|
|
|
|
.nz-icon-create-square{
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
}
|
2020-07-07 09:47:32 +08:00
|
|
|
|
/deep/ .el-form-item--small .el-form-item__error{
|
|
|
|
|
|
padding-top: 0px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkUrlTip{
|
|
|
|
|
|
width: 430px;
|
|
|
|
|
|
}
|
2020-10-16 18:11:53 +08:00
|
|
|
|
.system-config-form.terminal /deep/ .el-input-number--small{
|
|
|
|
|
|
width: 512px;
|
|
|
|
|
|
}
|
2020-11-19 18:20:31 +08:00
|
|
|
|
.system-config-form.basicForm /deep/ .el-input-number--small{
|
|
|
|
|
|
width: 512px;
|
|
|
|
|
|
}
|
2020-10-16 18:11:53 +08:00
|
|
|
|
.system-config-form /deep/ .el-input input{
|
|
|
|
|
|
text-align: left;
|
|
|
|
|
|
}
|
2020-11-25 11:54:22 +08:00
|
|
|
|
.notificationMessage{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
width: 780px;
|
|
|
|
|
|
background: #F6F6F6;
|
|
|
|
|
|
color: #999999;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
padding: 10px 10px 5px 10px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
justify-content: left;
|
|
|
|
|
|
justify-items: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.notificationMessage .more{
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
|
|
|
.system-config-form .el-form-item__content{
|
|
|
|
|
|
width: 512px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.system-config-form .el-input{
|
2020-10-16 18:11:53 +08:00
|
|
|
|
width:512px;
|
|
|
|
|
|
text-align: left;
|
2020-03-30 21:09:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
.system-config-form .el-input__inner{
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
|
width: 512px;
|
|
|
|
|
|
}
|
2020-04-02 20:57:43 +08:00
|
|
|
|
.system-tabs .el-tabs--border-card{
|
|
|
|
|
|
webkit-box-shadow: unset !important;
|
|
|
|
|
|
box-shadow: unset !important;
|
2020-04-08 19:18:30 +08:00
|
|
|
|
height: 100%;
|
2020-04-09 16:14:32 +08:00
|
|
|
|
width: 100%;
|
2020-04-08 19:18:30 +08:00
|
|
|
|
border-bottom: unset;
|
2020-04-09 16:14:32 +08:00
|
|
|
|
border-left: unset;
|
2020-04-02 20:57:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
.sys-reset-label .el-checkbox__original:checked + span{
|
|
|
|
|
|
background-color: orange;
|
|
|
|
|
|
}
|
|
|
|
|
|
.sys-reset-label .el-checkbox__original:checked + span:after{
|
|
|
|
|
|
-webkit-transform: rotate(45deg) scaleY(1);
|
|
|
|
|
|
transform: rotate(45deg) scaleY(1);
|
|
|
|
|
|
}
|
2020-04-09 16:14:32 +08:00
|
|
|
|
.reset-form .el-checkbox-group{
|
|
|
|
|
|
margin-left: -28px !important;
|
|
|
|
|
|
}
|
2020-07-03 17:28:02 +08:00
|
|
|
|
.linkBox .el-input--small .el-input__inner{
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkName .el-input__inner{
|
|
|
|
|
|
width: 100px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkUrl .el-input__inner{
|
|
|
|
|
|
width: 460px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkBox .el-form-item--mini.el-form-item, .linkBox .el-form-item--small.el-form-item{
|
|
|
|
|
|
margin-bottom: 0px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.linkBox .el-form--inline{
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
}
|
2020-11-25 11:54:22 +08:00
|
|
|
|
|
2020-03-30 21:09:34 +08:00
|
|
|
|
</style>
|