@rancher/shell 0.1.3 → 0.1.21

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 (245) hide show
  1. package/assets/brand/suse/dark/rancher-logo.svg +1 -148
  2. package/assets/brand/suse/favicon.png +0 -0
  3. package/assets/brand/suse/rancher-logo.svg +1 -130
  4. package/assets/images/featured/img1.jpg +0 -0
  5. package/assets/images/featured.jpg +0 -0
  6. package/assets/images/generic-plugin.svg +1 -0
  7. package/assets/styles/themes/_dark.scss +3 -0
  8. package/assets/styles/themes/_light.scss +3 -0
  9. package/assets/styles/themes/_suse.scss +1 -1
  10. package/assets/translations/en-us.yaml +219 -47
  11. package/assets/translations/zh-hans.yaml +21 -24
  12. package/components/AsyncButton.vue +17 -2
  13. package/components/ButtonDropdown.vue +4 -0
  14. package/components/Carousel.vue +291 -0
  15. package/components/CommunityLinks.vue +64 -22
  16. package/components/CruResource.vue +11 -3
  17. package/components/Dialog.vue +102 -0
  18. package/components/ExplorerMembers.vue +2 -4
  19. package/components/ExplorerProjectsNamespaces.vue +25 -9
  20. package/components/IconMessage.vue +9 -1
  21. package/components/LazyImage.vue +21 -8
  22. package/components/LocaleSelector.vue +62 -29
  23. package/components/PromptRemove.vue +2 -2
  24. package/components/ResourceList/Masthead.vue +21 -1
  25. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  26. package/components/ResourceList/index.vue +9 -23
  27. package/components/ResourceTable.vue +7 -2
  28. package/components/SimpleBox.vue +6 -4
  29. package/components/SortableTable/index.vue +18 -25
  30. package/components/Tabbed/Tab.vue +5 -0
  31. package/components/Tabbed/index.vue +54 -9
  32. package/components/TypeDescription.vue +10 -1
  33. package/components/auth/Principal.vue +1 -0
  34. package/components/fleet/FleetBundles.vue +8 -3
  35. package/components/fleet/FleetClusters.vue +6 -0
  36. package/components/fleet/FleetRepos.vue +7 -1
  37. package/components/fleet/FleetSummary.vue +6 -0
  38. package/components/form/Command.vue +5 -0
  39. package/components/form/EnvVars.vue +5 -0
  40. package/components/form/KeyValue.vue +80 -58
  41. package/components/form/NameNsDescription.vue +13 -5
  42. package/components/form/NodeScheduling.vue +6 -1
  43. package/components/form/PodAffinity.vue +5 -0
  44. package/components/form/ResourceTabs/index.vue +5 -1
  45. package/components/form/ServiceNameSelect.vue +5 -0
  46. package/components/form/ValueFromResource.vue +7 -1
  47. package/components/formatter/ClusterLink.vue +3 -7
  48. package/components/nav/NamespaceFilter.vue +3 -3
  49. package/components/nav/TopLevelMenu.vue +12 -29
  50. package/config/home-links.js +155 -0
  51. package/config/labels-annotations.js +2 -1
  52. package/config/private-label.js +1 -1
  53. package/config/product/explorer.js +5 -4
  54. package/config/product/legacy.js +0 -47
  55. package/config/product/manager.js +0 -2
  56. package/config/product/multi-cluster-apps.js +0 -12
  57. package/config/product/settings.js +12 -1
  58. package/config/product/uiplugins.js +17 -0
  59. package/config/settings.js +23 -2
  60. package/config/types.js +5 -1
  61. package/config/uiplugins.js +117 -0
  62. package/config/version.js +17 -0
  63. package/content/docs/en-us/getting-started.md +1 -26
  64. package/core/plugin.ts +12 -0
  65. package/core/plugins.js +38 -2
  66. package/core/types.ts +6 -0
  67. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  68. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  69. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  70. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  71. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  72. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  73. package/creators/app/init +16 -17
  74. package/creators/app/package.json +6 -0
  75. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  76. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  77. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  78. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  79. package/creators/pkg/init +1 -1
  80. package/creators/update/init +54 -0
  81. package/creators/update/package.json +20 -0
  82. package/creators/update/upgrade +56 -0
  83. package/creators/update/yarn-error.log +54 -0
  84. package/detail/provisioning.cattle.io.cluster.vue +3 -3
  85. package/detail/workload/index.vue +3 -2
  86. package/dialog/DiagnosticTimingsDialog.vue +116 -0
  87. package/dialog/RotateCertificatesDialog.vue +9 -3
  88. package/edit/auth/azuread.vue +28 -9
  89. package/edit/networking.k8s.io.ingress/index.vue +2 -2
  90. package/edit/persistentvolume/index.vue +51 -13
  91. package/edit/persistentvolumeclaim.vue +31 -13
  92. package/edit/pod.vue +27 -0
  93. package/edit/provisioning.cattle.io.cluster/rke2.vue +103 -24
  94. package/edit/service.vue +7 -5
  95. package/edit/workload/__tests__/Upgrading.test.ts +1 -0
  96. package/edit/workload/index.vue +32 -10
  97. package/edit/workload/mixins/workload.js +121 -126
  98. package/edit/workload/storage/ContainerMountPaths.vue +240 -0
  99. package/edit/workload/storage/Mount.vue +1 -0
  100. package/edit/workload/storage/awsElasticBlockStore.vue +20 -1
  101. package/edit/workload/storage/azureDisk.vue +22 -2
  102. package/edit/workload/storage/azureFile.vue +20 -2
  103. package/edit/workload/storage/csi/index.vue +23 -1
  104. package/edit/workload/storage/gcePersistentDisk.vue +20 -2
  105. package/edit/workload/storage/index.vue +33 -65
  106. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  107. package/edit/workload/storage/secret.vue +6 -1
  108. package/edit/workload/storage/vsphereVolume.vue +11 -1
  109. package/layouts/default.vue +14 -8
  110. package/layouts/home.vue +9 -4
  111. package/layouts/plain.vue +10 -5
  112. package/list/catalog.cattle.io.app.vue +10 -9
  113. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  114. package/list/cis.cattle.io.clusterscan.vue +12 -12
  115. package/list/fleet.cattle.io.bundle.vue +33 -28
  116. package/list/fleet.cattle.io.cluster.vue +26 -22
  117. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  118. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  119. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  120. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  121. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  122. package/list/logging.banzaicloud.io.flow.vue +7 -14
  123. package/list/management.cattle.io.cluster.vue +26 -15
  124. package/list/management.cattle.io.feature.vue +13 -8
  125. package/list/management.cattle.io.setting.vue +3 -3
  126. package/list/management.cattle.io.user.vue +38 -19
  127. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  128. package/list/namespace.vue +14 -1
  129. package/list/node.vue +13 -16
  130. package/list/persistentvolume.vue +16 -9
  131. package/list/persistentvolumeclaim.vue +5 -8
  132. package/list/provisioning.cattle.io.cluster.vue +35 -9
  133. package/list/service.vue +24 -12
  134. package/list/ui.cattle.io.navlink.vue +6 -0
  135. package/list/workload.vue +2 -2
  136. package/machine-config/harvester.vue +5 -3
  137. package/middleware/authenticated.js +6 -0
  138. package/mixins/resource-fetch.js +12 -18
  139. package/mixins/resource-manager.js +126 -0
  140. package/models/catalog.cattle.io.uiplugin.js +38 -0
  141. package/models/cluster/node.js +25 -2
  142. package/models/fleet.cattle.io.bundle.js +1 -1
  143. package/models/harvesterhci.io.management.cluster.js +11 -5
  144. package/models/pod.js +15 -5
  145. package/models/provisioning.cattle.io.cluster.js +16 -6
  146. package/models/workload.js +5 -3
  147. package/models/workload.service.js +10 -0
  148. package/nuxt.config.js +70 -25
  149. package/package.json +108 -109
  150. package/pages/auth/login.vue +11 -1
  151. package/pages/auth/verify.vue +9 -0
  152. package/pages/c/_cluster/apps/charts/index.vue +46 -1
  153. package/pages/c/_cluster/apps/charts/install.vue +10 -9
  154. package/pages/c/_cluster/explorer/index.vue +72 -9
  155. package/pages/c/_cluster/explorer/tools/index.vue +12 -5
  156. package/pages/c/_cluster/mcapps/index.vue +1 -1
  157. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  158. package/pages/c/_cluster/settings/brand.vue +0 -40
  159. package/pages/c/_cluster/settings/links.vue +152 -0
  160. package/pages/c/_cluster/settings/performance.vue +90 -7
  161. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +232 -0
  162. package/pages/c/_cluster/uiplugins/InstallDialog.vue +293 -0
  163. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +300 -0
  164. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +125 -0
  165. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +261 -0
  166. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +122 -0
  167. package/pages/c/_cluster/uiplugins/index.vue +808 -0
  168. package/pages/diagnostic.vue +185 -101
  169. package/pages/docs/_doc.vue +3 -1
  170. package/pages/home.vue +21 -56
  171. package/pages/prefs.vue +108 -88
  172. package/pages/safeMode.vue +17 -0
  173. package/pages/support/index.vue +34 -137
  174. package/pkg/dynamic-importer.lib.js +4 -0
  175. package/plugins/dashboard-store/actions.js +19 -0
  176. package/plugins/dashboard-store/getters.js +20 -3
  177. package/plugins/dashboard-store/mutations.js +13 -7
  178. package/plugins/dashboard-store/resource-class.js +2 -2
  179. package/plugins/formatters.js +15 -0
  180. package/plugins/plugin.js +61 -6
  181. package/plugins/steve/getters.js +12 -0
  182. package/plugins/steve/mutations.js +1 -1
  183. package/plugins/steve/subscribe.js +94 -72
  184. package/plugins/steve/web-worker.steve-sub-worker.js +24 -15
  185. package/plugins/version.js +21 -0
  186. package/promptRemove/management.cattle.io.globalrole.vue +47 -0
  187. package/promptRemove/management.cattle.io.roletemplate.vue +47 -0
  188. package/promptRemove/mixin/roleDeletionCheck.js +97 -0
  189. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  190. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  191. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  192. package/rancher-components/components/BadgeState/index.ts +1 -0
  193. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  194. package/rancher-components/components/Banner/Banner.vue +163 -0
  195. package/rancher-components/components/Banner/index.ts +1 -0
  196. package/rancher-components/components/Card/Card.vue +150 -0
  197. package/rancher-components/components/Card/index.ts +1 -0
  198. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  199. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  200. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  201. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  202. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  203. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  204. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  205. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  206. package/rancher-components/components/Form/Radio/index.ts +2 -0
  207. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  208. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  209. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  210. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  211. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  212. package/rancher-components/components/Form/index.ts +5 -0
  213. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  214. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  215. package/scripts/publish-shell.sh +40 -7
  216. package/scripts/record-deps.js +37 -0
  217. package/scripts/sync-shell-deps +37 -0
  218. package/scripts/test-plugins-build.sh +8 -5
  219. package/scripts/typegen.sh +84 -0
  220. package/store/auth.js +3 -0
  221. package/store/catalog.js +9 -8
  222. package/store/i18n.js +10 -1
  223. package/store/index.js +12 -3
  224. package/store/prefs.js +16 -0
  225. package/store/type-map.js +32 -5
  226. package/store/uiplugins.ts +15 -61
  227. package/types/shell/index.d.ts +3046 -0
  228. package/utils/__tests__/object.test.ts +0 -24
  229. package/utils/__tests__/selector.test.ts +1 -1
  230. package/utils/dynamic-importer.js +4 -0
  231. package/utils/favicon.js +8 -2
  232. package/utils/gc/gc-interval.ts +40 -0
  233. package/utils/gc/gc-root-store.js +76 -0
  234. package/utils/gc/gc-route-changed.ts +44 -0
  235. package/utils/gc/gc-types.ts +21 -0
  236. package/utils/gc/gc.ts +282 -0
  237. package/utils/grafana.js +2 -6
  238. package/utils/socket.js +41 -20
  239. package/utils/string.js +1 -7
  240. package/utils/validators/formRules/__tests__/index.test.ts +108 -0
  241. package/utils/validators/formRules/index.ts +9 -1
  242. package/config/footer.js +0 -19
  243. package/creators/pkg/nuxt.config.js +0 -6
  244. package/pages/plugins.vue +0 -387
  245. package/server/verdaccio-middleware.js +0 -56
