mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-18 08:12:33 +00:00
fix: Create playbook job form error
This commit is contained in:
@@ -158,37 +158,33 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.$route.query && this.$route.query.type) {
|
||||
this.initial.type = 'adhoc'
|
||||
switch (this.$route.query.type) {
|
||||
case 'adhoc':
|
||||
this.initial.type = 'adhoc'
|
||||
if (this.$route.query.id) {
|
||||
this.$axios.get(`/api/v1/ops/adhocs/${this.$route.query.id}`).then((data) => {
|
||||
this.initial.module = data.module
|
||||
this.initial.args = data.args
|
||||
this.initial.instant = true
|
||||
this.initial.runAfterSave = true
|
||||
this.instantTask = true
|
||||
this.createSuccessNextRoute = { name: 'Adhoc' }
|
||||
this.ready = true
|
||||
})
|
||||
} else {
|
||||
const type = this.$route.query['_type']
|
||||
switch (type) {
|
||||
case 'adhoc':
|
||||
this.initial.type = 'adhoc'
|
||||
if (this.$route.query.id) {
|
||||
this.$axios.get(`/api/v1/ops/adhocs/${this.$route.query.id}`).then((data) => {
|
||||
this.initial.module = data.module
|
||||
this.initial.args = data.args
|
||||
this.initial.instant = true
|
||||
this.initial.runAfterSave = true
|
||||
this.instantTask = true
|
||||
this.createSuccessNextRoute = { name: 'Adhoc' }
|
||||
this.ready = true
|
||||
}
|
||||
break
|
||||
case 'playbook':
|
||||
this.initial.type = 'playbook'
|
||||
if (this.$route.query.id) {
|
||||
this.initial.playbook = this.$route.query.id
|
||||
this.ready = true
|
||||
} else {
|
||||
this.ready = true
|
||||
}
|
||||
break
|
||||
}
|
||||
} else {
|
||||
this.ready = true
|
||||
})
|
||||
} else {
|
||||
this.ready = true
|
||||
}
|
||||
break
|
||||
case 'playbook':
|
||||
this.initial.type = 'playbook'
|
||||
if (this.$route.query.id) {
|
||||
this.initial.playbook = this.$route.query.id
|
||||
this.ready = true
|
||||
} else {
|
||||
this.ready = true
|
||||
}
|
||||
break
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericListTable
|
||||
ref="ListTable"
|
||||
:create-drawer="createDrawer"
|
||||
:detail-drawer="detailDrawer"
|
||||
:header-actions="headerActions"
|
||||
@@ -22,6 +23,7 @@ export default {
|
||||
JobRunDialog
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
item: {},
|
||||
createDrawer: () => import('@/views/ops/Job/JobUpdateCreate.vue'),
|
||||
@@ -113,7 +115,12 @@ export default {
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
createRoute: 'JobCreate',
|
||||
onCreate: () => {
|
||||
vm.$router.push({
|
||||
query: { _type: 'adhoc' }
|
||||
})
|
||||
vm.$refs.ListTable.onCreate()
|
||||
},
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericListTable
|
||||
ref="ListTable"
|
||||
:create-drawer="createDrawer"
|
||||
:detail-drawer="detailDrawer"
|
||||
:header-actions="headerActions"
|
||||
@@ -23,6 +24,7 @@ export default {
|
||||
JobRunDialog
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
createDrawer: () => import('@/views/ops/Job/JobUpdateCreate.vue'),
|
||||
detailDrawer: () => import('@/views/ops/Job/JobDetail/index.vue'),
|
||||
@@ -117,13 +119,11 @@ export default {
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
createRoute: () => {
|
||||
return {
|
||||
name: 'JobCreate',
|
||||
query: {
|
||||
type: 'playbook'
|
||||
}
|
||||
}
|
||||
onCreate: () => {
|
||||
vm.$router.push({
|
||||
query: { _type: 'playbook' }
|
||||
})
|
||||
vm.$refs.ListTable.onCreate()
|
||||
}
|
||||
},
|
||||
showJobRunDialog: false
|
||||
|
Reference in New Issue
Block a user