@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
package/list/workload.vue
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
WORKLOAD_TYPES, SCHEMA, NODE, POD, LIST_WORKLOAD_TYPES
|
|
5
5
|
} from '@shell/config/types';
|
|
6
6
|
import ResourceFetch from '@shell/mixins/resource-fetch';
|
|
7
|
-
import
|
|
7
|
+
import PaginatedResourceTable from '@shell/components/PaginatedResourceTable';
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const workloadSchema = {
|
|
10
10
|
id: 'workload',
|
|
11
11
|
type: SCHEMA,
|
|
12
12
|
attributes: {
|
|
@@ -26,7 +26,7 @@ const $loadingResources = ($route, $store) => {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const allTypes = $route.params.resource ===
|
|
29
|
+
const allTypes = $route.params.resource === workloadSchema.id;
|
|
30
30
|
|
|
31
31
|
return {
|
|
32
32
|
loadResources: allTypes ? allowedResources : [$route.params.resource],
|
|
@@ -36,7 +36,7 @@ const $loadingResources = ($route, $store) => {
|
|
|
36
36
|
|
|
37
37
|
export default {
|
|
38
38
|
name: 'ListWorkload',
|
|
39
|
-
components: { ResourceTable },
|
|
39
|
+
components: { ResourceTable, PaginatedResourceTable },
|
|
40
40
|
mixins: [ResourceFetch],
|
|
41
41
|
|
|
42
42
|
props: {
|
|
@@ -47,6 +47,10 @@ export default {
|
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
async fetch() {
|
|
50
|
+
if (this.paginationEnabled) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
if (this.allTypes && this.loadResources.length) {
|
|
51
55
|
this.$initializeFetchData(this.loadResources[0], this.loadResources);
|
|
52
56
|
} else {
|
|
@@ -57,6 +61,7 @@ export default {
|
|
|
57
61
|
const schema = this.$store.getters[`cluster/schemaFor`](NODE);
|
|
58
62
|
|
|
59
63
|
if (schema) {
|
|
64
|
+
// Used for shell/components/formatter/Endpoints.vue (too see column page needs to be wide and per page setting 25 or under)
|
|
60
65
|
this.$fetchType(NODE);
|
|
61
66
|
}
|
|
62
67
|
} catch {}
|
|
@@ -82,7 +87,15 @@ export default {
|
|
|
82
87
|
// Ensure these are set on load (to determine if the NS filter is required) rather than too late on `fetch`
|
|
83
88
|
const { loadResources, loadIndeterminate } = $loadingResources(this.$route, this.$store);
|
|
84
89
|
|
|
90
|
+
const { params:{ resource: type } } = this.$route;
|
|
91
|
+
const allTypes = this.$route.params.resource === workloadSchema.id;
|
|
92
|
+
const schema = type !== workloadSchema.id ? this.$store.getters['cluster/schemaFor'](type) : workloadSchema;
|
|
93
|
+
const paginationEnabled = !allTypes && this.$store.getters[`cluster/paginationEnabled`]?.({ id: type });
|
|
94
|
+
|
|
85
95
|
return {
|
|
96
|
+
allTypes,
|
|
97
|
+
schema,
|
|
98
|
+
paginationEnabled,
|
|
86
99
|
resources: [],
|
|
87
100
|
loadResources,
|
|
88
101
|
loadIndeterminate
|
|
@@ -90,24 +103,6 @@ export default {
|
|
|
90
103
|
},
|
|
91
104
|
|
|
92
105
|
computed: {
|
|
93
|
-
allTypes() {
|
|
94
|
-
return this.$route.params.resource === schema.id;
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
paginationEnabled() {
|
|
98
|
-
return !this.allTypes && this.$store.getters[`cluster/paginationEnabled`]();
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
schema() {
|
|
102
|
-
const { params:{ resource:type } } = this.$route;
|
|
103
|
-
|
|
104
|
-
if (type !== schema.id) {
|
|
105
|
-
return this.$store.getters['cluster/schemaFor'](type);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return schema;
|
|
109
|
-
},
|
|
110
|
-
|
|
111
106
|
filteredRows() {
|
|
112
107
|
const out = [];
|
|
113
108
|
|
|
@@ -127,14 +122,7 @@ export default {
|
|
|
127
122
|
},
|
|
128
123
|
|
|
129
124
|
headers() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (this.paginationEnabled) {
|
|
133
|
-
// See https://github.com/rancher/dashboard/issues/10417, health comes from selectors applied locally to all pods (bad)
|
|
134
|
-
return headers.filter((h) => h.name !== WORKLOAD_HEALTH_SCALE.name);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return headers;
|
|
125
|
+
return this.$store.getters['type-map/headersFor'](this.schema, false);
|
|
138
126
|
}
|
|
139
127
|
},
|
|
140
128
|
|
|
@@ -171,27 +159,25 @@ export default {
|
|
|
171
159
|
}
|
|
172
160
|
},
|
|
173
161
|
|
|
174
|
-
typeDisplay() {
|
|
175
|
-
const { params:{ resource:type } } = this.$route;
|
|
176
|
-
let paramSchema = schema;
|
|
177
|
-
|
|
178
|
-
if (type !== schema.id) {
|
|
179
|
-
paramSchema = this.$store.getters['cluster/schemaFor'](type);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return this.$store.getters['type-map/labelFor'](paramSchema, 99);
|
|
183
|
-
},
|
|
184
162
|
};
|
|
185
163
|
</script>
|
|
186
164
|
|
|
187
165
|
<template>
|
|
188
|
-
<
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
166
|
+
<div>
|
|
167
|
+
<PaginatedResourceTable
|
|
168
|
+
v-if="paginationEnabled"
|
|
169
|
+
:schema="schema"
|
|
170
|
+
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
171
|
+
/>
|
|
172
|
+
<ResourceTable
|
|
173
|
+
v-else
|
|
174
|
+
:loading="$fetchState.pending"
|
|
175
|
+
:schema="schema"
|
|
176
|
+
:headers="headers"
|
|
177
|
+
:rows="filteredRows"
|
|
178
|
+
:overflow-y="true"
|
|
179
|
+
:use-query-params-for-simple-filtering="useQueryParamsForSimpleFiltering"
|
|
180
|
+
:force-update-live-and-delayed="forceUpdateLiveAndDelayed"
|
|
181
|
+
/>
|
|
182
|
+
</div>
|
|
197
183
|
</template>
|
package/mixins/resource-fetch.js
CHANGED
|
@@ -52,6 +52,7 @@ export default {
|
|
|
52
52
|
incremental: false,
|
|
53
53
|
fetchedResourceType: [],
|
|
54
54
|
paginating: null,
|
|
55
|
+
isFirstLoad: true,
|
|
55
56
|
};
|
|
56
57
|
},
|
|
57
58
|
|
|
@@ -110,7 +111,7 @@ export default {
|
|
|
110
111
|
|
|
111
112
|
loading() {
|
|
112
113
|
if (this.canPaginate) {
|
|
113
|
-
return this.paginating;
|
|
114
|
+
return this.paginating === null ? true : this.paginating;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
return this.rows.length ? false : this.$fetchState.pending;
|
|
@@ -128,6 +129,12 @@ export default {
|
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
loading(newValue, oldValue) {
|
|
135
|
+
if (oldValue && !newValue) {
|
|
136
|
+
this.isFirstLoad = false;
|
|
137
|
+
}
|
|
131
138
|
}
|
|
132
139
|
},
|
|
133
140
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
export default {
|
|
3
|
+
data() {
|
|
4
|
+
return { overridesMixinPreventDoubleTriggerKeysOpen: false };
|
|
5
|
+
},
|
|
3
6
|
methods: {
|
|
4
7
|
mappedKeys(map, vm) {
|
|
5
8
|
// Defaults found at - https://github.com/sagalbot/vue-select/blob/master/src/components/Select.vue#L947
|
|
@@ -13,31 +16,19 @@ export default {
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
e.preventDefault();
|
|
16
|
-
|
|
17
|
-
const optsLen = vm.filteredOptions.length;
|
|
18
|
-
const typeAheadPointer = vm.typeAheadPointer;
|
|
19
|
-
|
|
20
|
-
if (e.shiftKey) {
|
|
21
|
-
if (typeAheadPointer === 0) {
|
|
22
|
-
return vm.onEscape();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return vm.typeAheadUp();
|
|
26
|
-
}
|
|
27
|
-
if (typeAheadPointer + 1 === optsLen) {
|
|
28
|
-
return vm.onEscape();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return vm.typeAheadDown();
|
|
32
19
|
});
|
|
33
20
|
|
|
21
|
+
// escape
|
|
34
22
|
(out[27] = (e) => {
|
|
35
23
|
vm.open = false;
|
|
36
24
|
vm.search = '';
|
|
37
25
|
|
|
26
|
+
this.$refs.select.focus();
|
|
27
|
+
|
|
38
28
|
return false;
|
|
39
29
|
});
|
|
40
30
|
|
|
31
|
+
// enter
|
|
41
32
|
(out[13] = (e, opt) => {
|
|
42
33
|
if (!vm.open) {
|
|
43
34
|
vm.open = true;
|
|
@@ -60,6 +51,9 @@ export default {
|
|
|
60
51
|
vm.$emit('option:selected', option);
|
|
61
52
|
|
|
62
53
|
if (vm.closeOnSelect) {
|
|
54
|
+
// this ties in to the Select component implementation
|
|
55
|
+
// so that the enter key handler doesn't open the dropdown again
|
|
56
|
+
this.overridesMixinPreventDoubleTriggerKeysOpen = true;
|
|
63
57
|
vm.open = false;
|
|
64
58
|
vm.typeAheadPointer = -1;
|
|
65
59
|
}
|
|
@@ -296,6 +296,11 @@ export default class MgmtCluster extends SteveModel {
|
|
|
296
296
|
return this.providerLogo;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
+
// Color to use as the underline for the icon in the app bar
|
|
300
|
+
get iconColor() {
|
|
301
|
+
return this.metadata?.annotations[CLUSTER_BADGE.COLOR];
|
|
302
|
+
}
|
|
303
|
+
|
|
299
304
|
// Custom badge to show for the Cluster (if the appropriate annotations are set)
|
|
300
305
|
get badge() {
|
|
301
306
|
const icon = this.metadata?.annotations?.[CLUSTER_BADGE.ICON_TEXT];
|
|
@@ -305,7 +310,7 @@ export default class MgmtCluster extends SteveModel {
|
|
|
305
310
|
return undefined;
|
|
306
311
|
}
|
|
307
312
|
|
|
308
|
-
let color = this.
|
|
313
|
+
let color = this.iconColor || DEFAULT_BADGE_COLOR;
|
|
309
314
|
const iconText = this.metadata?.annotations[CLUSTER_BADGE.ICON_TEXT] || '';
|
|
310
315
|
let foregroundColor;
|
|
311
316
|
|
|
@@ -30,9 +30,7 @@ export default class PV extends SteveModel {
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return allClaims.find((claim) => claim.spec.volumeName === this.name);
|
|
33
|
+
return this.$getters['all'](PVC).find((claim) => claim.spec.volumeName === this.name);
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
get claimName() {
|
|
@@ -82,6 +82,10 @@ export const PROVISIONER_OPTIONS = [
|
|
|
82
82
|
];
|
|
83
83
|
|
|
84
84
|
export default class extends SteveModel {
|
|
85
|
+
get provisionerListDisplay() {
|
|
86
|
+
return `${ this.provisioner } (${ this.provisionerDisplay })`;
|
|
87
|
+
}
|
|
88
|
+
|
|
85
89
|
get provisionerDisplay() {
|
|
86
90
|
const option = PROVISIONER_OPTIONS.find((o) => o.value === this.provisioner);
|
|
87
91
|
const fallback = `${ this.provisioner } ${ this.t('persistentVolume.csi.suffix') }`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rancher/shell",
|
|
3
|
-
"version": "3.0.1",
|
|
3
|
+
"version": "3.0.2-rc.1",
|
|
4
4
|
"description": "Rancher Dashboard Shell",
|
|
5
5
|
"repository": "https://github.com/rancherlabs/dashboard",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,57 +36,56 @@
|
|
|
36
36
|
"@babel/plugin-proposal-private-property-in-object": "7.14.5",
|
|
37
37
|
"@babel/preset-typescript": "7.16.7",
|
|
38
38
|
"@novnc/novnc": "1.2.0",
|
|
39
|
-
"@popperjs/core": "2.
|
|
39
|
+
"@popperjs/core": "2.11.8",
|
|
40
40
|
"@rancher/icons": "2.0.29",
|
|
41
41
|
"@types/is-url": "1.2.30",
|
|
42
42
|
"@types/node": "20.10.8",
|
|
43
43
|
"@types/semver": "^7.5.8",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "
|
|
45
|
-
"@typescript-eslint/parser": "
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
45
|
+
"@typescript-eslint/parser": "5.62.0",
|
|
46
46
|
"@vue/cli-plugin-babel": "~5.0.0",
|
|
47
47
|
"@vue/cli-plugin-typescript": "~5.0.0",
|
|
48
|
-
"@vue/cli-service": "
|
|
49
|
-
"@vue/test-utils": "
|
|
50
|
-
"@vue/vue3-jest": "
|
|
48
|
+
"@vue/cli-service": "5.0.8",
|
|
49
|
+
"@vue/test-utils": "2.4.6",
|
|
50
|
+
"@vue/vue3-jest": "27.0.0",
|
|
51
51
|
"add": "2.0.6",
|
|
52
52
|
"ansi_up": "5.0.0",
|
|
53
|
-
"axios": "0.21.4",
|
|
54
53
|
"axios-retry": "3.1.9",
|
|
54
|
+
"axios": "0.21.4",
|
|
55
55
|
"babel-eslint": "10.1.0",
|
|
56
56
|
"babel-plugin-module-resolver": "4.0.0",
|
|
57
57
|
"babel-preset-vue": "2.0.2",
|
|
58
58
|
"cache-loader": "4.1.0",
|
|
59
59
|
"clipboard-polyfill": "4.0.1",
|
|
60
|
-
"
|
|
60
|
+
"codemirror-editor-vue3": "2.8.0",
|
|
61
61
|
"codemirror": ">=5.64.0 <6",
|
|
62
|
-
"
|
|
63
|
-
"cookie": "0.7.0",
|
|
62
|
+
"color": "4.2.3",
|
|
64
63
|
"cookie-universal": "2.2.2",
|
|
65
|
-
"
|
|
64
|
+
"cookie": "0.7.0",
|
|
65
|
+
"core-js": "3.40.0",
|
|
66
66
|
"cron-validator": "1.3.1",
|
|
67
67
|
"cronstrue": "2.50.0",
|
|
68
|
-
"cross-env": "
|
|
68
|
+
"cross-env": "7.0.3",
|
|
69
69
|
"css-loader": "6.7.3",
|
|
70
70
|
"csv-loader": "3.0.3",
|
|
71
71
|
"custom-event-polyfill": "^1.0.7",
|
|
72
|
-
"cypress": "
|
|
73
|
-
"d3": "7.3.0",
|
|
72
|
+
"cypress": "11.1.0",
|
|
74
73
|
"d3-selection": "1.4.1",
|
|
75
|
-
"
|
|
74
|
+
"d3": "7.3.0",
|
|
76
75
|
"dayjs": "1.8.29",
|
|
77
76
|
"defu": "5.0.1",
|
|
78
77
|
"diff2html": "3.4.24",
|
|
79
78
|
"dompurify": "2.5.4",
|
|
80
79
|
"element-matches": "^0.1.2",
|
|
81
|
-
"eslint": "7.32.0",
|
|
82
80
|
"eslint-config-standard": "16.0.3",
|
|
83
81
|
"eslint-import-resolver-node": "0.3.4",
|
|
84
82
|
"eslint-module-utils": "2.6.1",
|
|
85
83
|
"eslint-plugin-cypress": "2.12.1",
|
|
86
|
-
"eslint-plugin-import": "2.
|
|
84
|
+
"eslint-plugin-import": "2.31.0",
|
|
87
85
|
"eslint-plugin-jest": "24.4.0",
|
|
88
86
|
"eslint-plugin-n": "15.2.0",
|
|
89
87
|
"eslint-plugin-vue": "9.10.0",
|
|
88
|
+
"eslint": "7.32.0",
|
|
90
89
|
"event-target-shim": "5.0.1",
|
|
91
90
|
"express": "4.17.1",
|
|
92
91
|
"file-saver": "2.0.2",
|
|
@@ -96,26 +95,26 @@
|
|
|
96
95
|
"intl-messageformat": "7.8.4",
|
|
97
96
|
"ip": "2.0.1",
|
|
98
97
|
"is-url": "1.2.4",
|
|
99
|
-
"jest": "27.5.1",
|
|
100
98
|
"jest-serializer-vue": "2.0.2",
|
|
101
|
-
"jexl": "2.
|
|
99
|
+
"jexl": "2.3.0",
|
|
100
|
+
"jest": "27.5.1",
|
|
102
101
|
"jquery": "3.5.1",
|
|
103
102
|
"js-cookie": "2.2.1",
|
|
104
|
-
"js-yaml": "4.1.0",
|
|
105
103
|
"js-yaml-loader": "1.2.2",
|
|
104
|
+
"js-yaml": "4.1.0",
|
|
106
105
|
"jsdiff": "1.1.1",
|
|
107
106
|
"jsonpath-plus": "10.0.7",
|
|
108
|
-
"jsrsasign": "
|
|
107
|
+
"jsrsasign": "11.0.0",
|
|
109
108
|
"jszip": "3.8.0",
|
|
110
109
|
"lodash": "4.17.21",
|
|
111
110
|
"marked": "4.0.17",
|
|
111
|
+
"node-polyfill-webpack-plugin": "3.0.0",
|
|
112
112
|
"nodemon": "2.0.22",
|
|
113
113
|
"nyc": "15.1.0",
|
|
114
|
-
"node-polyfill-webpack-plugin": "3.0.0",
|
|
115
114
|
"papaparse": "5.3.0",
|
|
116
115
|
"portal-vue": "~3.0.0",
|
|
117
|
-
"sass": "
|
|
118
|
-
"sass
|
|
116
|
+
"sass-loader": "12.6.0",
|
|
117
|
+
"sass": "1.83.1",
|
|
119
118
|
"serve-static": "1.14.1",
|
|
120
119
|
"set-cookie-parser": "2.4.6",
|
|
121
120
|
"shell-quote": "1.7.3",
|
|
@@ -127,23 +126,23 @@
|
|
|
127
126
|
"ufo": "0.7.11",
|
|
128
127
|
"unfetch": "4.2.0",
|
|
129
128
|
"url-parse": "1.5.10",
|
|
130
|
-
"vue": "
|
|
131
|
-
"vue-router": "4.4.3",
|
|
129
|
+
"vue-router": "4.5.0",
|
|
132
130
|
"vue-select": "4.0.0-beta.6",
|
|
133
131
|
"vue-server-renderer": "2.7.16",
|
|
132
|
+
"vue": "^3.2.13",
|
|
134
133
|
"vue3-resize": "0.2.0",
|
|
135
134
|
"vue3-virtual-scroll-list": "0.2.1",
|
|
136
135
|
"vuedraggable": "4.1.0",
|
|
137
|
-
"vuex": "
|
|
136
|
+
"vuex": "4.1.0",
|
|
138
137
|
"webpack-bundle-analyzer": "4.5.0",
|
|
139
138
|
"webpack-virtual-modules": "0.4.3",
|
|
140
139
|
"worker-loader": "3.0.8",
|
|
141
|
-
"xterm": "5.2.1",
|
|
142
140
|
"xterm-addon-canvas": "0.5.0",
|
|
143
141
|
"xterm-addon-fit": "0.8.0",
|
|
144
142
|
"xterm-addon-search": "0.13.0",
|
|
145
143
|
"xterm-addon-web-links": "0.9.0",
|
|
146
144
|
"xterm-addon-webgl": "0.16.0",
|
|
145
|
+
"xterm": "5.2.1",
|
|
147
146
|
"yarn": "1.22.18"
|
|
148
147
|
},
|
|
149
148
|
"resolutions": {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
|
|
3
|
-
import SortableTable from '@shell/components/SortableTable';
|
|
4
3
|
import { MESSAGE, NAME, OBJECT, REASON } from '@shell/config/table-headers';
|
|
5
4
|
import { EVENT } from '@shell/config/types';
|
|
6
|
-
import
|
|
5
|
+
import PaginatedResourceTable from '@shell/components/PaginatedResourceTable';
|
|
6
|
+
import { STEVE_EVENT_OBJECT, STEVE_NAME_COL } from '@shell/config/pagination-table-headers';
|
|
7
|
+
import { headerFromSchemaColString } from '@shell/store/type-map.utils';
|
|
8
|
+
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
|
7
9
|
|
|
8
10
|
export default {
|
|
9
|
-
components: {
|
|
10
|
-
|
|
11
|
-
async fetch() {
|
|
12
|
-
this.events = await fetchClusterResources(this.$store, EVENT);
|
|
13
|
-
},
|
|
11
|
+
components: { PaginatedResourceTable },
|
|
14
12
|
|
|
15
13
|
data() {
|
|
16
14
|
const reason = {
|
|
@@ -23,8 +21,7 @@ export default {
|
|
|
23
21
|
reason,
|
|
24
22
|
OBJECT,
|
|
25
23
|
MESSAGE,
|
|
26
|
-
NAME,
|
|
27
|
-
{
|
|
24
|
+
NAME, {
|
|
28
25
|
name: 'date',
|
|
29
26
|
label: 'Date',
|
|
30
27
|
labelKey: 'clusterIndexPage.sections.events.date.label',
|
|
@@ -36,9 +33,36 @@ export default {
|
|
|
36
33
|
},
|
|
37
34
|
];
|
|
38
35
|
|
|
36
|
+
const schema = this.$store.getters['cluster/schemaFor'](EVENT);
|
|
37
|
+
|
|
38
|
+
const paginationHeaders = [
|
|
39
|
+
reason,
|
|
40
|
+
STEVE_EVENT_OBJECT,
|
|
41
|
+
MESSAGE,
|
|
42
|
+
{
|
|
43
|
+
...STEVE_NAME_COL,
|
|
44
|
+
defaultSort: false,
|
|
45
|
+
},
|
|
46
|
+
headerFromSchemaColString('First Seen', schema, this.$store.getters, true),
|
|
47
|
+
{
|
|
48
|
+
...headerFromSchemaColString('Last Seen', schema, this.$store.getters, true),
|
|
49
|
+
defaultSort: true,
|
|
50
|
+
},
|
|
51
|
+
headerFromSchemaColString('Count', schema, this.$store.getters, true),
|
|
52
|
+
];
|
|
53
|
+
|
|
39
54
|
return {
|
|
40
|
-
|
|
55
|
+
schema,
|
|
56
|
+
events: [],
|
|
41
57
|
eventHeaders,
|
|
58
|
+
paginationHeaders,
|
|
59
|
+
allEventsLink: {
|
|
60
|
+
name: 'c-cluster-product-resource',
|
|
61
|
+
params: {
|
|
62
|
+
product: EXPLORER,
|
|
63
|
+
resource: EVENT,
|
|
64
|
+
}
|
|
65
|
+
}
|
|
42
66
|
};
|
|
43
67
|
},
|
|
44
68
|
|
|
@@ -63,16 +87,34 @@ export default {
|
|
|
63
87
|
</script>
|
|
64
88
|
|
|
65
89
|
<template>
|
|
66
|
-
<
|
|
67
|
-
:
|
|
68
|
-
:rows="events"
|
|
90
|
+
<PaginatedResourceTable
|
|
91
|
+
:schema="schema"
|
|
69
92
|
:headers="eventHeaders"
|
|
93
|
+
:pagination-headers="paginationHeaders"
|
|
94
|
+
|
|
70
95
|
key-field="id"
|
|
71
96
|
:search="false"
|
|
72
97
|
:table-actions="false"
|
|
73
98
|
:row-actions="false"
|
|
74
|
-
:
|
|
99
|
+
:groupable="false"
|
|
75
100
|
:rows-per-page="10"
|
|
76
|
-
|
|
77
|
-
|
|
101
|
+
>
|
|
102
|
+
<template v-slot:header-right>
|
|
103
|
+
<router-link
|
|
104
|
+
data-testid="events-link"
|
|
105
|
+
:to="allEventsLink"
|
|
106
|
+
class="events-link"
|
|
107
|
+
>
|
|
108
|
+
<span>{{ t('glance.eventsTable') }}</span>
|
|
109
|
+
</router-link>
|
|
110
|
+
</template>
|
|
111
|
+
</PaginatedResourceTable>
|
|
78
112
|
</template>
|
|
113
|
+
|
|
114
|
+
<style lang="scss" scoped>
|
|
115
|
+
.events-link {
|
|
116
|
+
align-self: center;
|
|
117
|
+
padding-right: 20px;
|
|
118
|
+
min-width: 200px;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -155,6 +155,7 @@ export default {
|
|
|
155
155
|
clusterCounts,
|
|
156
156
|
selectedTab: 'cluster-events',
|
|
157
157
|
extensionCards: getApplicableExtensionEnhancements(this, ExtensionPoint.CARD, CardLocation.CLUSTER_DASHBOARD_CARD, this.$route),
|
|
158
|
+
canViewEvents: !!this.$store.getters['cluster/schemaFor'](EVENT),
|
|
158
159
|
clusterServiceIcons,
|
|
159
160
|
};
|
|
160
161
|
},
|
|
@@ -473,16 +474,6 @@ export default {
|
|
|
473
474
|
return !!this.currentCluster?.spec?.description;
|
|
474
475
|
},
|
|
475
476
|
|
|
476
|
-
allEventsLink() {
|
|
477
|
-
return {
|
|
478
|
-
name: 'c-cluster-product-resource',
|
|
479
|
-
params: {
|
|
480
|
-
product: EXPLORER,
|
|
481
|
-
resource: EVENT,
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
|
-
},
|
|
485
|
-
|
|
486
477
|
allSecretsLink() {
|
|
487
478
|
return {
|
|
488
479
|
name: 'c-cluster-product-resource',
|
|
@@ -785,15 +776,11 @@ export default {
|
|
|
785
776
|
<div class="mt-30">
|
|
786
777
|
<Tabbed @changed="tabChange">
|
|
787
778
|
<Tab
|
|
779
|
+
v-if="canViewEvents"
|
|
788
780
|
name="cluster-events"
|
|
789
781
|
:label="t('clusterIndexPage.sections.events.label')"
|
|
790
782
|
:weight="2"
|
|
791
783
|
>
|
|
792
|
-
<span class="events-table-link">
|
|
793
|
-
<router-link :to="allEventsLink">
|
|
794
|
-
<span>{{ t('glance.eventsTable') }}</span>
|
|
795
|
-
</router-link>
|
|
796
|
-
</span>
|
|
797
784
|
<EventsTable />
|
|
798
785
|
</Tab>
|
|
799
786
|
<Tab
|
|
@@ -954,7 +941,7 @@ export default {
|
|
|
954
941
|
}
|
|
955
942
|
}
|
|
956
943
|
|
|
957
|
-
.
|
|
944
|
+
.cert-table-link {
|
|
958
945
|
display: flex;
|
|
959
946
|
justify-content: flex-end;
|
|
960
947
|
margin-bottom: 20px;
|