@rancher/shell 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/assets/brand/suse/favicon.png +0 -0
  2. package/assets/images/generic-plugin.svg +1 -7
  3. package/assets/styles/global/_button.scss +1 -0
  4. package/assets/translations/en-us.yaml +129 -53
  5. package/assets/translations/zh-hans.yaml +18 -0
  6. package/components/CommunityLinks.vue +40 -49
  7. package/components/ExplorerProjectsNamespaces.vue +20 -3
  8. package/components/HarvesterServiceAddOnConfig.vue +10 -10
  9. package/components/LazyImage.vue +21 -8
  10. package/components/PromptRemove.vue +2 -2
  11. package/components/ResourceList/Masthead.vue +21 -1
  12. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  13. package/components/ResourceList/index.vue +42 -36
  14. package/components/ResourceTable.vue +19 -0
  15. package/components/SortableTable/THead.vue +311 -70
  16. package/components/SortableTable/advanced-filtering.js +272 -0
  17. package/components/SortableTable/filtering.js +90 -29
  18. package/components/SortableTable/index.vue +486 -280
  19. package/components/Tabbed/index.vue +25 -7
  20. package/components/TypeDescription.vue +10 -1
  21. package/components/fleet/FleetClusters.vue +6 -0
  22. package/components/fleet/FleetRepos.vue +7 -1
  23. package/components/form/Command.vue +5 -0
  24. package/components/form/EnvVars.vue +5 -0
  25. package/components/form/NameNsDescription.vue +3 -1
  26. package/components/form/NodeScheduling.vue +6 -1
  27. package/components/form/PodAffinity.vue +5 -0
  28. package/components/form/ServiceNameSelect.vue +5 -0
  29. package/components/form/ValueFromResource.vue +7 -1
  30. package/components/form/WorkloadPorts.vue +2 -2
  31. package/components/nav/TopLevelMenu.vue +2 -1
  32. package/config/home-links.js +155 -0
  33. package/config/private-label.js +1 -1
  34. package/config/product/manager.js +0 -2
  35. package/config/product/settings.js +1 -0
  36. package/config/product/uiplugins.js +2 -1
  37. package/config/settings.js +3 -1
  38. package/config/uiplugins.js +76 -6
  39. package/config/version.js +17 -0
  40. package/core/plugin.ts +12 -0
  41. package/core/plugins.js +29 -5
  42. package/core/types.ts +6 -0
  43. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  44. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  45. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  46. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  47. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  48. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  49. package/creators/app/init +16 -17
  50. package/creators/app/package.json +7 -1
  51. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  52. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  53. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  54. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  55. package/creators/pkg/init +1 -1
  56. package/creators/pkg/package.json +1 -1
  57. package/creators/update/init +54 -0
  58. package/creators/update/package.json +20 -0
  59. package/creators/update/upgrade +56 -0
  60. package/creators/update/yarn-error.log +54 -0
  61. package/detail/provisioning.cattle.io.cluster.vue +1 -1
  62. package/detail/workload/index.vue +1 -0
  63. package/edit/persistentvolume/index.vue +48 -13
  64. package/edit/persistentvolumeclaim.vue +31 -13
  65. package/edit/provisioning.cattle.io.cluster/ACE.vue +2 -1
  66. package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +0 -1
  67. package/edit/provisioning.cattle.io.cluster/rke2.vue +52 -43
  68. package/edit/service.vue +1 -1
  69. package/edit/workload/index.vue +19 -9
  70. package/edit/workload/mixins/workload.js +109 -114
  71. package/edit/workload/storage/index.vue +11 -17
  72. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  73. package/edit/workload/storage/secret.vue +6 -1
  74. package/list/catalog.cattle.io.app.vue +10 -9
  75. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  76. package/list/cis.cattle.io.clusterscan.vue +12 -12
  77. package/list/fleet.cattle.io.bundle.vue +33 -28
  78. package/list/fleet.cattle.io.cluster.vue +26 -22
  79. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  80. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  81. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  82. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  83. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  84. package/list/logging.banzaicloud.io.flow.vue +7 -14
  85. package/list/management.cattle.io.cluster.vue +26 -15
  86. package/list/management.cattle.io.feature.vue +13 -8
  87. package/list/management.cattle.io.user.vue +38 -19
  88. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  89. package/list/namespace.vue +14 -1
  90. package/list/node.vue +13 -16
  91. package/list/persistentvolume.vue +16 -9
  92. package/list/persistentvolumeclaim.vue +5 -8
  93. package/list/provisioning.cattle.io.cluster.vue +34 -8
  94. package/list/service.vue +24 -12
  95. package/list/ui.cattle.io.navlink.vue +6 -0
  96. package/list/workload.vue +2 -2
  97. package/middleware/authenticated.js +6 -0
  98. package/mixins/resource-fetch.js +12 -18
  99. package/mixins/resource-manager.js +126 -0
  100. package/models/catalog.cattle.io.uiplugin.js +4 -0
  101. package/models/management.cattle.io.cluster.js +9 -1
  102. package/models/pod.js +15 -5
  103. package/models/provisioning.cattle.io.cluster.js +4 -0
  104. package/models/workload.service.js +10 -0
  105. package/nuxt.config.js +2 -1
  106. package/package.json +1 -1
  107. package/pages/auth/login.vue +10 -0
  108. package/pages/auth/verify.vue +9 -0
  109. package/pages/c/_cluster/apps/charts/install.vue +119 -31
  110. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  111. package/pages/c/_cluster/settings/links.vue +53 -101
  112. package/pages/c/_cluster/settings/performance.vue +90 -7
  113. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +3 -3
  114. package/pages/c/_cluster/uiplugins/InstallDialog.vue +72 -21
  115. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +26 -7
  116. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -7
  117. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +23 -15
  118. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +12 -5
  119. package/pages/c/_cluster/uiplugins/index.vue +223 -72
  120. package/pages/support/index.vue +31 -142
  121. package/plugins/dashboard-store/actions.js +19 -0
  122. package/plugins/dashboard-store/getters.js +20 -3
  123. package/plugins/dashboard-store/mutations.js +13 -7
  124. package/plugins/plugin.js +18 -15
  125. package/plugins/steve/getters.js +12 -0
  126. package/plugins/version.js +21 -0
  127. package/promptRemove/mixin/roleDeletionCheck.js +15 -1
  128. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  129. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  130. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  131. package/rancher-components/components/BadgeState/index.ts +1 -0
  132. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  133. package/rancher-components/components/Banner/Banner.vue +163 -0
  134. package/rancher-components/components/Banner/index.ts +1 -0
  135. package/rancher-components/components/Card/Card.vue +150 -0
  136. package/rancher-components/components/Card/index.ts +1 -0
  137. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  138. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  139. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  140. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  141. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  142. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  143. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  144. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  145. package/rancher-components/components/Form/Radio/index.ts +2 -0
  146. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  147. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  148. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  149. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  150. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  151. package/rancher-components/components/Form/index.ts +5 -0
  152. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  153. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  154. package/scripts/publish-shell.sh +39 -6
  155. package/scripts/record-deps.js +37 -0
  156. package/scripts/test-plugins-build.sh +8 -5
  157. package/scripts/typegen.sh +84 -0
  158. package/store/auth.js +3 -0
  159. package/store/index.js +12 -3
  160. package/store/type-map.js +2 -0
  161. package/types/shell/index.d.ts +3046 -0
  162. package/utils/favicon.js +8 -2
  163. package/utils/gc/gc-interval.ts +40 -0
  164. package/utils/gc/gc-root-store.js +76 -0
  165. package/utils/gc/gc-route-changed.ts +44 -0
  166. package/utils/gc/gc-types.ts +21 -0
  167. package/utils/gc/gc.ts +282 -0
  168. package/config/footer.js +0 -18
  169. package/creators/pkg/nuxt.config.js +0 -6
  170. package/yarn-error.log +0 -195
