mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 01:11:07 +00:00
[Update] 更改任务详情组件
This commit is contained in:
@@ -381,8 +381,8 @@ const cn = {
|
|||||||
'UsersAndUserGroups': '用户或用户组',
|
'UsersAndUserGroups': '用户或用户组',
|
||||||
'AssetAndNode': '资产或节点',
|
'AssetAndNode': '资产或节点',
|
||||||
'Active': '激活中',
|
'Active': '激活中',
|
||||||
'Add user to asset permission': '添加用户',
|
'Add user to this permission': '添加用户',
|
||||||
'Add user group to asset permission': '添加用户组',
|
'Add user group to this permission': '添加用户组',
|
||||||
'Add asset to this permission': '添加资产',
|
'Add asset to this permission': '添加资产',
|
||||||
'Add node to this permission': '添加节点',
|
'Add node to this permission': '添加节点',
|
||||||
'Add System User to this permission': '添加系统用户',
|
'Add System User to this permission': '添加系统用户',
|
||||||
|
@@ -6,26 +6,8 @@
|
|||||||
<DetailCard v-if="flag" :title="cardTitle" :items="detailCardItems" />
|
<DetailCard v-if="flag" :title="cardTitle" :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-card class="box-card primary">
|
<RunInfoCard v-bind="RunSuccessConfig" />
|
||||||
<div slot="header" class="clearfix">
|
<RunInfoCard v-bind="RunFailedConfig" />
|
||||||
<i class="fa fa-info" />
|
|
||||||
<span>{{ LastRunSuccessHosts }}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
运行成功的主机,请求的api里没有该数据
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="10">
|
|
||||||
<el-card class="box-card primary">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<i class="fa fa-info" />
|
|
||||||
<span>{{ LastRunFailedHosts }}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
运行失败的主机,请求的api里没有该数据
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -41,13 +23,15 @@ import DetailCard from '@/components/DetailCard/index'
|
|||||||
import { getAdhocDetail } from '@/api/ops'
|
import { getAdhocDetail } from '@/api/ops'
|
||||||
import AdhocExecutionHistory from './AdhocExecutionHistory'
|
import AdhocExecutionHistory from './AdhocExecutionHistory'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
|
import RunInfoCard from './runinfocard/RunInfoCard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AdhocDetail',
|
name: 'AdhocDetail',
|
||||||
components: {
|
components: {
|
||||||
GenericDetailPage,
|
GenericDetailPage,
|
||||||
DetailCard,
|
DetailCard,
|
||||||
AdhocExecutionHistory
|
AdhocExecutionHistory,
|
||||||
|
RunInfoCard
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -68,6 +52,27 @@ export default {
|
|||||||
],
|
],
|
||||||
hasRightSide: false
|
hasRightSide: false
|
||||||
},
|
},
|
||||||
|
RunSuccessConfig: {
|
||||||
|
icon: 'fa-info',
|
||||||
|
title: this.$t('jobcenter.Last run success hosts'),
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
hostname: 'linux',
|
||||||
|
result: 'api没有该数据,api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
RunFailedConfig: {
|
||||||
|
icon: 'fa-info',
|
||||||
|
title: this.$t('jobcenter.Last run failed hosts'),
|
||||||
|
headerColor: 'danger',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
hostname: 'window',
|
||||||
|
result: 'api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
adhocData: '',
|
adhocData: '',
|
||||||
versionDetailData: {}
|
versionDetailData: {}
|
||||||
}
|
}
|
||||||
@@ -76,12 +81,6 @@ export default {
|
|||||||
cardTitle() {
|
cardTitle() {
|
||||||
return 'api 没有该数据'
|
return 'api 没有该数据'
|
||||||
},
|
},
|
||||||
LastRunSuccessHosts() {
|
|
||||||
return this.$t('jobcenter.Last run success hosts')
|
|
||||||
},
|
|
||||||
LastRunFailedHosts() {
|
|
||||||
return this.$t('jobcenter.Last run failed hosts')
|
|
||||||
},
|
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -166,22 +165,5 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.el-table /deep/ .el-table__row > td {
|
|
||||||
line-height: 1.5;
|
|
||||||
padding: 8px 0;
|
|
||||||
}
|
|
||||||
.el-table /deep/ .el-table__row > td> div > span {
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.el-table /deep/ .el-table__header > thead > tr >th {
|
|
||||||
padding: 8px 0;
|
|
||||||
background-color: #F5F5F6;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.table{
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@@ -6,24 +6,8 @@
|
|||||||
<DetailCard v-if="flag" :title="cardTitle" :items="detailCardItems" />
|
<DetailCard v-if="flag" :title="cardTitle" :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-card class="box-card primary">
|
<RunInfoCard v-bind="RunSuccessConfig" />
|
||||||
<div slot="header" class="clearfix">
|
<RunInfoCard v-bind="RunFailedConfig" />
|
||||||
<i class="fa fa-info" />
|
|
||||||
<span>{{ SuccessHosts }}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
运行成功的主机,请求的api里没有该数据
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<el-card class="box-card primary">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<i class="fa fa-info" />
|
|
||||||
<span>{{ FailedHosts }}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
运行失败的主机,请求的api里没有该数据
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,12 +22,14 @@ import { GenericDetailPage } from '@/layout/components'
|
|||||||
import DetailCard from '@/components/DetailCard/index'
|
import DetailCard from '@/components/DetailCard/index'
|
||||||
import { getHistoryExecutionDetail } from '@/api/ops'
|
import { getHistoryExecutionDetail } from '@/api/ops'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
|
import RunInfoCard from './runinfocard/RunInfoCard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HistoryExecutionDetail',
|
name: 'HistoryExecutionDetail',
|
||||||
components: {
|
components: {
|
||||||
GenericDetailPage,
|
GenericDetailPage,
|
||||||
DetailCard
|
DetailCard,
|
||||||
|
RunInfoCard
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -67,6 +53,27 @@ export default {
|
|||||||
detailApiUrl: `/api/v1/ops/adhoc-executions/${this.$route.params.id}/`
|
detailApiUrl: `/api/v1/ops/adhoc-executions/${this.$route.params.id}/`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
RunSuccessConfig: {
|
||||||
|
icon: 'fa-info',
|
||||||
|
title: this.$t('jobcenter.Last run success hosts'),
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
hostname: 'linux',
|
||||||
|
result: 'api没有该数据==api没有该数据api没有该数据api没有该数据api没有该数据'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
RunFailedConfig: {
|
||||||
|
icon: 'fa-info',
|
||||||
|
title: this.$t('jobcenter.Last run failed hosts'),
|
||||||
|
headerColor: 'danger',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
hostname: 'window',
|
||||||
|
result: 'api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
historyExecutionDetailData: {}
|
historyExecutionDetailData: {}
|
||||||
}
|
}
|
||||||
@@ -75,12 +82,6 @@ export default {
|
|||||||
cardTitle() {
|
cardTitle() {
|
||||||
return `${this.historyExecutionDetailData.task_display}:${this.historyExecutionDetailData.adhoc_short_id}`
|
return `${this.historyExecutionDetailData.task_display}:${this.historyExecutionDetailData.adhoc_short_id}`
|
||||||
},
|
},
|
||||||
SuccessHosts() {
|
|
||||||
return this.$t('jobcenter.SuccessHosts')
|
|
||||||
},
|
|
||||||
FailedHosts() {
|
|
||||||
return this.$t('jobcenter.FailedHosts')
|
|
||||||
},
|
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -135,22 +136,5 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.el-table /deep/ .el-table__row > td {
|
|
||||||
line-height: 1.5;
|
|
||||||
padding: 8px 0;
|
|
||||||
}
|
|
||||||
.el-table /deep/ .el-table__row > td> div > span {
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.el-table /deep/ .el-table__header > thead > tr >th {
|
|
||||||
padding: 8px 0;
|
|
||||||
background-color: #F5F5F6;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.table{
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@@ -6,24 +6,8 @@
|
|||||||
<DetailCard v-if="flag" :title="cardTitle" :items="detailCardItems" />
|
<DetailCard v-if="flag" :title="cardTitle" :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-card class="box-card primary">
|
<RunInfoCard v-bind="RunSuccessConfig" />
|
||||||
<div slot="header" class="clearfix">
|
<RunInfoCard v-bind="RunFailedConfig" />
|
||||||
<i class="fa fa-info" />
|
|
||||||
<span>{{ LastRunSuccessHosts }}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
运行成功的主机,请求的api里没有该数据
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<el-card class="box-card primary">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<i class="fa fa-info" />
|
|
||||||
<span>{{ LastRunFailedHosts }}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
运行失败的主机,请求的api里没有该数据
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,6 +30,7 @@ import { toSafeLocalDateStr } from '@/utils/common'
|
|||||||
import { getTaskDetail } from '@/api/ops'
|
import { getTaskDetail } from '@/api/ops'
|
||||||
import TaskHistory from './TaskHistory'
|
import TaskHistory from './TaskHistory'
|
||||||
import TaskAdhoc from './TaskAdhoc'
|
import TaskAdhoc from './TaskAdhoc'
|
||||||
|
import RunInfoCard from './runinfocard/RunInfoCard'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TaskDetail',
|
name: 'TaskDetail',
|
||||||
@@ -53,7 +38,8 @@ export default {
|
|||||||
GenericDetailPage,
|
GenericDetailPage,
|
||||||
DetailCard,
|
DetailCard,
|
||||||
TaskAdhoc,
|
TaskAdhoc,
|
||||||
TaskHistory
|
TaskHistory,
|
||||||
|
RunInfoCard
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -81,6 +67,27 @@ export default {
|
|||||||
],
|
],
|
||||||
hasRightSide: false
|
hasRightSide: false
|
||||||
},
|
},
|
||||||
|
RunSuccessConfig: {
|
||||||
|
icon: 'fa-info',
|
||||||
|
title: this.$t('jobcenter.Last run success hosts'),
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
hostname: 'linux',
|
||||||
|
result: 'api没有该数据==api没有该数据api没有该数据api没有该数据api没有该数据'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
RunFailedConfig: {
|
||||||
|
icon: 'fa-info',
|
||||||
|
title: this.$t('jobcenter.Last run failed hosts'),
|
||||||
|
headerColor: 'danger',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
hostname: 'window',
|
||||||
|
result: 'api没有该数据api没有该数据api没有该数据api没有该数据api没有该数据'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
taskData: {}
|
taskData: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -88,12 +95,6 @@ export default {
|
|||||||
cardTitle() {
|
cardTitle() {
|
||||||
return this.taskData.name
|
return this.taskData.name
|
||||||
},
|
},
|
||||||
LastRunSuccessHosts() {
|
|
||||||
return this.$t('jobcenter.Last run success hosts')
|
|
||||||
},
|
|
||||||
LastRunFailedHosts() {
|
|
||||||
return this.$t('jobcenter.Last run failed hosts')
|
|
||||||
},
|
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -160,22 +161,5 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.el-table /deep/ .el-table__row > td {
|
|
||||||
line-height: 1.5;
|
|
||||||
padding: 8px 0;
|
|
||||||
}
|
|
||||||
.el-table /deep/ .el-table__row > td> div > span {
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.el-table /deep/ .el-table__header > thead > tr >th {
|
|
||||||
padding: 8px 0;
|
|
||||||
background-color: #F5F5F6;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.table{
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
48
src/views/jobcenter/runinfocard/RunInfoCard.vue
Normal file
48
src/views/jobcenter/runinfocard/RunInfoCard.vue
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="box-card primary box-margin">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<i v-if="icon" :class="'fa ' + icon" />
|
||||||
|
<span>{{ title }}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-table class="el-table" style="width: 100%" :data="content" :show-header="false">
|
||||||
|
<el-table-column width="150px" prop="hostname" />
|
||||||
|
<el-table-column prop="result">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.result }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'RunInfoCard',
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.box-margin {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
@@ -4,9 +4,9 @@
|
|||||||
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard v-if="!assetReletionConfig.loading" v-bind="assetReletionConfig" />
|
<RelationCard v-bind="assetReletionConfig" />
|
||||||
<RelationCard v-if="!nodeReletionConfig.loading" v-bind="nodeReletionConfig" />
|
<RelationCard v-bind="nodeReletionConfig" />
|
||||||
<RelationCard v-if="!systemUserReletionConfig.loading" v-bind="systemUserReletionConfig" />
|
<RelationCard v-bind="systemUserReletionConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -64,23 +64,39 @@ export default {
|
|||||||
assetReletionConfig: {
|
assetReletionConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('perms.Add asset to this permission'),
|
title: this.$t('perms.Add asset to this permission'),
|
||||||
url: '/api/v1/assets/assets/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/assets/assets/'
|
||||||
loading: false
|
}
|
||||||
},
|
},
|
||||||
nodeReletionConfig: {
|
nodeReletionConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('perms.Add node to this permission'),
|
title: this.$t('perms.Add node to this permission'),
|
||||||
url: '/api/v1/assets/nodes/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/assets/nodes/',
|
||||||
loading: false
|
processResults(data) {
|
||||||
|
let results = data.results
|
||||||
|
results = results.map((item) => {
|
||||||
|
return { label: item.full_value, value: item.id }
|
||||||
|
})
|
||||||
|
const more = !!data.next
|
||||||
|
return { results: results, pagination: more, total: data.count }
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
systemUserReletionConfig: {
|
systemUserReletionConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('perms.Add System User to this permission'),
|
title: this.$t('perms.Add System User to this permission'),
|
||||||
url: '/api/v1/assets/system-users/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/assets/system-users/',
|
||||||
loading: false
|
processResults(data) {
|
||||||
|
let results = data.results
|
||||||
|
results = results.map((item) => {
|
||||||
|
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||||
|
})
|
||||||
|
const more = !!data.next
|
||||||
|
return { results: results, pagination: more, total: data.count }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,14 @@ export default {
|
|||||||
url: '/api/v1/perms/asset-permissions/',
|
url: '/api/v1/perms/asset-permissions/',
|
||||||
hasSelection: false,
|
hasSelection: false,
|
||||||
hasTree: true,
|
hasTree: true,
|
||||||
|
treeSetting: {
|
||||||
|
showMenu: false,
|
||||||
|
showRefresh: true,
|
||||||
|
showAssets: true,
|
||||||
|
url: '/api/v1/perms/asset-permissions/',
|
||||||
|
nodeUrl: '/api/v1/perms/asset-permissions/',
|
||||||
|
treeUrl: '/api/v1/assets/nodes/children/tree/?assets=1'
|
||||||
|
},
|
||||||
tagSearch: [
|
tagSearch: [
|
||||||
{ label: this.$tc('Name'), key: 'name' },
|
{ label: this.$tc('Name'), key: 'name' },
|
||||||
{ label: this.$t('perms.IsValid'), key: 'is_valid' },
|
{ label: this.$t('perms.IsValid'), key: 'is_valid' },
|
||||||
@@ -27,14 +35,6 @@ export default {
|
|||||||
{ label: this.$t('perms.SystemUser'), key: 'system_user' },
|
{ label: this.$t('perms.SystemUser'), key: 'system_user' },
|
||||||
{ label: '继承(先占位)', key: 'all=0' }
|
{ label: '继承(先占位)', key: 'all=0' }
|
||||||
],
|
],
|
||||||
treeSetting: {
|
|
||||||
showMenu: false,
|
|
||||||
showRefresh: true,
|
|
||||||
showAssets: true,
|
|
||||||
url: '/api/v1/perms/asset-permissions/',
|
|
||||||
nodeUrl: '/api/v1/perms/asset-permissions/',
|
|
||||||
treeUrl: '/api/v1/assets/nodes/children/tree/?assets=1'
|
|
||||||
},
|
|
||||||
columns: ['expand', 'name', 'users', 'user_groups', 'assets', 'nodes', 'system_users', 'is_active', 'actions'],
|
columns: ['expand', 'name', 'users', 'user_groups', 'assets', 'nodes', 'system_users', 'is_active', 'actions'],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
expand: {
|
expand: {
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard v-if="!userReletionConfig.loading" v-bind="userReletionConfig" />
|
<RelationCard v-bind="userReletionConfig" />
|
||||||
<RelationCard v-if="!groupReletionConfig.loading" v-bind="groupReletionConfig" />
|
<RelationCard v-bind="groupReletionConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -61,17 +61,38 @@ export default {
|
|||||||
assetPermissionUserGroup: [],
|
assetPermissionUserGroup: [],
|
||||||
userReletionConfig: {
|
userReletionConfig: {
|
||||||
icon: 'fa-user',
|
icon: 'fa-user',
|
||||||
title: this.$t('perms.Add user to asset permission'),
|
title: this.$t('perms.Add user to this permission'),
|
||||||
url: '/api/v1/users/users/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/users/users/',
|
||||||
loading: false
|
processResults(data) {
|
||||||
|
let results = data.results
|
||||||
|
results = results.map((item) => {
|
||||||
|
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||||
|
})
|
||||||
|
const more = !!data.next
|
||||||
|
return { results: results, pagination: more, total: data.count }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
performAdd: (items) => {
|
||||||
|
console.log('item=====', items)
|
||||||
|
const relationUrl = `/api/v1/perms/asset-permissions-users-relations/`
|
||||||
|
const objectId = this.$route.params.id
|
||||||
|
console.log('objectId====', objectId)
|
||||||
|
const data = items.map(v => {
|
||||||
|
return {
|
||||||
|
user: v.value,
|
||||||
|
assetpermission: objectId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return this.$axios.post(relationUrl, data)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
groupReletionConfig: {
|
groupReletionConfig: {
|
||||||
icon: 'fa-group',
|
icon: 'fa-group',
|
||||||
title: this.$t('perms.Add user group to asset permission'),
|
title: this.$t('perms.Add user group to this permission'),
|
||||||
url: '/api/v1/users/groups/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/users/groups/'
|
||||||
loading: false
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard v-if="!databaseAppReletionConfig.loading" v-bind="databaseAppReletionConfig" />
|
<RelationCard v-bind="databaseAppReletionConfig" />
|
||||||
<RelationCard v-if="!systemUserReletionConfig.loading" v-bind="systemUserReletionConfig" />
|
<RelationCard v-bind="systemUserReletionConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -41,6 +41,9 @@ export default {
|
|||||||
formatter: DeleteActionFormatter,
|
formatter: DeleteActionFormatter,
|
||||||
deleteUrl: `/api/v1/perms/database-app-permissions-database-apps-relations/?databaseapppermission=${this.$route.params.id}&databaseapp=`
|
deleteUrl: `/api/v1/perms/database-app-permissions-database-apps-relations/?databaseapppermission=${this.$route.params.id}&databaseapp=`
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
tableAttrs: {
|
||||||
|
border: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
@@ -59,16 +62,24 @@ export default {
|
|||||||
databaseAppReletionConfig: {
|
databaseAppReletionConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('perms.Add DatabaseApp to this permission'),
|
title: this.$t('perms.Add DatabaseApp to this permission'),
|
||||||
url: '/api/v1/applications/database-apps/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/applications/database-apps/'
|
||||||
loading: false
|
}
|
||||||
},
|
},
|
||||||
systemUserReletionConfig: {
|
systemUserReletionConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('perms.Add System User to this permission'),
|
title: this.$t('perms.Add System User to this permission'),
|
||||||
url: '/api/v1/assets/system-users/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/assets/system-users/',
|
||||||
loading: false
|
processResults(data) {
|
||||||
|
let results = data.results
|
||||||
|
results = results.map((item) => {
|
||||||
|
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||||
|
})
|
||||||
|
const more = !!data.next
|
||||||
|
return { results: results, pagination: more, total: data.count }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
|
hasExport: false,
|
||||||
|
hasImport: false,
|
||||||
|
hasRefresh: false,
|
||||||
hasBulkDelete: false
|
hasBulkDelete: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard v-if="!userReletionConfig.loading" v-bind="userReletionConfig" />
|
<RelationCard v-bind="userReletionConfig" />
|
||||||
<RelationCard v-if="!groupReletionConfig.loading" v-bind="groupReletionConfig" />
|
<RelationCard v-bind="groupReletionConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -42,6 +42,9 @@ export default {
|
|||||||
formatter: DeleteActionFormatter,
|
formatter: DeleteActionFormatter,
|
||||||
deleteUrl: `/api/v1/perms/database-app-permissions-users-relations/?databaseapppermission=${this.$route.params.id}&user=`
|
deleteUrl: `/api/v1/perms/database-app-permissions-users-relations/?databaseapppermission=${this.$route.params.id}&user=`
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
tableAttrs: {
|
||||||
|
border: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
@@ -59,17 +62,25 @@ export default {
|
|||||||
databaseAppPermissionUserGroup: [],
|
databaseAppPermissionUserGroup: [],
|
||||||
userReletionConfig: {
|
userReletionConfig: {
|
||||||
icon: 'fa-user',
|
icon: 'fa-user',
|
||||||
title: this.$t('perms.Add user to asset permission'),
|
title: this.$t('perms.Add user to this permission'),
|
||||||
url: '/api/v1/users/users/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/users/users/',
|
||||||
loading: false
|
processResults(data) {
|
||||||
|
let results = data.results
|
||||||
|
results = results.map((item) => {
|
||||||
|
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||||
|
})
|
||||||
|
const more = !!data.next
|
||||||
|
return { results: results, pagination: more, total: data.count }
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
groupReletionConfig: {
|
groupReletionConfig: {
|
||||||
icon: 'fa-group',
|
icon: 'fa-group',
|
||||||
title: this.$t('perms.Add user group to asset permission'),
|
title: this.$t('perms.Add user group to this permission'),
|
||||||
url: '/api/v1/users/groups/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/users/groups/'
|
||||||
loading: false
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -35,6 +35,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
|
hasExport: false,
|
||||||
|
hasImport: false,
|
||||||
|
hasRefresh: false,
|
||||||
hasBulkDelete: false
|
hasBulkDelete: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard v-if="!remoteAppReletionConfig.loading" v-bind="remoteAppReletionConfig" />
|
<RelationCard v-bind="remoteAppReletionConfig" />
|
||||||
<RelationCard v-if="!systemUserReletionConfig.loading" v-bind="systemUserReletionConfig" />
|
<RelationCard v-bind="systemUserReletionConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -31,6 +31,9 @@ export default {
|
|||||||
// asset_display: {
|
// asset_display: {
|
||||||
// label: this.$t('perms.RemoteApp')
|
// label: this.$t('perms.RemoteApp')
|
||||||
// }
|
// }
|
||||||
|
},
|
||||||
|
tableAttrs: {
|
||||||
|
border: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
@@ -49,16 +52,24 @@ export default {
|
|||||||
remoteAppReletionConfig: {
|
remoteAppReletionConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('perms.Add RemoteApp to this permission'),
|
title: this.$t('perms.Add RemoteApp to this permission'),
|
||||||
url: '/api/v1/applications/remote-apps/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/applications/remote-apps/'
|
||||||
loading: false
|
}
|
||||||
},
|
},
|
||||||
systemUserReletionConfig: {
|
systemUserReletionConfig: {
|
||||||
icon: 'fa-info',
|
icon: 'fa-info',
|
||||||
title: this.$t('perms.Add System User to this permission'),
|
title: this.$t('perms.Add System User to this permission'),
|
||||||
url: '/api/v1/assets/system-users/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/assets/system-users/',
|
||||||
loading: false
|
processResults(data) {
|
||||||
|
let results = data.results
|
||||||
|
results = results.map((item) => {
|
||||||
|
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||||
|
})
|
||||||
|
const more = !!data.next
|
||||||
|
return { results: results, pagination: more, total: data.count }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard v-if="!userReletionConfig.loading" v-bind="userReletionConfig" />
|
<RelationCard v-bind="userReletionConfig" />
|
||||||
<RelationCard v-if="!groupReletionConfig.loading" v-bind="groupReletionConfig" />
|
<RelationCard v-bind="groupReletionConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -31,6 +31,9 @@ export default {
|
|||||||
// user_display: {
|
// user_display: {
|
||||||
// label: this.$t('perms.User')
|
// label: this.$t('perms.User')
|
||||||
// }
|
// }
|
||||||
|
},
|
||||||
|
tableAttrs: {
|
||||||
|
border: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
@@ -48,17 +51,25 @@ export default {
|
|||||||
remoteAppPermissionUserGroup: [],
|
remoteAppPermissionUserGroup: [],
|
||||||
userReletionConfig: {
|
userReletionConfig: {
|
||||||
icon: 'fa-user',
|
icon: 'fa-user',
|
||||||
title: this.$t('perms.Add user to asset permission'),
|
title: this.$t('perms.Add user to this permission'),
|
||||||
url: '/api/v1/users/users/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/users/users/',
|
||||||
loading: false
|
processResults(data) {
|
||||||
|
let results = data.results
|
||||||
|
results = results.map((item) => {
|
||||||
|
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||||
|
})
|
||||||
|
const more = !!data.next
|
||||||
|
return { results: results, pagination: more, total: data.count }
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
groupReletionConfig: {
|
groupReletionConfig: {
|
||||||
icon: 'fa-group',
|
icon: 'fa-group',
|
||||||
title: this.$t('perms.Add user group to asset permission'),
|
title: this.$t('perms.Add user group to this permission'),
|
||||||
url: '/api/v1/users/groups/',
|
objectsAjax: {
|
||||||
value: [],
|
url: '/api/v1/users/groups/'
|
||||||
loading: false
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user