index.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('cloudenv.text_318')"
  5. icon="onecloud"
  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" :res-id="data.id" :cloudprovider-id="data.id" resource="cloudproviders" :data="detailData" :onManager="onManager" :getParams="getParams" />
  16. </base-side-page>
  17. </template>
  18. <script>
  19. import Usage from '@Cloudenv/sections/UsageSidepage'
  20. import CloudproviderregionList from '@Cloudenv/views/cloudproviderregion/components/List'
  21. import SidePageMixin from '@/mixins/sidePage'
  22. import WindowsMixin from '@/mixins/windows'
  23. import Actions from '@/components/PageList/Actions'
  24. import { findPlatform } from '@/utils/common/hypervisor'
  25. import SamlProvider from '@Cloudenv/views/samlprovider/components/List'
  26. import ColumnsMixin from '../mixins/columns'
  27. import SingleActionsMixin from '../mixins/singleActions'
  28. import CloudaccountDetail from './Detail'
  29. import CloudaccountQuotaList from './QuotaList'
  30. export default {
  31. name: 'CloudproviderSidePage',
  32. components: {
  33. Actions,
  34. CloudaccountDetail,
  35. CloudproviderregionList,
  36. CloudaccountQuotaList,
  37. Usage,
  38. SamlProvider,
  39. },
  40. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  41. data () {
  42. return {
  43. data: {},
  44. }
  45. },
  46. computed: {
  47. getParams () {
  48. if (this.params.windowData.currentTab === 'cloudproviderregion-list') {
  49. return () => {
  50. return {
  51. cloudprovider_id: this.data.id,
  52. details: true,
  53. }
  54. }
  55. }
  56. if (this.params.windowData.currentTab === 'saml-provider') {
  57. return () => {
  58. return {
  59. manager_id: this.data.id,
  60. }
  61. }
  62. }
  63. return null
  64. },
  65. brand () {
  66. return this.detailData?.brand || ''
  67. },
  68. isPublic () {
  69. return findPlatform(this.brand.toLowerCase()) === 'public'
  70. },
  71. detailTabs () {
  72. const detailTabs = [
  73. { label: this.$t('cloudenv.text_237'), key: 'cloudaccount-detail' },
  74. { label: this.$t('cloudenv.text_10'), key: 'cloudproviderregion-list' },
  75. { label: this.$t('cloudenv.text_362'), key: 'cloudaccount-quota-list' },
  76. { label: this.$t('cloudenv.text_319'), key: 'usage' },
  77. { label: this.$t('cloudenv.text_15'), key: 'event-drawer' },
  78. ]
  79. if (this.isPublic) {
  80. detailTabs.splice(4, 0, { label: this.$t('cloudenv.saml_provider'), key: 'saml-provider' })
  81. }
  82. return detailTabs
  83. },
  84. },
  85. }
  86. </script>