@@ -1,3 +1,4 @@
1
+ import { mapGetters } from 'vuex';
1
2
  import omitBy from 'lodash/omitBy';
2
3
  import { cleanUp } from '@shell/utils/object';
3
4
  import {
@@ -13,7 +14,7 @@ import {
13
14
  } from '@shell/config/types';
14
15
  import Tab from '@shell/components/Tabbed/Tab';
15
16
  import CreateEditView from '@shell/mixins/create-edit-view';
16
- import { allHash } from '@shell/utils/promise';
17
+ import ResourceManager from '@shell/mixins/resource-manager';
17
18
  import LabeledSelect from '@shell/components/form/LabeledSelect';
18
19
  import { LabeledInput } from '@components/Form/LabeledInput';
19
20
  import ServiceNameSelect from '@shell/components/form/ServiceNameSelect';
@@ -29,7 +30,7 @@ import WorkloadPorts from '@shell/components/form/WorkloadPorts';
29
30
  import ContainerResourceLimit from '@shell/components/ContainerResourceLimit';
30
31
  import KeyValue from '@shell/components/form/KeyValue';
31
32
  import Tabbed from '@shell/components/Tabbed';
32
- import { mapGetters } from 'vuex';
33
+
33
34
  import NodeScheduling from '@shell/components/form/NodeScheduling';
34
35
  import PodAffinity from '@shell/components/form/PodAffinity';
35
36
  import Tolerations from '@shell/components/form/Tolerations';
@@ -94,7 +95,7 @@ export default {
94
95
  ContainerMountPaths
95
96
  },
96
97
 
97
- mixins: [CreateEditView],
98
+ mixins: [CreateEditView, ResourceManager],
98
99
 
99
100
  props: {
100
101
  value: {
@@ -118,36 +119,11 @@ export default {
118
119
  },
119
120
 
120
121
  async fetch() {
121
- const requests = { rancherClusters: this.$store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER }) };
122
- const needed = {
123
- configMaps: CONFIG_MAP,
124
- nodes: NODE,
125
- services: SERVICE,
126
- pvcs: PVC,
127
- sas: SERVICE_ACCOUNT,
128
- secrets: SECRET,
129
- };
130
-
131
- // Only fetch types if the user can see them
132
- Object.keys(needed).forEach((key) => {
133
- const type = needed[key];
134
-
135
- if (this.$store.getters['cluster/schemaFor'](type)) {
136
- requests[key] = this.$store.dispatch('cluster/findAll', { type });
137
- }
138
- });
139
-
140
- const hash = await allHash(requests);
122
+ await this.$store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER });
141
123
 
