@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,13 +1,13 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
4
3
  import { LOGGING } from '@shell/config/types';
4
+ import ResourceFetch from '@shell/mixins/resource-fetch';
5
5
 
6
6
  export default {
7
7
  name: 'ListApps',
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,
@@ -21,16 +21,11 @@ export default {
21
21
 
22
22
  async fetch() {
23
23
  await this.$store.dispatch('cluster/findAll', { type: LOGGING.CLUSTER_OUTPUT });
24
- this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
25
- },
26
-
27
- data() {
28
- return { rows: null };
29
- },
24
+ await this.$fetchType(this.resource);
25
+ }
30
26
  };
31
27
  </script>
32
28
 
33
29
  <template>
34
- <Loading v-if="$fetchState.pending" />
35
- <ResourceTable v-else-if="rows" :schema="schema" :rows="rows" />
30
+ <ResourceTable :schema="schema" :rows="rows" :loading="loading" />
36
31
  </template>
@@ -1,13 +1,12 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
4
3
  import { LOGGING } from '@shell/config/types';
5
-
4
+ import ResourceFetch from '@shell/mixins/resource-fetch';
6
5
  export default {
7
6
  name: 'ListApps',
8
- components: { Loading, ResourceTable },
9
-
10
- props: {
7
+ components: { ResourceTable },
8
+ mixins: [ResourceFetch],
9
+ props: {
11
10
  resource: {
12
11
  type: String,
13
12
  required: true,
@@ -24,18 +23,12 @@ export default {
24
23
  await this.$store.dispatch('cluster/findAll', { type: LOGGING.OUTPUT });
25
24
  await this.$store.dispatch('cluster/findAll', { type: LOGGING.CLUSTER_OUTPUT });
26
25
  } catch (e) {}
27
- const rows = await this.$store.dispatch('cluster/findAll', { type: LOGGING.FLOW });
28
26
 
29
- this.rows = rows;
30
- },
31
-
32
- data() {
33
- return { rows: [] };
34
- },
27
+ await this.$fetchType(LOGGING.FLOW);
28
+ }
35
29
  };
36
30
  </script>
37
31
 
38
32
  <template>
39
- <Loading v-if="$fetchState.pending" />
40
- <ResourceTable v-else :schema="schema" :rows="rows" />
33
+ <ResourceTable :schema="schema" :rows="rows" :loading="loading" />
41
34
  </template>
@@ -1,31 +1,42 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
4
3
  import { MANAGEMENT } from '@shell/config/types';
5
4
  import { filterOnlyKubernetesClusters } from '@shell/utils/cluster';
6
-
5
+ import ResourceFetch from '@shell/mixins/resource-fetch';
7
6
  export default {
8
7
  name: 'ListMgmtClusters',
9
- components: { Loading, ResourceTable },
8
+ components: { ResourceTable },
9
+ mixins: [ResourceFetch],
10
10
 
11
- async fetch() {
12
- await this.$store.dispatch(`${ this.inStore }/findAll`, { type: this.$attrs.resource });
11
+ props: {
12
+ resource: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ schema: {
17
+ type: Object,
18
+ required: true,
19
+ },
13
20
  },
14
21
 
22
+ async fetch() {
23
+ await this.$fetchType(this.resource);
24
+ },
15
25
  computed: {
16
- inStore() {
17
- return this.$store.getters['currentProduct'].inStore;
18
- },
19
- rows() {
20
- const all = this.$store.getters[`${ this.inStore }/all`](MANAGEMENT.CLUSTER);
21
-
22
- return filterOnlyKubernetesClusters(all);
26
+ filteredRows() {
27
+ return filterOnlyKubernetesClusters(this.rows);
23
28
  }
24
- }
29
+ },
30
+ // override with relevant info for the loading indicator since this doesn't use it's own masthead
31
+ $loadingResources() {
32
+ return {
33
+ loadResources: [MANAGEMENT.CLUSTER],
34
+ loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
35
+ };
36
+ },
25
37
  };
26
38
  </script>
27
39
 
28
40
  <template>
29
- <Loading v-if="$fetchState.pending" />
30
- <ResourceTable v-else :schema="$attrs.schema" :rows="rows" :headers="$attrs.headers" :group-by="$attrs.groupBy" />
41
+ <ResourceTable :schema="schema" :rows="filteredRows" :headers="$attrs.headers" :group-by="$attrs.groupBy" :loading="loading" />
31
42
  </template>
@@ -3,23 +3,22 @@ import { mapState, mapGetters } from 'vuex';
3
3
  import AsyncButton from '@shell/components/AsyncButton';
4
4
  import { Card } from '@components/Card';
5
5
  import ResourceTable from '@shell/components/ResourceTable';
6
- import Loading from '@shell/components/Loading';
7
6
  import { Banner } from '@components/Banner';
8
7
  import { LabeledInput } from '@components/Form/LabeledInput';
9
8
  import { MANAGEMENT } from '@shell/config/types';
10
9
  import { SETTING } from '@shell/config/settings';
10
+ import ResourceFetch from '@shell/mixins/resource-fetch';
11
11
 
12
12
  export default {
13
13
  components: {
14
14
  AsyncButton,
15
15
  Banner,
16
16
  Card,
17
- Loading,
18
17
  ResourceTable,
19
18
  LabeledInput
20
19
  },
21
-
22
- props: {
20
+ mixins: [ResourceFetch],
21
+ props: {
23
22
  resource: {
24
23
  type: String,
25
24
  required: true,
@@ -32,7 +31,7 @@ export default {
32
31
  },
33
32
 
34
33
  async fetch() {
35
- this.rows = await this.$store.dispatch('management/findAll', { type: this.resource });
34
+ await this.$fetchType(this.resource);
36
35
 
37
36
  this.serverUrlSetting = this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SERVER_URL);
38
37
 
@@ -52,7 +51,6 @@ export default {
52
51
 
53
52
  data() {
54
53
  return {
55
- rows: null,
56
54
  update: [],
57
55
  updateMode: 'activate',
58
56
  error: null,
@@ -85,6 +83,13 @@ export default {
85
83
  },
86
84
  },
87
85
 
86
+ $loadingResources() {
87
+ return {
88
+ loadResources: [MANAGEMENT.FEATURE],
89
+ loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
90
+ };
91
+ },
92
+
88
93
  watch: {
89
94
  showPromptUpdate(show) {
90
95
  if (show) {
@@ -184,12 +189,12 @@ export default {
184
189
  </script>
185
190
 
186
191
  <template>
187
- <Loading v-if="$fetchState.pending" />
188
- <div v-else>
192
+ <div>
189
193
  <ResourceTable
190
194
  :schema="schema"
191
195
  :rows="filteredRows"
192
196
  :row-actions="enableRowActions"
197
+ :loading="loading"
193
198
  >
194
199
  <template slot="cell:name" slot-scope="scope">
195
200
  <div class="feature-name">
@@ -4,13 +4,13 @@ import { MANAGEMENT } from '@shell/config/types';
4
4
  import { ALLOWED_SETTINGS } from '@shell/config/settings';
5
5
  import { Banner } from '@components/Banner';
6
6
  import Loading from '@shell/components/Loading';
7
- import { DEV } from '@shell/store/prefs';
7
+ import { VIEW_IN_API } from '@shell/store/prefs';
8
8
 
9
9
  export default {
10
10
  components: { Banner, Loading },
11
11
 
12
12
  async fetch() {
13
- const isDev = this.$store.getters['prefs/get'](DEV);
13
+ const viewInApi = this.$store.getters['prefs/get'](VIEW_IN_API);
14
14
  const rows = await this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.SETTING });
15
15
  const t = this.$store.getters['i18n/t'];
16
16
  // Map settings from array to object keyed by id
@@ -51,7 +51,7 @@ export default {
51
51
  }
52
52
  // There are only 2 actions that can be enabled - Edit Setting or View in API
53
53
  // If neither is available for this setting then we hide the action menu button
54
- s.hasActions = (!s.readOnly || isDev) && setting.availableActions?.length;
54
+ s.hasActions = (!s.readOnly || viewInApi) && setting.availableActions?.length;
55
55
  settings.push(s);
56
56
  }
57
57
 
@@ -1,26 +1,45 @@
1
1
  <script>
2
2
  import AsyncButton from '@shell/components/AsyncButton';
3
- import { NORMAN } from '@shell/config/types';
3
+ import { MANAGEMENT, NORMAN } from '@shell/config/types';
4
4
  import { NAME } from '@shell/config/product/auth';
5
5
  import ResourceTable from '@shell/components/ResourceTable';
6
- import Loading from '@shell/components/Loading';
7
6
  import Masthead from '@shell/components/ResourceList/Masthead';
7
+ import ResourceFetch from '@shell/mixins/resource-fetch';
8
8
 
9
9
  export default {
10
10
  components: {
11
11
  AsyncButton,
12
- Loading,
13
12
  ResourceTable,
14
13
  Masthead
15
14
  },
15
+ mixins: [ResourceFetch],
16
+ props: {
17
+ resource: {
18
+ type: String,
19
+ required: true,
20
+ },
21
+
22
+ loadResources: {
23
+ type: Array,
24
+ default: () => []
25
+ },
16
26
 
27
+ loadIndeterminate: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+
32
+ incrementalLoadingIndicator: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ },
17
37
  async fetch() {
18
38
  const store = this.$store;
19
- const resource = this.resource;
20
39
 
21
40
  await store.dispatch(`rancher/findAll`, { type: NORMAN.USER });
22
41
 
23
- this.allUsers = await store.dispatch(`management/findAll`, { type: resource });
42
+ await this.$fetchType(this.resource);
24
43
 
25
44
  this.canRefreshAccess = await this.$store.dispatch('rancher/request', { url: '/v3/users?limit=0' })
26
45
  .then(res => !!res?.actions?.refreshauthprovideraccess);
@@ -28,21 +47,19 @@ export default {
28
47
 
29
48
  data() {
30
49
  const getters = this.$store.getters;
31
- const params = { ...this.$route.params };
32
-
33
- const resource = params.resource;
34
50
 
35
- const schema = getters[`management/schemaFor`](resource);
51
+ const schema = getters[`management/schemaFor`](this.resource);
36
52
 
37
53
  return {
38
54
  schema,
39
- resource,
40
-
41
- // Provided by fetch later
42
- rows: null,
43
55
  canRefreshAccess: false,
56
+ };
57
+ },
44
58
 
45
- allUsers: null,
59
+ $loadingResources() {
60
+ return {
61
+ loadResources: [MANAGEMENT.USER],
62
+ loadIndeterminate: true, // results are filtered so we wouldn't get the correct count on indicator...
46
63
  };
47
64
  },
48
65
 
@@ -56,7 +73,7 @@ export default {
56
73
  },
57
74
 
58
75
  users() {
59
- if ( !this.allUsers ) {
76
+ if ( !this.rows ) {
60
77
  return [];
61
78
  }
62
79
 
@@ -64,7 +81,7 @@ export default {
64
81
  // 1) Only show system users in explorer/users and not in auth/users
65
82
  // 2) Supplement user with info to enable/disable the refresh group membership action (this is not persisted on save)
66
83
  const params = { ...this.$route.params };
67
- const requiredUsers = params.product === NAME ? this.allUsers.filter(a => !a.isSystem) : this.allUsers;
84
+ const requiredUsers = params.product === NAME ? this.rows.filter(a => !a.isSystem) : this.rows;
68
85
 
69
86
  requiredUsers.forEach((r) => {
70
87
  r.canRefreshAccess = this.canRefreshAccess;
@@ -94,11 +111,13 @@ export default {
94
111
  </script>
95
112
 
96
113
  <template>
97
- <Loading v-if="$fetchState.pending" />
98
- <div v-else>
114
+ <div>
99
115
  <Masthead
100
116
  :schema="schema"
101
117
  :resource="resource"
118
+ :show-incremental-loading-indicator="incrementalLoadingIndicator"
119
+ :load-resources="loadResources"
120
+ :load-indeterminate="loadIndeterminate"
102
121
  >
103
122
  <template slot="extraActions">
104
123
  <AsyncButton
@@ -113,7 +132,7 @@ export default {
113
132
  </template>
114
133
  </Masthead>
115
134
 
116
- <ResourceTable :schema="schema" :rows="users" :group-by="groupBy" />
135
+ <ResourceTable :schema="schema" :rows="users" :group-by="groupBy" :loading="loading" />
117
136
  </div>
118
137
  </template>
119
138
 
@@ -1,16 +1,13 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
4
3
  import { Banner } from '@components/Banner';
5
4
  import { MONITORING } from '@shell/config/types';
6
-
5
+ import ResourceFetch from '@shell/mixins/resource-fetch';
7
6
  export default {
8
7
  name: 'ListApps',
9
- components: {
10
- Banner, Loading, ResourceTable
11
- },
12
-
13
- props: {
8
+ components: { Banner, ResourceTable },
9
+ mixins: [ResourceFetch],
10
+ props: {
14
11
  resource: {
15
12
  type: String,
16
13
  required: true,
@@ -25,27 +22,23 @@ export default {
25
22
  async fetch() {
26
23
  try {
27
24
  await this.$store.dispatch('cluster/findAll', { type: MONITORING.ALERTMANAGERCONFIG });
28
- this.rows = await this.$store.dispatch('cluster/findAll', { type: this.resource });
25
+ await this.$fetchType(this.resource);
29
26
  } catch (err) {
30
27
  throw new Error(err);
31
28
  }
32
- },
33
-
34
- data() {
35
- return { rows: null };
36
- },
29
+ }
37
30
  };
38
31
  </script>
39
32
 
40
33
  <template>
41
- <Loading v-if="$fetchState.pending" />
42
- <div v-else-if="rows.length > 0">
34
+ <div v-if="rows.length || loading">
43
35
  <Banner color="info">
44
36
  {{ t('monitoring.alertmanagerConfig.description') }}
45
37
  </Banner>
46
38
  <ResourceTable
47
39
  :schema="schema"
48
40
  :rows="rows"
41
+ :loading="loading"
49
42
  />
50
43
  </div>
51
44
 
@@ -6,6 +6,10 @@ export default {
6
6
  name: 'ListNamespace',
7
7
  components: { ResourceTable },
8
8
  props: {
9
+ resource: {
10
+ type: String,
11
+ required: true,
12
+ },
9
13
  schema: {
10
14
  type: Object,
11
15
  required: true,
@@ -14,6 +18,10 @@ export default {
14
18
  type: Array,
15
19
  required: true,
16
20
  },
21
+ loading: {
22
+ type: Boolean,
23
+ required: false,
24
+ },
17
25
  },
18
26
 
19
27
  computed: {
@@ -28,7 +36,11 @@ export default {
28
36
  return this.rows;
29
37
  }
30
38
  },
31
- }
39
+ },
40
+
41
+ $loadingResources() {
42
+ return { loadIndeterminate: true };
43
+ },
32
44
  };
33
45
  </script>
34
46
 
@@ -39,6 +51,7 @@ export default {
39
51
  :groupable="false"
40
52
  :schema="schema"
41
53
  key-field="_key"
54
+ :loading="loading"
42
55
  v-on="$listeners"
43
56
  />
44
57
  </template>
package/list/node.vue CHANGED
@@ -1,6 +1,5 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
4
3
  import Tag from '@shell/components/Tag';
5
4
  import { Banner } from '@components/Banner';
6
5
  import {
@@ -16,18 +15,21 @@ import { allHash } from '@shell/utils/promise';
16
15
  import { get } from '@shell/utils/object';
17
16
  import { GROUP_RESOURCES, mapPref } from '@shell/store/prefs';
18
17
  import { COLUMN_BREAKPOINTS } from '@shell/components/SortableTable/index.vue';
19
-
18
+ import ResourceFetch from '@shell/mixins/resource-fetch';
20
19
  export default {
21
20
  name: 'ListNode',
22
21
  components: {
23
- Loading,
24
22
  ResourceTable,
25
23
  Tag,
26
24
  Banner
27
25
  },
28
- mixins: [metricPoller],
26
+ mixins: [metricPoller, ResourceFetch],
29
27
 
30
28
  props: {
29
+ resource: {
30
+ type: String,
31
+ required: true,
32
+ },
31
33
  schema: {
32
34
  type: Object,
33
35
  required: true,
@@ -35,7 +37,7 @@ export default {
35
37
  },
36
38
 
37
39
  async fetch() {
38
- const hash = { kubeNodes: this.$store.dispatch('cluster/findAll', { type: NODE }) };
40
+ const hash = { kubeNodes: this.$fetchType(NODE) };
39
41
 
40
42
  this.canViewPods = this.$store.getters[`cluster/schemaFor`](POD);
41
43
 
@@ -58,16 +60,11 @@ export default {
58
60
  this.$store.dispatch('cluster/findAll', { type: POD });
59
61
  }
60
62
 
61
- const res = await allHash(hash);
62
-
63
- this.kubeNodes = res.kubeNodes;
63
+ await allHash(hash);
64
64
  },
65
65
 
66
66
  data() {
67
- return {
68
- kubeNodes: null,
69
- canViewPods: false,
70
- };
67
+ return { canViewPods: false };
71
68
  },
72
69
 
73
70
  beforeDestroy() {
@@ -79,7 +76,7 @@ export default {
79
76
 
80
77
  computed: {
81
78
  hasWindowsNodes() {
82
- return (this.kubeNodes || []).some(node => node.status.nodeInfo.operatingSystem === 'windows');
79
+ return (this.rows || []).some(node => node.status.nodeInfo.operatingSystem === 'windows');
83
80
  },
84
81
  tableGroup: mapPref(GROUP_RESOURCES),
85
82
 
@@ -141,8 +138,7 @@ export default {
141
138
  </script>
142
139
 
143
140
  <template>
144
- <Loading v-if="$fetchState.pending" />
145
- <div v-else>
141
+ <div>
146
142
  <Banner
147
143
  v-if="hasWindowsNodes"
148
144
  color="info"
@@ -152,8 +148,9 @@ export default {
152
148
  v-bind="$attrs"
153
149
  :schema="schema"
154
150
  :headers="headers"
155
- :rows="kubeNodes"
151
+ :rows="rows"
156
152
  :sub-rows="true"
153
+ :loading="loading"
157
154
  v-on="$listeners"
158
155
  >
159
156
  <template #sub-row="{fullColspan, row}">
@@ -1,27 +1,34 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
- import Loading from '@shell/components/Loading';
4
3
  import { PVC } from '@shell/config/types';
4
+ import ResourceFetch from '@shell/mixins/resource-fetch';
5
5
 
6
6
  export default {
7
7
  name: 'ListPersistentVolume',
8
- components: { Loading, ResourceTable },
8
+ components: { ResourceTable },
9
+ mixins: [ResourceFetch],
10
+ props: {
11
+ resource: {
12
+ type: String,
13
+ required: true,
14
+ },
15
+
16
+ schema: {
17
+ type: Object,
18
+ required: true,
19
+ },
20
+ },
9
21
 
10
22
  async fetch() {
11
23
  const inStore = this.$store.getters['currentStore']();
12
24
  const pvcPromise = this.$store.dispatch(`${ inStore }/findAll`, { type: PVC });
13
25
 
14
- this.rows = await this.$store.dispatch(`${ inStore }/findAll`, { type: this.$attrs.resource });
26
+ await this.$fetchType(this.resource);
15
27
  await pvcPromise;
16
- },
17
-
18
- data() {
19
- return { rows: [] };
20
28
  }
21
29
  };
22
30
  </script>
23
31
 
24
32
  <template>
25
- <Loading v-if="$fetchState.pending" />
26
- <ResourceTable v-else :schema="$attrs.schema" :rows="rows" :headers="$attrs.headers" :group-by="$attrs.groupBy" />
33
+ <ResourceTable :schema="schema" :rows="rows" :headers="$attrs.headers" :group-by="$attrs.groupBy" :loading="loading" />
27
34
  </template>
@@ -1,12 +1,13 @@
1
1
  <script>
2
2
  import ResourceTable from '@shell/components/ResourceTable';
3
3
  import { STORAGE_CLASS } from '@shell/config/types';
4
+ import ResourceFetch from '@shell/mixins/resource-fetch';
4
5
 
5
6
  export default {
6
7
  name: 'ListPersistentVolumeClaim',
7
8
  components: { ResourceTable },
8
-
9
- props: {
9
+ mixins: [ResourceFetch],
10
+ props: {
10
11
  resource: {
11
12
  type: String,
12
13
  required: true,
@@ -24,18 +25,14 @@ export default {
24
25
  // Fetch storage classes so we can determine if a PVC can be expanded
25
26
  this.$store.dispatch(`${ inStore }/findAll`, { type: STORAGE_CLASS });
26
27
 
27
- this.rows = await this.$store.dispatch(`${ inStore }/findAll`, { type: this.resource });
28
- },
29
-
30
- data() {
31
- return { rows: [] };
28
+ await this.$fetchType(this.resource);
32
29
  }
33
30
  };
34
31
  </script>
35
32
 
36
33
  <template>
37
34
  <ResourceTable
38
- :loading="$fetchState.pending"
35
+ :loading="loading"
39
36
  :schema="schema"
40
37
  :rows="rows"
41
38
  />