diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 66a1e5972..87bbca5dc 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -902,7 +902,11 @@ const cn = { lat: '纬度', lng: '经度', zoom: '缩放', - lnglat: '坐标' + lnglat: '坐标', + sysLogo:'系统Logo', + scrapeTimeout:"Scrape timeout", + snmpTrapPort:"SNMP trap端口", + logoTip:'Logo支持格式为jpg、jpeg、png且大小小于2M的图片' }, email: { email: '邮件', @@ -912,6 +916,7 @@ const cn = { smtpAccount: 'SMTP账号', smtpPwd: 'SMTP密码', sendAccount: '发送账号', + timeout:"超时时间", testAccount: '测试账号', useSSL: 'SSL', useTLS: 'TLS', @@ -920,11 +925,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', @@ -937,7 +947,8 @@ const cn = { filterTip: '可能的选项是(cn或uid或sAMAccountName=%(user)s)', map: '属性映射', mapTip: '属性映射代表怎样将NEZHA用户属性映射到jumpserver用户上;username,email是jumpserver的属性', - active: '启用LDAP认证' + active: '启用LDAP认证', + timeout:"超时时间" }, link: { link: 'Link', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 4680239d3..35f092238 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -952,7 +952,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', @@ -972,7 +973,7 @@ const en = { filePath: 'File path', operation: 'Operation', account: 'Account', - state: 'State', + state: 'Enable', buildIn: 'Build in', add: 'Add', update: 'Update', @@ -1001,7 +1002,8 @@ const en = { role: 'Role', create: 'Creator', creatAt: 'Create at', - expireAt: 'Expire at' + expireAt: 'Expire at', + noExpire: 'No expiration date', } }, assetType: { diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue index 02babbc95..4d2222b03 100644 --- a/nezha-fronted/src/components/common/login.vue +++ b/nezha-fronted/src/components/common/login.vue @@ -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 diff --git a/nezha-fronted/src/components/page/config/agent.vue b/nezha-fronted/src/components/page/config/agent.vue index b912065fa..b314b9fac 100644 --- a/nezha-fronted/src/components/page/config/agent.vue +++ b/nezha-fronted/src/components/page/config/agent.vue @@ -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() } } diff --git a/nezha-fronted/src/components/page/config/system.vue b/nezha-fronted/src/components/page/config/system.vue index 11df96b2f..b36e8e24b 100644 --- a/nezha-fronted/src/components/page/config/system.vue +++ b/nezha-fronted/src/components/page/config/system.vue @@ -52,11 +52,11 @@ - + {{item.name}} - UTC{{item.offset>=0?'+'+(item.offset/1000/60/60):'-'+(item.offset/1000/60/60)}} + {{timezoneOptionHandler(item.offset)}} @@ -79,7 +79,7 @@ {{$t('overall.submit')}} - + @@ -132,7 +132,9 @@ - + + {{$t('config.system.basic.second')}} + @@ -141,7 +143,9 @@ - + + {{$t('config.system.basic.day')}} + {{$t('overall.submit')}} @@ -177,6 +181,11 @@ {{$t("config.system.ldap.mapTip")}} + + + {{$t('config.system.basic.second')}} + + {{$t('overall.reset')}} {{$t('config.system.email.testConnection')}} @@ -196,7 +205,7 @@ - + @@ -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 () { diff --git a/nezha-fronted/src/components/page/config/system/apiKeyTab.vue b/nezha-fronted/src/components/page/config/system/apiKeyTab.vue index 1e4615186..8bad751b3 100644 --- a/nezha-fronted/src/components/page/config/system/apiKeyTab.vue +++ b/nezha-fronted/src/components/page/config/system/apiKeyTab.vue @@ -71,7 +71,8 @@ export default { methods: { addApiKey: function () { this.$refs.dataTable.addApiKey() - } + this.$refs.dataTable.getRoles() + }, } } diff --git a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue index 059ec9bd4..d9974cfba 100644 --- a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue +++ b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue @@ -49,7 +49,7 @@ - + - + @@ -71,6 +71,9 @@ {{scope.row[item.prop]?scope.row[item.prop].name:'-'}} + + {{scope.row[item.prop]?scope.row[item.prop]:$t('config.system.apiKey.noExpire')}} + {{scope.row[item.prop]}} - @@ -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() + } } diff --git a/nezha-fronted/src/components/page/config/system/linkTable.vue b/nezha-fronted/src/components/page/config/system/linkTable.vue index c60c3ca32..9dfc6ccf9 100644 --- a/nezha-fronted/src/components/page/config/system/linkTable.vue +++ b/nezha-fronted/src/components/page/config/system/linkTable.vue @@ -102,10 +102,6 @@ export default { label: 'URL', prop: 'url', show: true - }, { - label: this.$t('config.system.link.create'), - prop: 'creator', - show: true } ], rules: { diff --git a/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue b/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue index e2ba3ade8..d72fe0e19 100644 --- a/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue +++ b/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue @@ -57,7 +57,7 @@ - {{scope.row[item.prop] == '1'?$t(''):$t('')}} + {{scope.row[item.prop]}} -