142
- this.servicesOwned = hash.services ? await this.value.getServicesOwned() : [];
143
-
144
- this.allSecrets = hash.secrets || [];
145
- this.allConfigMaps = hash.configMaps || [];
146
- this.allNodeObjects = hash.nodes || [];
147
- this.allNodes = this.allNodeObjects.map(node => node.id);
148
- this.allServices = hash.services || [];
149
- this.pvcs = hash.pvcs || [];
150
- this.sas = hash.sas || [];
124
+ // don't block UI for these resources
125
+ this.resourceManagerFetchSecondaryResources(this.secondaryResourceData);
126
+ this.servicesOwned = await this.value.getServicesOwned();
151
127
  },
152
128
 
153
129
  data() {
@@ -167,16 +143,21 @@ export default {
167
143
  name: `container-0`,
168
144
  }];
169
145
 
170
- const podSpec = { template: { spec: { containers: podContainers, initContainers: [] } } };
146
+ const metadata = { ...this.value.metadata };
147
+
148
+ const podSpec = { template: { spec: { containers: podContainers, initContainers: [] }, metadata } };
171
149
 
172
150
  this.$set(this.value, 'spec', podSpec);
173
151
  }
174
152
  }
175
153
 
154
+ // EDIT view for POD
155
+ // Transform it from POD world to workload
176
156
  if ((this.mode === _EDIT || this.mode === _VIEW ) && this.value.type === 'pod' ) {
177
157
  const podSpec = { ...this.value.spec };
158
+ const metadata = { ...this.value.metadata };
178
159
 
179
- this.$set(this.value.spec, 'template', { spec: podSpec });
160
+ this.$set(this.value.spec, 'template', { spec: podSpec, metadata });
180
161
  }
181
162
 
182
163
  const spec = this.value.spec;
