index.vue 2.3 KB

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