index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('compute.text_112')"
  5. icon="res-physicalmachine"
  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 :options="singleActions" :row="detailData" button-type="link" button-size="small" />
  13. </template>
  14. <component
  15. source="physicalmachine"
  16. :is="params.windowData.currentTab"
  17. :id="listId"
  18. :res-id="data.id"
  19. :hostInfo="detailData"
  20. :on-manager="onManager"
  21. :getParams="getParams"
  22. :columns="columns"
  23. taskResource="compute-tasks"
  24. @tab-change="handleTabChange" />
  25. </base-side-page>
  26. </template>
  27. <script>
  28. import SidePageMixin from '@/mixins/sidePage'
  29. import WindowsMixin from '@/mixins/windows'
  30. import Actions from '@/components/PageList/Actions'
  31. import StorageList from '../../host/sidepage/Storage'
  32. import GpuList from '../../host/sidepage/Gpu'
  33. import SingleActionsMixin from '../mixins/singleActions'
  34. import ColumnsMixin from '../mixins/columns'
  35. import BaremetalList from './Baremetal'
  36. import PhysicalmachineDetail from './Detail'
  37. import NetworkList from './Network'
  38. import BmcLog from './BMCLog'
  39. export default {
  40. name: 'PhysicalmachineSidePage',
  41. components: {
  42. PhysicalmachineDetail,
  43. BaremetalList,
  44. NetworkList,
  45. StorageList,
  46. GpuList,
  47. BmcLog,
  48. Actions,
  49. },
  50. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  51. data () {
  52. return {
  53. detailTabs: [
  54. { label: this.$t('compute.text_238'), key: 'physicalmachine-detail' },
  55. { label: this.$t('compute.text_864'), key: 'baremetal-list' },
  56. { label: this.$t('compute.text_104'), key: 'network-list' },
  57. { label: this.$t('compute.text_99'), key: 'storage-list' },
  58. { label: this.$t('compute.text_607'), key: 'gpu-list' },
  59. { label: this.$t('compute.text_865'), key: 'bmc-log' },
  60. { label: this.$t('table.title.task'), key: 'task-drawer' },
  61. { label: this.$t('compute.text_240'), key: 'event-drawer' },
  62. ],
  63. }
  64. },
  65. computed: {
  66. getParams () {
  67. if (this.params.windowData.currentTab === 'baremetal-list') {
  68. return {
  69. host: this.data.id,
  70. }
  71. } else if (this.params.windowData.currentTab === 'storage-list') {
  72. return {
  73. details: true,
  74. with_meta: true,
  75. limit: 20,
  76. host_id: this.data.id,
  77. }
  78. } else if (this.params.windowData.currentTab === 'gpu-list') {
  79. return {
  80. show_baremetal_isolated_devices: true,
  81. }
  82. } else if (this.params.windowData.currentTab === 'bmc-log') {
  83. return {
  84. host_id: this.data.id,
  85. }
  86. }
  87. return null
  88. },
  89. listId () {
  90. switch (this.params.windowData.currentTab) {
  91. case 'event-drawer':
  92. return 'EventListForPhysicalmachineSidePage'
  93. case 'baremetal-list':
  94. return 'BaremetalListForPhysicalmachineSidePage'
  95. case 'network-list':
  96. return 'NetworkListForPhysicalmachineSidePage'
  97. case 'storage-list':
  98. return 'StorageListForPhysicalmachineSidePage'
  99. case 'gpu-list':
  100. return 'GpuListForPhysicalmachineSidePage'
  101. default:
  102. return ''
  103. }
  104. },
  105. },
  106. }
  107. </script>