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

This commit is contained in:
Bai
2020-06-16 15:23:32 +08:00
7 changed files with 18 additions and 24 deletions

View File

@@ -119,8 +119,8 @@ export default {
).then(() => {
this.$message.success(this.$t('common.deleteSuccessMsg'))
this.zTree.removeNode(currentNode)
}).catch(error => {
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
}).catch(() => {
// this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
})
},
onRename: function(event, treeId, treeNode, isCancel) {

View File

@@ -65,7 +65,11 @@ export default {
.replace('详情', '')
this.$log.debug('Object is: ', obj)
const objectName = this.getObjectName(obj)
return `${objectType}: ${objectName}`
let title = `${objectType}: ${objectName}`
if (title.length > 80) {
title = title.slice(0, 80) + '...'
}
return title
}
},
goBack: {

View File

@@ -15,7 +15,7 @@
import DetailCard from '@/components/DetailCard'
import RelationCard from '@/components/RelationCard'
import QuickActions from '@/components/QuickActions'
import LabelCard from '@/components/LabelCard'
import LabelCard from './components/LabelCard'
import { toSafeLocalDateStr } from '@/utils/common'
export default {

View File

@@ -1,8 +1,8 @@
<template>
<IBox fa="fa-info-circle" :title="title" v-bind="$attrs">
<div class="quick-actions">
<p v-if="iTag.length === 0">{{ $t('common.Nothing') }}</p>
<el-tag v-for="i in iTag" :key="i" type="info">{{ i }}</el-tag>
<p v-if="iLabels.length === 0">{{ $t('common.Nothing') }}</p>
<el-tag v-for="i in iLabels" :key="i.name + i.value" type="info">{{ i.name }}: {{ i.value }}</el-tag>
</div>
</IBox>
</template>
@@ -30,17 +30,14 @@ export default {
},
data() {
return {
iTag: []
iLabels: []
}
},
mounted() {
this.$axios.get(`/api/v1/assets/labels/`).then(res => {
if (this.labels === []) {
return
}
for (const i in res) {
if (this.labels.indexOf(res[i].id) > -1) {
this.iTag.push(res[i].name)
this.iLabels.push(res[i])
}
}
})

View File

@@ -143,6 +143,11 @@ export default {
name: 'AssetCreate',
query: this.$route.query
},
searchConfig: {
options: [
{ label: this.$t('assets.Label'), value: 'label' }
]
},
extraMoreActions: [
{
name: 'DeactiveSelected',

View File

@@ -83,8 +83,7 @@ export default {
headerActions: {
hasLeftActions: false,
hasImport: false,
hasExport: false,
tagSearch: []
hasExport: false
}
},
headerActions: {

View File

@@ -22,17 +22,6 @@ export default {
url: `/api/v1/perms/asset-permissions/?user_id=${this.object.id}`,
hasSelection: false,
hasTree: true,
tagSearch: [
{ label: this.$t('common.Name'), key: 'name' },
{ label: this.$t('common.isValid'), key: 'is_valid' },
{ label: this.$t('users.Username'), key: 'username' },
{ label: this.$t('users.UserGroups'), key: 'user_group' },
{ label: this.$t('assets.IP'), key: 'ip' },
{ label: this.$t('assets.Hostname'), key: 'hostname' },
{ label: this.$t('assets.Node'), key: 'node' },
{ label: this.$t('assets.SystemUser'), key: 'system_user' },
{ label: '继承(先占位)', key: 'all=0' }
],
columns: [
'name', 'users_amount', 'user_groups_amount', 'assets_amount',
'nodes_amount', 'system_users_amount', 'is_active', 'actions'