index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. title="Redis"
  5. icon="res-redis"
  6. :res-name="detailData.name"
  7. :tabs="detailTabs"
  8. :current-tab="params.windowData.currentTab"
  9. :loaded="loaded"
  10. @tab-change="handleTabChange">
  11. <template v-slot:actions v-if="showActions">
  12. <actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
  13. </template>
  14. <component
  15. :is="params.windowData.currentTab"
  16. :data="detailData"
  17. :on-manager="onManager"
  18. :params="getParams"
  19. :getParams="getParams"
  20. :show-create-action="false"
  21. :res-id="getParams.elasticcache_id"
  22. :id="listId"
  23. :columns="columns"
  24. taskResource="compute-tasks" />
  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 SecgroupList from '@Compute/views/secgroup/components/List'
  32. import SingleActionsMixin from '../mixins/singleActions'
  33. import ColumnsMixin from '../mixins/columns'
  34. import RedisDetail from './Detail'
  35. import RedisWhiteList from './WhiteList'
  36. import RedisAccountList from './AccountList'
  37. import RedisBackupList from './BackupList'
  38. import Monitor from './Monitor'
  39. export default {
  40. name: 'RedisSidePage',
  41. components: {
  42. Actions,
  43. RedisDetail,
  44. SecgroupList,
  45. RedisWhiteList,
  46. RedisAccountList,
  47. RedisBackupList,
  48. Monitor,
  49. },
  50. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  51. data () {
  52. return {}
  53. },
  54. computed: {
  55. detailTabs () {
  56. const ret = [
  57. { label: this.$t('db.text_187'), key: 'redis-detail' },
  58. { label: this.$t('db.text_330'), key: 'redis-white-list' },
  59. { label: this.$t('db.text_331'), key: 'redis-account-list' },
  60. { label: this.$t('db.text_332'), key: 'redis-backup-list' },
  61. { label: this.$t('db.text_191'), key: 'monitor' },
  62. { label: this.$t('table.title.task'), key: 'task-drawer' },
  63. { label: this.$t('db.text_192'), key: 'event-drawer' },
  64. ]
  65. return ret
  66. },
  67. showActions () {
  68. return !this.$isScopedPolicyMenuHidden('redis_hidden_columns.perform_action')
  69. },
  70. getParams () {
  71. return {
  72. elasticcache_id: this.detailData.id,
  73. details: true,
  74. }
  75. },
  76. listId () {
  77. switch (this.params.windowData.currentTab) {
  78. case 'event-drawer':
  79. return 'EventListForRedisSidePage'
  80. case 'secgroup-list':
  81. return 'SecgroupListForRedisSidePage'
  82. default:
  83. return ''
  84. }
  85. },
  86. },
  87. }
  88. </script>