Skip to content

Commit

Permalink
Merge pull request #5531 from GuoLiBin6/feat/glb-to-3.10/compute
Browse files Browse the repository at this point in the history
feat(4588): recovery list add event log
  • Loading branch information
easy-mj authored Oct 18, 2023
2 parents c9b0dfe + 658123c commit a265f58
Show file tree
Hide file tree
Showing 10 changed files with 246 additions and 9 deletions.
13 changes: 11 additions & 2 deletions containers/Compute/views/disk-recovery/components/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

<script>
import * as R from 'ramda'
import ColumnsMixin from '../mixins/columns'
import SingleActionsMixin from '../mixins/singleActions'
import expectStatus from '@/constants/expectStatus'
import { getNameFilter, getStatusFilter, getBrandFilter, getTenantFilter, getFilter } from '@/utils/common/tableFilter'
import WindowsMixin from '@/mixins/windows'
import ListMixin from '@/mixins/list'
import GlobalSearchMixin from '@/mixins/globalSearch'
import SingleActionsMixin from '../mixins/singleActions'
import ColumnsMixin from '../mixins/columns'
export default {
name: 'DiskRecoveryList',
Expand Down Expand Up @@ -128,6 +128,15 @@ export default {
pending_delete: true,
}
},
handleOpenSidepage (row) {
this.sidePageTriggerHandle(this, 'DiskRecoverySidePage', {
id: row.id,
resource: 'disks',
getParams: this.getParam,
}, {
list: this.list,
})
},
},
}
</script>
14 changes: 12 additions & 2 deletions containers/Compute/views/disk-recovery/mixins/columns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as R from 'ramda'
import { getBrandTableColumn, getStatusTableColumn, getCopyWithContentTableColumn, getProjectTableColumn, getTimeTableColumn } from '@/utils/common/tableColumn'
import { getNameDescriptionTableColumn, getBrandTableColumn, getStatusTableColumn, getCopyWithContentTableColumn, getProjectTableColumn, getTimeTableColumn } from '@/utils/common/tableColumn'
import i18n from '@/locales'

