@rancher/shell 3.0.1 → 3.0.2-rc.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.
- package/assets/styles/base/_basic.scss +17 -5
- package/assets/styles/base/_mixins.scss +2 -1
- package/assets/styles/global/_button.scss +10 -0
- package/assets/styles/global/_form.scss +2 -2
- package/assets/translations/en-us.yaml +33 -5
- package/assets/translations/zh-hans.yaml +1 -1
- package/components/ActionMenu.vue +8 -0
- package/components/AsyncButton.vue +9 -3
- package/components/BannerGraphic.vue +10 -0
- package/components/ButtonGroup.vue +2 -0
- package/components/ButtonMultiAction.vue +6 -0
- package/components/ClusterIconMenu.vue +1 -1
- package/components/CodeMirror.vue +28 -1
- package/components/CommunityLinks.vue +13 -0
- package/components/CruResource.vue +6 -0
- package/components/GrowlManager.vue +14 -4
- package/components/LocaleSelector.vue +49 -5
- package/components/PaginatedResourceTable.vue +4 -3
- package/components/ResourceDetail/Masthead.vue +11 -4
- package/components/ResourceList/index.vue +5 -3
- package/components/ResourceTable.vue +1 -1
- package/components/SortableTable/THead.vue +19 -4
- package/components/SortableTable/index.vue +13 -9
- package/components/SortableTable/selection.js +19 -5
- package/components/YamlEditor.vue +2 -1
- package/components/auth/SelectPrincipal.vue +1 -1
- package/components/fleet/FleetBundles.vue +2 -1
- package/components/form/LabeledSelect.vue +20 -7
- package/components/form/NodeScheduling.vue +5 -1
- package/components/form/Password.vue +23 -13
- package/components/form/ResourceLabeledSelect.vue +1 -1
- package/components/form/Select.vue +28 -6
- package/components/form/SelectOrCreateAuthSecret.vue +39 -11
- package/components/form/__tests__/NodeScheduling.test.ts +44 -0
- package/components/formatter/Endpoints.vue +1 -1
- package/components/formatter/LiveExpiryDate.vue +5 -1
- package/components/formatter/ServiceTargets.vue +1 -1
- package/components/formatter/ServiceType.vue +19 -17
- package/components/nav/Pinned.vue +6 -1
- package/components/nav/TopLevelMenu.helper.ts +17 -1
- package/components/nav/TopLevelMenu.vue +154 -19
- package/config/pagination-table-headers.js +9 -1
- package/config/product/apps.js +63 -30
- package/config/product/explorer.js +182 -17
- package/config/product/settings.js +9 -1
- package/config/router/routes.js +0 -1
- package/config/settings.ts +20 -2
- package/config/table-headers.js +23 -15
- package/config/types.js +2 -1
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +12 -3
- package/edit/fleet.cattle.io.gitrepo.vue +40 -33
- package/edit/provisioning.cattle.io.cluster/rke2.vue +13 -2
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +10 -2
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +8 -2
- package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +6 -3
- package/edit/workload/mixins/workload.js +15 -7
- package/list/catalog.cattle.io.app.vue +4 -11
- package/list/catalog.cattle.io.clusterrepo.vue +59 -25
- package/list/fleet.cattle.io.bundle.vue +2 -2
- package/list/management.cattle.io.feature.vue +12 -5
- package/list/management.cattle.io.setting.vue +30 -19
- package/list/namespace.vue +4 -1
- package/list/networking.k8s.io.ingress.vue +14 -11
- package/list/node.vue +65 -63
- package/list/persistentvolume.vue +55 -20
- package/list/persistentvolumeclaim.vue +3 -15
- package/list/service.vue +16 -21
- package/list/workload.vue +35 -49
- package/mixins/resource-fetch.js +8 -1
- package/mixins/vue-select-overrides.js +10 -16
- package/models/management.cattle.io.cluster.js +6 -1
- package/models/persistentvolume.js +1 -3
- package/models/storage.k8s.io.storageclass.js +4 -0
- package/package.json +28 -29
- package/pages/c/_cluster/explorer/EventsTable.vue +58 -16
- package/pages/c/_cluster/explorer/index.vue +3 -16
- package/pages/c/_cluster/settings/performance.vue +49 -23
- package/pages/home.vue +24 -3
- package/pages/support/index.vue +1 -1
- package/plugins/floating-vue.js +1 -1
- package/plugins/steve/steve-pagination-utils.ts +85 -15
- package/rancher-components/Banner/Banner.vue +12 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +27 -5
- package/rancher-components/Form/Radio/RadioButton.vue +0 -6
- package/rancher-components/Form/Radio/RadioGroup.vue +5 -1
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +2 -2
- package/scripts/test-plugins-build.sh +21 -6
- package/scripts/typegen.sh +1 -0
- package/store/index.js +16 -0
- package/store/type-map.utils.ts +14 -1
- package/types/shell/index.d.ts +467 -418
- package/types/store/vuex.d.ts +1 -1
- package/types/vue-shim.d.ts +2 -8
- package/utils/cluster.js +2 -2
- package/utils/string.js +6 -0
- package/vue.config.js +3 -4
|
@@ -62,16 +62,31 @@ export default {
|
|
|
62
62
|
return { settings: null };
|
|
63
63
|
},
|
|
64
64
|
|
|
65
|
-
computed: {
|
|
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
|
-
|
|
77
|
+
toggleActionMenu(e, setting) {
|
|
69
78
|
const actionElement = e.srcElement;
|
|
70
79
|
|
|
71
|
-
this
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
>
|
|
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
|
-
|
|
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.
|
|
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-
|
|
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
|
><{{ t('advancedSettings.none') }}></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>
|
package/list/namespace.vue
CHANGED
|
@@ -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 '
|
|
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
|
|
3
|
-
|
|
2
|
+
import PaginatedResourceTable from '@shell/components/PaginatedResourceTable';
|
|
3
|
+
|
|
4
4
|
export default {
|
|
5
|
-
components: {
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
<
|
|
34
|
+
<PaginatedResourceTable
|
|
30
35
|
:schema="schema"
|
|
31
|
-
:rows="rows"
|
|
32
|
-
:loading="loading"
|
|
33
36
|
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
34
|
-
:
|
|
37
|
+
:fetchSecondaryResources="fetchSecondaryResources"
|
|
35
38
|
/>
|
|
36
39
|
</template>
|
package/list/node.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
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:
|
|
24
|
+
name: 'ListNode',
|
|
25
|
+
|
|
28
26
|
components: {
|
|
29
|
-
|
|
27
|
+
PaginatedResourceTable,
|
|
30
28
|
Tag,
|
|
31
29
|
Banner
|
|
32
30
|
},
|
|
33
|
-
|
|
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.
|
|
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
|
-
|
|
102
|
-
|
|
97
|
+
canPaginate() {
|
|
98
|
+
const args = { id: this.resource?.id || this.resource };
|
|
103
99
|
|
|
104
|
-
|
|
105
|
-
|
|
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.
|
|
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.
|
|
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.$
|
|
192
|
+
hash.mgmtNodes = this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.NODE });
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
if (this.canViewNormanNodes) {
|
|
193
|
-
hash.normanNodes = this.$
|
|
196
|
+
hash.normanNodes = this.$store.dispatch(`rancher/findAll`, { type: NORMAN.NODE });
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
if (this.canViewMachines) {
|
|
197
|
-
hash.machines = this.$
|
|
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.$
|
|
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
|
|
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
|
-
<
|
|
304
|
+
<PaginatedResourceTable
|
|
300
305
|
v-bind="$attrs"
|
|
301
306
|
:schema="schema"
|
|
302
307
|
:headers="headers"
|
|
303
|
-
:
|
|
308
|
+
:paginationHeaders="paginationHeaders"
|
|
304
309
|
:sub-rows="true"
|
|
305
|
-
:
|
|
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
|
-
</
|
|
376
|
+
</PaginatedResourceTable>
|
|
375
377
|
</div>
|
|
376
378
|
</template>
|
|
377
379
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
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
|
|
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:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
65
|
+
return this.$store.dispatch(`cluster/findPage`, { type: PVC, opt });
|
|
66
|
+
},
|
|
32
67
|
}
|
|
33
|
-
};
|
|
68
|
+
});
|
|
34
69
|
</script>
|
|
35
70
|
|
|
36
71
|
<template>
|
|
37
|
-
<
|
|
72
|
+
<PaginatedResourceTable
|
|
38
73
|
:schema="schema"
|
|
39
|
-
:
|
|
40
|
-
:
|
|
41
|
-
:group-by="$attrs.groupBy"
|
|
42
|
-
:loading="loading"
|
|
74
|
+
:fetchSecondaryResources="fetchSecondaryResources"
|
|
75
|
+
:fetchPageSecondaryResources="fetchPageSecondaryResources"
|
|
43
76
|
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
44
|
-
|
|
77
|
+
|
|
78
|
+
:overflow-x="overflowX"
|
|
79
|
+
:overflow-y="overflowY"
|
|
45
80
|
/>
|
|
46
81
|
</template>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
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: {
|
|
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
|
-
<
|
|
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
|
|
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: {
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
<
|
|
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
|
-
:
|
|
46
|
+
:fetchSecondaryResources="fetchSecondaryResources"
|
|
52
47
|
/>
|
|
53
48
|
</template>
|