diff --git a/src/views/ops/Adhoc/AdhocOpenDialog.vue b/src/views/ops/Adhoc/AdhocOpenDialog.vue index a442732da..b6a58910e 100644 --- a/src/views/ops/Adhoc/AdhocOpenDialog.vue +++ b/src/views/ops/Adhoc/AdhocOpenDialog.vue @@ -32,7 +32,7 @@ export default { width: '60%', tableConfig: { hasSelection: false, - url: `/api/v1/ops/adhocs/`, + url: `/api/v1/ops/adhocs/?creator=${this.$store.state.users.profile.id}`, columns: ['name', 'module', 'args', 'comment', 'actions'], columnsMeta: { name: { diff --git a/src/views/ops/Job/JobUpdateCreate.vue b/src/views/ops/Job/JobUpdateCreate.vue index 19d5305e6..978945510 100644 --- a/src/views/ops/Job/JobUpdateCreate.vue +++ b/src/views/ops/Job/JobUpdateCreate.vue @@ -83,7 +83,7 @@ export default { multiple: false, value: [], ajax: { - url: '/api/v1/ops/playbooks/', + url: `/api/v1/ops/playbooks/?creator=${this.$store.state.users.profile.id}`, transformOption: (item) => { return { label: item.name, value: item.id } } diff --git a/src/views/ops/Template/Adhoc.vue b/src/views/ops/Template/Adhoc.vue index 29fff770d..ca96f2052 100644 --- a/src/views/ops/Template/Adhoc.vue +++ b/src/views/ops/Template/Adhoc.vue @@ -16,7 +16,7 @@ export default { 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 +29,14 @@ export default { formatter: ActionsFormatter, formatterArgs: { hasUpdate: true, - canUpdate: this.$hasPerm('ops.change_adhoc'), + canUpdate: ({ row }) => { + return this.$hasPerm('ops.change_adhoc') && !row.disable_edit + }, updateRoute: 'AdhocUpdate', hasDelete: true, - canDelete: this.$hasPerm('ops.delete_adhoc'), + canDelete: ({ row }) => { + return this.$hasPerm('ops.delete_adhoc') && !row.disable_edit + }, hasClone: false } } diff --git a/src/views/ops/Template/Adhoc/AdhocUpdateCreate.vue b/src/views/ops/Template/Adhoc/AdhocUpdateCreate.vue index ef024a9cf..5331f1240 100644 --- a/src/views/ops/Template/Adhoc/AdhocUpdateCreate.vue +++ b/src/views/ops/Template/Adhoc/AdhocUpdateCreate.vue @@ -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', diff --git a/src/views/ops/Template/Playbook.vue b/src/views/ops/Template/Playbook.vue index ce31d1ce2..e52b29dcf 100644 --- a/src/views/ops/Template/Playbook.vue +++ b/src/views/ops/Template/Playbook.vue @@ -23,7 +23,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 +36,15 @@ export default { formatter: ActionsFormatter, formatterArgs: { hasUpdate: true, - canUpdate: this.$hasPerm('ops.change_playbook'), + canUpdate: ({ row }) => { + return this.$hasPerm('ops.change_playbook') && !row.disable_edit + }, updateRoute: 'PlaybookUpdate', hasDelete: true, - canDelete: this.$hasPerm('ops.delete_playbook'), - hasClone: false + canDelete: ({ row }) => { + return this.$hasPerm('ops.delete_playbook') && !row.disable_edit + }, + hasClone: true } } } diff --git a/src/views/ops/Template/Playbook/PlaybookCreateUpdate.vue b/src/views/ops/Template/Playbook/PlaybookCreateUpdate.vue index 5aef9f36d..ddcabed20 100644 --- a/src/views/ops/Template/Playbook/PlaybookCreateUpdate.vue +++ b/src/views/ops/Template/Playbook/PlaybookCreateUpdate.vue @@ -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' diff --git a/src/views/ops/Template/Playbook/PlaybookDetail/Workspace.vue b/src/views/ops/Template/Playbook/PlaybookDetail/Workspace.vue index 264e6641d..d8fe0bc3a 100644 --- a/src/views/ops/Template/Playbook/PlaybookDetail/Workspace.vue +++ b/src/views/ops/Template/Playbook/PlaybookDetail/Workspace.vue @@ -2,7 +2,7 @@
-