index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div>
  3. <page-header
  4. :title="$t('compute.text_97')"
  5. isShowResStatusTab
  6. :status-opts="statusOpts"
  7. :status-click-handle="statusClickHandle"
  8. :tabs="cloudEnvOptions"
  9. :current-tab.sync="cloudEnv" />
  10. <page-body>
  11. <image-list
  12. v-if="cloudEnv === 'onpremise'"
  13. id="ImageList"
  14. :imageType="imageType"
  15. :cloud-env="cloudEnv"
  16. :filterParams="filterParams"
  17. :diskFormats="diskFormats"
  18. statusResKey="image"
  19. @resStatisticsChange="resStatisticsChange" />
  20. <cache-image-list
  21. v-else
  22. id="CacheImageList"
  23. :cloud-env="cloudEnv"
  24. :filterParams="filterParams"
  25. :diskFormats="diskFormats"
  26. statusResKey="image"
  27. @resStatisticsChange="resStatisticsChange" />
  28. </page-body>
  29. </div>
  30. </template>
  31. <script>
  32. import ResStatisticsV2Mixin from '@/mixins/resStatisticsV2Mixin'
  33. import CacheImageList from '@Compute/views/cached-image/components/List'
  34. import ImageList from './components/List'
  35. export default {
  36. name: 'ImageIndex',
  37. components: {
  38. ImageList,
  39. CacheImageList,
  40. },
  41. mixins: [ResStatisticsV2Mixin],
  42. props: {
  43. diskFormats: {
  44. type: Array,
  45. },
  46. },
  47. data () {
  48. return {
  49. listId: 'ImageList',
  50. apiVersion: 'v1',
  51. statusNormalList: ['active'],
  52. cloudEnv: 'onpremise',
  53. }
  54. },
  55. computed: {
  56. cloudEnvOptions () {
  57. return [
  58. { label: this.$t('dictionary.onpremise_env'), key: 'onpremise' },
  59. { label: this.$t('dictionary.private_env'), key: 'private' },
  60. { label: this.$t('dictionary.public_env'), key: 'public' },
  61. ]
  62. },
  63. },
  64. }
  65. </script>