export default {
Expand All @@ -25,7 +25,17 @@ export default {
return column
}
column = [
getCopyWithContentTableColumn({ field: 'name', title: i18n.t('compute.text_228') }),
getNameDescriptionTableColumn({
field: 'name',
edit: false,
editDesc: false,
hideField: true,
slotCallback: row => {
return (
<side-page-trigger onTrigger={() => this.handleOpenSidepage(row)}>{row.name}</side-page-trigger>
)
},
}),
getStatusTableColumn({ statusModule: 'disk', hiddenLogView: true }),
{
field: 'disk_type',
Expand Down
60 changes: 60 additions & 0 deletions containers/Compute/views/disk-recovery/sidepage/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<base-side-page
@cancel="cancelSidePage"
:title="$t('compute.text_100')"
icon="res-disk"
:res-name="detailData.name"
:current-tab="params.windowData.currentTab"
:tabs="detailTabs"
:loaded="loaded"
@tab-change="handleTabChange">
<template v-slot:actions>
<actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
</template>
<component
:is="params.windowData.currentTab"
:res-id="data.id"
:id="listId"
:data="detailData"
:on-manager="onManager"
:getParams="getParams"
:cloudEnv="cloudEnvData"
@tab-change="handleTabChange" />
</base-side-page>
</template>

<script>
import SidePageMixin from '@/mixins/sidePage'
import WindowsMixin from '@/mixins/windows'
import Actions from '@/components/PageList/Actions'
import ColumnsMixin from '../mixins/columns'
import SingleActionsMixin from '../mixins/singleActions'
export default {
name: 'DiskRecoverySidePage',
components: {
Actions,
},
mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
data () {
return {
detailTabs: [
{ label: this.$t('compute.text_240'), key: 'event-drawer' },
],
}
},
computed: {
getParams () {
return {}
},
listId () {
switch (this.params.windowData.currentTab) {
case 'event-drawer':
return 'EventListForDiskRecoverySidePage'
default:
return ''
}
},
},
}
</script>
9 changes: 9 additions & 0 deletions containers/Compute/views/image-recovery/components/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ export default {
guestimagesFetcher (params) {
return this.vm.list({ params })
},
handleOpenSidepage (row) {
this.sidePageTriggerHandle(this, 'ImageRecoverySidePage', {
id: row.id,
resource: this.cloudEnv,
getParams: this.getParams,
}, {
list: this.list,
})
},
},
}
</script>
13 changes: 12 additions & 1 deletion containers/Compute/views/image-recovery/mixins/columns.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import * as R from 'ramda'
import { sizestr } from '@/utils/utils'
import SystemIcon from '@/sections/SystemIcon'
import { getStatusTableColumn, getCopyWithContentTableColumn, getProjectTableColumn, getTimeTableColumn } from '@/utils/common/tableColumn'
import { getNameDescriptionTableColumn, getStatusTableColumn, getCopyWithContentTableColumn, getProjectTableColumn, getTimeTableColumn } from '@/utils/common/tableColumn'
import i18n from '@/locales'

export default {
created () {
this.columns = [
getNameDescriptionTableColumn({
field: 'name',
edit: false,
editDesc: false,
hideField: true,
slotCallback: row => {
return (
<side-page-trigger onTrigger={() => this.handleOpenSidepage(row)}>{row.name}</side-page-trigger>
)
},
}),
getCopyWithContentTableColumn({ field: 'name', title: i18n.t('compute.text_228') }),
getStatusTableColumn({ statusModule: 'image', hiddenLogView: true }),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
label: i18n.t('compute.text_477'),
permission: 'images_delete',
action: obj => {
console.log(this.onManager)
this.createDialog('DeleteResDialog', {
vm: this,
data: [obj],
Expand Down
60 changes: 60 additions & 0 deletions containers/Compute/views/image-recovery/sidepage/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<base-side-page
@cancel="cancelSidePage"
:title="$t('compute.text_97')"
icon="res-image"
:res-name="detailData.name"
:current-tab="params.windowData.currentTab"
:tabs="detailTabs"
:loaded="loaded"
@tab-change="handleTabChange">
<template v-slot:actions>
<actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
</template>
<component
:is="params.windowData.currentTab"
:res-id="data.id"
:id="listId"
:data="detailData"
:on-manager="onManager"
:getParams="getParams"
:cloudEnv="cloudEnvData"
@tab-change="handleTabChange" />
</base-side-page>
</template>

<script>
import SidePageMixin from '@/mixins/sidePage'
import WindowsMixin from '@/mixins/windows'
import Actions from '@/components/PageList/Actions'
import ColumnsMixin from '../mixins/columns'
import SingleActionsMixin from '../mixins/singleActions'
export default {
name: 'ImageRecoverySidePage',
components: {
Actions,
},
mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
data () {
return {
detailTabs: [
{ label: this.$t('compute.text_240'), key: 'event-drawer' },
],
}
},
computed: {
getParams () {
return {}
},
listId () {
switch (this.params.windowData.currentTab) {
case 'event-drawer':
return 'EventListForImageRecoverySidePage'
default:
return ''
}
},
},
}
</script>
9 changes: 9 additions & 0 deletions containers/Compute/views/server-recovery/components/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ export default {
...this.getParams,
}
},
handleOpenSidepage (row) {
this.sidePageTriggerHandle(this, 'VminstanceRecoverySidePage', {
id: row.id,
resource: 'servers',
getParams: this.getParam,
}, {
list: this.list,
})
},
},
}
</script>
16 changes: 13 additions & 3 deletions containers/Compute/views/server-recovery/mixins/columns.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import { SERVER_TYPE } from '@Compute/constants'
import { sizestr } from '@/utils/utils'
import { getBrandTableColumn, getStatusTableColumn, getCopyWithContentTableColumn, getIpsTableColumn, getTimeTableColumn } from '@/utils/common/tableColumn'
import { getNameDescriptionTableColumn, getBrandTableColumn, getStatusTableColumn, getCopyWithContentTableColumn, getIpsTableColumn, getTimeTableColumn } from '@/utils/common/tableColumn'
import SystemIcon from '@/sections/SystemIcon'
import i18n from '@/locales'
import { SERVER_TYPE } from '@Compute/constants'
import { findPlatform } from '@/utils/common/hypervisor'

export default {
created () {
this.columns = [
getCopyWithContentTableColumn({ field: 'name', title: i18n.t('compute.text_228'), sortable: true }),
getNameDescriptionTableColumn({
field: 'name',
edit: false,
editDesc: false,
hideField: true,
slotCallback: row => {
return (
<side-page-trigger onTrigger={() => this.handleOpenSidepage(row)}>{row.name}</side-page-trigger>
)
},
}),
getCopyWithContentTableColumn({ field: 'id', title: 'ID' }),
getCopyWithContentTableColumn({ field: 'external_id', title: i18n.t('table.title.external_id') }),
getStatusTableColumn({ statusModule: 'server', hiddenLogView: true }),
Expand Down
60 changes: 60 additions & 0 deletions containers/Compute/views/server-recovery/sidepage/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<base-side-page
@cancel="cancelSidePage"
:title="$t('compute.text_91')"
icon="res-vminstance"
:res-name="detailData.name"
:current-tab="params.windowData.currentTab"
:tabs="detailTabs"
:loaded="loaded"
@tab-change="handleTabChange">
<template v-slot:actions>
<actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
</template>
<component
:is="params.windowData.currentTab"
:res-id="data.id"
:id="listId"
:data="detailData"
:on-manager="onManager"
:getParams="getParams"
:cloudEnv="cloudEnvData"
@tab-change="handleTabChange" />
</base-side-page>
</template>

<script>
import SidePageMixin from '@/mixins/sidePage'
import WindowsMixin from '@/mixins/windows'
import Actions from '@/components/PageList/Actions'
import ColumnsMixin from '../mixins/columns'
import SingleActionsMixin from '../mixins/singleActions'
export default {
name: 'VminstanceRecoverySidePage',
components: {
Actions,
},
mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
data () {
return {
detailTabs: [
{ label: this.$t('compute.text_240'), key: 'event-drawer' },
],
}
},
computed: {
getParams () {
return {}
},
listId () {
switch (this.params.windowData.currentTab) {
case 'event-drawer':
return 'EventListForVminstanceRecoverySidePage'
default:
return ''
}
},
},
}
</script>

0 comments on commit a265f58

Please sign in to comment.