mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
perf: table col modify
This commit is contained in:
@@ -21,13 +21,13 @@ export default {
|
||||
min: ['material', 'is_success'],
|
||||
default: [
|
||||
'creator_name', 'material', 'is_finished',
|
||||
'is_success', 'time_cost', 'date_start',
|
||||
'is_success', 'time_cost',
|
||||
'date_finished', 'actions'
|
||||
]
|
||||
},
|
||||
columns: [
|
||||
'creator_name', 'material', 'is_finished',
|
||||
'is_success', 'time_cost', 'date_start',
|
||||
'is_success', 'time_cost',
|
||||
'date_finished', 'actions'
|
||||
],
|
||||
columnsMeta: {
|
||||
|
||||
@@ -16,36 +16,32 @@ export default {
|
||||
app: 'audits',
|
||||
resource: 'userloginlog'
|
||||
},
|
||||
columnsExclude: ['backend'],
|
||||
columnsShow: {
|
||||
min: ['username', 'type'],
|
||||
min: ['username', 'status'],
|
||||
default: [
|
||||
'username', 'type', 'backend_display', 'ip', 'city',
|
||||
'user_agent', 'mfa', 'reason_display', 'status', 'datetime'
|
||||
'username', 'backend_display', 'city',
|
||||
'reason_display', 'status', 'datetime'
|
||||
]
|
||||
},
|
||||
url: '/api/v1/audits/login-logs/',
|
||||
columnsMeta: {
|
||||
user_agent: {
|
||||
width: '150px'
|
||||
username: {
|
||||
width: '120px'
|
||||
},
|
||||
backend_display: {
|
||||
width: '120px'
|
||||
},
|
||||
actions: {
|
||||
has: false
|
||||
},
|
||||
ip: {
|
||||
width: '140px'
|
||||
},
|
||||
city: {
|
||||
width: '90px'
|
||||
width: '120px'
|
||||
},
|
||||
mfa: {
|
||||
width: '80px'
|
||||
},
|
||||
type: {
|
||||
width: '110px'
|
||||
reason_display: {
|
||||
width: '120px'
|
||||
},
|
||||
datetime: {
|
||||
width: '160px'
|
||||
width: '120px'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -51,8 +51,8 @@ export default {
|
||||
}
|
||||
},
|
||||
columns: [
|
||||
'expandCol', 'input', 'risk_level', 'user', 'remote_addr',
|
||||
'asset', 'account', 'session', 'timestamp'
|
||||
'expandCol', 'input', 'risk_level', 'user',
|
||||
'asset', 'session', 'timestamp'
|
||||
],
|
||||
extraQuery: {
|
||||
date_to: dateTo,
|
||||
@@ -80,14 +80,14 @@ export default {
|
||||
has: false
|
||||
},
|
||||
asset: {
|
||||
width: '140px'
|
||||
width: '120px'
|
||||
},
|
||||
user: {
|
||||
width: '140px'
|
||||
width: '100px'
|
||||
},
|
||||
session: {
|
||||
formatter: DetailFormatter,
|
||||
width: '80px',
|
||||
width: '100px',
|
||||
formatterArgs: {
|
||||
openInNewPage: true,
|
||||
can: this.$hasPerm('terminal.view_session'),
|
||||
@@ -104,7 +104,7 @@ export default {
|
||||
},
|
||||
timestamp: {
|
||||
label: this.$t('Date'),
|
||||
width: '150px',
|
||||
width: '130px',
|
||||
sortable: 'custom',
|
||||
formatter: function(row) {
|
||||
return toSafeLocalDateStr(row.timestamp * 1000)
|
||||
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
tableConfig: {
|
||||
columnsShow: {
|
||||
default: [
|
||||
'id', 'user', 'remote_addr', 'asset', 'account', 'operate',
|
||||
'id', 'user', 'asset', 'account', 'operate',
|
||||
'filename', 'date_start', 'is_success', 'actions'
|
||||
]
|
||||
},
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
width: '100px'
|
||||
},
|
||||
is_success: {
|
||||
width: '80px'
|
||||
width: '100px'
|
||||
},
|
||||
actions: {
|
||||
width: '82px',
|
||||
@@ -41,7 +41,9 @@ export default {
|
||||
name: 'download',
|
||||
title: this.$t('Download'),
|
||||
type: 'primary',
|
||||
can: ({ row }) => { return row.has_file },
|
||||
can: ({ row }) => {
|
||||
return row.has_file
|
||||
},
|
||||
tip: ({ row }) => {
|
||||
return row.has_file ? this.$t('Download') : this.$t('DownloadFTPFileTip')
|
||||
},
|
||||
|
||||
@@ -29,13 +29,13 @@ export default {
|
||||
columnsShow: {
|
||||
min: ['user_display', 'actions'],
|
||||
default: [
|
||||
'user_display', 'backend_display', 'ip', 'city',
|
||||
'user_agent', 'date_created', 'is_active', 'actions'
|
||||
'user_display', 'backend_display', 'city',
|
||||
'date_created', 'is_active', 'actions'
|
||||
]
|
||||
},
|
||||
columns: [
|
||||
'user_display', 'backend_display', 'ip', 'city', 'type',
|
||||
'user_agent', 'date_created', 'is_active', 'date_expired', 'actions'
|
||||
'user_display', 'backend_display', 'city', 'type',
|
||||
'date_created', 'is_active', 'date_expired', 'actions'
|
||||
],
|
||||
columnsMeta: {
|
||||
is_active: {
|
||||
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
min: ['id', 'actions'],
|
||||
default: [
|
||||
'id', 'user', 'asset', 'account', 'remote_addr', 'protocol',
|
||||
'command_amount', 'date_start', 'duration', 'actions'
|
||||
'date_start', 'actions'
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export default {
|
||||
return {
|
||||
tableConfig: {
|
||||
url: this.url,
|
||||
columnsExtra: ['index', 'duration'],
|
||||
columnsExtra: ['duration'],
|
||||
columnsExclude: ['terminal'],
|
||||
columnsShow: this.columnsShow,
|
||||
columnsMeta: {
|
||||
@@ -50,10 +50,11 @@ export default {
|
||||
formatter: function(row, column, cellValue, index) {
|
||||
const label = index + 1
|
||||
const route = { to: { name: 'SessionDetail', params: { id: row.id }}}
|
||||
return <router-link {...{ attrs: route }} class='link'>{ label }</router-link>
|
||||
return <router-link {...{ attrs: route }} class='link'>{label}</router-link>
|
||||
}
|
||||
},
|
||||
user: {
|
||||
width: '100px',
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
getRoute: ({ row }) => {
|
||||
@@ -121,7 +122,7 @@ export default {
|
||||
width: '140px'
|
||||
},
|
||||
protocol: {
|
||||
width: '80px',
|
||||
width: '100px',
|
||||
sortable: false,
|
||||
formatter: null
|
||||
},
|
||||
@@ -132,6 +133,7 @@ export default {
|
||||
width: '150px'
|
||||
},
|
||||
duration: {
|
||||
label: this.$t('Duration'),
|
||||
formatter: function(row) {
|
||||
return timeOffset(row.date_start, row.date_end)
|
||||
},
|
||||
@@ -166,13 +168,12 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.link {
|
||||
color: var(--color-info);
|
||||
}
|
||||
.link {
|
||||
color: var(--color-info);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user