mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-07 18:08:50 +00:00
Compare commits
4 Commits
pr@v3@fixe
...
v2.16.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59be77849d | ||
|
|
c90265d7bf | ||
|
|
edb5e1b363 | ||
|
|
3b222c5af0 |
@@ -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)
|
||||
|
||||
@@ -242,6 +242,8 @@
|
||||
"ReLogin": "重新登录"
|
||||
},
|
||||
"common": {
|
||||
"UserLoginLimit": "用户登录限制",
|
||||
"IPLoginLimit": "IP 登录限制",
|
||||
"Setting": "设置",
|
||||
"ViewMore": "查看更多",
|
||||
"Announcement": "公告",
|
||||
|
||||
@@ -236,6 +236,8 @@
|
||||
"ReLogin": "Re-Login"
|
||||
},
|
||||
"common": {
|
||||
"UserLoginLimit": "User login limit",
|
||||
"IPLoginLimit": "IP login limit",
|
||||
"Setting": "Setting",
|
||||
"ViewMore": "View more",
|
||||
"Announcement": "Announcement",
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user