Merge branch 'v4' of github.com:jumpserver/lina into v4

This commit is contained in:
Bai
2024-03-06 17:07:36 +08:00
33 changed files with 151 additions and 371 deletions

View File

@@ -157,6 +157,7 @@ export default {
}, },
columnsMeta: { columnsMeta: {
name: { name: {
width: '120px',
formatter: function(row) { formatter: function(row) {
const to = { const to = {
name: 'AssetAccountDetail', name: 'AssetAccountDetail',
@@ -182,8 +183,10 @@ export default {
} }
} }
}, },
username: {
width: '120px'
},
secret_type: { secret_type: {
width: '100px',
formatter: function(row) { formatter: function(row) {
return row.secret_type.label return row.secret_type.label
} }
@@ -194,7 +197,7 @@ export default {
} }
}, },
has_secret: { has_secret: {
width: '100px', width: '120px',
formatterArgs: { formatterArgs: {
showFalse: false showFalse: false
} }

View File

@@ -153,7 +153,7 @@ export default {
border: 1px solid #dcdee2; border: 1px solid #dcdee2;
border-radius: 1px; border-radius: 1px;
background-color: #fff; background-color: #fff;
line-height: 32px; line-height: 30px;
&:hover { &:hover {
border-color: #C0C4CC; border-color: #C0C4CC;
@@ -165,7 +165,7 @@ export default {
} }
&>>> .el-autocomplete { &>>> .el-autocomplete {
height: 30px; height: 28px;
} }
} }
@@ -184,7 +184,7 @@ export default {
} }
.filter-field >>> .el-input__inner { .filter-field >>> .el-input__inner {
height: 29px; height: 28px;
} }
.show-password { .show-password {

View File

@@ -51,6 +51,7 @@ export default {
computed: { computed: {
iTitle() { iTitle() {
let title = this.title || this.$route.meta.title let title = this.title || this.$route.meta.title
console.log('title', this.$route.meta.title)
if (!title) { if (!title) {
title = this.$t('NoTitle') title = this.$t('NoTitle')
} }

View File

@@ -140,7 +140,7 @@ export default [
name: 'AccountPushCreate', name: 'AccountPushCreate',
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('Create'), title: i18n.t('AccountPushCreate'),
permissions: ['accounts.add_pushaccountautomation'] permissions: ['accounts.add_pushaccountautomation']
} }
}, },
@@ -150,7 +150,7 @@ export default [
name: 'AccountPushUpdate', name: 'AccountPushUpdate',
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('Update'), title: i18n.t('AccountPushUpdate'),
permissions: ['accounts.change_pushaccountautomation'] permissions: ['accounts.change_pushaccountautomation']
} }
}, },
@@ -212,7 +212,7 @@ export default [
name: 'AccountGatherTaskCreate', name: 'AccountGatherTaskCreate',
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('Create'), title: i18n.t('AccountGatherTaskCreate'),
permissions: ['accounts.add_gatheraccountsautomation'] permissions: ['accounts.add_gatheraccountsautomation']
} }
}, },
@@ -232,7 +232,7 @@ export default [
name: 'AccountGatherTaskUpdate', name: 'AccountGatherTaskUpdate',
hidden: true, hidden: true,
meta: { meta: {
title: i18n.t('Update'), title: i18n.t('AccountGatherTaskUpdate'),
action: 'update', action: 'update',
permissions: ['accounts.change_gatheraccountsautomation'], permissions: ['accounts.change_gatheraccountsautomation'],
activeMenu: '/accounts/account-gather' activeMenu: '/accounts/account-gather'
@@ -357,7 +357,7 @@ export default [
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'), component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupPlanCreate', name: 'AccountBackupPlanCreate',
meta: { meta: {
title: i18n.t('Create'), title: i18n.t('AccountBackupPlanCreate'),
action: 'create' action: 'create'
}, },
hidden: true hidden: true
@@ -367,7 +367,7 @@ export default [
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'), component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupPlanUpdate', name: 'AccountBackupPlanUpdate',
meta: { meta: {
title: i18n.t('Update'), title: i18n.t('AccountBackupPlanUpdate'),
action: 'update' action: 'update'
}, },
hidden: true hidden: true
@@ -376,7 +376,7 @@ export default [
path: ':id', path: ':id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'), component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'),
name: 'AccountBackupPlanDetail', name: 'AccountBackupPlanDetail',
meta: { title: i18n.t('AccountBackup') }, meta: { title: i18n.t('AccountBackupPlanDetail') },
hidden: true hidden: true
}, },
{ {

View File

@@ -43,7 +43,7 @@
&.has-logo { &.has-logo {
.el-scrollbar { .el-scrollbar {
height: calc(100% - #{$headerHeight} - 40px - 50px); // header-height, view-header, footer-height height: calc(100% - #{$headerHeight} - 40px - 52px); // header-height, view-header, footer-height
} }
} }

View File

@@ -415,9 +415,14 @@ export function formatFileSize(bytes) {
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i] return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
} }
const notUppercase = ['to', 'a', 'from']
export function toTitleCase(string) { export function toTitleCase(string) {
if (!string) return string if (!string) return string
return string.trim().split(' ').map(item => { return string.trim().split(' ').map(item => {
if (notUppercase.includes(item.toLowerCase())) {
return item
}
return item[0].toUpperCase() + item.slice(1) return item[0].toUpperCase() + item.slice(1)
}).join(' ') }).join(' ')
} }

View File

@@ -38,7 +38,6 @@ async function getPublicSetting({ to, from, next }, isOpen) {
if (!publicSettings || Object.keys(publicSettings).length === 0 || !isOpen) { if (!publicSettings || Object.keys(publicSettings).length === 0 || !isOpen) {
await store.dispatch('settings/getPublicSettings', isOpen) await store.dispatch('settings/getPublicSettings', isOpen)
} }
console.log('Get public setting done')
} }
async function refreshCurrentOrg() { async function refreshCurrentOrg() {

View File

@@ -42,14 +42,10 @@ export default {
}, },
timedelta: { timedelta: {
label: this.$t('TimeDelta'), label: this.$t('TimeDelta'),
width: '90px',
formatter: function(row) { formatter: function(row) {
return row.timedelta.toFixed(2) + 's' return row.timedelta.toFixed(2) + 's'
} }
}, },
is_success: {
width: '90px'
},
actions: { actions: {
formatterArgs: { formatterArgs: {
hasDelete: false, hasDelete: false,

View File

@@ -45,14 +45,7 @@ export default {
is_periodic: { is_periodic: {
formatterArgs: { formatterArgs: {
showFalse: false showFalse: false
}, }
width: '80px'
},
periodic_display: {
width: '150px'
},
comment: {
width: '90px'
}, },
executed_amount: { executed_amount: {
formatter: DetailFormatter, formatter: DetailFormatter,
@@ -70,7 +63,6 @@ export default {
} }
}, },
actions: { actions: {
width: '164px',
formatterArgs: { formatterArgs: {
onClone: ({ row }) => { onClone: ({ row }) => {
vm.$router.push({ name: 'AccountBackupPlanCreate', query: { clone_from: row.id }}) vm.$router.push({ name: 'AccountBackupPlanCreate', query: { clone_from: row.id }})

View File

@@ -51,7 +51,6 @@ export default {
prop: 'id', prop: 'id',
label: this.$t('Actions'), label: this.$t('Actions'),
align: 'center', align: 'center',
width: 150,
objects: this.object.assets, objects: this.object.assets,
formatter: DeleteActionFormatter, formatter: DeleteActionFormatter,
onDelete: function(col, row, cellValue, reload) { onDelete: function(col, row, cellValue, reload) {

View File

@@ -42,25 +42,21 @@ export default {
}, },
asset_amount: { asset_amount: {
label: this.$t('AssetAmount'), label: this.$t('AssetAmount'),
width: '80px',
formatter: function(row) { formatter: function(row) {
return <span>{row.snapshot.asset_amount}</span> return <span>{row.snapshot.asset_amount}</span>
} }
}, },
node_amount: { node_amount: {
label: this.$t('NodeAmount'), label: this.$t('NodeAmount'),
width: '80px',
formatter: function(row) { formatter: function(row) {
return <span>{row.snapshot.node_amount}</span> return <span>{row.snapshot.node_amount}</span>
} }
}, },
status: { status: {
label: this.$t('Result'), label: this.$t('Result')
width: '80px'
}, },
timedelta: { timedelta: {
label: this.$t('TimeDelta'), label: this.$t('TimeDelta'),
width: '90px',
formatter: function(row) { formatter: function(row) {
return row.timedelta.toFixed(2) + 's' return row.timedelta.toFixed(2) + 's'
} }

View File

@@ -46,21 +46,14 @@ export default {
return <span> { row.secret_strategy.label } </span> return <span> { row.secret_strategy.label } </span>
} }
}, },
secret_type: {
width: '120px'
},
is_periodic: { is_periodic: {
formatterArgs: { formatterArgs: {
showFalse: false showFalse: false
}, },
width: '152px'
},
periodic_display: {
width: '150px' width: '150px'
}, },
executed_amount: { executed_amount: {
formatter: DetailFormatter, formatter: DetailFormatter,
width: '100px',
formatterArgs: { formatterArgs: {
route: 'AccountGatherList', route: 'AccountGatherList',
can: vm.$hasPerm('accounts.view_changesecretexecution'), can: vm.$hasPerm('accounts.view_changesecretexecution'),
@@ -75,11 +68,7 @@ export default {
} }
} }
}, },
comment: {
width: '90px'
},
actions: { actions: {
width: '164px',
formatterArgs: { formatterArgs: {
onClone: ({ row }) => { onClone: ({ row }) => {
vm.$router.push({ name: 'AccountChangeSecretCreate', query: { clone_from: row.id }}) vm.$router.push({ name: 'AccountChangeSecretCreate', query: { clone_from: row.id }})

View File

@@ -52,7 +52,7 @@ export default {
formatterArgs: { formatterArgs: {
showFalse: false showFalse: false
}, },
width: '152px' width: '150px'
}, },
periodic_display: { periodic_display: {
}, },

View File

@@ -14,8 +14,8 @@ export default {
}, },
data() { data() {
return { return {
node_ids: [], nodeIds: [],
asset_ids: [], assetIds: [],
isAssetType: '', isAssetType: '',
initial: { initial: {
is_periodic: this.$store.getters.hasValidLicense, is_periodic: this.$store.getters.hasValidLicense,
@@ -55,7 +55,7 @@ export default {
}, },
on: { on: {
input: ([value]) => { input: ([value]) => {
this.asset_ids = value this.assetIds = value
} }
} }
}, },
@@ -71,7 +71,7 @@ export default {
}, },
on: { on: {
input: ([value]) => { input: ([value]) => {
this.node_ids = value?.map(i => i.pk) this.nodeIds = value?.map(i => i.pk)
} }
} }
}, },
@@ -96,8 +96,8 @@ export default {
label: this.$t('PushParams'), label: this.$t('PushParams'),
el: { el: {
method: 'push_account_method', method: 'push_account_method',
assets: this.asset_ids, assets: this.assetIds,
nodes: this.node_ids nodes: this.nodeIds
}, },
helpText: this.$t('ParamsHelpText') helpText: this.$t('ParamsHelpText')
} }
@@ -121,13 +121,13 @@ export default {
} }
}, },
watch: { watch: {
node_ids: { nodeIds: {
handler(val) { handler(val) {
this.fieldsMeta.params.el.nodes = val this.fieldsMeta.params.el.nodes = val
}, },
deep: true deep: true
}, },
asset_ids: { assetIds: {
handler(val) { handler(val) {
this.fieldsMeta.params.el.assets = val this.fieldsMeta.params.el.assets = val
}, },

View File

@@ -42,25 +42,21 @@ export default {
}, },
asset_amount: { asset_amount: {
label: this.$t('AssetAmount'), label: this.$t('AssetAmount'),
width: '120px',
formatter: function(row) { formatter: function(row) {
return <span>{row.snapshot.asset_amount}</span> return <span>{row.snapshot.asset_amount}</span>
} }
}, },
node_amount: { node_amount: {
label: this.$t('NodeAmount'), label: this.$t('NodeAmount'),
width: '120px',
formatter: function(row) { formatter: function(row) {
return <span>{row.snapshot.node_amount}</span> return <span>{row.snapshot.node_amount}</span>
} }
}, },
status: { status: {
label: this.$t('Result'), label: this.$t('Result')
width: '120px'
}, },
timedelta: { timedelta: {
label: this.$t('TimeDelta'), label: this.$t('TimeDelta'),
width: '100px',
formatter: function(row) { formatter: function(row) {
return row.timedelta.toFixed(2) + 's' return row.timedelta.toFixed(2) + 's'
} }

View File

@@ -56,22 +56,13 @@ export default {
} }
}, },
assets_amount: { assets_amount: {
label: vm.$t('AssetAmount'), label: vm.$t('AssetAmount')
width: '80px'
}, },
nodes_amount: { nodes_amount: {
label: vm.$t('NodeAmount'), label: vm.$t('NodeAmount')
width: '80px'
},
is_periodic: {
width: '152px'
},
periodic_display: {
width: '150px'
}, },
password_strategy_display: { password_strategy_display: {
label: vm.$t('PasswordStrategy'), label: vm.$t('PasswordStrategy'),
width: '220px',
showOverflowTooltip: true showOverflowTooltip: true
}, },
executed_amount: { executed_amount: {
@@ -89,14 +80,7 @@ export default {
} }
} }
}, },
is_active: {
width: '87px'
},
comment: {
width: '90px'
},
actions: { actions: {
width: '164px',
formatterArgs: { formatterArgs: {
extraActions: [ extraActions: [
{ {

View File

@@ -38,17 +38,12 @@ export default {
}, },
columnsMeta: { columnsMeta: {
privileged: { privileged: {
width: '120px',
formatterArgs: { formatterArgs: {
showText: false, showText: false,
showFalse: false showFalse: false
} }
}, },
secret_type: {
width: '120px'
},
has_secret: { has_secret: {
width: '120px',
formatterArgs: { formatterArgs: {
showFalse: false, showFalse: false,
showText: false showText: false

View File

@@ -21,14 +21,12 @@ export default {
min: ['material', 'is_success'], min: ['material', 'is_success'],
default: [ default: [
'creator_name', 'material', 'is_finished', 'creator_name', 'material', 'is_finished',
'is_success', 'time_cost', 'is_success', 'time_cost', 'date_finished', 'actions'
'date_finished', 'actions'
] ]
}, },
columns: [ columns: [
'creator_name', 'material', 'is_finished', 'creator_name', 'material', 'is_finished',
'is_success', 'time_cost', 'is_success', 'time_cost', 'date_finished', 'actions'
'date_finished', 'actions'
], ],
columnsMeta: { columnsMeta: {
actions: { actions: {
@@ -50,7 +48,6 @@ export default {
} }
}, },
time_cost: { time_cost: {
width: '100px',
formatter: function(row) { formatter: function(row) {
if (row.time_cost) { if (row.time_cost) {
return row.time_cost.toFixed(2) + 's' return row.time_cost.toFixed(2) + 's'
@@ -59,19 +56,14 @@ export default {
} }
}, },
is_finished: { is_finished: {
width: '96px',
formatter: (row) => { formatter: (row) => {
if (row.is_finished) { if (row.is_finished) {
return <i Class='fa fa-check text-primary'/> return <i Class='fa fa-check text-primary'/>
} }
return <i Class='fa fa-times text-danger'/> return <i Class='fa fa-times text-danger'/>
},
formatterArgs: {
width: '14px'
} }
}, },
is_success: { is_success: {
width: '96px',
formatter: (row) => { formatter: (row) => {
if (!row.is_finished) { if (!row.is_finished) {
return <i Class='fa fa fa-spinner fa-spin'/> return <i Class='fa fa fa-spinner fa-spin'/>
@@ -80,13 +72,7 @@ export default {
return <i Class='fa fa-check text-primary'/> return <i Class='fa fa-check text-primary'/>
} }
return <i Class='fa fa-times text-danger'/> return <i Class='fa fa-times text-danger'/>
},
formatterArgs: {
width: '14px'
} }
},
date_start: {
width: '160px'
} }
} }
}, },

View File

@@ -25,23 +25,8 @@ export default {
}, },
url: '/api/v1/audits/login-logs/', url: '/api/v1/audits/login-logs/',
columnsMeta: { columnsMeta: {
username: {
width: '120px'
},
backend_display: {
width: '120px'
},
actions: { actions: {
has: false has: false
},
city: {
width: '120px'
},
reason_display: {
width: '120px'
},
datetime: {
width: '120px'
} }
} }
}, },

View File

@@ -39,20 +39,7 @@ export default {
] ]
}, },
columnsMeta: { columnsMeta: {
resource_type: {
width: '180px'
},
datetime: {
width: '160px'
},
remote_addr: {
width: '140px'
},
action_display: {
width: '70px'
},
actions: { actions: {
width: '70px',
formatter: ActionsFormatter, formatter: ActionsFormatter,
formatterArgs: { formatterArgs: {
hasUpdate: false, hasUpdate: false,

View File

@@ -18,12 +18,6 @@ export default {
default: ['user', 'change_by', 'remote_addr', 'datetime'] default: ['user', 'change_by', 'remote_addr', 'datetime']
}, },
columnsMeta: { columnsMeta: {
remote_addr: {
width: '140px'
},
datetime: {
width: '180px'
},
actions: { actions: {
has: false has: false
} }

View File

@@ -18,9 +18,8 @@
import Page from '@/layout/components/Page' import Page from '@/layout/components/Page'
import AssetTreeTable from '@/components/Apps/AssetTreeTable' import AssetTreeTable from '@/components/Apps/AssetTreeTable'
import PermBulkUpdateDialog from './components/PermBulkUpdateDialog' import PermBulkUpdateDialog from './components/PermBulkUpdateDialog'
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { AccountLabelMapper, AssetPermissionListPageSearchConfigOptions } from '../const' import { AssetPermissionListPageSearchConfigOptions, AssetPermissionTableMeta } from '../const'
export default { export default {
components: { components: {
@@ -55,99 +54,7 @@ export default {
'nodes_amount', 'accounts', 'is_valid', 'actions' 'nodes_amount', 'accounts', 'is_valid', 'actions'
] ]
}, },
columnsMeta: { columnsMeta: AssetPermissionTableMeta
name: {
minWidth: '160px',
formatterArgs: {
routeQuery: {
activeTab: 'AssetPermissionDetail'
}
}
},
action: {
label: this.$t('Action'),
formatter: function(row) {
if (row.actions.length === 6) {
return vm.$t('All')
}
return row.actions.map(item => {
return item.label.replace(/ \([^)]*\)/, '')
}).join(',')
}
},
is_expired: {
formatterArgs: {
showFalse: false
}
},
from_ticket: {
width: 100,
formatterArgs: {
showFalse: false
}
},
users_amount: {
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionUser'
}
}
},
user_groups_amount: {
width: 100,
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionUser'
}
}
},
assets_amount: {
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionAsset'
}
}
},
nodes_amount: {
width: 80,
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionAsset'
}
}
},
accounts: {
formatter: AmountFormatter,
formatterArgs: {
getItem(item) {
if (item !== '@SPEC') {
return AccountLabelMapper[item] || item
}
},
routeQuery: {
activeTab: 'AssetPermissionAccount'
}
}
},
actions: {
formatterArgs: {
updateRoute: 'AssetPermissionUpdate',
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/perms/asset-permissions/${id}/`
return this.$axios.delete(url)
}
}
}
}
}, },
headerActions: { headerActions: {
hasLabelSearch: true, hasLabelSearch: true,

View File

@@ -1,4 +1,5 @@
import i18n from '@/i18n/i18n' import i18n from '@/i18n/i18n'
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue'
export const UserAssetPermissionListPageSearchConfigOptions = [ export const UserAssetPermissionListPageSearchConfigOptions = [
{ label: i18n.t('Name'), value: 'name' }, { label: i18n.t('Name'), value: 'name' },
@@ -30,6 +31,100 @@ export const UserAssetPermissionListPageSearchConfigOptions = [
} }
] ]
export const AssetPermissionTableMeta = {
name: {
minWidth: '160px',
formatterArgs: {
routeQuery: {
activeTab: 'AssetPermissionDetail'
}
}
},
action: {
label: i18n.t('Action'),
formatter: (row) => {
if (row.actions.length === 6) {
return i18n.t('All')
}
return row.actions.map(item => {
return item.label.replace(/ \([^)]*\)/, '')
}).join(',')
}
},
is_expired: {
formatterArgs: {
showFalse: false
}
},
from_ticket: {
width: 100,
formatterArgs: {
showFalse: false
}
},
users_amount: {
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionUser'
}
}
},
user_groups_amount: {
width: 100,
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionUser'
}
}
},
assets_amount: {
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionAsset'
}
}
},
nodes_amount: {
width: 80,
formatter: AmountFormatter,
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionAsset'
}
}
},
accounts: {
formatter: AmountFormatter,
formatterArgs: {
getItem(item) {
if (item !== '@SPEC') {
return AccountLabelMapper[item] || item
}
},
routeQuery: {
activeTab: 'AssetPermissionAccount'
}
}
},
actions: {
formatterArgs: {
updateRoute: 'AssetPermissionUpdate',
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/perms/asset-permissions/${id}/`
return this.$axios.delete(url)
}
}
}
}
export const AssetPermissionListPageSearchConfigOptions = [ export const AssetPermissionListPageSearchConfigOptions = [
...UserAssetPermissionListPageSearchConfigOptions, ...UserAssetPermissionListPageSearchConfigOptions,
{ {

View File

@@ -66,7 +66,6 @@ export default {
formatter: OutputExpandFormatter formatter: OutputExpandFormatter
}, },
risk_level: { risk_level: {
width: '105px',
formatter: (row, col, cellValue) => { formatter: (row, col, cellValue) => {
const display = row['risk_level'].label const display = row['risk_level'].label
if (cellValue?.value === 0) { if (cellValue?.value === 0) {
@@ -79,15 +78,8 @@ export default {
actions: { actions: {
has: false has: false
}, },
asset: {
width: '120px'
},
user: {
width: '100px'
},
session: { session: {
formatter: DetailFormatter, formatter: DetailFormatter,
width: '100px',
formatterArgs: { formatterArgs: {
openInNewPage: true, openInNewPage: true,
can: this.$hasPerm('terminal.view_session'), can: this.$hasPerm('terminal.view_session'),
@@ -104,7 +96,6 @@ export default {
}, },
timestamp: { timestamp: {
label: this.$t('Date'), label: this.$t('Date'),
width: '130px',
sortable: 'custom', sortable: 'custom',
formatter: function(row) { formatter: function(row) {
return toSafeLocalDateStr(row.timestamp * 1000) return toSafeLocalDateStr(row.timestamp * 1000)

View File

@@ -21,17 +21,7 @@ export default {
}, },
url: '/api/v1/audits/ftp-logs/', url: '/api/v1/audits/ftp-logs/',
columnsMeta: { columnsMeta: {
remote_addr: {
width: '140px'
},
operate: {
width: '100px'
},
is_success: {
width: '100px'
},
actions: { actions: {
width: '82px',
formatterArgs: { formatterArgs: {
hasUpdate: false, hasUpdate: false,
hasDelete: false, hasDelete: false,

View File

@@ -27,7 +27,7 @@ export default {
return { return {
min: ['id', 'actions'], min: ['id', 'actions'],
default: [ default: [
'id', 'user', 'asset', 'account', 'remote_addr', 'protocol', 'id', 'user', 'asset', 'account', 'protocol',
'date_start', 'actions' 'date_start', 'actions'
] ]
} }
@@ -46,7 +46,6 @@ export default {
prop: 'id', prop: 'id',
label: this.$t('Number'), label: this.$t('Number'),
align: 'center', align: 'center',
width: '80px',
formatter: function(row, column, cellValue, index) { formatter: function(row, column, cellValue, index) {
const label = index + 1 const label = index + 1
const route = { to: { name: 'SessionDetail', params: { id: row.id }}} const route = { to: { name: 'SessionDetail', params: { id: row.id }}}
@@ -54,7 +53,6 @@ export default {
} }
}, },
user: { user: {
width: '100px',
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
getRoute: ({ row }) => { getRoute: ({ row }) => {
@@ -88,7 +86,6 @@ export default {
} }
}, },
is_finished: { is_finished: {
width: '86px',
formatterArgs: { formatterArgs: {
showFalse: false showFalse: false
} }
@@ -112,32 +109,15 @@ export default {
} }
} }
}, },
command_amount: {
width: '90px'
},
login_from: {
width: '115px'
},
remote_addr: {
width: '140px'
},
protocol: { protocol: {
width: '100px',
sortable: false, sortable: false,
formatter: null formatter: null
}, },
date_start: {
width: '150px'
},
date_end: {
width: '150px'
},
duration: { duration: {
label: this.$t('Duration'), label: this.$t('Duration'),
formatter: function(row) { formatter: function(row) {
return timeOffset(row.date_start, row.date_end) return timeOffset(row.date_start, row.date_end)
}, }
width: '80px'
}, },
is_locked: { is_locked: {
label: this.$t('IsLocked') label: this.$t('IsLocked')
@@ -145,7 +125,6 @@ export default {
actions: { actions: {
prop: 'actions', prop: 'actions',
label: this.$t('Actions'), label: this.$t('Actions'),
width: '160px',
formatter: ActionsFormatter, formatter: ActionsFormatter,
formatterArgs: { formatterArgs: {
hasEdit: false, hasEdit: false,

View File

@@ -67,7 +67,7 @@ export default {
showText: false showText: false
}, },
align: 'center', align: 'center',
width: '100px' width: '150px'
}, },
actions: { actions: {
formatterArgs: { formatterArgs: {

View File

@@ -53,7 +53,7 @@ export default {
showText: false showText: false
}, },
align: 'center', align: 'center',
width: '100px' width: '150px'
}, },
comment: { comment: {
sortable: 'custom' sortable: 'custom'

View File

@@ -21,7 +21,6 @@ export default {
}, },
columnsMeta: { columnsMeta: {
users_amount: { users_amount: {
width: '120px',
formatter: AmountFormatter, formatter: AmountFormatter,
formatterArgs: { formatterArgs: {
async: true, async: true,

View File

@@ -66,7 +66,7 @@ export default {
} }
}, },
builtin: { builtin: {
width: '100px', width: '150px',
formatterArgs: { formatterArgs: {
showFalse: false showFalse: false
} }

View File

@@ -8,8 +8,7 @@
<script> <script>
import ListTable from '@/components/Table/ListTable' import ListTable from '@/components/Table/ListTable'
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue' import { AssetPermissionTableMeta, UserAssetPermissionListPageSearchConfigOptions } from '@/views/perms/const'
import { UserAssetPermissionListPageSearchConfigOptions } from '@/views/perms/const'
export default { export default {
name: 'UserAssetPermission', name: 'UserAssetPermission',
@@ -32,101 +31,11 @@ export default {
columnsShow: { columnsShow: {
min: ['name', 'actions'], min: ['name', 'actions'],
default: [ default: [
'name', 'users', 'user_groups', 'assets', 'name', 'users_amount', 'user_groups_amount', 'assets_amount',
'nodes', 'accounts', 'is_valid', 'actions' 'nodes_amount', 'accounts', 'is_valid', 'actions'
] ]
}, },
columnsMeta: { columnsMeta: AssetPermissionTableMeta
name: {
formatterArgs: {
route: 'AssetPermissionDetail'
}
},
action: {
label: this.$t('Action'),
formatter: function(row) {
return row.actions.map(item => {
return item.label
}).join(', ')
}
},
is_expired: {
formatterArgs: {
showFalse: false
}
},
from_ticket: {
width: 100,
formatterArgs: {
showFalse: false
}
},
users: {
width: '100px',
formatter: AmountFormatter,
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionUser'
}
}
},
user_groups: {
width: '100px',
formatter: AmountFormatter,
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionUser'
}
}
},
assets: {
width: '100px',
formatter: AmountFormatter,
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionAsset'
}
}
},
nodes: {
width: '100px',
formatter: AmountFormatter,
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionAsset'
}
}
},
accounts: {
width: '100px',
formatter: AmountFormatter,
formatterArgs: {
route: 'AssetPermissionDetail',
getItem(item) {
return item
},
routeQuery: {
activeTab: 'AssetPermissionAccount'
}
}
},
actions: {
formatterArgs: {
updateRoute: 'AssetPermissionUpdate',
hasDelete: false,
hasClone: false,
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/perms/asset-permissions/${id}/`
return this.$axios.delete(url)
}
}
}
}
}, },
headerActions: { headerActions: {
hasLeftActions: false, hasLeftActions: false,

View File

@@ -1,7 +1,7 @@
<template> <template>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :md="24" :sm="24"> <el-col :md="24" :sm="24">
<BaseList :cssssssssslumns-show="columnsShow" :url="url" /> <BaseList :columns-show="columnsShow" :url="url" />
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
@@ -24,10 +24,10 @@ export default {
return { return {
url: `/api/v1/terminal/sessions/?user_id=${this.object.id}&order=is_finished,-date_end`, url: `/api/v1/terminal/sessions/?user_id=${this.object.id}&order=is_finished,-date_end`,
columnsShow: { columnsShow: {
min: ['id'], min: ['id', 'user', 'asset', 'account'],
default: [ default: [
'id', 'user', 'asset', 'account', 'remote_addr', 'protocol', 'id', 'user', 'asset', 'account', 'protocol',
'command_amount', 'date_start', 'duration' 'date_start', 'duration'
] ]
} }
} }

View File

@@ -63,6 +63,9 @@ export default {
width: '120px', width: '120px',
collapsible: false collapsible: false
}, },
email: {
'min-width': '120px'
},
username: { username: {
formatter: (row) => { formatter: (row) => {
return row['username'].replace(' ', '*') return row['username'].replace(' ', '*')