@rancher/shell 3.0.1 → 3.0.2-rc.2

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 (98) hide show
  1. package/assets/styles/base/_basic.scss +17 -5
  2. package/assets/styles/base/_mixins.scss +2 -1
  3. package/assets/styles/global/_button.scss +10 -0
  4. package/assets/styles/global/_form.scss +2 -2
  5. package/assets/translations/en-us.yaml +33 -5
  6. package/assets/translations/zh-hans.yaml +1 -1
  7. package/components/ActionMenu.vue +8 -0
  8. package/components/AsyncButton.vue +9 -3
  9. package/components/BannerGraphic.vue +10 -0
  10. package/components/ButtonGroup.vue +2 -0
  11. package/components/ButtonMultiAction.vue +6 -0
  12. package/components/ClusterIconMenu.vue +1 -1
  13. package/components/CodeMirror.vue +28 -1
  14. package/components/CommunityLinks.vue +13 -0
  15. package/components/CruResource.vue +6 -0
  16. package/components/GrowlManager.vue +14 -4
  17. package/components/LocaleSelector.vue +49 -5
  18. package/components/PaginatedResourceTable.vue +4 -3
  19. package/components/ResourceDetail/Masthead.vue +11 -4
  20. package/components/ResourceList/index.vue +5 -3
  21. package/components/ResourceTable.vue +1 -1
  22. package/components/SortableTable/THead.vue +19 -4
  23. package/components/SortableTable/index.vue +13 -9
  24. package/components/SortableTable/selection.js +19 -5
  25. package/components/YamlEditor.vue +2 -1
  26. package/components/auth/SelectPrincipal.vue +1 -1
  27. package/components/fleet/FleetBundles.vue +2 -1
  28. package/components/form/LabeledSelect.vue +20 -7
  29. package/components/form/NodeScheduling.vue +5 -1
  30. package/components/form/Password.vue +23 -13
  31. package/components/form/ResourceLabeledSelect.vue +1 -1
  32. package/components/form/Select.vue +28 -6
  33. package/components/form/SelectOrCreateAuthSecret.vue +39 -11
  34. package/components/form/__tests__/NodeScheduling.test.ts +44 -0
  35. package/components/formatter/Endpoints.vue +1 -1
  36. package/components/formatter/LiveExpiryDate.vue +5 -1
  37. package/components/formatter/ServiceTargets.vue +1 -1
  38. package/components/formatter/ServiceType.vue +19 -17
  39. package/components/nav/Pinned.vue +6 -1
  40. package/components/nav/TopLevelMenu.helper.ts +17 -1
  41. package/components/nav/TopLevelMenu.vue +154 -19
  42. package/config/pagination-table-headers.js +9 -1
  43. package/config/product/apps.js +63 -30
  44. package/config/product/explorer.js +182 -17
  45. package/config/product/settings.js +9 -1
  46. package/config/router/routes.js +0 -1
  47. package/config/settings.ts +20 -2
  48. package/config/table-headers.js +23 -15
  49. package/config/types.js +2 -1
  50. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +12 -3
  51. package/edit/__tests__/management.cattle.io.setting.test.ts +37 -18
  52. package/edit/fleet.cattle.io.gitrepo.vue +40 -33
  53. package/edit/management.cattle.io.setting.vue +2 -0
  54. package/edit/provisioning.cattle.io.cluster/rke2.vue +13 -2
  55. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +10 -2
  56. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +8 -2
  57. package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +6 -3
  58. package/edit/workload/mixins/workload.js +15 -7
  59. package/list/catalog.cattle.io.app.vue +4 -11
  60. package/list/catalog.cattle.io.clusterrepo.vue +59 -25
  61. package/list/fleet.cattle.io.bundle.vue +2 -2
  62. package/list/management.cattle.io.feature.vue +12 -5
  63. package/list/management.cattle.io.setting.vue +30 -19
  64. package/list/namespace.vue +4 -1
  65. package/list/networking.k8s.io.ingress.vue +14 -11
  66. package/list/node.vue +65 -63
  67. package/list/persistentvolume.vue +55 -20
  68. package/list/persistentvolumeclaim.vue +3 -15
  69. package/list/service.vue +16 -21
  70. package/list/workload.vue +35 -49
  71. package/mixins/resource-fetch.js +8 -1
  72. package/mixins/vue-select-overrides.js +10 -16
  73. package/models/management.cattle.io.cluster.js +6 -1
  74. package/models/persistentvolume.js +1 -3
  75. package/models/storage.k8s.io.storageclass.js +4 -0
  76. package/package.json +29 -29
  77. package/pages/c/_cluster/explorer/EventsTable.vue +58 -16
  78. package/pages/c/_cluster/explorer/index.vue +3 -16
  79. package/pages/c/_cluster/settings/performance.vue +49 -23
  80. package/pages/home.vue +24 -3
  81. package/pages/support/index.vue +1 -1
  82. package/plugins/floating-vue.js +1 -1
  83. package/plugins/steve/steve-pagination-utils.ts +85 -15
  84. package/rancher-components/Banner/Banner.vue +12 -0
  85. package/rancher-components/Form/Checkbox/Checkbox.vue +27 -5
  86. package/rancher-components/Form/Radio/RadioButton.vue +0 -6
  87. package/rancher-components/Form/Radio/RadioGroup.vue +5 -1
  88. package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +2 -2
  89. package/scripts/test-plugins-build.sh +21 -6
  90. package/scripts/typegen.sh +1 -0
  91. package/store/index.js +16 -0
  92. package/store/type-map.utils.ts +14 -1
  93. package/types/shell/index.d.ts +467 -418
  94. package/types/store/vuex.d.ts +1 -1
  95. package/types/vue-shim.d.ts +2 -8
  96. package/utils/cluster.js +2 -2
  97. package/utils/string.js +6 -0
  98. package/vue.config.js +3 -4