@@ -228,37 +209,81 @@ export default {
228
209
  this.selectContainer(container);
229
210
 
230
211
  return {
231
- allConfigMaps: [],
232
- allNodes: null,
233
- allNodeObjects: [],
234
- allSecrets: [],
235
- allServices: [],
236
- name: this.value?.metadata?.name || null,
237
- pvcs: [],
238
- sas: [],
239
- showTabs: false,
240
- pullPolicyOptions: ['Always', 'IfNotPresent', 'Never'],
212
+ secondaryResourceData: {
213
+ namespace: this.value?.metadata?.namespace || null,
214
+ data: {
215
+ [CONFIG_MAP]: { applyTo: [{ var: 'namespacedConfigMaps' }] },
216
+ [PVC]: { applyTo: [{ var: 'pvcs' }] },
217
+ [SERVICE_ACCOUNT]: { applyTo: [{ var: 'namespacedServiceNames' }] },
218
+ [SECRET]: {
219
+ applyTo: [
220
+ { var: 'namespacedSecrets' },
221
+ {
222
+ var: 'imagePullNamespacedSecrets',
223
+ parsingFunc: (data) => {
224
+ return data.filter(secret => (secret._type === SECRET_TYPES.DOCKER || secret._type === SECRET_TYPES.DOCKER_JSON));
225
+ }
226
+ }
227
+ ]
228
+ },
229
+ [NODE]: {
230
+ applyTo: [
231
+ { var: 'allNodeObjects' },
232
+ {
233
+ var: 'allNodes',
234
+ parsingFunc: (data) => {
235
+ return data.map(node => node.id);
236
+ }
237
+ }
238
+ ]
239
+ },
240
+ [SERVICE]: {
241
+ applyTo: [
242
+ { var: 'allServices' },
243
+ {
244
+ var: 'headlessServices',
245
+ parsingFunc: (data) => {
246
+ return data.filter(service => service.spec.clusterIP === 'None');
247
+ }
248
+ }
249
+ ]
250
+ },
251
+ }
252
+ },
253
+ namespacedConfigMaps: [],
254
+ allNodes: null,
255
+ allNodeObjects: [],
256
+ namespacedSecrets: [],
257
+ imagePullNamespacedSecrets: [],
258
+ allServices: [],
259
+ headlessServices: [],
260
+ name: this.value?.metadata?.name || null,
261
+ pvcs: [],
262
+ namespacedServiceNames: [],
263
+ showTabs: false,
264
+ pullPolicyOptions: ['Always', 'IfNotPresent', 'Never'],
241
265
  spec,
242
266
  type,
243
- servicesOwned: [],
244
- servicesToRemove: [],
245
- portsForServices: [],
267
+ servicesOwned: [],
268
+ servicesToRemove: [],
269
+ portsForServices: [],
246
270
  isInitContainer,
247
271
  container,
248
- containerChange: 0,
249
- tabChange: 0,
250
- podFsGroup: podTemplateSpec.securityContext?.fsGroup,
251
- savePvcHookName: 'savePvcHook',
252
- tabWeightMap: TAB_WEIGHT_MAP,
253
- fvFormRuleSets: [{
272
+ containerChange: 0,
273
+ tabChange: 0,
274
+ podFsGroup: podTemplateSpec.securityContext?.fsGroup,
275
+ savePvcHookName: 'savePvcHook',
276
+ tabWeightMap: TAB_WEIGHT_MAP,
277
+ fvFormRuleSets: [{
254
278
  path: 'image', rootObject: this.container, rules: ['required'], translationKey: 'workload.container.image'
255
279
  }],
256
280
  fvReportedValidationPaths: ['spec'],
257
-
281
+ isNamespaceNew: false,
258
282
  };
259
283
  },
260
284
 
261
285
  computed: {
286
+ ...mapGetters(['currentCluster']),
262
287
  tabErrors() {
263
288
  return { general: this.fvGetPathErrors(['image'])?.length > 0 };
264
289
  },
@@ -326,13 +351,13 @@ export default {
326
351
  }
327
352
 
328
353
  return this.spec.jobTemplate.metadata.labels;
329
- } else {
330
- if (!this.spec.template.metadata) {
331
- this.$set(this.spec.template, 'metadata', { labels: {} });
332
- }
354
+ }
333
355
 
334
- return this.spec.template.metadata.labels;
356
+ if (!this.spec.template.metadata) {
357
+ this.$set(this.spec.template, 'metadata', { labels: {} });
335
358
  }
359
+
360
+ return this.spec.template.metadata.labels;
336
361
  },
337
362
  set(neu) {
338
363
  if (this.isCronJob) {
@@ -351,13 +376,12 @@ export default {
351
376
  }
352
377
 
353
378
  return this.spec.jobTemplate.metadata.annotations;
354
- } else {
355
- if (!this.spec.template.metadata) {
356
- this.$set(this.spec.template, 'metadata', { annotations: {} });
357
- }
358
-
359
- return this.spec.template.metadata.annotations;
360
379
  }
380
+ if (!this.spec.template.metadata) {
381
+ this.$set(this.spec.template, 'metadata', { annotations: {} });
382
+ }
383
+
384
+ return this.spec.template.metadata.annotations;
361
385
  },
362
386
  set(neu) {
363
387
  if (this.isCronJob) {
@@ -467,55 +491,6 @@ export default {
467
491
  return this.$store.getters['cluster/schemaFor'](this.type);
468
492
  },
469
493
 
470
- namespacedSecrets() {
471
- const namespace = this.value?.metadata?.namespace;
472
-
473
- if (namespace) {
474
- return this.allSecrets.filter(
475
- secret => secret.metadata.namespace === namespace
476
- );
477
- } else {
478
- return this.allSecrets;
479
- }
480
- },
481
-
482
- imagePullNamespacedSecrets() {
483
- const namespace = this.value?.metadata?.namespace;
484
-
485
- return this.allSecrets.filter(secret => secret.metadata.namespace === namespace && (secret._type === SECRET_TYPES.DOCKER || secret._type === SECRET_TYPES.DOCKER_JSON));
486
- },
487
-
488
- namespacedConfigMaps() {
489
- const namespace = this.value?.metadata?.namespace;
490
-
491
- if (namespace) {
492
- return this.allConfigMaps.filter(
493
- configMap => configMap.metadata.namespace === namespace
494
- );
495
- } else {
496
- return this.allConfigMaps;
497
- }
498
- },
499
-
500
- namespacedServiceNames() {
501
- const { namespace } = this.value?.metadata;
502
-
503
- if (namespace) {
504
- return this.sas.filter(
505
- serviceName => serviceName.metadata.namespace === namespace
506
- );
507
- } else {
508
- return this.sas;
509
- }
510
- },
511
-
512
- headlessServices() {
513
- return this.allServices.filter(
514
- service => service.spec.clusterIP === 'None' &&
515
- service.metadata.namespace === this.value.metadata.namespace
516
- );
517
- },
518
-
519
494
  workloadTypes() {
520
495
  return omitBy(WORKLOAD_TYPES, (type) => {
521
496
  return (
@@ -558,6 +533,25 @@ export default {
558
533
  },
559
534
 
560
535
  watch: {
536
+ async 'value.metadata.namespace'(neu) {
537
+ if (this.isNamespaceNew) {
538
+ // we don't need to re-fetch namespace specific (or non-namespace specific) resources when the namespace hasn't been created yet
539
+ return;
540
+ }
541
+ this.secondaryResourceData.namespace = neu;
542
+ // Fetch resources that are namespace specific, we don't need to re-fetch non-namespaced resources on namespace change
543
+ this.resourceManagerFetchSecondaryResources(this.secondaryResourceData, true);
544
+
545
+ this.servicesOwned = await this.value.getServicesOwned();
546
+ },
547
+
548
+ isNamespaceNew(neu, old) {
549
+ if (!old && neu) {
550
+ // As the namespace is new any resource that's been fetched with a namespace is now invalid
551
+ this.resourceManagerClearSecondaryResources(this.secondaryResourceData, true);
552
+ }
553
+ },
554
+
561
555
  type(neu, old) {
562
556
  const template =
563
557
  old === WORKLOAD_TYPES.CRON_JOB ? this.spec?.jobTemplate?.spec?.template : this.spec?.template;
@@ -689,6 +683,7 @@ export default {
689
683
  template = this.spec.template;
690
684
  }
691
685
 
686
+ // WORKLOADS
692
687
  if (
693
688
  this.type !== WORKLOAD_TYPES.JOB &&
694
689
  this.type !== WORKLOAD_TYPES.CRON_JOB &&
@@ -1,5 +1,4 @@
1
1
  <script>
2
- import { PVC } from '@shell/config/types';
3
2
  import ButtonDropdown from '@shell/components/ButtonDropdown';
4
3
  import Mount from '@shell/edit/workload/storage/Mount';
5
4
  import { _VIEW } from '@shell/config/query-params';
@@ -47,25 +46,25 @@ export default {
47
46
  type: Array,
48
47
  default: () => [],
49
48
  },
49
+ namespacedPvcs: {
50
+ type: Array,
51
+ default: () => [],
52
+ },
50
53
 
51
54
  registerBeforeHook: {
52
55
  type: Function,
53
56
  default: null,
54
57
  },
55
- },
56
-
57
- async fetch() {
58
- if ( this.$store.getters['cluster/schemaFor'](PVC) ) {
59
- this.pvcs = await this.$store.dispatch('cluster/findAll', { type: PVC });
60
- } else {
61
- this.pvcs = [];
62
- }
58
+ loading: {
59
+ default: false,
60
+ type: Boolean
61
+ },
63
62
  },
64
63
 
65
64
  data() {
66
65
  this.initializeStorage();
67
66
 
68
- return { pvcs: [] };
67
+ return {};
69
68
  },
70
69
 
71
70
  computed: {
@@ -73,12 +72,6 @@ export default {
73
72
  return this.mode === _VIEW;
74
73
  },
75
74
 
76
- namespacedPVCs() {
77
- const namespace = this.namespace || this.$store.getters['defaultNamespace'];
78
-
79
- return this.pvcs.filter(pvc => pvc.metadata.namespace === namespace);
80
- },
81
-
82
75
  /**
83
76
  * Generated list of volumes
84
77
  */
@@ -110,7 +103,7 @@ export default {
110
103
  },
111
104
 
112
105
  pvcNames() {
113
- return this.namespacedPVCs.map(pvc => pvc.metadata.name);
106
+ return this.namespacedPvcs.map(pvc => pvc.metadata.name);
114
107
  },
115
108
  },
116
109
 
@@ -270,6 +263,7 @@ export default {
270
263
  :pvcs="pvcNames"
271
264
  :register-before-hook="registerBeforeHook"
272
265
  :save-pvc-hook-name="savePvcHookName"
266
+ :loading="loading"
273
267
  @removePvcForm="removePvcForm"
274
268
  />
275
269
  <div v-else-if="isView">
@@ -53,6 +53,10 @@ export default {
53
53
  type: String,
54
54
  required: true
55
55
  },
56
+ loading: {
57
+ default: false,
58
+ type: Boolean
59
+ },
56
60
  },
57
61
 
58
62
  async fetch() {
@@ -129,6 +133,7 @@ export default {
129
133
  :mode="mode"
130
134
  :label="t('workload.storage.subtypes.persistentVolumeClaim')"
131
135
  :options="pvcs"
136
+ :loading="loading"
132
137
  />
133
138
  </div>
134
139
  </div>
@@ -43,7 +43,10 @@ export default {
43
43
  return {};
44
44
  }
45
45
  },
46
-
46
+ loading: {
47
+ default: false,
48
+ type: Boolean
49
+ },
47
50
  },
48
51
 
49
52
  computed: {
@@ -154,6 +157,7 @@ export default {
154
157
  :mode="mode"
155
158
  :required="true"
156
159
  :label="t('workload.storage.subtypes.secret')"
160
+ :loading="loading"
157
161
  />
158
162
  <LabeledSelect
159
163
  v-else-if="type==='configMap'"
@@ -162,6 +166,7 @@ export default {
162
166
  :required="true"
163
167
  :mode="mode"
164
168
  :label="t('workload.storage.subtypes.configMap')"
169
+ :loading="loading"
165
170
  />
166
171
  </div>
167
172
  <div class="col span-6">
@@ -1,10 +1,11 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
3
+ import ResourceFetch from '@shell/mixins/resource-fetch';
4
4
 
5
5
  export default {
6
6
  name: 'ListApps',
7
- components: { Loading, ResourceTable },
7
+ components: { ResourceTable },
8
+ mixins: [ResourceFetch],
8
9
 
9
10
  props: {
10
11
  resource: {
@@ -21,18 +22,18 @@ export default {
21
22
  async fetch() {
22
23
  await this.$store.dispatch('catalog/load');
23
24
 
24
- this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
25
- },
26
-
27
- data() {
28
- return { rows: null };
25
+ await this.$fetchType(this.resource);
29
26
  },
30
27
  };
31
28
  </script>
32
29
 
33
30
  <template>
34
- <Loading v-if="$fetchState.pending" />
35
- <ResourceTable v-else class="apps" :schema="schema" :rows="rows">
31
+ <ResourceTable
32
+ class="apps"
33
+ :schema="schema"
34
+ :rows="rows"
35
+ :loading="loading"
36
+ >
36
37
  <template #cell:upgrade="{row}">
37
38
  <span v-if="row.upgradeAvailable" class="badge-state bg-warning hand" @click="row.goToUpgrade(row.upgradeAvailable)">
38
39
  {{ row.upgradeAvailable }}
@@ -1,64 +1,24 @@
1
1
  <script>
2
- import { mapGetters } from 'vuex';
3
2
  import ResourceTable from '@shell/components/ResourceTable';
4
- import Masthead from '@shell/components/ResourceList/Masthead';
5
- import { Banner } from '@components/Banner';
6
- import { HIDE_DESC, mapPref } from '@shell/store/prefs';
7
- import { addObject } from '@shell/utils/array';
8
-
9
3
  export default {
10
4
  name: 'ListClusterReposApps',
11
- components: {
12
- Banner,
13
- Masthead,
14
- ResourceTable
15
- },
16
-
17
- props: {
5
+ components: { ResourceTable },
6
+ props: {
18
7
  resource: {
19
8
  type: String,
20
9
  required: true,
21
10
  },
22
-
23
11
  schema: {
24
12
  type: Object,
25
13
  required: true,
26
14
  },
27
-
28
15
  rows: {
29
16
  type: Array,
30
17
  required: true,
31
18
  },
32
- },
33
-
34
- computed: {
35
- ...mapGetters(['currentCluster']),
36
- hideDescriptions: mapPref(HIDE_DESC),
37
-
38
- typeDescriptionKey() {
39
- // Show a different message to cover support for RKE templates in the local cluster
40
- // (no current cluster means catalog requests default to local)
41
- const key = !this.currentCluster || this.currentCluster.isLocal ? 'typeDescription."catalog.cattle.io.clusterrepo.local"' : 'typeDescription."catalog.cattle.io.clusterrepo"';
42
-
43
- if ( this.hideDescriptions.includes(this.resource) || this.hideDescriptions.includes('ALL') ) {
44
- return false;
45
- }
46
-
47
- if ( this.$store.getters['i18n/exists'](key) ) {
48
- return key;
49
- }
50
-
51
- return false;
52
- }
53
- },
54
-
55
- methods: {
56
- hideTypeDescription() {
57
- const neu = this.hideDescriptions.slice();
58
-
59
- addObject(neu, this.resource);
60
-
61
- this.hideDescriptions = neu;
19
+ loading: {
20
+ type: Boolean,
21
+ required: false,
62
22
  },
63
23
  }
64
24
  };
@@ -66,25 +26,10 @@ export default {
66
26
 
67
27
  <template>
68
28
  <div>
69
- <Masthead
70
- :schema="schema"
71
- :resource="resource"
72
- >
73
- <template #typeDescription>
74
- <Banner
75
- v-if="typeDescriptionKey"
76
- class="type-banner mb-20 mt-0"
77
- color="info"
78
- :closable="true"
79
- :label-key="typeDescriptionKey"
80
- @close="hideTypeDescription"
81
- />
82
- </template>
83
- </Masthead>
84
-
85
29
  <ResourceTable
86
30
  :schema="schema"
87
31
  :rows="rows"
32
+ :loading="loading"
88
33
  />
89
34
  </div>
90
35
  </template>
@@ -1,13 +1,13 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
4
3
  import { get } from '@shell/utils/object';
5
4
  import { AGE } from '@shell/config/table-headers';
5
+ import ResourceFetch from '@shell/mixins/resource-fetch';
6
6
 
7
7
  export default {
8
- components: { Loading, ResourceTable },
9
-
10
- props: {
8
+ components: { ResourceTable },
9
+ mixins: [ResourceFetch],
10
+ props: {
11
11
  resource: {
12
12
  type: String,
13
13
  required: true,
@@ -20,11 +20,7 @@ export default {
20
20
  },
21
21
 
22
22
  async fetch() {
23
- this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
24
- },
25
-
26
- data() {
27
- return { rows: null };
23
+ await this.$fetchType(this.resource);
28
24
  },
29
25
 
30
26
  computed: {
@@ -53,12 +49,16 @@ export default {
53
49
  } else {
54
50
  return headersFromSchema;
55
51
  }
56
- }
52
+ },
57
53
  },
58
54
  };
59
55
  </script>
60
56
 
61
57
  <template>
62
- <Loading v-if="$fetchState.pending" />
63
- <ResourceTable v-else :schema="schema" :rows="rows" :headers="headers" />
58
+ <ResourceTable
59
+ :schema="schema"
60
+ :rows="rows"
61
+ :headers="headers"
62
+ :loading="loading"
63
+ />
64
64
  </template>