Detail.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <detail
  3. :onManager="onManager"
  4. :data="data"
  5. :base-info="baseInfo"
  6. :extra-info="extraInfo"
  7. status-module="image"
  8. resource="instant_apps" />
  9. </template>
  10. <script>
  11. import WindowsMixin from '@/mixins/windows'
  12. import {
  13. getEnabledTableColumn,
  14. getPublicScopeTableColumn,
  15. } from '@/utils/common/tableColumn'
  16. import {
  17. // getPackageNameTableColumn,
  18. // getPackageVersionTableColumn,
  19. // getAppImageTableColumn,
  20. getAppSizeTableColumn,
  21. getAppCacheStatusColumn,
  22. getModelIdTableColumn,
  23. getModelNameTableColumn,
  24. getLlmTypeTableColumn,
  25. } from '../utils/columns'
  26. export default {
  27. name: 'InstantAppDetail',
  28. mixins: [WindowsMixin],
  29. props: {
  30. data: {
  31. type: Object,
  32. required: true,
  33. },
  34. onManager: {
  35. type: Function,
  36. required: true,
  37. },
  38. },
  39. data () {
  40. return {
  41. cmOptions: {
  42. tabSize: 2,
  43. styleActiveLine: true,
  44. lineNumbers: true,
  45. line: true,
  46. readOnly: true,
  47. theme: 'material',
  48. mode: 'text/plain',
  49. },
  50. baseInfo: [
  51. // getPackageNameTableColumn(),
  52. // getPackageVersionTableColumn(),
  53. // getAppImageTableColumn({ vm: this }),
  54. getEnabledTableColumn(),
  55. getEnabledTableColumn({
  56. field: 'auto_cache',
  57. title: this.$t('aice.mounted_apps.auto_cache'),
  58. }),
  59. getAppCacheStatusColumn(),
  60. getModelIdTableColumn(),
  61. getModelNameTableColumn(),
  62. getLlmTypeTableColumn(),
  63. getPublicScopeTableColumn(),
  64. getAppSizeTableColumn(),
  65. ],
  66. extraInfo: [
  67. {
  68. field: 'mounts',
  69. title: this.$t('aice.mounted_apps.mounts'),
  70. slots: {
  71. default: ({ row }, h) => {
  72. return [
  73. <code-mirror value={ this.mountPaths } options={ this.cmOptions } />]
  74. },
  75. },
  76. },
  77. ],
  78. }
  79. },
  80. computed: {
  81. mountPaths () {
  82. if (!this.data.mounts || !Array.isArray(this.data.mounts)) {
  83. return ''
  84. }
  85. return this.data.mounts.join('\n')
  86. },
  87. },
  88. }
  89. </script>