mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-17 23:59:02 +00:00
feat: Support playbook, adhoc share
This commit is contained in:
@@ -32,7 +32,7 @@ export default {
|
||||
width: '60%',
|
||||
tableConfig: {
|
||||
hasSelection: false,
|
||||
url: `/api/v1/ops/adhocs/`,
|
||||
url: `/api/v1/ops/adhocs/?only_mine=true`,
|
||||
columns: ['name', 'module', 'args', 'comment', 'actions'],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
|
@@ -83,7 +83,7 @@ export default {
|
||||
multiple: false,
|
||||
value: [],
|
||||
ajax: {
|
||||
url: '/api/v1/ops/playbooks/',
|
||||
url: `/api/v1/ops/playbooks/?only_mine=true`,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name, value: item.id }
|
||||
}
|
||||
|
@@ -11,12 +11,13 @@ export default {
|
||||
GenericListTable
|
||||
},
|
||||
data() {
|
||||
const currentUserID = this.$store.state.users.profile.id
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/ops/adhocs/',
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'module', 'args', 'comment', 'date_created', 'actions']
|
||||
default: ['name', 'module', 'args', 'comment', 'scope', 'date_created', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
name: {
|
||||
@@ -29,10 +30,14 @@ export default {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: true,
|
||||
canUpdate: this.$hasPerm('ops.change_adhoc'),
|
||||
canUpdate: ({ row }) => {
|
||||
return this.$hasPerm('ops.change_adhoc') && row.creator === currentUserID
|
||||
},
|
||||
updateRoute: 'AdhocUpdate',
|
||||
hasDelete: true,
|
||||
canDelete: this.$hasPerm('ops.delete_adhoc'),
|
||||
canDelete: ({ row }) => {
|
||||
return this.$hasPerm('ops.delete_adhoc') && row.creator === currentUserID
|
||||
},
|
||||
hasClone: false
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ export default {
|
||||
return {
|
||||
url: '/api/v1/ops/adhocs/',
|
||||
fields: [
|
||||
[this.$t('Basic'), ['name', 'module', 'args', 'comment']]
|
||||
[this.$t('Basic'), ['name', 'module', 'args', 'comment', 'scope']]
|
||||
],
|
||||
initial: {
|
||||
module: 'shell',
|
||||
|
@@ -16,6 +16,7 @@ export default {
|
||||
GenericListTable
|
||||
},
|
||||
data() {
|
||||
const currentUserID = this.$store.state.users.profile.id
|
||||
return {
|
||||
createDialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
@@ -23,7 +24,7 @@ export default {
|
||||
url: '/api/v1/ops/playbooks/',
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'comment', 'date_created', 'actions']
|
||||
default: ['name', 'comment', 'scope', 'date_created', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
name: {
|
||||
@@ -36,11 +37,15 @@ export default {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: true,
|
||||
canUpdate: this.$hasPerm('ops.change_playbook'),
|
||||
canUpdate: ({ row }) => {
|
||||
return this.$hasPerm('ops.change_playbook') && row.creator === currentUserID
|
||||
},
|
||||
updateRoute: 'PlaybookUpdate',
|
||||
hasDelete: true,
|
||||
canDelete: this.$hasPerm('ops.delete_playbook'),
|
||||
hasClone: false
|
||||
canDelete: ({ row }) => {
|
||||
return this.$hasPerm('ops.delete_playbook') && row.creator === currentUserID
|
||||
},
|
||||
hasClone: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ export default {
|
||||
return {
|
||||
url: '/api/v1/ops/playbooks/',
|
||||
fields: [
|
||||
[this.$t('Basic'), ['name', 'comment']]
|
||||
[this.$t('Basic'), ['name', 'comment', 'scope']]
|
||||
],
|
||||
createSuccessNextRoute: {
|
||||
name: 'Template'
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<NewNodeDialog v-if="createDialogVisible" :visible.sync="createDialogVisible" @confirm="doCreate" />
|
||||
<TreeTable ref="TreeTable" :tree-setting="treeSetting">
|
||||
<template slot="rMenu">
|
||||
<template v-if="!disableEdit" slot="rMenu">
|
||||
<li id="m_create_file" class="rmenu" tabindex="-1" @click="onCreate('file')">
|
||||
{{ $tc('NewFile') }}
|
||||
</li>
|
||||
@@ -62,7 +62,9 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const disableEdit = this.object.creator !== this.$store.state.users.profile.id
|
||||
return {
|
||||
disableEdit: disableEdit,
|
||||
newNode: {},
|
||||
createDialogVisible: false,
|
||||
createType: 'directory',
|
||||
@@ -70,7 +72,8 @@ export default {
|
||||
closing: false,
|
||||
DataZTree: 0,
|
||||
cmOptions: {
|
||||
mode: 'yaml'
|
||||
mode: 'yaml',
|
||||
readOnly: disableEdit
|
||||
},
|
||||
toolbar: {
|
||||
left: {
|
||||
@@ -82,6 +85,7 @@ export default {
|
||||
el: {
|
||||
type: 'primary'
|
||||
},
|
||||
isVisible: disableEdit,
|
||||
callback: () => {
|
||||
this.onSave()
|
||||
}
|
||||
@@ -94,6 +98,7 @@ export default {
|
||||
el: {
|
||||
type: 'primary'
|
||||
},
|
||||
isVisible: disableEdit,
|
||||
callback: () => {
|
||||
this.onReset()
|
||||
}
|
||||
|
Reference in New Issue
Block a user