index.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('k8s.text_310')"
  5. icon="res-k8s-persistentvolumeclaim"
  6. :res-name="detailData.name"
  7. :actions="params.actions"
  8. :current-tab="params.windowData.currentTab"
  9. :tabs="detailTabs"
  10. :loaded="loaded"
  11. @tab-change="handleTabChange">
  12. <template v-slot:actions>
  13. <actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
  14. </template>
  15. <component :is="params.windowData.currentTab" :id="listId" :res-id="data.id" :data="detailData" :onManager="onManager" :getParams="getParams" resource="persistentvolumeclaims" :showSearchbox="false" :showGroupActions="false" />
  16. </base-side-page>
  17. </template>
  18. <script>
  19. import ColumnsMixin from '../mixins/columns'
  20. import SingleActionsMixin from '../mixins/singleActions'
  21. import Detail from './Detail'
  22. import SourceInformationSidepage from '@K8S/sections/SourceInformationSidepage'
  23. import EventsSidepage from '@K8S/sections/EventsSidepage'
  24. import PodList from '@K8S/views/pod/components/List'
  25. import SidePageMixin from '@/mixins/sidePage'
  26. import WindowsMixin from '@/mixins/windows'
  27. import Actions from '@/components/PageList/Actions'
  28. export default {
  29. name: 'K8SPersistentvolumeclaimSidePage',
  30. components: {
  31. Actions,
  32. Detail,
  33. SourceInformationSidepage,
  34. EventsSidepage,
  35. PodList,
  36. },
  37. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  38. data () {
  39. return {
  40. detailTabs: [
  41. { label: this.$t('k8s.text_217'), key: 'detail' },
  42. { label: this.$t('k8s.text_9'), key: 'pod-list' },
  43. { label: this.$t('k8s.text_218'), key: 'events-sidepage' },
  44. { label: this.$t('k8s.text_219'), key: 'source-information-sidepage' },
  45. { label: this.$t('compute.text_240'), key: 'event-drawer' },
  46. ],
  47. }
  48. },
  49. computed: {
  50. getParams () {
  51. return {
  52. owner_kind: this.detailData.kind,
  53. owner_name: this.detailData.name,
  54. namespace: this.detailData.namespace,
  55. cluster: this.detailData.clusterID,
  56. }
  57. },
  58. listId () {
  59. switch (this.params.windowData.currentTab) {
  60. case 'event-drawer':
  61. return 'EventListForK8SPersistentvolumeclaimSidePage'
  62. case 'pod-list':
  63. return 'PodListForK8SPersistentvolumeclaimSidePage'
  64. case 'events-sidepage':
  65. return 'EventsForK8SPersistentvolumeclaimSidePage'
  66. default:
  67. return ''
  68. }
  69. },
  70. },
  71. }
  72. </script>