@@ -62,16 +62,31 @@ export default {
62
62
  return { settings: null };
63
63
  },
64
64
 
65
- computed: { ...mapGetters({ t: 'i18n/t' }) },
65
+ computed: {
66
+ ...mapGetters({ t: 'i18n/t' }),
67
+ ...mapGetters({
68
+ // Use either these Vuex getters
69
+ // OR the props to set the action menu state,
70
+ // but don't use both.
71
+ targetElem: 'action-menu/elem',
72
+ shouldShow: 'action-menu/showing',
73
+ }),
74
+ },
66
75
 
67
76
  methods: {
68
- showActionMenu(e, setting) {
77
+ toggleActionMenu(e, setting) {
69
78
  const actionElement = e.srcElement;
70
79
 
71
- this.$store.commit(`action-menu/show`, {
72
- resources: setting.data,
73
- elem: actionElement
74
- });
80
+ if (!this.targetElem && !this.shouldShow) {
81
+ this.$store.commit(`action-menu/show`, {
82
+ resources: setting.data,
83
+ elem: actionElement
84
+ });
85
+ } else if (this.targetElem === actionElement && this.shouldShow) {
86
+ // this condition is needed so that we can "toggle" the action menu with
87
+ // the keyboard for accessibility (row action menu)
88
+ this.$store.commit('action-menu/hide');
89
+ }
75
90
  },
76
91
  }
77
92
  };
