feat:system 修改
This commit is contained in:
@@ -901,7 +901,11 @@ const cn = {
|
||||
lat: '纬度',
|
||||
lng: '经度',
|
||||
zoom: '缩放',
|
||||
lnglat: '坐标'
|
||||
lnglat: '坐标',
|
||||
sysLogo:'系统Logo',
|
||||
scrapeTimeout:"Scrape timeout",
|
||||
snmpTrapPort:"SNMP trap端口",
|
||||
logoTip:'Logo支持格式为jpg、jpeg、png且大小小于2M的图片'
|
||||
},
|
||||
email: {
|
||||
email: '邮件',
|
||||
@@ -911,6 +915,7 @@ const cn = {
|
||||
smtpAccount: 'SMTP账号',
|
||||
smtpPwd: 'SMTP密码',
|
||||
sendAccount: '发送账号',
|
||||
timeout:"超时时间",
|
||||
testAccount: '测试账号',
|
||||
useSSL: 'SSL',
|
||||
useTLS: 'TLS',
|
||||
@@ -919,11 +924,16 @@ const cn = {
|
||||
sendAccountTip: '提示:发送邮件账号,默认使用SMTP账号作为发送账号',
|
||||
testAccountTip: '提示:仅用来作为测试邮件收件人',
|
||||
sslTip: '如果SMTP端口是465,通常需要启用SSL',
|
||||
tlsTip: '如果SMTP端口是587,通常需要启用TLS'
|
||||
tlsTip: '如果SMTP端口是587,通常需要启用TLS',
|
||||
securityType: '安全协议'
|
||||
},
|
||||
terminal: {
|
||||
terminal: '终端',
|
||||
terminalNum: '最大终端数量'
|
||||
terminalNum: '最大终端数量',
|
||||
timeout:"超时时间",
|
||||
userTip:"Telnet user prompt",
|
||||
pinTip:"Ternet password prompt",
|
||||
localRetention:"本地存储",
|
||||
},
|
||||
ldap: {
|
||||
ldap: 'LDAP',
|
||||
@@ -936,7 +946,8 @@ const cn = {
|
||||
filterTip: '可能的选项是(cn或uid或sAMAccountName=%(user)s)',
|
||||
map: '属性映射',
|
||||
mapTip: '属性映射代表怎样将NEZHA用户属性映射到jumpserver用户上;username,email是jumpserver的属性',
|
||||
active: '启用LDAP认证'
|
||||
active: '启用LDAP认证',
|
||||
timeout:"超时时间"
|
||||
},
|
||||
link: {
|
||||
link: 'Link',
|
||||
|
||||
@@ -951,7 +951,8 @@ const en = {
|
||||
filterTip: 'The possible options are: (cn or uid or sAMAccountName=%(user)s)',
|
||||
map: 'Attribute mapping',
|
||||
mapTip: 'Attribute mapping represents how to map LDAP user attributes to NEZHA users; username,email are the attributes of NEZHA',
|
||||
active: 'LDAP authentication'
|
||||
active: 'LDAP authentication',
|
||||
timeout:"Timeout"
|
||||
},
|
||||
link: {
|
||||
link: 'Link',
|
||||
@@ -971,7 +972,7 @@ const en = {
|
||||
filePath: 'File path',
|
||||
operation: 'Operation',
|
||||
account: 'Account',
|
||||
state: 'State',
|
||||
state: 'Enable',
|
||||
buildIn: 'Build in',
|
||||
add: 'Add',
|
||||
update: 'Update',
|
||||
@@ -1000,7 +1001,8 @@ const en = {
|
||||
role: 'Role',
|
||||
create: 'Creator',
|
||||
creatAt: 'Create at',
|
||||
expireAt: 'Expire at'
|
||||
expireAt: 'Expire at',
|
||||
noExpire: 'No expiration date',
|
||||
}
|
||||
},
|
||||
assetType: {
|
||||
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
this.license.warnInfo = ''
|
||||
this.license.valid = true
|
||||
} else {
|
||||
this.license.valid = true
|
||||
this.license.valid = false
|
||||
this.license.warnInfo = response.msg
|
||||
}
|
||||
this.license.token = response.token
|
||||
|
||||
@@ -173,10 +173,11 @@ export default {
|
||||
label: 'Centos',
|
||||
name: 'centos'
|
||||
},
|
||||
{
|
||||
label: 'Ubuntu',
|
||||
name: 'ubuntu'
|
||||
}],
|
||||
// {
|
||||
// label: 'Ubuntu',
|
||||
// name: 'ubuntu'
|
||||
// }
|
||||
],
|
||||
agentParam: {
|
||||
osType: 'centos',
|
||||
dc: '',
|
||||
@@ -188,6 +189,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toDownloadAgent: function () {
|
||||
this.getAllDc();
|
||||
this.showAgentDownload = true
|
||||
this.token = sessionStorage.getItem('nz-token')
|
||||
axios.get('/healthy').then(response => {
|
||||
@@ -275,7 +277,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getAllDc()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -52,11 +52,11 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.basic.timezone')" prop="timezone">
|
||||
<!-- <el-input v-model.number="basic.timezone" ></el-input>-->
|
||||
<el-select v-model="basic.timezone" id="system-baisc-timezone" >
|
||||
<el-select v-model="basic.timezone" id="system-baisc-timezone" filterable>
|
||||
<el-option v-for="(item,index) in timezoneOption" :key="index" :label="item.name" :value="item.name" >
|
||||
<div style="display: flex;justify-content: space-between;padding: 5px;">
|
||||
<div >{{item.name}}</div>
|
||||
<div >UTC{{item.offset>=0?'+'+(item.offset/1000/60/60):'-'+(item.offset/1000/60/60)}}</div>
|
||||
<div >{{timezoneOptionHandler(item.offset)}}</div>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -79,7 +79,7 @@
|
||||
<button id="system-basic-save" @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>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div v->
|
||||
</div >
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('config.system.email.email')" name="email" >
|
||||
<div class="system-config-form" v-if="activeTab === 'email'">
|
||||
@@ -132,7 +132,9 @@
|
||||
<div class="system-config-form terminal" v-if="activeTab === 'terminal'">
|
||||
<el-form :model="terminal" label-width="180px" size="small" ref="terminalForm" :rules="terminalRules">
|
||||
<el-form-item :label="$t('config.system.terminal.timeout')" prop="terminal_timeout">
|
||||
<el-input-number v-model="terminal.terminal_timeout" controls-position="right" :min="1" id="system-terminal-max_terminal_num"></el-input-number>
|
||||
<el-input v-model="terminal.terminal_timeout" controls-position="right" :min="1" id="system-terminal-max_terminal_num">
|
||||
<template slot="append"><span >{{$t('config.system.basic.second')}}</span></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.terminal.userTip')" prop="terminal_telnet_user_tip">
|
||||
<el-input id="system-terminal-user-tip" v-model="terminal.terminal_telnet_user_tip"></el-input>
|
||||
@@ -141,7 +143,9 @@
|
||||
<el-input id="system-terminal_telnet_pin_tip" v-model="terminal.terminal_telnet_pin_tip"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.terminal.localRetention')" prop="terminal_record_local_retention">
|
||||
<el-input-number v-model="terminal.terminal_record_local_retention" controls-position="right" :min="1" id="system-terminal_record_local_retention"></el-input-number>
|
||||
<el-input v-model="terminal.terminal_record_local_retention" controls-position="right" :min="1" id="system-terminal_record_local_retention">
|
||||
<template slot="append"><span >{{$t('config.system.basic.day')}}</span></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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>
|
||||
@@ -177,6 +181,11 @@
|
||||
<!--借用错误提示的样式-->
|
||||
<div class="el-form-item__tip el-form-item__tip--two-row">{{$t("config.system.ldap.mapTip")}}</div>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.ldap.timeout')" prop="ldap_timeout">
|
||||
<el-input v-model.number="ldap.ldap_timeout" >
|
||||
<template slot="append"><span >{{$t('config.system.basic.second')}}</span></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<button id='system-ldap-reset' @click="resetForm('ldapForm','ldap')" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new" type="button">{{$t('overall.reset')}}</button>
|
||||
<button id='system-ldap-test' @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>
|
||||
@@ -196,7 +205,7 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('config.system.reset.reset')" name="reset">
|
||||
<div class="system-config-form" v-if="activeTab === 'reset'">
|
||||
<el-form :model="reset" label-width="82px" size="small" ref="resetForm" :rules="resetRules" :validate-on-rule-change="false" class="reset-form">
|
||||
<el-form :model="reset" label-width="180px" size="small" ref="resetForm" :rules="resetRules" :validate-on-rule-change="false" class="reset-form">
|
||||
<el-form-item prop="type" :label="$t('config.system.reset.type')">
|
||||
<!-- <div class="el-checkbox-group">-->
|
||||
<!-- <div v-for="(item,index) in resetOptions" :key="item.value+index" >-->
|
||||
@@ -287,7 +296,7 @@ export default {
|
||||
emailCopy: null,
|
||||
emailRules: {
|
||||
email_host: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
||||
// { required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
||||
{ validator: hostPlus, trigger: 'blur' }
|
||||
],
|
||||
email_port: [
|
||||
@@ -321,7 +330,8 @@ export default {
|
||||
ldap_ou: '',
|
||||
ldap_user_filter: '',
|
||||
ldap_mapping: '',
|
||||
ldap_enable: 'off'
|
||||
ldap_enable: 'off',
|
||||
ldap_timeout:'',
|
||||
},
|
||||
ldapCopy: null,
|
||||
ldapRules: {
|
||||
@@ -464,9 +474,7 @@ export default {
|
||||
if (valid) {
|
||||
const param = Object.assign({}, this[type])
|
||||
|
||||
if (type == 'email') {
|
||||
param.email_test=true;
|
||||
}
|
||||
param[type+'_test']=true
|
||||
const postParam = Object.assign({}, param)
|
||||
this.$put('/sys/config/'+type, postParam).then(response => {
|
||||
this.prevent_opt.save = false
|
||||
@@ -758,12 +766,12 @@ export default {
|
||||
|
||||
if(isImage && isLt2M){
|
||||
const self = this;
|
||||
this.urlToBase64(file.raw).then(res=>{
|
||||
this.fileToBase64(file.raw).then(res=>{
|
||||
self.basic.system_logo = res;
|
||||
});
|
||||
}
|
||||
},
|
||||
urlToBase64:function(file) {
|
||||
fileToBase64:function(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let reader = new FileReader();
|
||||
reader.readAsDataURL(file);//转化二进制流,异步方法
|
||||
@@ -774,6 +782,17 @@ export default {
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
timezoneOptionHandler:function(offset){
|
||||
let offsetHour = (offset/1000/60/60).toFixed(0)
|
||||
|
||||
let offsetMinute = offset%(1000*60*60)/(1000*60)
|
||||
|
||||
let hour = offsetHour>0?(offsetHour<9?'+0'+offsetHour:'+'+offsetHour):(offsetHour == 0?(offsetMinute==0?'':'+00'):(offsetHour>-10?'-0'+Math.abs(offsetHour):offsetHour))
|
||||
|
||||
let minute = offsetHour==0&&offsetMinute == 0?'':(offsetMinute==0?':00':(offsetMinute>9?':'+offsetMinute:':0'+offsetMinute))
|
||||
|
||||
return 'UTC'+hour+minute
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
@@ -71,7 +71,8 @@ export default {
|
||||
methods: {
|
||||
addApiKey: function () {
|
||||
this.$refs.dataTable.addApiKey()
|
||||
}
|
||||
this.$refs.dataTable.getRoles()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</el-popover>
|
||||
</template>
|
||||
<template v-if="item.prop == 'expireAt'">
|
||||
<el-popover :content="rules.expireAt.message" placement="top" trigger="manual" v-model="rules.expireAt.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.expireAt)">
|
||||
<!-- <el-popover :content="rules.expireAt.message" placement="top" trigger="manual" v-model="rules.expireAt.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.expireAt)">-->
|
||||
<el-date-picker
|
||||
slot="reference"
|
||||
style="width: 100%;"
|
||||
@@ -61,7 +61,7 @@
|
||||
:picker-options="pickerOptions"
|
||||
:placeholder="$t('el.datepicker.selectTime')">
|
||||
</el-date-picker>
|
||||
</el-popover>
|
||||
<!-- </el-popover>-->
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -71,6 +71,9 @@
|
||||
<template v-else-if="item.prop == 'role'">
|
||||
{{scope.row[item.prop]?scope.row[item.prop].name:'-'}}
|
||||
</template>
|
||||
<template v-else-if="item.prop == 'expireAt'">
|
||||
{{scope.row[item.prop]?scope.row[item.prop]:$t('config.system.apiKey.noExpire')}}
|
||||
</template>
|
||||
<template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
|
||||
<template v-else>-</template>
|
||||
</template>
|
||||
@@ -138,7 +141,7 @@ export default {
|
||||
rules: {
|
||||
name: { required: true, message: this.$t('validate.required'), switch: false },
|
||||
roleId: { required: true, message: this.$t('validate.required'), switch: false },
|
||||
expireAt: { required: true, message: this.$t('validate.required'), switch: false }
|
||||
// expireAt: { required: true, message: this.$t('validate.required'), switch: false }
|
||||
},
|
||||
pickerOptions: {
|
||||
// 限制预约时间
|
||||
@@ -154,7 +157,7 @@ export default {
|
||||
this.tableData.unshift({
|
||||
id: '',
|
||||
name: '',
|
||||
roles: {
|
||||
role: {
|
||||
id: '',
|
||||
name: ''
|
||||
},
|
||||
@@ -174,15 +177,15 @@ export default {
|
||||
},
|
||||
save: function (obj) {
|
||||
const copy = JSON.parse(JSON.stringify(obj))
|
||||
if (copy.roles) {
|
||||
copy.roleId = copy.roles.id
|
||||
if (copy.role) {
|
||||
copy.roleId = copy.role.id
|
||||
}
|
||||
delete copy.roles
|
||||
delete copy.role
|
||||
this.saveOrUpdate(copy)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getRoles()
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -102,10 +102,6 @@ export default {
|
||||
label: 'URL',
|
||||
prop: 'url',
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('config.system.link.create'),
|
||||
prop: 'creator',
|
||||
show: true
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="item.prop == 'state'">
|
||||
<div :class="{'active-icon green':scope.row[item.prop] == '1','active-icon red':scope.row[item.prop] == '0'}"></div><span>{{scope.row[item.prop] == '1'?$t(''):$t('')}}</span>
|
||||
<el-switch :disabled="true" v-model="scope.row.state" active-color="#ee9d3f" :active-value="1" :inactive-value="0" />
|
||||
</template>
|
||||
<template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
|
||||
<template v-else>-</template>
|
||||
|
||||
Reference in New Issue
Block a user