mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-13 14:42:11 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59be77849d | ||
|
|
c90265d7bf | ||
|
|
edb5e1b363 | ||
|
|
3b222c5af0 |
@@ -98,15 +98,25 @@ export default {
|
|||||||
this.$refs.dataTable.$refs.dataTable.search(attrs, true)
|
this.$refs.dataTable.$refs.dataTable.search(attrs, true)
|
||||||
},
|
},
|
||||||
handleDateChange(attrs) {
|
handleDateChange(attrs) {
|
||||||
this.$set(this.extraQuery, 'date_from', attrs[0].toISOString())
|
let dateFrom = ''
|
||||||
this.$set(this.extraQuery, 'date_to', attrs[1].toISOString())
|
let dateTo = ''
|
||||||
// this.extraQuery = {
|
try {
|
||||||
// date_from: attrs[0].toISOString(),
|
dateFrom = attrs[0].toISOString()
|
||||||
// date_to: attrs[1].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 = {
|
const query = {
|
||||||
date_from: attrs[0].toISOString(),
|
date_from: dateFrom,
|
||||||
date_to: attrs[1].toISOString()
|
date_to: dateTo
|
||||||
}
|
}
|
||||||
this.$emit('TagDateChange', attrs)
|
this.$emit('TagDateChange', attrs)
|
||||||
return this.dataTable.searchDate(query)
|
return this.dataTable.searchDate(query)
|
||||||
|
|||||||
@@ -242,6 +242,8 @@
|
|||||||
"ReLogin": "重新登录"
|
"ReLogin": "重新登录"
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
|
"UserLoginLimit": "用户登录限制",
|
||||||
|
"IPLoginLimit": "IP 登录限制",
|
||||||
"Setting": "设置",
|
"Setting": "设置",
|
||||||
"ViewMore": "查看更多",
|
"ViewMore": "查看更多",
|
||||||
"Announcement": "公告",
|
"Announcement": "公告",
|
||||||
|
|||||||
@@ -236,6 +236,8 @@
|
|||||||
"ReLogin": "Re-Login"
|
"ReLogin": "Re-Login"
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
|
"UserLoginLimit": "User login limit",
|
||||||
|
"IPLoginLimit": "IP login limit",
|
||||||
"Setting": "Setting",
|
"Setting": "Setting",
|
||||||
"ViewMore": "View more",
|
"ViewMore": "View more",
|
||||||
"Announcement": "Announcement",
|
"Announcement": "Announcement",
|
||||||
|
|||||||
@@ -18,10 +18,12 @@ import { GenericListPage, GenericCreateUpdateForm } from '@/layout/components'
|
|||||||
import Dialog from '@/components/Dialog'
|
import Dialog from '@/components/Dialog'
|
||||||
import Select2 from '@/components/FormFields/Select2'
|
import Select2 from '@/components/FormFields/Select2'
|
||||||
|
|
||||||
const numTotFixed = (row) => {
|
const numTotFixed = (row, type) => {
|
||||||
if (row && row.stat) {
|
const cur = row.stat?.[type] || ''
|
||||||
return row.stat?.memory_used.toFixed(1)
|
if (cur instanceof Number && !Number.isInteger(cur)) {
|
||||||
|
return cur.toFixed(1)
|
||||||
}
|
}
|
||||||
|
return cur
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -109,17 +111,17 @@ export default {
|
|||||||
'stat.cpu_load': {
|
'stat.cpu_load': {
|
||||||
label: this.$t('sessions.systemCpuLoad'),
|
label: this.$t('sessions.systemCpuLoad'),
|
||||||
width: '120px',
|
width: '120px',
|
||||||
formatter: numTotFixed
|
formatter: (row) => (numTotFixed(row, 'cpu_load'))
|
||||||
},
|
},
|
||||||
'stat.disk_used': {
|
'stat.disk_used': {
|
||||||
label: this.$t('sessions.systemDiskUsedPercent'),
|
label: this.$t('sessions.systemDiskUsedPercent'),
|
||||||
width: '120px',
|
width: '120px',
|
||||||
formatter: numTotFixed
|
formatter: (row) => (numTotFixed(row, 'disk_used'))
|
||||||
},
|
},
|
||||||
'stat.memory_used': {
|
'stat.memory_used': {
|
||||||
label: this.$t('sessions.systemMemoryUsedPercent'),
|
label: this.$t('sessions.systemMemoryUsedPercent'),
|
||||||
width: '120px',
|
width: '120px',
|
||||||
formatter: numTotFixed
|
formatter: (row) => (numTotFixed(row, 'memory_used'))
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
label: this.$t('xpack.LoadStatus'),
|
label: this.$t('xpack.LoadStatus'),
|
||||||
|
|||||||
@@ -43,22 +43,48 @@ export default {
|
|||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
fields: [
|
fields: [
|
||||||
'SECURITY_LOGIN_LIMIT_COUNT', 'SECURITY_LOGIN_LIMIT_TIME', 'SECURITY_LOGIN_IP_BLACK_LIST',
|
[
|
||||||
'USER_LOGIN_SINGLE_MACHINE_ENABLED', 'ONLY_ALLOW_EXIST_USER_AUTH',
|
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'
|
'ONLY_ALLOW_AUTH_FROM_SOURCE'
|
||||||
|
]
|
||||||
|
]
|
||||||
],
|
],
|
||||||
successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }},
|
successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }},
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
},
|
},
|
||||||
afterGetFormValue(validValues) {
|
afterGetFormValue(validValues) {
|
||||||
validValues.SECURITY_LOGIN_IP_BLACK_LIST = validValues.SECURITY_LOGIN_IP_BLACK_LIST.toString()
|
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
|
return validValues
|
||||||
},
|
},
|
||||||
cleanFormValue(value) {
|
cleanFormValue(value) {
|
||||||
const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST
|
const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST
|
||||||
|
const ipWhiltList = value.SECURITY_LOGIN_IP_WHITE_LIST
|
||||||
if (!Array.isArray(ipBlackList)) {
|
if (!Array.isArray(ipBlackList)) {
|
||||||
value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList ? ipBlackList.split(',') : []
|
value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList ? ipBlackList.split(',') : []
|
||||||
}
|
}
|
||||||
|
if (!Array.isArray(ipWhiltList)) {
|
||||||
|
value.SECURITY_LOGIN_IP_WHITE_LIST = ipWhiltList ? ipWhiltList.split(',') : []
|
||||||
|
}
|
||||||
return value
|
return value
|
||||||
},
|
},
|
||||||
url: '/api/v1/settings/setting/?category=security'
|
url: '/api/v1/settings/setting/?category=security'
|
||||||
|
|||||||
Reference in New Issue
Block a user