Compare commits

...

4 Commits

Author SHA1 Message Date
ibuler
59be77849d fix: 修复法国用户因为时区时间不同引起的错误 2021-11-25 17:51:03 +08:00
“怀磊”
c90265d7bf fix: 修复终端管理数字显示不正确问题 2021-11-25 15:12:39 +08:00
Michael Bai
edb5e1b363 fix: 修改翻译 2021-11-19 18:45:59 +08:00
feng626
3b222c5af0 perf: ip黑白名单 2021-11-19 18:45:59 +08:00
5 changed files with 59 additions and 17 deletions

View File

@@ -98,15 +98,25 @@ export default {
this.$refs.dataTable.$refs.dataTable.search(attrs, true)
},
handleDateChange(attrs) {
this.$set(this.extraQuery, 'date_from', attrs[0].toISOString())
this.$set(this.extraQuery, 'date_to', attrs[1].toISOString())
// this.extraQuery = {
// date_from: attrs[0].toISOString(),
// date_to: attrs[1].toISOString()
// }
let dateFrom = ''
let dateTo = ''
try {
dateFrom = attrs[0].toISOString()
dateTo = attrs[1].toISOString()
} catch (e) {
this.$log.error('Handle date change error: ', attrs)
dateFrom = new Date()
dateFrom.setDate(dateFrom.getDate() - 5)
dateFrom = dateFrom.toISOString()
dateTo = new Date()
dateTo.setDate(dateTo.getDate() + 1)
dateTo = dateTo.toISOString()
}
this.$set(this.extraQuery, 'date_from', dateFrom)
this.$set(this.extraQuery, 'date_to', dateTo)
const query = {
date_from: attrs[0].toISOString(),
date_to: attrs[1].toISOString()
date_from: dateFrom,
date_to: dateTo
}
this.$emit('TagDateChange', attrs)
return this.dataTable.searchDate(query)

View File

@@ -242,6 +242,8 @@
"ReLogin": "重新登录"
},
"common": {
"UserLoginLimit": "用户登录限制",
"IPLoginLimit": "IP 登录限制",
"Setting": "设置",
"ViewMore": "查看更多",
"Announcement": "公告",

View File

@@ -236,6 +236,8 @@
"ReLogin": "Re-Login"
},
"common": {
"UserLoginLimit": "User login limit",
"IPLoginLimit": "IP login limit",
"Setting": "Setting",
"ViewMore": "View more",
"Announcement": "Announcement",

View File

@@ -18,10 +18,12 @@ import { GenericListPage, GenericCreateUpdateForm } from '@/layout/components'
import Dialog from '@/components/Dialog'
import Select2 from '@/components/FormFields/Select2'
const numTotFixed = (row) => {
if (row && row.stat) {
return row.stat?.memory_used.toFixed(1)
const numTotFixed = (row, type) => {
const cur = row.stat?.[type] || ''
if (cur instanceof Number && !Number.isInteger(cur)) {
return cur.toFixed(1)
}
return cur
}
export default {
components: {
@@ -109,17 +111,17 @@ export default {
'stat.cpu_load': {
label: this.$t('sessions.systemCpuLoad'),
width: '120px',
formatter: numTotFixed
formatter: (row) => (numTotFixed(row, 'cpu_load'))
},
'stat.disk_used': {
label: this.$t('sessions.systemDiskUsedPercent'),
width: '120px',
formatter: numTotFixed
formatter: (row) => (numTotFixed(row, 'disk_used'))
},
'stat.memory_used': {
label: this.$t('sessions.systemMemoryUsedPercent'),
width: '120px',
formatter: numTotFixed
formatter: (row) => (numTotFixed(row, 'memory_used'))
},
status: {
label: this.$t('xpack.LoadStatus'),

View File

@@ -43,22 +43,48 @@ export default {
},
visible: false,
fields: [
'SECURITY_LOGIN_LIMIT_COUNT', 'SECURITY_LOGIN_LIMIT_TIME', 'SECURITY_LOGIN_IP_BLACK_LIST',
'USER_LOGIN_SINGLE_MACHINE_ENABLED', 'ONLY_ALLOW_EXIST_USER_AUTH',
'ONLY_ALLOW_AUTH_FROM_SOURCE'
[
this.$t('common.UserLoginLimit'),
[
'SECURITY_LOGIN_LIMIT_COUNT',
'SECURITY_LOGIN_LIMIT_TIME'
]
],
[
this.$t('common.IPLoginLimit'),
[
'SECURITY_LOGIN_IP_LIMIT_COUNT',
'SECURITY_LOGIN_IP_LIMIT_TIME',
'SECURITY_LOGIN_IP_WHITE_LIST',
'SECURITY_LOGIN_IP_BLACK_LIST'
]
],
[
this.$t('common.Other'),
[
'USER_LOGIN_SINGLE_MACHINE_ENABLED',
'ONLY_ALLOW_EXIST_USER_AUTH',
'ONLY_ALLOW_AUTH_FROM_SOURCE'
]
]
],
successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }},
fieldsMeta: {
},
afterGetFormValue(validValues) {
validValues.SECURITY_LOGIN_IP_BLACK_LIST = validValues.SECURITY_LOGIN_IP_BLACK_LIST.toString()
validValues.SECURITY_LOGIN_IP_WHITE_LIST = validValues.SECURITY_LOGIN_IP_WHITE_LIST.toString()
return validValues
},
cleanFormValue(value) {
const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST
const ipWhiltList = value.SECURITY_LOGIN_IP_WHITE_LIST
if (!Array.isArray(ipBlackList)) {
value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList ? ipBlackList.split(',') : []
}
if (!Array.isArray(ipWhiltList)) {
value.SECURITY_LOGIN_IP_WHITE_LIST = ipWhiltList ? ipWhiltList.split(',') : []
}
return value
},
url: '/api/v1/settings/setting/?category=security'