fix(applications): 修复更新数据库页面不对的问题

This commit is contained in:
ibuler
2021-08-16 11:00:22 +08:00
committed by 老广
parent e030fc313e
commit 20c201f351
5 changed files with 19 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
<template>
<GenericDetailPage :object.sync="DatabaseApp" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners">
<GenericDetailPage :object.sync="app" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners">
<keep-alive>
<component :is="config.activeMenu" :object="DatabaseApp" />
<component :is="config.activeMenu" :object="app" />
</keep-alive>
</GenericDetailPage>
</template>
@@ -18,7 +18,7 @@ export default {
},
data() {
return {
DatabaseApp: {
app: {
name: '', get_type_display: '', host: '', port: '', database: '', date_created: '', created_by: '', comment: '', attrs: ''
},
config: {
@@ -31,7 +31,10 @@ export default {
],
actions: {
detailApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`,
deleteApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`
deleteApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`,
updateCallback: (item) => {
this.$router.push({ name: 'DatabaseAppUpdate', params: { id: this.app.id }, query: { type: this.app.type }})
}
}
}
}

View File

@@ -11,7 +11,6 @@ import DetailCard from '@/components/DetailCard'
import { toSafeLocalDateStr } from '@/utils/common'
export default {
name: 'DatabaseAppDetail',
components: {
DetailCard
},

View File

@@ -1,7 +1,7 @@
<template>
<GenericDetailPage :object.sync="KubernetesApp" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners">
<GenericDetailPage :object.sync="app" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners">
<keep-alive>
<component :is="config.activeMenu" :object="KubernetesApp" />
<component :is="config.activeMenu" :object="app" />
</keep-alive>
</GenericDetailPage>
</template>
@@ -18,7 +18,7 @@ export default {
},
data() {
return {
KubernetesApp: {
app: {
name: '', type_display: '', cluster: '', date_created: '', created_by: '', comment: '', attrs: ''
},
config: {
@@ -31,7 +31,10 @@ export default {
],
actions: {
detailApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`,
deleteApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`
deleteApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`,
updateCallback: (item) => {
this.$router.push({ name: 'KubernetesAppUpdate', params: { id: this.app.id }, query: { type: this.app.type }})
}
}
}
}

View File

@@ -12,7 +12,6 @@ import DetailCard from '@/components/DetailCard'
import { toSafeLocalDateStr } from '@/utils/common'
export default {
name: 'RemoteAppDetail',
components: {
DetailCard
},

View File

@@ -1,7 +1,7 @@
<template>
<GenericDetailPage :object.sync="RemoteApp" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners">
<GenericDetailPage :object.sync="app" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners">
<keep-alive>
<component :is="config.activeMenu" :object="RemoteApp" />
<component :is="config.activeMenu" :object="app" />
</keep-alive>
</GenericDetailPage>
</template>
@@ -17,9 +17,8 @@ export default {
TabPage
},
data() {
const vm = this
return {
RemoteApp: {
app: {
name: '', asset: '', get_type_display: '', path: '', date_created: '', created_by: '', comment: '', attrs: ''
},
config: {
@@ -33,8 +32,8 @@ export default {
actions: {
detailApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`,
deleteApiUrl: `/api/v1/applications/applications/${this.$route.params.id}/`,
updateCallback: function(item) {
vm.$router.push({ name: 'RemoteAppUpdate', params: { id: vm.RemoteApp.id }, query: { type: vm.RemoteApp.type }})
updateCallback: (item) => {
this.$router.push({ name: 'RemoteAppUpdate', params: { id: this.app.id }, query: { type: this.app.type }})
}
}
}