feat: 修改session命令

This commit is contained in:
ibuler
2020-06-16 13:48:05 +08:00
parent c73bb3f9c7
commit 5df1355b5f
3 changed files with 12 additions and 28 deletions

View File

@@ -100,7 +100,7 @@ export async function generatePageRoutes({ to, from, next }) {
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor'] // note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
// 不能改名 current_org_roles, 里面返回的就是这个 // 不能改名 current_org_roles, 里面返回的就是这个
const currentRole = store.getters.currentRole const currentRole = store.getters.currentRole
console.log('Current org role: ', currentRole, rolec.getRolesDisplay(currentRole)) // console.log('Current org role: ', currentRole, rolec.getRolesDisplay(currentRole))
// generate accessible routes map based on roles // generate accessible routes map based on roles
const accessRoutes = await store.dispatch('permission/generateRoutes', currentRole) const accessRoutes = await store.dispatch('permission/generateRoutes', currentRole)

View File

@@ -6,7 +6,7 @@
import { GenericListPage } from '@/layout/components' import { GenericListPage } from '@/layout/components'
import { getDaysAgo, toSafeLocalDateStr } from '@/utils/common' import { getDaysAgo, toSafeLocalDateStr } from '@/utils/common'
import { OutputExpandFormatter } from './formatters' import { OutputExpandFormatter } from './formatters'
import { DetailFormatter, BooleanFormatter } from '@/components/ListTable/formatters' import { DetailFormatter } from '@/components/ListTable/formatters'
export default { export default {
components: { components: {
@@ -34,33 +34,17 @@ export default {
prop: 'output', prop: 'output',
formatter: OutputExpandFormatter formatter: OutputExpandFormatter
}, },
input: {
label: this.$t('sessions.command')
},
risk_level: { risk_level: {
label: this.$t('sessions.riskLevel'), label: this.$t('sessions.riskLevel'),
formatter: BooleanFormatter, formatter: (row, col, cellValue) => {
formatterArgs: { const display = row.risk_level_display
hasTips: true, if (cellValue === 0) {
tips(val) { return display
switch (val) { } else {
case 0: return <span class='text-danger'> { display } </span>
return vm.$t('sessions.riskLevels.common')
default:
return vm.$t('sessions.riskLevels.common')
}
} }
} }
}, },
user: {
label: this.$t('sessions.user')
},
asset: {
label: this.$t('sessions.asset')
},
system_user: {
label: this.$t('sessions.systemUser')
},
session: { session: {
label: this.$t('sessions.session'), label: this.$t('sessions.session'),
formatter: DetailFormatter, formatter: DetailFormatter,

View File

@@ -1,8 +1,8 @@
<template> <template>
<pre style="border: none; background: none; white-space: pre-wrap"> <pre style="border: none; background: none; white-space: pre-wrap;padding: 10px 20px">
{{ '$ '+ row.input }} {{ '$ '+ row.input }}
<br> <br>
{{ row.output }} {{ row.output }}
</pre> </pre>
</template> </template>