mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
perf: 修改文案
This commit is contained in:
@@ -153,7 +153,7 @@ export default {
|
||||
border: 1px solid #dcdee2;
|
||||
border-radius: 1px;
|
||||
background-color: #fff;
|
||||
line-height: 32px;
|
||||
line-height: 30px;
|
||||
|
||||
&:hover {
|
||||
border-color: #C0C4CC;
|
||||
@@ -165,7 +165,7 @@ export default {
|
||||
}
|
||||
|
||||
&>>> .el-autocomplete {
|
||||
height: 30px;
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ export default {
|
||||
}
|
||||
|
||||
.filter-field >>> .el-input__inner {
|
||||
height: 29px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.show-password {
|
||||
|
||||
@@ -51,6 +51,7 @@ export default {
|
||||
computed: {
|
||||
iTitle() {
|
||||
let title = this.title || this.$route.meta.title
|
||||
console.log('title', this.$route.meta.title)
|
||||
if (!title) {
|
||||
title = this.$t('NoTitle')
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ export default [
|
||||
name: 'AccountPushCreate',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('Create'),
|
||||
title: i18n.t('AccountPushCreate'),
|
||||
permissions: ['accounts.add_pushaccountautomation']
|
||||
}
|
||||
},
|
||||
@@ -150,7 +150,7 @@ export default [
|
||||
name: 'AccountPushUpdate',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('Update'),
|
||||
title: i18n.t('AccountPushUpdate'),
|
||||
permissions: ['accounts.change_pushaccountautomation']
|
||||
}
|
||||
},
|
||||
@@ -212,7 +212,7 @@ export default [
|
||||
name: 'AccountGatherTaskCreate',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('Create'),
|
||||
title: i18n.t('AccountGatherTaskCreate'),
|
||||
permissions: ['accounts.add_gatheraccountsautomation']
|
||||
}
|
||||
},
|
||||
@@ -232,7 +232,7 @@ export default [
|
||||
name: 'AccountGatherTaskUpdate',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('Update'),
|
||||
title: i18n.t('AccountGatherTaskUpdate'),
|
||||
action: 'update',
|
||||
permissions: ['accounts.change_gatheraccountsautomation'],
|
||||
activeMenu: '/accounts/account-gather'
|
||||
@@ -357,7 +357,7 @@ export default [
|
||||
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
|
||||
name: 'AccountBackupPlanCreate',
|
||||
meta: {
|
||||
title: i18n.t('Create'),
|
||||
title: i18n.t('AccountBackupPlanCreate'),
|
||||
action: 'create'
|
||||
},
|
||||
hidden: true
|
||||
@@ -367,7 +367,7 @@ export default [
|
||||
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
|
||||
name: 'AccountBackupPlanUpdate',
|
||||
meta: {
|
||||
title: i18n.t('Update'),
|
||||
title: i18n.t('AccountBackupPlanUpdate'),
|
||||
action: 'update'
|
||||
},
|
||||
hidden: true
|
||||
@@ -376,7 +376,7 @@ export default [
|
||||
path: ':id',
|
||||
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'),
|
||||
name: 'AccountBackupPlanDetail',
|
||||
meta: { title: i18n.t('AccountBackup') },
|
||||
meta: { title: i18n.t('AccountBackupPlanDetail') },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
&.has-logo {
|
||||
.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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -415,9 +415,14 @@ export function formatFileSize(bytes) {
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
|
||||
}
|
||||
|
||||
const notUppercase = ['to', 'a', 'from']
|
||||
|
||||
export function toTitleCase(string) {
|
||||
if (!string) return string
|
||||
return string.trim().split(' ').map(item => {
|
||||
if (notUppercase.includes(item.toLowerCase())) {
|
||||
return item
|
||||
}
|
||||
return item[0].toUpperCase() + item.slice(1)
|
||||
}).join(' ')
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ async function getPublicSetting({ to, from, next }, isOpen) {
|
||||
if (!publicSettings || Object.keys(publicSettings).length === 0 || !isOpen) {
|
||||
await store.dispatch('settings/getPublicSettings', isOpen)
|
||||
}
|
||||
console.log('Get public setting done')
|
||||
}
|
||||
|
||||
async function refreshCurrentOrg() {
|
||||
|
||||
@@ -14,8 +14,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
node_ids: [],
|
||||
asset_ids: [],
|
||||
nodeIds: [],
|
||||
assetIds: [],
|
||||
isAssetType: '',
|
||||
initial: {
|
||||
is_periodic: this.$store.getters.hasValidLicense,
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
},
|
||||
on: {
|
||||
input: ([value]) => {
|
||||
this.asset_ids = value
|
||||
this.assetIds = value
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
},
|
||||
on: {
|
||||
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'),
|
||||
el: {
|
||||
method: 'push_account_method',
|
||||
assets: this.asset_ids,
|
||||
nodes: this.node_ids
|
||||
assets: this.assetIds,
|
||||
nodes: this.nodeIds
|
||||
},
|
||||
helpText: this.$t('ParamsHelpText')
|
||||
}
|
||||
@@ -121,13 +121,13 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
node_ids: {
|
||||
nodeIds: {
|
||||
handler(val) {
|
||||
this.fieldsMeta.params.el.nodes = val
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
asset_ids: {
|
||||
assetIds: {
|
||||
handler(val) {
|
||||
this.fieldsMeta.params.el.assets = val
|
||||
},
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
import Page from '@/layout/components/Page'
|
||||
import AssetTreeTable from '@/components/Apps/AssetTreeTable'
|
||||
import PermBulkUpdateDialog from './components/PermBulkUpdateDialog'
|
||||
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { AccountLabelMapper, AssetPermissionListPageSearchConfigOptions } from '../const'
|
||||
import { AssetPermissionListPageSearchConfigOptions, AssetPermissionTableMeta } from '../const'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -55,99 +54,7 @@ export default {
|
||||
'nodes_amount', 'accounts', 'is_valid', 'actions'
|
||||
]
|
||||
},
|
||||
columnsMeta: {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
columnsMeta: AssetPermissionTableMeta
|
||||
},
|
||||
headerActions: {
|
||||
hasLabelSearch: true,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import i18n from '@/i18n/i18n'
|
||||
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue'
|
||||
|
||||
export const UserAssetPermissionListPageSearchConfigOptions = [
|
||||
{ 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 = [
|
||||
...UserAssetPermissionListPageSearchConfigOptions,
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
return {
|
||||
min: ['id', 'actions'],
|
||||
default: [
|
||||
'id', 'user', 'asset', 'account', 'remote_addr', 'protocol',
|
||||
'id', 'user', 'asset', 'account', 'protocol',
|
||||
'date_start', 'actions'
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/Table/ListTable'
|
||||
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue'
|
||||
import { UserAssetPermissionListPageSearchConfigOptions } from '@/views/perms/const'
|
||||
import { AssetPermissionTableMeta, UserAssetPermissionListPageSearchConfigOptions } from '@/views/perms/const'
|
||||
|
||||
export default {
|
||||
name: 'UserAssetPermission',
|
||||
@@ -32,101 +31,11 @@ export default {
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'name', 'users', 'user_groups', 'assets',
|
||||
'nodes', 'accounts', 'is_valid', 'actions'
|
||||
'name', 'users_amount', 'user_groups_amount', 'assets_amount',
|
||||
'nodes_amount', 'accounts', 'is_valid', 'actions'
|
||||
]
|
||||
},
|
||||
columnsMeta: {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
columnsMeta: AssetPermissionTableMeta
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-row :gutter="10">
|
||||
<el-col :md="24" :sm="24">
|
||||
<BaseList :cssssssssslumns-show="columnsShow" :url="url" />
|
||||
<BaseList :columns-show="columnsShow" :url="url" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -24,10 +24,10 @@ export default {
|
||||
return {
|
||||
url: `/api/v1/terminal/sessions/?user_id=${this.object.id}&order=is_finished,-date_end`,
|
||||
columnsShow: {
|
||||
min: ['id'],
|
||||
min: ['id', 'user', 'asset', 'account'],
|
||||
default: [
|
||||
'id', 'user', 'asset', 'account', 'remote_addr', 'protocol',
|
||||
'command_amount', 'date_start', 'duration'
|
||||
'id', 'user', 'asset', 'account', 'protocol',
|
||||
'date_start', 'duration'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,9 @@ export default {
|
||||
width: '120px',
|
||||
collapsible: false
|
||||
},
|
||||
email: {
|
||||
'min-width': '120px'
|
||||
},
|
||||
username: {
|
||||
formatter: (row) => {
|
||||
return row['username'].replace(' ', '*')
|
||||
|
||||
Reference in New Issue
Block a user