@@ -101,7 +116,7 @@ export default {
101
116
  <span
102
117
  v-if="setting.fromEnv"
103
118
  class="modified"
104
- >Set by Environment Variable</span>
119
+ >{{ t('advancedSettings.setEnv') }}</span>
105
120
  <span
106
121
  v-else-if="setting.customized"
107
122
  class="modified"
@@ -118,23 +133,27 @@ export default {
118
133
  aria-expanded="false"
119
134
  type="button"
120
135
  class="btn btn-sm role-multi-action actions"
121
- @click="showActionMenu($event, setting)"
136
+ role="button"
137
+ :aria-label="t('advancedSettings.edit.label')"
138
+ @click="toggleActionMenu($event, setting)"
122
139
  >
123
140
  <i class="icon icon-actions" />
124
141
  </button>
125
142
  </div>
126
143
  </div>
127
144
  <div value>
128
- <div v-if="setting.hide">
145
+ <div v-if="setting.canHide">
129
146
  <button
130
147
  class="btn btn-sm role-primary"
148
+ role="button"
149
+ :aria-label="t('advancedSettings.hideShow')"
131
150
  @click="setting.hide = !setting.hide"
132
151
  >
133
- {{ t('advancedSettings.show') }} {{ setting.id }}
152
+ {{ setting.hide ? t('advancedSettings.show') : t('advancedSettings.hide') }} {{ setting.id }}
134
153
  </button>
135
154
  </div>
136
155
  <div
137
- v-else
156
+ v-show="!setting.canHide || (setting.canHide && !setting.hide)"
138
157
  class="settings-value"
139
158
  >
140
159
  <pre v-if="setting.kind === 'json'">{{ setting.json }}</pre>
@@ -146,14 +165,6 @@ export default {
146
165
  class="text-muted"
147
166
  >&lt;{{ t('advancedSettings.none') }}&gt;</pre>
148
167
  </div>
149
- <div v-if="setting.canHide && !setting.hide">
150
- <button
151
- class="btn btn-sm role-primary"
152
- @click="setting.hide = !setting.hide"
153
- >
154
- {{ t('advancedSettings.hide') }} {{ setting.id }}
155
- </button>
156
- </div>
157
168
  </div>
158
169
  </div>
159
170
  </div>
@@ -1,6 +1,9 @@
1
1
  <script>
2
+ /**
3
+ * This file is used in shell/scripts/test-plugins-build.sh (creates an extension with it in, and builds using a shell built from source)
4
+ */
2
5
  import { mapGetters } from 'vuex';
3
- import { NS_SNAPSHOT_QUOTA } from '../config/table-headers';
6
+ import { NS_SNAPSHOT_QUOTA } from '@shell/config/table-headers';
4
7
  import ResourceTable from '@shell/components/ResourceTable';
5
8
  import { HCI } from '@shell/config/types';
6
9
  export default {
@@ -1,9 +1,8 @@
1
1
  <script>
2
- import ResourceTable from '@shell/components/ResourceTable';
3
- import ResourceFetch from '@shell/mixins/resource-fetch';
2
+ import PaginatedResourceTable from '@shell/components/PaginatedResourceTable';
3
+
4
4
  export default {
5
- components: { ResourceTable },
6
- mixins: [ResourceFetch],
5
+ components: { PaginatedResourceTable },
7
6
  props: {
8
7
  resource: {
9
8
  type: String,
@@ -18,19 +17,23 @@ export default {
18
17
  default: false
19
18
  }
20
19
  },
21
- async fetch() {
22
- // pathExistsInSchema requires schema networking.k8s.io.ingress to have resources fields via schema definition but none were found. has the schema 'fetchResourceFields' been called?
23
- await Promise.all([this.schema.fetchResourceFields(), this.$fetchType(this.resource)]);
20
+
21
+ methods: {
22
+ /**
23
+ * opts: FetchSecondaryResourcesOpts
24
+ */
25
+ async fetchSecondaryResources(opts) {
26
+ // pathExistsInSchema requires schema networking.k8s.io.ingress to have resources fields via schema definition but none were found. has the schema 'fetchResourceFields' been called?
27
+ await this.schema.fetchResourceFields();
28
+ }
24
29
  }
25
30
  };
26
31
  </script>
27
32
 
28
33
  <template>
29
- <ResourceTable
34
+ <PaginatedResourceTable
30
35
  :schema="schema"
31
- :rows="rows"
32
- :loading="loading"
33
36
  :use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
34
- :force-update-live-and-delayed="forceUpdateLiveAndDelayed"
37
+ :fetchSecondaryResources="fetchSecondaryResources"
35
38
  />
36
39
  </template>
package/list/node.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import ResourceTable from '@shell/components/ResourceTable.vue';
2
+ import PaginatedResourceTable, { FetchPageSecondaryResourcesOpts } from '@shell/components/PaginatedResourceTable.vue';
3
3
  import Tag from '@shell/components/Tag.vue';
4
4
  import { Banner } from '@components/Banner';
5
5
  import { PODS } from '@shell/config/table-headers';
@@ -15,22 +15,21 @@ import {
15
15
  CAPI,
16
16
  MANAGEMENT, METRIC, NODE, NORMAN, POD
17
17
  } from '@shell/config/types';
18
- import { allHash } from '@shell/utils/promise';
19
18
  import { GROUP_RESOURCES, mapPref } from '@shell/store/prefs';
20
19
  import { COLUMN_BREAKPOINTS } from '@shell/types/store/type-map';
21
20
 
22
- import ResourceFetch from '@shell/mixins/resource-fetch';
23
21
  import { mapGetters } from 'vuex';
24
- import { FetchPageSecondaryResourcesOpts } from 'components/PaginatedResourceTable.vue';
25
22
 
26
23
  export default defineComponent({
27
- name: 'ListNode',
24
+ name: 'ListNode',
25
+
28
26
  components: {
29
- ResourceTable,
27
+ PaginatedResourceTable,
30
28
  Tag,
31
29
  Banner
32
30
  },
33
- mixins: [metricPoller, ResourceFetch],
31
+
32
+ mixins: [metricPoller],
34
33
 
35
34
  props: {
36
35
  resource: {
@@ -54,15 +53,6 @@ export default defineComponent({
54
53
  }
55
54
  },
56
55
 
57
- async fetch() {
58
- this.$initializeFetchData(this.resource);
59
-
60
- await allHash({
61
- kubeNodes: this.$fetchType(this.resource),
62
- ...this.fetchSecondaryResources(),
63
- });
64
- },
65
-
66
56
  data() {
67
57
  return {
68
58
  // Pods required for `Pods` column's running pods metrics
@@ -91,38 +81,27 @@ export default defineComponent({
91
81
 
92
82
  computed: {
93
83
  ...mapGetters(['currentCluster']),
84
+
85
+ kubeNodes() {
86
+ // Note if server side pagination is used this is only the current page
87
+ return this.$store.getters[`cluster/all`](this.resource);
88
+ },
89
+
94
90
  hasWindowsNodes() {
95
91
  // Note if server side pagination is used this is only applicable to the current page
96
- return (this.rows || []).some((node: any) => node.status.nodeInfo.operatingSystem === 'windows');
92
+ return (this.kubeNodes || []).some((node: any) => node.status.nodeInfo.operatingSystem === 'windows');
97
93
  },
98
94
 
99
95
  tableGroup: mapPref(GROUP_RESOURCES),
100
96
 
101
- headers() {
102
- // This is all about adding the pods column... if the user can see pods
97
+ canPaginate() {
98
+ const args = { id: this.resource?.id || this.resource };
103
99
 
104
- if (this.canPaginate) {
105
- const paginationHeaders = [...this.$store.getters['type-map/headersFor'](this.schema, true)];
106
-
107
- if (paginationHeaders) {
108
- if (this.canViewPods) {
109
- paginationHeaders.splice(paginationHeaders.length - 1, 0, {
110
- ...PODS,
111
- breakpoint: COLUMN_BREAKPOINTS.DESKTOP,
112
- sort: false,
113
- search: false,
114
- getValue: (row: any) => row.podConsumedUsage
115
- });
116
- }
117
-
118
- return paginationHeaders;
119
- } else {
120
- console.warn('Nodes list expects pagination headers but none found'); // eslint-disable-line no-console
121
-
122
- return [];
123
- }
124
- }
100
+ return this.resource && this.$store.getters[`cluster/paginationEnabled`]?.(args);
101
+ },
125
102
 
103
+ headers() {
104
+ // This is all about adding the pods column... if the user can see pods
126
105
  const headers = [...this.$store.getters['type-map/headersFor'](this.schema, false)];
127
106
 
128
107
  if (this.canViewPods) {
@@ -135,6 +114,34 @@ export default defineComponent({
135
114
 
136
115
  return headers;
137
116
  },
117
+
118
+ paginationHeaders() {
119
+ // This is all about adding the pods column... if the user can see pods
120
+
121
+ if (!this.canPaginate) {
122
+ return [];
123
+ }
124
+
125
+ const paginationHeaders = [...this.$store.getters['type-map/headersFor'](this.schema, true)];
126
+
127
+ if (paginationHeaders) {
128
+ if (this.canViewPods) {
129
+ paginationHeaders.splice(paginationHeaders.length - 1, 0, {
130
+ ...PODS,
131
+ breakpoint: COLUMN_BREAKPOINTS.DESKTOP,
132
+ sort: false,
133
+ search: false,
134
+ getValue: (row: any) => row.podConsumedUsage
135
+ });
136
+ }
137
+
138
+ return paginationHeaders;
139
+ } else {
140
+ console.warn('Nodes list expects pagination headers but none found'); // eslint-disable-line no-console
141
+
142
+ return [];
143
+ }
144
+ },
138
145
  },
139
146
 
140
147
  methods: {
@@ -144,7 +151,7 @@ export default defineComponent({
144
151
  }
145
152
 
146
153
  if (this.canPaginate) {
147
- if (!this.rows.length) {
154
+ if (!this.kubeNodes.length) {
148
155
  return;
149
156
  }
150
157
 
@@ -152,7 +159,7 @@ export default defineComponent({
152
159
  force: true,
153
160
  pagination: new FilterArgs({
154
161
  filters: new PaginationParamFilter({
155
- fields: this.rows.map((r: any) => new PaginationFilterField({
162
+ fields: this.kubeNodes.map((r: any) => new PaginationFilterField({
156
163
  field: 'metadata.name',
157
164
  value: r.id
158
165
  }))
@@ -179,27 +186,23 @@ export default defineComponent({
179
186
  },
180
187
 
181
188
  fetchSecondaryResources(): { [key: string]: Promise<any>} {
182
- if (this.canPaginate) {
183
- return {};
184
- }
185
-
186
189
  const hash: { [key: string]: Promise<any>} = {};
187
190
 
188
191
  if (this.canViewMgmtNodes) {
189
- hash.mgmtNodes = this.$fetchType(MANAGEMENT.NODE, [], 'management');
192
+ hash.mgmtNodes = this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.NODE });
190
193
  }
191
194
 
192
195
  if (this.canViewNormanNodes) {
193
- hash.normanNodes = this.$fetchType(NORMAN.NODE, [], 'rancher');
196
+ hash.normanNodes = this.$store.dispatch(`rancher/findAll`, { type: NORMAN.NODE });
194
197
  }
195
198
 
196
199
  if (this.canViewMachines) {
197
- hash.machines = this.$fetchType(CAPI.MACHINE, [], 'management');
200
+ hash.machines = this.$store.dispatch(`management/findAll`, { type: CAPI.MACHINE });
198
201
  }
199
202
 
200
203
  if (this.canViewPods) {
201
204
  // No need to block on this
202
- this.$fetchType(POD);
205
+ this.$store.dispatch(`cluster/findAll`, { type: POD });
203
206
  }
204
207
 
205
208
  return hash;
@@ -208,7 +211,7 @@ export default defineComponent({
208
211
  /**
209
212
  * Nodes columns need other resources in order to show data in some columns
210
213
  *
211
- * In the paginated world we want to resrict the fetch of those resources to only the one's we need
214
+ * In the paginated world we want to restrict the fetch of those resources to only the one's we need
212
215
  *
213
216
  * So when we have a page.... use those entries as filters when fetching the other resources
214
217
  */
@@ -218,6 +221,11 @@ export default defineComponent({
218
221
  }
219
222
 
220
223
  if (this.canViewMgmtNodes && this.canViewNormanNodes) {
224
+ if (this.canViewNormanNodes) {
225
+ // Ideally we only fetch the nodes we need....
226
+ this.$store.dispatch(`rancher/findAll`, { type: NORMAN.NODE });
227
+ }
228
+
221
229
  // We only fetch mgmt node to get norman node. We only fetch node to get node actions
222
230
  // See https://github.com/rancher/dashboard/issues/10743
223
231
  const opt: ActionFindPageArgs = {
@@ -230,10 +238,7 @@ export default defineComponent({
230
238
  })
231
239
  };
232
240
 
233
- this.$store.dispatch(`management/findPage`, { type: MANAGEMENT.NODE, opt })
234
- .then(() => {
235
- this.$store.dispatch(`rancher/findAll`, { type: NORMAN.NODE, opt: { force } });
236
- });
241
+ this.$store.dispatch(`management/findPage`, { type: MANAGEMENT.NODE, opt });
237
242
  }
238
243
 
239
244
  if (this.canViewMachines) {
@@ -296,19 +301,16 @@ export default defineComponent({
296
301
  color="info"
297
302
  :label="t('cluster.custom.registrationCommand.windowsWarning')"
298
303
  />
299
- <ResourceTable
304
+ <PaginatedResourceTable
300
305
  v-bind="$attrs"
301
306
  :schema="schema"
302
307
  :headers="headers"
303
- :rows="rows"
308
+ :paginationHeaders="paginationHeaders"
304
309
  :sub-rows="true"
305
- :loading="loading"
310
+ :fetchSecondaryResources="fetchSecondaryResources"
311
+ :fetchPageSecondaryResources="fetchPageSecondaryResources"
306
312
  :use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
307
- :force-update-live-and-delayed="forceUpdateLiveAndDelayed"
308
313
  data-testid="cluster-node-list"
309
- :external-pagination-enabled="canPaginate"
310
- :external-pagination-result="paginationResult"
311
- @pagination-changed="paginationChanged"
312
314
  >
313
315
  <template #sub-row="{fullColspan, row, onRowMouseEnter, onRowMouseLeave}">
314
316
  <tr
@@ -371,7 +373,7 @@ export default defineComponent({
371
373
  </td>
372
374
  </tr>
373
375
  </template>
374
- </ResourceTable>
376
+ </PaginatedResourceTable>
375
377
  </div>
376
378
  </template>
377
379
 
@@ -1,13 +1,16 @@
1
- <script>
2
- import ResourceTable from '@shell/components/ResourceTable';
1
+ <script lang="ts">
2
+ import { defineComponent } from 'vue';
3
+ import PaginatedResourceTable, { FetchPageSecondaryResourcesOpts } from '@shell/components/PaginatedResourceTable.vue';
3
4
  import { PVC } from '@shell/config/types';
4
- import ResourceFetch from '@shell/mixins/resource-fetch';
5
+ import { ActionFindPageArgs } from '@shell/types/store/dashboard-store.types';
6
+ import { FilterArgs, PaginationFilterField, PaginationParamFilter } from '@shell/types/store/pagination.types';
5
7
 
6
- export default {
7
- name: 'ListPersistentVolume',
8
- components: { ResourceTable },
9
- mixins: [ResourceFetch],
10
- props: {
8
+ export default defineComponent({
9
+ name: 'ListPersistentVolume',
10
+
11
+ components: { PaginatedResourceTable },
12
+
13
+ props: {
11
14
  resource: {
12
15
  type: String,
13
16
  required: true,
@@ -21,26 +24,58 @@ export default {
21
24
  useQueryParamsForSimpleFiltering: {
22
25
  type: Boolean,
23
26
  default: false
24
- }
27
+ },
28
+
29
+ overflowX: {
30
+ type: Boolean,
31
+ default: false
32
+ },
33
+
34
+ overflowY: {
35
+ type: Boolean,
36
+ default: false
37
+ },
25
38
  },
26
39
 
27
- async fetch() {
28
- this.$initializeFetchData(this.resource);
40
+ methods: {
41
+ fetchSecondaryResources(): { [key: string]: Promise<any>} {
42
+ return { pvc: this.$store.dispatch(`cluster/findAll`, { type: PVC }) };
43
+ },
44
+
45
+ /**
46
+ * PV columns need other resources in order to show data in some columns
47
+ *
48
+ * So when we have a page.... use those entries as filters when fetching the other resources
49
+ */
50
+ async fetchPageSecondaryResources({ canPaginate, force, page }: FetchPageSecondaryResourcesOpts) {
51
+ if (!page?.length) {
52
+ return;
53
+ }
54
+
55
+ const opt: ActionFindPageArgs = {
56
+ force,
57
+ pagination: new FilterArgs({
58
+ filters: PaginationParamFilter.createMultipleFields(page.map((r: any) => new PaginationFilterField({
59
+ field: 'spec.volumeName',
60
+ value: r.metadata.name
61
+ }))),
62
+ })
63
+ };
29
64
 
30
- this.$fetchType(PVC);
31
- await this.$fetchType(this.resource);
65
+ return this.$store.dispatch(`cluster/findPage`, { type: PVC, opt });
66
+ },
32
67
  }
33
- };
68
+ });
34
69
  </script>
35
70
 
36
71
  <template>
37
- <ResourceTable
72
+ <PaginatedResourceTable
38
73
  :schema="schema"
39
- :rows="rows"
40
- :headers="$attrs.headers"
41
- :group-by="$attrs.groupBy"
42
- :loading="loading"
74
+ :fetchSecondaryResources="fetchSecondaryResources"
75
+ :fetchPageSecondaryResources="fetchPageSecondaryResources"
43
76
  :use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
44
- :force-update-live-and-delayed="forceUpdateLiveAndDelayed"
77
+
78
+ :overflow-x="overflowX"
79
+ :overflow-y="overflowY"
45
80
  />
46
81
  </template>
@@ -1,12 +1,9 @@
1
1
  <script>
2
- import ResourceTable from '@shell/components/ResourceTable';
3
- import { STORAGE_CLASS } from '@shell/config/types';
4
- import ResourceFetch from '@shell/mixins/resource-fetch';
2
+ import PaginatedResourceTable from '@shell/components/PaginatedResourceTable';
5
3
 
6
4
  export default {
7
5
  name: 'ListPersistentVolumeClaim',
8
- components: { ResourceTable },
9
- mixins: [ResourceFetch],
6
+ components: { PaginatedResourceTable },
10
7
  props: {
11
8
  resource: {
12
9
  type: String,
@@ -24,21 +21,12 @@ export default {
24
21
  }
25
22
  },
26
23
 
27
- async fetch() {
28
- this.$initializeFetchData(this.resource);
29
-
30
- this.$fetchType(STORAGE_CLASS);
31
- await this.$fetchType(this.resource);
32
- }
33
24
  };
34
25
  </script>
35
26
 
36
27
  <template>
37
- <ResourceTable
38
- :loading="loading"
28
+ <PaginatedResourceTable
39
29
  :schema="schema"
40
- :rows="rows"
41
30
  :use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
42
- :force-update-live-and-delayed="forceUpdateLiveAndDelayed"
43
31
  />
44
32
  </template>
package/list/service.vue CHANGED
@@ -1,12 +1,10 @@
1
1
  <script>
2
- import ResourceTable from '@shell/components/ResourceTable';
2
+ import PaginatedResourceTable from '@shell/components/PaginatedResourceTable';
3
3
  import { NODE } from '@shell/config/types';
4
- import ResourceFetch from '@shell/mixins/resource-fetch';
5
4
 
6
5
  export default {
7
6
  name: 'ListService',
8
- components: { ResourceTable },
9
- mixins: [ResourceFetch],
7
+ components: { PaginatedResourceTable },
10
8
  props: {
11
9
  resource: {
12
10
  type: String,
@@ -24,30 +22,27 @@ export default {
24
22
  }
25
23
  },
26
24
 
27
- // fetch nodes before loading this page, as they may be referenced in the Target table column
28
- async fetch() {
29
- const store = this.$store;
30
- const inStore = store.getters['currentStore']();
31
-
32
- this.$initializeFetchData(this.resource);
33
-
34
- if (store.getters[`${ inStore }/schemaFor`](NODE)) {
35
- this.$fetchType(NODE);
25
+ methods: {
26
+ /**
27
+ * opts: FetchSecondaryResourcesOpts
28
+ */
29
+ async fetchSecondaryResources(opts) {
30
+ const inStore = this.$store.getters['currentStore']();
31
+
32
+ if (this.$store.getters[`${ inStore }/schemaFor`](NODE)) {
33
+ // fetch nodes before loading this page, as they may be referenced in the Target table column
34
+ // shell/components/formatter/ServiceTargets.vue --> shell/components/formatter/Endpoints.vue --> Picks the first one that has a model's externalIp
35
+ await this.$store.dispatch(`${ inStore }/findAll`, { type: NODE });
36
+ }
36
37
  }
37
-
38
- await this.$fetchType(this.resource);
39
38
  }
40
39
  };
41
40
  </script>
42
41
 
43
42
  <template>
44
- <ResourceTable
43
+ <PaginatedResourceTable
45
44
  :schema="schema"
46
- :rows="rows"
47
- :headers="$attrs.headers"
48
- :group-by="$attrs.groupBy"
49
- :loading="loading"
50
45
  :use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
51
- :force-update-live-and-delayed="forceUpdateLiveAndDelayed"
46
+ :fetchSecondaryResources="fetchSecondaryResources"
52
47
  />
53
48
  </template>