@@ -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>
@@ -1,8 +1,8 @@
1
1
  <script>
2
2
  import { FLEET } from '@shell/config/types';
3
3
  import { Banner } from '@components/Banner';
4
- import Loading from '@shell/components/Loading';
5
4
  import ResourceTable from '@shell/components/ResourceTable';
5
+ import ResourceFetch from '@shell/mixins/resource-fetch';
6
6
  import {
7
7
  AGE,
8
8
  STATE,
@@ -12,11 +12,13 @@ import { isHarvesterCluster } from '@shell/utils/cluster';
12
12
 
13
13
  export default {
14
14
  name: 'ListBundle',
15
- components: {
16
- Banner, Loading, ResourceTable
17
- },
18
-
19
- props: {
15
+ components: { Banner, ResourceTable },
16
+ mixins: [ResourceFetch],
17
+ props: {
18
+ resource: {
19
+ type: String,
20
+ required: true,
21
+ },
20
22
  schema: {
21
23
  type: Object,
22
24
  required: true,
@@ -24,15 +26,12 @@ export default {
24
26
  },
25
27
 
26
28
  async fetch() {
27
- this.allBundles = await this.$store.dispatch('management/findAll', { type: FLEET.BUNDLE });
29
+ await this.$fetchType(FLEET.BUNDLE);
28
30
  this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
29
31
  },
30
32
 
31
33
  data() {
32
- return {
33
- allFleet: [],
34
- allBundles: [],
35
- };
34
+ return { allFleet: [] };
36
35
  },
37
36
 
38
37
  computed: {
@@ -51,7 +50,7 @@ export default {
51
50
  bundles() {
52
51
  const harvester = this.harvesterClusters;
53
52
 
54
- return this.allBundles.filter((bundle) => {
53
+ return this.rows.filter((bundle) => {
55
54
  const targets = bundle.spec?.targets || [];
56
55
 
57
56
  // Filter out any bundle that has one target whose cluster is a harvester cluster
@@ -64,7 +63,7 @@ export default {
64
63
  },
65
64
 
66
65
  hidden() {
67
- return this.allBundles.length - this.bundles.length;
66
+ return this.rows.length - this.bundles.length;
68
67
  },
69
68
 
70
69
  headers() {
@@ -84,25 +83,31 @@ export default {
84
83
  return out;
85
84
  },
86
85
  },
86
+
87
+ // override with relevant info for the loading indicator since this doesn't use it's own masthead
88
+ $loadingResources() {
89
+ return {
90
+ loadResources: [FLEET.BUNDLE],
91
+ loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
92
+ };
93
+ },
87
94
  };
88
95
  </script>
89
96
 
90
97
  <template>
91
98
  <div>
92
- <Loading v-if="$fetchState.pending" />
93
- <div v-else>
94
- <Banner v-if="hidden" color="info" :label="t('fleet.bundles.harvester', {count: hidden} )" />
95
- <ResourceTable
96
- :schema="schema"
97
- :headers="headers"
98
- :rows="bundles"
99
- >
100
- <template #cell:deploymentsReady="{row}">
101
- <span v-if="row.status.summary.desiredReady != row.status.summary.ready" class="text-warning">
102
- {{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
103
- <span v-else>{{ row.status.summary.desiredReady }}</span>
104
- </template>
105
- </ResourceTable>
106
- </div>
99
+ <Banner v-if="hidden" color="info" :label="t('fleet.bundles.harvester', {count: hidden} )" />
100
+ <ResourceTable
101
+ :schema="schema"
102
+ :headers="headers"
103
+ :rows="bundles"
104
+ :loading="loading"
105
+ >
106
+ <template #cell:deploymentsReady="{row}">
107
+ <span v-if="row.status.summary.desiredReady != row.status.summary.ready" class="text-warning">
108
+ {{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
109
+ <span v-else>{{ row.status.summary.desiredReady }}</span>
110
+ </template>
111
+ </ResourceTable>
107
112
  </div>
108
113
  </template>
@@ -1,17 +1,19 @@
1
1
  <script>
2
2
  import FleetClusters from '@shell/components/fleet/FleetClusters';
3
3
  import { FLEET, MANAGEMENT } from '@shell/config/types';
4
- import Loading from '@shell/components/Loading';
5
4
  import { isHarvesterCluster } from '@shell/utils/cluster';
6
5
  import { Banner } from '@components/Banner';
6
+ import ResourceFetch from '@shell/mixins/resource-fetch';
7
7
 
8
8
  export default {
9
9
  name: 'ListCluster',
10
- components: {
11
- Banner, FleetClusters, Loading
12
- },
13
-
14
- props: {
10
+ components: { Banner, FleetClusters },
11
+ mixins: [ResourceFetch],
12
+ props: {
13
+ resource: {
14
+ type: String,
15
+ required: true,
16
+ },
15
17
  schema: {
16
18
  type: Object,
17
19
  required: true,
@@ -21,19 +23,16 @@ export default {
21
23
  async fetch() {
22
24
  await this.$store.dispatch('management/findAll', { type: FLEET.WORKSPACE });
23
25
  this.allMgmt = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER });
24
- this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
26
+ await this.$fetchType(FLEET.CLUSTER);
25
27
  },
26
28
 
27
29
  data() {
28
- return {
29
- allMgmt: null,
30
- allFleet: null,
31
- };
30
+ return { allMgmt: [] };
32
31
  },
33
32
 
34
33
  computed: {
35
34
  allClusters() {
36
- const out = this.allFleet.slice();
35
+ const out = this.rows.slice();
37
36
 
38
37
  const known = {};
39
38
 
@@ -50,7 +49,7 @@ export default {
50
49
  return out;
51
50
  },
52
51
 
53
- rows() {
52
+ filteredRows() {
54
53
  return this.fleetClusters.filter(c => !isHarvesterCluster(c));
55
54
  },
56
55
 
@@ -59,21 +58,26 @@ export default {
59
58
  },
60
59
 
61
60
  hiddenHarvesterCount() {
62
- return this.fleetClusters.length - this.rows.length;
61
+ return this.fleetClusters.length - this.filteredRows.length;
63
62
  },
64
63
  },
64
+ // override with relevant info for the loading indicator since this doesn't use it's own masthead
65
+ $loadingResources() {
66
+ return {
67
+ loadResources: [FLEET.CLUSTER],
68
+ loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
69
+ };
70
+ },
65
71
  };
66
72
  </script>
67
73
 
68
74
  <template>
69
75
  <div>
70
- <Loading v-if="$fetchState.pending" />
71
- <div v-else>
72
- <Banner v-if="hiddenHarvesterCount" color="info" :label="t('fleet.clusters.harvester', {count: hiddenHarvesterCount} )" />
73
- <FleetClusters
74
- :rows="rows"
75
- :schema="schema"
76
- />
77
- </div>
76
+ <Banner v-if="hiddenHarvesterCount" color="info" :label="t('fleet.clusters.harvester', {count: hiddenHarvesterCount} )" />
77
+ <FleetClusters
78
+ :rows="filteredRows"
79
+ :schema="schema"
80
+ :loading="loading"
81
+ />
78
82
  </div>
79
83
  </template>
@@ -23,6 +23,11 @@ export default {
23
23
  type: Array,
24
24
  required: true,
25
25
  },
26
+
27
+ loading: {
28
+ type: Boolean,
29
+ required: false,
30
+ },
26
31
  },
27
32
 
28
33
  computed: {
@@ -57,6 +62,7 @@ export default {
57
62
  :schema="schema"
58
63
  :headers="headers"
59
64
  :rows="rows"
65
+ :loading="loading"
60
66
  key-field="_key"
61
67
  v-on="$listeners"
62
68
  >
@@ -1,17 +1,19 @@
1
1
  <script>
2
2
  import { FLEET } from '@shell/config/types';
3
3
  import { Banner } from '@components/Banner';
4
- import Loading from '@shell/components/Loading';
5
4
  import ResourceTable from '@shell/components/ResourceTable';
6
5
  import { isHarvesterCluster } from '@shell/utils/cluster';
6
+ import ResourceFetch from '@shell/mixins/resource-fetch';
7
7
 
8
8
  export default {
9
9
  name: 'ListClusterGroup',
10
- components: {
11
- Banner, Loading, ResourceTable
12
- },
13
-
14
- props: {
10
+ components: { Banner, ResourceTable },
11
+ mixins: [ResourceFetch],
12
+ props: {
13
+ resource: {
14
+ type: String,
15
+ required: true,
16
+ },
15
17
  schema: {
16
18
  type: Object,
17
19
  required: true,
@@ -19,15 +21,12 @@ export default {
19
21
  },
20
22
 
21
23
  async fetch() {
22
- this.allTokens = await this.$store.dispatch('management/findAll', { type: FLEET.TOKEN });
24
+ await this.$fetchType(FLEET.TOKEN);
23
25
  this.allFleet = await this.$store.dispatch('management/findAll', { type: FLEET.CLUSTER });
24
26
  },
25
27
 
26
28
  data() {
27
- return {
28
- allFleet: null,
29
- allTokens: null,
30
- };
29
+ return { allFleet: [] };
31
30
  },
32
31
 
33
32
  computed: {
@@ -45,7 +44,7 @@ export default {
45
44
  tokens() {
46
45
  const harvester = this.harvesterClusters;
47
46
 
48
- return this.allTokens.filter((token) => {
47
+ return this.rows.filter((token) => {
49
48
  const refs = token.metadata?.ownerReferences || [];
50
49
 
51
50
  for (const owner of refs) {
@@ -59,23 +58,28 @@ export default {
59
58
  },
60
59
 
61
60
  hidden() {
62
- return this.allTokens.length - this.tokens.length;
61
+ return this.rows.length - this.tokens.length;
63
62
  }
64
- }
63
+ },
64
+ // override with relevant info for the loading indicator since this doesn't use it's own masthead
65
+ $loadingResources() {
66
+ return {
67
+ loadResources: [FLEET.TOKEN],
68
+ loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
69
+ };
70
+ },
65
71
  };
66
72
  </script>
67
73
 
68
74
  <template>
69
75
  <div>
70
- <Loading v-if="$fetchState.pending" />
71
- <div v-else>
72
- <Banner v-if="hidden" color="info" :label="t('fleet.tokens.harvester', {count: hidden} )" />
73
- <ResourceTable
74
- v-bind="$attrs"
75
- :schema="schema"
76
- :rows="tokens"
77
- >
78
- </ResourceTable>
79
- </div>
76
+ <Banner v-if="hidden" color="info" :label="t('fleet.tokens.harvester', {count: hidden} )" />
77
+ <ResourceTable
78
+ v-bind="$attrs"
79
+ :schema="schema"
80
+ :rows="tokens"
81
+ :loading="loading"
82
+ >
83
+ </ResourceTable>
80
84
  </div>
81
85
  </template>
@@ -1,18 +1,17 @@
1
1
  <script>
2
2
  import FleetRepos from '@shell/components/fleet/FleetRepos';
3
3
  import Masthead from '@shell/components/ResourceList/Masthead';
4
- import Loading from '@shell/components/Loading';
5
4
  import { FLEET } from '@shell/config/types';
5
+ import ResourceFetch from '@shell/mixins/resource-fetch';
6
6
 
7
7
  export default {
8
8
  name: 'ListGitRepo',
9
9
  components: {
10
- Loading,
11
10
  FleetRepos,
12
11
  Masthead,
13
12
  },
14
-
15
- props: {
13
+ mixins: [ResourceFetch],
14
+ props: {
16
15
  schema: {
17
16
  type: Object,
18
17
  required: true,
@@ -22,6 +21,21 @@ export default {
22
21
  type: String,
23
22
  required: true,
24
23
  },
24
+
25
+ loadResources: {
26
+ type: Array,
27
+ default: () => []
28
+ },
29
+
30
+ loadIndeterminate: {
31
+ type: Boolean,
32
+ default: false
33
+ },
34
+
35
+ incrementalLoadingIndicator: {
36
+ type: Boolean,
37
+ default: false
38
+ },
25
39
  },
26
40
 
27
41
  async fetch() {
@@ -30,28 +44,25 @@ export default {
30
44
  await store.dispatch('management/findAll', { type: FLEET.CLUSTER });
31
45
  await store.dispatch('management/findAll', { type: FLEET.CLUSTER_GROUP });
32
46
 
33
- const inStore = store.getters['currentStore'](this.resource);
34
-
35
- this.rows = await store.dispatch(`${ inStore }/findAll`, { type: this.resource });
36
- },
37
-
38
- data() {
39
- return { rows: null };
40
- },
47
+ await this.$fetchType(this.resource);
48
+ }
41
49
  };
42
50
  </script>
43
51
 
44
52
  <template>
45
- <Loading v-if="$fetchState.pending" />
46
- <div v-else>
53
+ <div>
47
54
  <Masthead
48
55
  :schema="schema"
49
56
  :resource="resource"
57
+ :show-incremental-loading-indicator="incrementalLoadingIndicator"
58
+ :load-resources="loadResources"
59
+ :load-indeterminate="loadIndeterminate"
50
60
  :create-button-label="t('fleet.gitRepo.repo.addRepo')"
51
61
  />
52
62
  <FleetRepos
53
63
  :rows="rows"
54
64
  :schema="schema"
65
+ :loading="loading"
55
66
  />
56
67
  </div>
57
68
  </template>
@@ -1,19 +1,40 @@
1
1
  <script>
2
- import Loading from '@shell/components/Loading';
3
2
  import ResourceTable from '@shell/components/ResourceTable';
4
3
  import Masthead from '@shell/components/ResourceList/Masthead';
5
4
  import { Banner } from '@components/Banner';
6
5
  import { HELM } from '@shell/config/types';
6
+ import ResourceFetch from '@shell/mixins/resource-fetch';
7
7
 
8
8
  export default {
9
9
  components: {
10
- Loading, ResourceTable, Masthead, Banner
10
+ ResourceTable, Masthead, Banner
11
+ },
12
+ mixins: [ResourceFetch],
13
+ props: {
14
+ resource: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+
19
+ loadResources: {
20
+ type: Array,
21
+ default: () => []
22
+ },
23
+
24
+ loadIndeterminate: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+
29
+ incrementalLoadingIndicator: {
30
+ type: Boolean,
31
+ default: false
32
+ },
11
33
  },
12
34
  async fetch() {
13
35
  this.projectHelmChartSchema = this.$store.getters['cluster/schemaFor'](HELM.PROJECTHELMCHART);
36
+ await this.$fetchType(HELM.PROJECTHELMCHART);
14
37
 
15
- this.projectHelmCharts = await this.$store.dispatch('cluster/findAll', { type: HELM.PROJECTHELMCHART } );
16
- this.pending = false;
17
38
  this.$store.dispatch('type-map/configureType', { match: HELM.PROJECTHELMCHART, isCreatable: true });
18
39
  this.headers = this.$store.getters['type-map/headersFor'](this.projectHelmChartSchema).map((header) => {
19
40
  if (header.name === 'name') {
@@ -30,11 +51,8 @@ export default {
30
51
  },
31
52
  data() {
32
53
  return {
33
- resource: HELM.PROJECTHELMCHART,
34
- projectHelmChartSchema: null,
35
- projectHelmCharts: [],
36
- pending: true,
37
- headers: null
54
+ projectHelmChartSchema: null,
55
+ headers: null,
38
56
  };
39
57
  },
40
58
  computed: {
@@ -51,35 +69,36 @@ export default {
51
69
  <Masthead
52
70
  :schema="projectHelmChartSchema"
53
71
  :resource="resource"
72
+ :show-incremental-loading-indicator="incrementalLoadingIndicator"
73
+ :load-resources="loadResources"
74
+ :load-indeterminate="loadIndeterminate"
54
75
  is-creatable
55
76
  />
56
77
  <Banner color="info" :label="t('monitoring.projectMonitoring.list.banner')" />
57
- <Loading v-if="pending" />
58
- <div v-else>
59
- <!-- ToDo: figure out how to get this centered in the empty space -->
60
- <div v-if="projectHelmCharts.length === 0" class="empty-list">
61
- <div class="message">
62
- <i class="icon icon-monitoring icon-10x icon-grey"></i>
63
- <div class="text-large">
64
- {{ t('monitoring.projectMonitoring.list.empty.message') }}
65
- </div>
66
- <div v-if="canCreateProjectHelmChart" class="text-large">
67
- {{ t('monitoring.projectMonitoring.list.empty.canCreate') }}
68
- </div>
69
- <div v-else class="text-large">
70
- {{ t('monitoring.projectMonitoring.list.empty.cannotCreate') }}
71
- </div>
78
+ <!-- ToDo: figure out how to get this centered in the empty space -->
79
+ <div v-if="rows.length === 0 && !loading" class="empty-list">
80
+ <div class="message">
81
+ <i class="icon icon-monitoring icon-10x icon-grey"></i>
82
+ <div class="text-large">
83
+ {{ t('monitoring.projectMonitoring.list.empty.message') }}
84
+ </div>
85
+ <div v-if="canCreateProjectHelmChart" class="text-large">
86
+ {{ t('monitoring.projectMonitoring.list.empty.canCreate') }}
87
+ </div>
88
+ <div v-else class="text-large">
89
+ {{ t('monitoring.projectMonitoring.list.empty.cannotCreate') }}
72
90
  </div>
73
91
  </div>
74
- <div v-else>
75
- <ResourceTable
76
- :rows="projectHelmCharts"
77
- :headers="headers"
78
- :schema="projectHelmChartSchema"
79
- key-field="_key"
80
- :groupable="false"
81
- />
82
- </div>
92
+ </div>
93
+ <div v-else>
94
+ <ResourceTable
95
+ :rows="rows"
96
+ :headers="headers"
97
+ :schema="projectHelmChartSchema"
98
+ :loading="loading"
99
+ key-field="_key"
100
+ :groupable="false"
101
+ />
83
102
  </div>
84
103
  </div>
85
104
  </template>