mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-03 16:06:13 +00:00
fix
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<table style="width: 100%">
|
<table style="width: 100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<AssetSelect ref="assetSelect" @getAsset="getAsset" />
|
<AssetSelect ref="assetSelect" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import IBox from '@/components/IBox'
|
import IBox from '@/components/IBox'
|
||||||
import AssetSelect from '@/components/AssetSelect'
|
import AssetSelect from '@/components/AssetSelect'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AssetRelationCard',
|
name: 'AssetRelationCard',
|
||||||
components: {
|
components: {
|
||||||
@@ -47,26 +48,19 @@ export default {
|
|||||||
},
|
},
|
||||||
onAddSuccess: {
|
onAddSuccess: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default(that) {
|
default: (objects, that) => {}
|
||||||
this.$log.debug('AssetSelect value', that.assets)
|
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
|
||||||
setTimeout(() => location.reload(), 300)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
assets: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addObjects() {
|
addObjects() {
|
||||||
this.performAdd(this.assets, this).then(
|
const objects = this.$refs.assetSelect.$refs.select2.iValue
|
||||||
() => this.onAddSuccess(this)
|
this.performAdd(objects, this).then(
|
||||||
|
() => this.onAddSuccess(objects, this)
|
||||||
)
|
)
|
||||||
},
|
|
||||||
getAsset(assets) {
|
|
||||||
this.assets = assets
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -11,7 +11,7 @@
|
|||||||
@confirm="handleConfirm"
|
@confirm="handleConfirm"
|
||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
>
|
>
|
||||||
<GenericTreeListPage
|
<TreeTable
|
||||||
ref="ListPage"
|
ref="ListPage"
|
||||||
:tree-setting="treeSetting"
|
:tree-setting="treeSetting"
|
||||||
:table-config="tableConfig"
|
:table-config="tableConfig"
|
||||||
@@ -22,13 +22,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericTreeListPage from '@/layout/components/GenericTreeListPage'
|
import TreeTable from '@/components/TreeTable'
|
||||||
import { DetailFormatter } from '@/components/ListTable/formatters'
|
import { DetailFormatter } from '@/components/ListTable/formatters'
|
||||||
import { Select2, Dialog } from '@/components'
|
import { Select2, Dialog } from '@/components'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
componentName: 'AssetSelect',
|
componentName: 'AssetSelect',
|
||||||
components: { GenericTreeListPage, Select2, Dialog },
|
components: { TreeTable, Select2, Dialog },
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@@ -176,7 +176,7 @@ export default {
|
|||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
.treebox {
|
.treebox {
|
||||||
height: 100vh - 120;
|
height: calc(100vh - 120px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -20,7 +20,7 @@ export default {
|
|||||||
const url = col.deleteUrl + cellValue
|
const url = col.deleteUrl + cellValue
|
||||||
this.$axios.delete(url).then(res => {
|
this.$axios.delete(url).then(res => {
|
||||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
reload()
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
|
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
|
||||||
})
|
})
|
||||||
|
@@ -158,6 +158,9 @@ export default {
|
|||||||
this.initialSelect()
|
this.initialSelect()
|
||||||
this.initialized = true
|
this.initialized = true
|
||||||
}
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.select.elFormItem.clearValidate()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadMore(load) {
|
async loadMore(load) {
|
||||||
|
@@ -22,3 +22,4 @@ export { default as Switcher } from './Swicher'
|
|||||||
export { default as SummaryCard } from './SummaryCard'
|
export { default as SummaryCard } from './SummaryCard'
|
||||||
export { default as UploadField } from './UploadField'
|
export { default as UploadField } from './UploadField'
|
||||||
export { default as AssetUserTable } from './AssetUserTable'
|
export { default as AssetUserTable } from './AssetUserTable'
|
||||||
|
export { default as AssetRelationCard } from './AssetRelationCard'
|
||||||
|
@@ -224,6 +224,7 @@
|
|||||||
"createSuccessMsg": "创建成功",
|
"createSuccessMsg": "创建成功",
|
||||||
"createdBy": "创建人",
|
"createdBy": "创建人",
|
||||||
"dateCreated": "创建日期",
|
"dateCreated": "创建日期",
|
||||||
|
"dateStart": "开始日期",
|
||||||
"dateExpired": "失效日期",
|
"dateExpired": "失效日期",
|
||||||
"deleteErrorMsg": "删除失败",
|
"deleteErrorMsg": "删除失败",
|
||||||
"deleteSelected": "删除所选",
|
"deleteSelected": "删除所选",
|
||||||
@@ -338,7 +339,9 @@
|
|||||||
"versionRunExecution": "执行历史",
|
"versionRunExecution": "执行历史",
|
||||||
"selectAssetsMessage":"选择左侧资产, 选择运行的系统用户,批量执行命令",
|
"selectAssetsMessage":"选择左侧资产, 选择运行的系统用户,批量执行命令",
|
||||||
"selectedAssets": "已选择资产:",
|
"selectedAssets": "已选择资产:",
|
||||||
"inTotal": "总共"
|
"inTotal": "总共",
|
||||||
|
"Execute": "执行",
|
||||||
|
"PleaseSelect": "请选择"
|
||||||
},
|
},
|
||||||
"perms": {
|
"perms": {
|
||||||
"Actions": "动作",
|
"Actions": "动作",
|
||||||
@@ -417,7 +420,7 @@
|
|||||||
"CreateReplayStorage": "创建录像存储",
|
"CreateReplayStorage": "创建录像存储",
|
||||||
"Dashboard": "仪表盘",
|
"Dashboard": "仪表盘",
|
||||||
"DatabaseApp": "数据库应用",
|
"DatabaseApp": "数据库应用",
|
||||||
"DatabaseAppCreate": "",
|
"DatabaseAppCreate": "创建数据库应用",
|
||||||
"DatabaseAppDetail": "数据库详情",
|
"DatabaseAppDetail": "数据库详情",
|
||||||
"DatabaseAppPermission": "数据库授权",
|
"DatabaseAppPermission": "数据库授权",
|
||||||
"DatabaseAppPermissionCreate": "创建数据库授权规则",
|
"DatabaseAppPermissionCreate": "创建数据库授权规则",
|
||||||
|
@@ -336,7 +336,9 @@
|
|||||||
"TaskMonitor": "Task monitor",
|
"TaskMonitor": "Task monitor",
|
||||||
"selectAssetsMessage":"Select the left asset, select the running system user, execute command in batch",
|
"selectAssetsMessage":"Select the left asset, select the running system user, execute command in batch",
|
||||||
"selectedAssets": "Selected assets:",
|
"selectedAssets": "Selected assets:",
|
||||||
"inTotal": "In total"
|
"inTotal": "In total",
|
||||||
|
"Execute": "Execute",
|
||||||
|
"PleaseSelect": "Please select"
|
||||||
},
|
},
|
||||||
"perms": {
|
"perms": {
|
||||||
"Actions": "Actions",
|
"Actions": "Actions",
|
||||||
|
@@ -91,7 +91,8 @@ export default {
|
|||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
route: 'AssetDetail'
|
route: 'AssetDetail'
|
||||||
}
|
},
|
||||||
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
ip: {
|
ip: {
|
||||||
sortable: 'custom',
|
sortable: 'custom',
|
||||||
@@ -114,7 +115,7 @@ export default {
|
|||||||
},
|
},
|
||||||
hasTips: true
|
hasTips: true
|
||||||
},
|
},
|
||||||
width: '80px',
|
width: '90px',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
<CodeMirror :options="codeMirrorOptions" @change="handleActionChange" />
|
<CodeMirror :options="codeMirrorOptions" @change="handleActionChange" />
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex;flex-direction: column ;justify-content: space-between">
|
<div style="display: flex;flex-direction: column ;justify-content: space-between">
|
||||||
<el-select v-model="selectedSystemUser" placeholder="请选择" @change="handleSystemUserChange">
|
<el-select v-model="selectedSystemUser" :placeholder="this.$t('ops.PleaseSelect')" @change="handleSystemUserChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button type="primary" size="small" @click="execute">执行</el-button>
|
<el-button type="primary" size="small" @click="execute">{{ this.$t('ops.Execute') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</IBox>
|
</IBox>
|
||||||
|
@@ -32,16 +32,16 @@ export default {
|
|||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('ops.lastRunSuccessHosts'),
|
title: this.$t('ops.lastRunSuccessHosts'),
|
||||||
content: {
|
content: {
|
||||||
hostname: 'linux',
|
hostname: this.object.last_success[0],
|
||||||
result: 'api没有该数据==api没有该数据api没有该数据api没有该数据api没有该数据'
|
result: this.object.last_success[1]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
RunFailedConfig: {
|
RunFailedConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('ops.lastRunFailedHosts'),
|
title: this.$t('ops.lastRunFailedHosts'),
|
||||||
content: {
|
content: {
|
||||||
hostname: 'window',
|
hostname: this.object.last_failure[0],
|
||||||
result: 'api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据'
|
result: this.object.last_failure[1]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
taskData: {}
|
taskData: {}
|
||||||
|
@@ -23,6 +23,7 @@ export default {
|
|||||||
initial: {
|
initial: {
|
||||||
is_active: true,
|
is_active: true,
|
||||||
actions: ['all', 'connect', 'updownload', 'upload_file', 'download_file'],
|
actions: ['all', 'connect', 'updownload', 'upload_file', 'download_file'],
|
||||||
|
date_start: '2020-06-18 00:00:00 +0800',
|
||||||
date_expired: '2099-12-31 00:00:00 +0800',
|
date_expired: '2099-12-31 00:00:00 +0800',
|
||||||
nodes: nodesInitial,
|
nodes: nodesInitial,
|
||||||
assets: assetsInitial
|
assets: assetsInitial
|
||||||
@@ -32,7 +33,7 @@ export default {
|
|||||||
[this.$t('perms.User'), ['users', 'user_groups']],
|
[this.$t('perms.User'), ['users', 'user_groups']],
|
||||||
[this.$t('perms.Asset'), ['assets', 'nodes', 'system_users']],
|
[this.$t('perms.Asset'), ['assets', 'nodes', 'system_users']],
|
||||||
[this.$t('common.action'), ['actions']],
|
[this.$t('common.action'), ['actions']],
|
||||||
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
[this.$t('common.Other'), ['is_active', 'date_start', 'date_expired', 'comment']]
|
||||||
],
|
],
|
||||||
url: '/api/v1/perms/asset-permissions/',
|
url: '/api/v1/perms/asset-permissions/',
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
@@ -97,6 +98,9 @@ export default {
|
|||||||
{ label: 'download_file', value: this.$t('perms.downloadFile') }
|
{ label: 'download_file', value: this.$t('perms.downloadFile') }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
date_start: {
|
||||||
|
label: this.$t('common.dateStart')
|
||||||
|
},
|
||||||
date_expired: {
|
date_expired: {
|
||||||
label: this.$t('common.dateExpired')
|
label: this.$t('common.dateExpired')
|
||||||
},
|
},
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<AssetRelationCard type="primary" v-bind="assetRelationConfig" />
|
<AssetRelationCard type="primary" v-bind="assetRelationConfig" />
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
import ListTable from '@/components/ListTable'
|
import ListTable from '@/components/ListTable'
|
||||||
import RelationCard from '@/components/RelationCard'
|
import RelationCard from '@/components/RelationCard'
|
||||||
import { DeleteActionFormatter } from '@/components/ListTable/formatters/index'
|
import { DeleteActionFormatter } from '@/components/ListTable/formatters/index'
|
||||||
import AssetRelationCard from './AssetRelationCard/index'
|
import AssetRelationCard from '@/components/AssetRelationCard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AssetPermissionAsset',
|
name: 'AssetPermissionAsset',
|
||||||
@@ -64,16 +64,22 @@ export default {
|
|||||||
assetRelationConfig: {
|
assetRelationConfig: {
|
||||||
icon: 'fa-edit',
|
icon: 'fa-edit',
|
||||||
title: this.$t('perms.addAssetToThisPermission'),
|
title: this.$t('perms.addAssetToThisPermission'),
|
||||||
performAdd: (items) => {
|
performAdd: (items, that) => {
|
||||||
const relationUrl = `/api/v1/perms/asset-permissions-assets-relations/`
|
const relationUrl = `/api/v1/perms/asset-permissions-assets-relations/`
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const data = items.map(v => {
|
const data = items.map(item => {
|
||||||
return {
|
return {
|
||||||
assetpermission: objectId,
|
assetpermission: objectId,
|
||||||
asset: v
|
asset: item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return this.$axios.post(relationUrl, data)
|
return this.$axios.post(relationUrl, data)
|
||||||
|
},
|
||||||
|
onAddSuccess: (items, that) => {
|
||||||
|
this.$log.debug('AssetSelect value', that.assets)
|
||||||
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
|
this.$refs.ListTable.reloadTable()
|
||||||
|
that.$refs.assetSelect.$refs.select2.clearSelected()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodeRelationConfig: {
|
nodeRelationConfig: {
|
||||||
@@ -102,7 +108,7 @@ export default {
|
|||||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.$refs.select2.clearSelected()
|
that.$refs.select2.clearSelected()
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
this.$refs.ListTable.reloadTable()
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const itemId = item.value
|
const itemId = item.value
|
||||||
@@ -119,7 +125,7 @@ export default {
|
|||||||
that.select2.disabledValues.splice(i, 1)
|
that.select2.disabledValues.splice(i, 1)
|
||||||
}
|
}
|
||||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
this.$refs.ListTable.reloadTable()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
systemUserRelationConfig: {
|
systemUserRelationConfig: {
|
||||||
@@ -148,7 +154,6 @@ export default {
|
|||||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.$refs.select2.clearSelected()
|
that.$refs.select2.clearSelected()
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const itemId = item.value
|
const itemId = item.value
|
||||||
@@ -167,7 +172,6 @@ export default {
|
|||||||
that.select2.disabledValues.splice(i, 1)
|
that.select2.disabledValues.splice(i, 1)
|
||||||
}
|
}
|
||||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
<DetailCard :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<QuickActions type="primary" :actions="quickActions" />
|
<QuickActions type="primary" :actions="quickActions" />
|
||||||
@@ -52,9 +52,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
cardTitle() {
|
|
||||||
return this.object.id
|
|
||||||
},
|
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard type="primary" v-bind="userRelationConfig" />
|
<RelationCard type="primary" v-bind="userRelationConfig" />
|
||||||
@@ -85,7 +85,7 @@ export default {
|
|||||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.$refs.select2.clearSelected()
|
that.$refs.select2.clearSelected()
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
this.$refs.ListTable.reloadTable()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
groupRelationConfig: {
|
groupRelationConfig: {
|
||||||
@@ -117,7 +117,7 @@ export default {
|
|||||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.$refs.select2.clearSelected()
|
that.$refs.select2.clearSelected()
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
this.$refs.ListTable.reloadTable()
|
||||||
},
|
},
|
||||||
onDeleteSuccess: (obj, that) => {
|
onDeleteSuccess: (obj, that) => {
|
||||||
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
@@ -128,7 +128,7 @@ export default {
|
|||||||
that.select2.disabledValues.splice(i, 1)
|
that.select2.disabledValues.splice(i, 1)
|
||||||
}
|
}
|
||||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||||
setTimeout(() => location.reload(), 300)
|
this.$refs.ListTable.reloadTable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ export default {
|
|||||||
activeMenu: 'AssetPermissionDetail',
|
activeMenu: 'AssetPermissionDetail',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
title: this.$t('perms.assetPermissionDetail'),
|
title: this.$t('common.BasicInfo'),
|
||||||
name: 'AssetPermissionDetail'
|
name: 'AssetPermissionDetail'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -24,7 +24,7 @@ export default {
|
|||||||
url: '/api/v1/perms/asset-permissions/',
|
url: '/api/v1/perms/asset-permissions/',
|
||||||
hasSelection: false,
|
hasSelection: false,
|
||||||
hasTree: true,
|
hasTree: true,
|
||||||
columns: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_active', 'actions'],
|
columns: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_valid', 'actions'],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
name: {
|
name: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
|
@@ -12,13 +12,14 @@ export default {
|
|||||||
return {
|
return {
|
||||||
initial: {
|
initial: {
|
||||||
is_active: true,
|
is_active: true,
|
||||||
|
date_start: '2020-06-18 00:00:00 +0800',
|
||||||
date_expired: '2099-12-31 00:00:00 +0800'
|
date_expired: '2099-12-31 00:00:00 +0800'
|
||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
[this.$t('perms.' + 'Basic'), ['name']],
|
[this.$t('perms.' + 'Basic'), ['name']],
|
||||||
[this.$t('perms.' + 'USER'), ['users', 'user_groups']],
|
[this.$t('perms.' + 'USER'), ['users', 'user_groups']],
|
||||||
[this.$t('perms.' + 'databaseApp'), ['database_apps', 'system_users']],
|
[this.$t('perms.' + 'databaseApp'), ['database_apps', 'system_users']],
|
||||||
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
[this.$t('common.Other'), ['is_active', 'date_start', 'date_expired', 'comment']]
|
||||||
],
|
],
|
||||||
url: '/api/v1/perms/database-app-permissions/',
|
url: '/api/v1/perms/database-app-permissions/',
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
@@ -61,6 +62,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
date_start: {
|
||||||
|
label: this.$t('common.dateStart')
|
||||||
|
},
|
||||||
|
date_expired: {
|
||||||
|
label: this.$t('common.dateExpired')
|
||||||
|
},
|
||||||
actions: {
|
actions: {
|
||||||
label: this.$t('perms.Actions')
|
label: this.$t('perms.Actions')
|
||||||
},
|
},
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
<DetailCard :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<QuickActions type="primary" :actions="quickActions" />
|
<QuickActions type="primary" :actions="quickActions" />
|
||||||
@@ -52,9 +52,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
cardTitle() {
|
|
||||||
return this.object.id
|
|
||||||
},
|
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
@@ -27,7 +27,7 @@ export default {
|
|||||||
activeMenu: 'DatabaseAppPermissionDetail',
|
activeMenu: 'DatabaseAppPermissionDetail',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
title: this.$t('perms.databaseAppPermissionDetail'),
|
title: this.$t('common.BasicInfo'),
|
||||||
name: 'DatabaseAppPermissionDetail'
|
name: 'DatabaseAppPermissionDetail'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -12,13 +12,14 @@ export default {
|
|||||||
return {
|
return {
|
||||||
initial: {
|
initial: {
|
||||||
is_active: true,
|
is_active: true,
|
||||||
|
date_start: '2020-06-18 00:00:00 +0800',
|
||||||
date_expired: '2099-12-31 00:00:00 +0800'
|
date_expired: '2099-12-31 00:00:00 +0800'
|
||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
[this.$t('perms.Basic'), ['name']],
|
[this.$t('perms.Basic'), ['name']],
|
||||||
[this.$t('perms.User'), ['users', 'user_groups']],
|
[this.$t('perms.User'), ['users', 'user_groups']],
|
||||||
[this.$t('perms.remoteApp'), ['remote_apps', 'system_users']],
|
[this.$t('perms.remoteApp'), ['remote_apps', 'system_users']],
|
||||||
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
[this.$t('common.Other'), ['is_active', 'date_start', 'date_expired', 'comment']]
|
||||||
],
|
],
|
||||||
url: '/api/v1/perms/remote-app-permissions/',
|
url: '/api/v1/perms/remote-app-permissions/',
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
@@ -61,6 +62,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
date_start: {
|
||||||
|
label: this.$t('common.dateStart')
|
||||||
|
},
|
||||||
|
date_expired: {
|
||||||
|
label: this.$t('common.dateExpired')
|
||||||
|
},
|
||||||
actions: {
|
actions: {
|
||||||
label: this.$t('perms.Actions')
|
label: this.$t('perms.Actions')
|
||||||
},
|
},
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
<DetailCard :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<QuickActions type="primary" :actions="quickActions" />
|
<QuickActions type="primary" :actions="quickActions" />
|
||||||
@@ -52,9 +52,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
cardTitle() {
|
|
||||||
return this.object.id
|
|
||||||
},
|
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
@@ -27,7 +27,7 @@ export default {
|
|||||||
activeMenu: 'RemoteAppPermissionDetail',
|
activeMenu: 'RemoteAppPermissionDetail',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
title: this.$t('perms.remoteAppPermissionDetail'),
|
title: this.$t('common.BasicInfo'),
|
||||||
name: 'RemoteAppPermissionDetail'
|
name: 'RemoteAppPermissionDetail'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -1,90 +0,0 @@
|
|||||||
<template>
|
|
||||||
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs">
|
|
||||||
<table style="width: 100%">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<AssetSelect ref="assetSelect" @change="getAsset" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<el-button :type="type" size="small" @click="addObjects">{{ $t('common.Add') }}</el-button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</IBox>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import IBox from '@/components/IBox/index'
|
|
||||||
import AssetSelect from '@/components/AssetSelect/index'
|
|
||||||
export default {
|
|
||||||
name: 'AssetRelationCard',
|
|
||||||
components: {
|
|
||||||
IBox,
|
|
||||||
AssetSelect
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
icon: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'primary'
|
|
||||||
},
|
|
||||||
value: {
|
|
||||||
type: [Array, Number, String],
|
|
||||||
default: () => []
|
|
||||||
},
|
|
||||||
performAdd: {
|
|
||||||
type: Function,
|
|
||||||
default: (objects, that) => {}
|
|
||||||
},
|
|
||||||
onAddSuccess: {
|
|
||||||
type: Function,
|
|
||||||
default(that) {
|
|
||||||
this.$log.debug('AssetSelect value', that.assets)
|
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
|
||||||
setTimeout(() => location.reload(), 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
assets: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
addObjects() {
|
|
||||||
this.performAdd(this.assets, this).then(
|
|
||||||
() => this.onAddSuccess(this)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
getAsset(assets) {
|
|
||||||
this.assets = assets
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
b, strong {
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr td {
|
|
||||||
line-height: 1.42857;
|
|
||||||
padding: 8px;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr.item td {
|
|
||||||
border-top: 1px solid #e7eaec;
|
|
||||||
}
|
|
||||||
</style>
|
|
@@ -13,7 +13,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import ListTable from '@/components/ListTable/index'
|
import ListTable from '@/components/ListTable/index'
|
||||||
import RelationCard from '@/components/RelationCard/index'
|
import RelationCard from '@/components/RelationCard/index'
|
||||||
import AssetRelationCard from './AssetRelationCard'
|
import AssetRelationCard from '@/components/AssetRelationCard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChangeAuthPlanAsset',
|
name: 'ChangeAuthPlanAsset',
|
||||||
@@ -52,14 +52,14 @@ export default {
|
|||||||
assetRelationConfig: {
|
assetRelationConfig: {
|
||||||
icon: 'fa-edit',
|
icon: 'fa-edit',
|
||||||
title: this.$t('xpack.ChangeAuthPlan.AddAsset'),
|
title: this.$t('xpack.ChangeAuthPlan.AddAsset'),
|
||||||
performAdd: (items, vm) => {
|
performAdd: (items, that) => {
|
||||||
const relationUrl = `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/asset/add/`
|
const relationUrl = `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/asset/add/`
|
||||||
const data = {
|
const data = {
|
||||||
assets: items
|
assets: items
|
||||||
}
|
}
|
||||||
return this.$axios.patch(relationUrl, data)
|
return this.$axios.patch(relationUrl, data)
|
||||||
},
|
},
|
||||||
onAddSuccess: (that) => {
|
onAddSuccess: (items, that) => {
|
||||||
this.$log.debug('AssetSelect value', that.assets)
|
this.$log.debug('AssetSelect value', that.assets)
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
this.$refs.listTable.reloadTable()
|
this.$refs.listTable.reloadTable()
|
||||||
|
@@ -22,13 +22,13 @@ export default {
|
|||||||
config: {
|
config: {
|
||||||
activeMenu: 'SyncInstanceTaskList',
|
activeMenu: 'SyncInstanceTaskList',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
|
||||||
title: this.$t('xpack.Cloud.SyncInstanceTaskList'),
|
|
||||||
name: 'SyncInstanceTaskList'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: this.$t('xpack.Cloud.AccountList'),
|
title: this.$t('xpack.Cloud.AccountList'),
|
||||||
name: 'AccountList'
|
name: 'AccountList'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('xpack.Cloud.SyncInstanceTaskList'),
|
||||||
|
name: 'SyncInstanceTaskList'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -89,21 +89,21 @@ export default {
|
|||||||
component: () => import('@/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList'),
|
component: () => import('@/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList'),
|
||||||
name: 'SyncInstanceTaskList',
|
name: 'SyncInstanceTaskList',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskList') }
|
meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskList'), activeMenu: '/xpack/cloud' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'sync-instance-tasks/create',
|
path: 'sync-instance-tasks/create',
|
||||||
component: () => import('@/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate'),
|
component: () => import('@/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate'),
|
||||||
name: 'SyncInstanceTaskCreate',
|
name: 'SyncInstanceTaskCreate',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskCreate') }
|
meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskCreate'), activeMenu: '/xpack/cloud' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'sync-instance-tasks/:id/update',
|
path: 'sync-instance-tasks/:id/update',
|
||||||
component: () => import('@/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate'),
|
component: () => import('@/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate'),
|
||||||
name: 'SyncInstanceTaskUpdate',
|
name: 'SyncInstanceTaskUpdate',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskUpdate') }
|
meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskUpdate'), activeMenu: '/xpack/cloud' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user