@rancher/shell 3.0.5 → 3.0.7
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/images/pl/dark/rancher-logo.svg +131 -44
- package/assets/images/pl/rancher-logo.svg +120 -44
- package/assets/styles/base/_basic.scss +2 -2
- package/assets/styles/base/_color-classic.scss +51 -0
- package/assets/styles/base/_color.scss +3 -3
- package/assets/styles/base/_mixins.scss +1 -1
- package/assets/styles/base/_variables-classic.scss +47 -0
- package/assets/styles/global/_button.scss +49 -17
- package/assets/styles/global/_form.scss +1 -1
- package/assets/styles/themes/_dark.scss +4 -0
- package/assets/styles/themes/_light.scss +3 -69
- package/assets/styles/themes/_modern.scss +194 -50
- package/assets/styles/vendor/vue-select.scss +1 -2
- package/assets/translations/en-us.yaml +33 -21
- package/components/ClusterIconMenu.vue +1 -1
- package/components/ClusterProviderIcon.vue +1 -1
- package/components/CodeMirror.vue +1 -1
- package/components/FilterPanel.vue +8 -1
- package/components/IconOrSvg.vue +40 -29
- package/components/PaginatedResourceTable.vue +7 -2
- package/components/PromptRemove.vue +5 -0
- package/components/ResourceDetail/index.vue +1 -0
- package/components/ResourceTable.vue +30 -20
- package/components/SortableTable/sorting.js +3 -1
- package/components/Tabbed/index.vue +5 -5
- package/components/form/ResourceTabs/index.vue +37 -18
- package/components/form/SecretSelector.vue +6 -2
- package/components/nav/Group.vue +29 -9
- package/components/nav/Header.vue +6 -8
- package/components/nav/NamespaceFilter.vue +1 -1
- package/components/nav/TopLevelMenu.helper.ts +47 -20
- package/components/nav/TopLevelMenu.vue +44 -14
- package/components/nav/Type.vue +0 -5
- package/components/nav/__tests__/TopLevelMenu.test.ts +2 -0
- package/config/pagination-table-headers.js +10 -2
- package/config/product/explorer.js +9 -8
- package/config/table-headers.js +9 -0
- package/config/uiplugins.js +1 -1
- package/core/plugin.ts +33 -9
- package/core/types.ts +37 -6
- package/detail/provisioning.cattle.io.cluster.vue +1 -0
- package/dialog/InstallExtensionDialog.vue +71 -45
- package/dialog/UninstallExtensionDialog.vue +2 -1
- package/dialog/__tests__/InstallExtensionDialog.test.ts +111 -0
- package/edit/auth/oidc.vue +86 -16
- package/list/catalog.cattle.io.clusterrepo.vue +2 -2
- package/mixins/__tests__/chart.test.ts +1 -1
- package/mixins/chart.js +1 -1
- package/models/event.js +7 -0
- package/models/provisioning.cattle.io.cluster.js +9 -0
- package/package.json +2 -2
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +6 -0
- package/pages/c/_cluster/apps/charts/StatusLabel.vue +4 -3
- package/pages/c/_cluster/apps/charts/index.vue +12 -11
- package/pages/c/_cluster/explorer/EventsTable.vue +3 -6
- package/pages/c/_cluster/settings/performance.vue +1 -1
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +159 -62
- package/pages/c/_cluster/uiplugins/__tests__/PluginInfoPanel.test.ts +102 -0
- package/pages/c/_cluster/uiplugins/__tests__/{index.spec.ts → index.test.ts} +121 -55
- package/pages/c/_cluster/uiplugins/index.vue +110 -94
- package/plugins/__tests__/subscribe.events.test.ts +194 -0
- package/plugins/dashboard-store/actions.js +3 -0
- package/plugins/dashboard-store/getters.js +1 -1
- package/plugins/dashboard-store/resource-class.js +15 -4
- package/plugins/steve/__tests__/subscribe.spec.ts +27 -24
- package/plugins/steve/index.js +18 -10
- package/plugins/steve/mutations.js +2 -2
- package/plugins/steve/resourceWatcher.js +2 -2
- package/plugins/steve/steve-pagination-utils.ts +26 -31
- package/plugins/steve/subscribe.js +113 -85
- package/plugins/subscribe-events.ts +211 -0
- package/rancher-components/BadgeState/BadgeState.vue +8 -6
- package/rancher-components/Banner/Banner.vue +2 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +3 -3
- package/rancher-components/Form/Radio/RadioButton.vue +3 -3
- package/scripts/test-plugins-build.sh +4 -5
- package/scripts/typegen.sh +2 -0
- package/store/auth.js +2 -2
- package/store/index.js +12 -22
- package/types/extension-manager.ts +8 -1
- package/types/resources/settings.d.ts +24 -17
- package/types/shell/index.d.ts +534 -336
- package/types/store/subscribe-events.types.ts +70 -0
- package/types/store/subscribe.types.ts +6 -22
- package/types/store/vuex.d.ts +2 -1
- package/types/vue-shim.d.ts +2 -5
- package/utils/pagination-utils.ts +98 -30
- package/utils/pagination-wrapper.ts +6 -8
- package/utils/sort.js +5 -0
- package/utils/unit-tests/pagination-utils.spec.ts +283 -0
- package/utils/validators/formRules/__tests__/index.test.ts +7 -0
- package/utils/validators/formRules/index.ts +2 -2
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { NORMAN_NAME } from '@shell/config/labels-annotations';
|
|
2
|
+
import { getVersionData } from '@shell/config/version';
|
|
3
|
+
import { parseRancherVersion } from '@shell/config/uiplugins';
|
|
4
|
+
import semver from 'semver';
|
|
2
5
|
import {
|
|
3
6
|
_CLONE,
|
|
4
7
|
_CONFIG,
|
|
@@ -59,7 +62,7 @@ const DEFAULT_COLOR = 'warning';
|
|
|
59
62
|
const DEFAULT_ICON = 'x';
|
|
60
63
|
|
|
61
64
|
const DEFAULT_WAIT_INTERVAL = 1000;
|
|
62
|
-
const
|
|
65
|
+
const DEFAULT_WAIT_TIMEOUT = 30000;
|
|
63
66
|
|
|
64
67
|
export const STATES_ENUM = {
|
|
65
68
|
IN_USE: 'in-use',
|
|
@@ -803,7 +806,7 @@ export default class Resource {
|
|
|
803
806
|
// ------------------------------------------------------------------
|
|
804
807
|
|
|
805
808
|
waitForTestFn(fn, msg, timeoutMs, intervalMs) {
|
|
806
|
-
return waitFor(() => fn.apply(this), msg, timeoutMs ||
|
|
809
|
+
return waitFor(() => fn.apply(this), msg, timeoutMs || DEFAULT_WAIT_TIMEOUT, intervalMs || DEFAULT_WAIT_INTERVAL, true);
|
|
807
810
|
}
|
|
808
811
|
|
|
809
812
|
waitForState(state, timeout, interval) {
|
|
@@ -852,7 +855,7 @@ export default class Resource {
|
|
|
852
855
|
return (entry.status || '').toLowerCase() === `${ withStatus }`.toLowerCase();
|
|
853
856
|
}
|
|
854
857
|
|
|
855
|
-
waitForCondition(name, withStatus = 'True', timeoutMs =
|
|
858
|
+
waitForCondition(name, withStatus = 'True', timeoutMs = DEFAULT_WAIT_TIMEOUT, intervalMs = DEFAULT_WAIT_INTERVAL) {
|
|
856
859
|
return this.waitForTestFn(() => {
|
|
857
860
|
return this.isCondition(name, withStatus);
|
|
858
861
|
}, `condition ${ name }=${ withStatus }`, timeoutMs, intervalMs);
|
|
@@ -929,12 +932,20 @@ export default class Resource {
|
|
|
929
932
|
const currentRoute = this.currentRouter().currentRoute.value;
|
|
930
933
|
const extensionMenuActions = getApplicableExtensionEnhancements(this.$rootState, ExtensionPoint.ACTION, ActionLocation.TABLE, currentRoute, this);
|
|
931
934
|
|
|
935
|
+
const currRancherVersionData = getVersionData();
|
|
936
|
+
const parsedRancherVersion = parseRancherVersion(currRancherVersionData.Version);
|
|
937
|
+
|
|
938
|
+
// "showConfiguration" table action is only compatible with Rancher 2.13 and onwards
|
|
939
|
+
// defence against extension issue https://github.com/rancher/dashboard/issues/15564
|
|
940
|
+
// where mostly likely extension CRD model is extending from resource-class
|
|
941
|
+
const isResourceDetailDrawerCompatibleWithRancherSystem = semver.satisfies(parsedRancherVersion, '>= 2.13.0');
|
|
942
|
+
|
|
932
943
|
const all = [
|
|
933
944
|
{
|
|
934
945
|
action: 'showConfiguration',
|
|
935
946
|
label: this.t('action.showConfiguration'),
|
|
936
947
|
icon: 'icon icon-document',
|
|
937
|
-
enabled: this.disableResourceDetailDrawer !== true && (this.canCustomEdit || this.canYaml), // If the resource can't show an edit or a yaml we don't want to show the configuration drawer
|
|
948
|
+
enabled: isResourceDetailDrawerCompatibleWithRancherSystem && this.disableResourceDetailDrawer !== true && (this.canCustomEdit || this.canYaml), // If the resource can't show an edit or a yaml we don't want to show the configuration drawer
|
|
938
949
|
},
|
|
939
950
|
{ divider: true },
|
|
940
951
|
{
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { actions, getters, mutations } from '../subscribe';
|
|
2
2
|
import { REVISION_TOO_OLD } from '../../../utils/socket';
|
|
3
|
-
import {
|
|
3
|
+
import { STEVE_WATCH_MODE } from '../../../types/store/subscribe.types';
|
|
4
4
|
import backOff from '../../../utils/back-off';
|
|
5
|
+
import { SteveWatchEventListenerManager } from '../../subscribe-events';
|
|
5
6
|
|
|
6
7
|
describe('steve: subscribe', () => {
|
|
7
8
|
describe('actions', () => {
|
|
8
9
|
describe('watch', () => {
|
|
9
|
-
const state = {};
|
|
10
|
+
const state = { listenerManager: new SteveWatchEventListenerManager() };
|
|
10
11
|
const getters = {
|
|
11
|
-
normalizeType:
|
|
12
|
-
schemaFor:
|
|
13
|
-
inError:
|
|
14
|
-
watchStarted:
|
|
12
|
+
normalizeType: (type: string) => type,
|
|
13
|
+
schemaFor: () => null,
|
|
14
|
+
inError: () => false,
|
|
15
|
+
watchStarted: () => false,
|
|
16
|
+
listenerManager: state.listenerManager
|
|
15
17
|
};
|
|
16
18
|
const rootGetters = {
|
|
17
19
|
'type-map/isSpoofed': () => false,
|
|
@@ -211,15 +213,11 @@ describe('steve: subscribe', () => {
|
|
|
211
213
|
}, {
|
|
212
214
|
...obj,
|
|
213
215
|
revision,
|
|
214
|
-
mode:
|
|
216
|
+
mode: STEVE_WATCH_MODE.RESOURCE_CHANGES,
|
|
215
217
|
force: true,
|
|
216
218
|
});
|
|
217
219
|
|
|
218
|
-
expect(dispatch).toHaveBeenNthCalledWith(1, '
|
|
219
|
-
id: undefined, mode: STEVE_WATCH_EVENT.CHANGES, namespace: undefined, selector: undefined, type: obj.type
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
expect(dispatch).toHaveBeenNthCalledWith(2, 'send', {
|
|
220
|
+
expect(dispatch).toHaveBeenNthCalledWith(1, 'send', {
|
|
223
221
|
debounceMs: 4000,
|
|
224
222
|
mode: 'resource.changes',
|
|
225
223
|
resourceType: obj.type,
|
|
@@ -231,7 +229,7 @@ describe('steve: subscribe', () => {
|
|
|
231
229
|
state, dispatch, getters, commit
|
|
232
230
|
}, { ...msg });
|
|
233
231
|
|
|
234
|
-
expect(dispatch).toHaveBeenCalledTimes(
|
|
232
|
+
expect(dispatch).toHaveBeenCalledTimes(1);
|
|
235
233
|
dispatch.mockClear();
|
|
236
234
|
};
|
|
237
235
|
|
|
@@ -252,7 +250,7 @@ describe('steve: subscribe', () => {
|
|
|
252
250
|
});
|
|
253
251
|
expect(state.inError).toStrictEqual(
|
|
254
252
|
{
|
|
255
|
-
'type=abc,namespace=,id=,selector=': {
|
|
253
|
+
'type=abc,namespace=,id=,selector=,mode=resource.changes': {
|
|
256
254
|
obj: {
|
|
257
255
|
type: msg.resourceType,
|
|
258
256
|
mode: msg.mode,
|
|
@@ -268,7 +266,7 @@ describe('steve: subscribe', () => {
|
|
|
268
266
|
}, { ...msg });
|
|
269
267
|
// stop tries to watch again, however we're in error so will be ignored
|
|
270
268
|
expect(dispatch).toHaveBeenNthCalledWith(1, 'watch', {
|
|
271
|
-
id: undefined, mode:
|
|
269
|
+
id: undefined, mode: STEVE_WATCH_MODE.RESOURCE_CHANGES, namespace: undefined, selector: undefined, standardWatch: true, type: obj.type
|
|
272
270
|
});
|
|
273
271
|
|
|
274
272
|
dispatch.mockClear();
|
|
@@ -349,19 +347,24 @@ describe('steve: subscribe', () => {
|
|
|
349
347
|
const obj = { type: 'abc' };
|
|
350
348
|
const msg = {
|
|
351
349
|
resourceType: obj.type,
|
|
352
|
-
mode:
|
|
350
|
+
mode: STEVE_WATCH_MODE.RESOURCE_CHANGES,
|
|
353
351
|
};
|
|
354
352
|
|
|
355
353
|
const initStore = () => {
|
|
356
|
-
const state = {
|
|
354
|
+
const state = {
|
|
355
|
+
started: [],
|
|
356
|
+
inError: {},
|
|
357
|
+
listenerManager: new SteveWatchEventListenerManager()
|
|
358
|
+
};
|
|
357
359
|
const _getters = {
|
|
358
|
-
normalizeType:
|
|
359
|
-
schemaFor:
|
|
360
|
-
storeName:
|
|
361
|
-
inError:
|
|
362
|
-
watchStarted:
|
|
363
|
-
backOffId:
|
|
364
|
-
canBackoff:
|
|
360
|
+
normalizeType: (type: string) => type,
|
|
361
|
+
schemaFor: () => ({}),
|
|
362
|
+
storeName: 'test',
|
|
363
|
+
inError: (...args) => getters.inError(state)(...args),
|
|
364
|
+
watchStarted: (...args) => getters.watchStarted(state)(...args),
|
|
365
|
+
backOffId: (...args) => getters.backOffId()(...args),
|
|
366
|
+
canBackoff: () => true,
|
|
367
|
+
listenerManager: state.listenerManager
|
|
365
368
|
};
|
|
366
369
|
const commit = (type, ...args) => mutations[type](state, ...args);
|
|
367
370
|
|
package/plugins/steve/index.js
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
import getters, { STEVE_MODEL_TYPES } from './getters';
|
|
10
10
|
import mutations from './mutations';
|
|
11
11
|
import actions from './actions';
|
|
12
|
+
import { SteveWatchEventListenerManager } from '@shell/plugins/subscribe-events';
|
|
13
|
+
import { markRaw } from 'vue';
|
|
12
14
|
|
|
13
15
|
export function SteveFactory(namespace, baseUrl) {
|
|
14
16
|
return {
|
|
@@ -17,16 +19,22 @@ export function SteveFactory(namespace, baseUrl) {
|
|
|
17
19
|
state() {
|
|
18
20
|
return {
|
|
19
21
|
...coreStoreState(namespace, baseUrl),
|
|
20
|
-
socket:
|
|
21
|
-
queue:
|
|
22
|
-
wantSocket:
|
|
23
|
-
debugSocket:
|
|
24
|
-
allowStreaming:
|
|
25
|
-
pendingFrames:
|
|
26
|
-
deferredRequests:
|
|
27
|
-
started:
|
|
28
|
-
inError:
|
|
29
|
-
|
|
22
|
+
socket: null,
|
|
23
|
+
queue: [], // For change event coalescing
|
|
24
|
+
wantSocket: false,
|
|
25
|
+
debugSocket: false,
|
|
26
|
+
allowStreaming: true,
|
|
27
|
+
pendingFrames: [],
|
|
28
|
+
deferredRequests: {},
|
|
29
|
+
started: [],
|
|
30
|
+
inError: {},
|
|
31
|
+
/**
|
|
32
|
+
* Socket listener manager for this store
|
|
33
|
+
*
|
|
34
|
+
* Instance of @SteveWatchEventListenerManager . See it's description for more info
|
|
35
|
+
*/
|
|
36
|
+
socketListenerManager: markRaw(new SteveWatchEventListenerManager()),
|
|
37
|
+
podsByNamespace: {}, // Cache of pods by namespace
|
|
30
38
|
};
|
|
31
39
|
},
|
|
32
40
|
|
|
@@ -164,10 +164,10 @@ export default {
|
|
|
164
164
|
},
|
|
165
165
|
|
|
166
166
|
reset(state) {
|
|
167
|
-
// Reset generic store things
|
|
168
|
-
|
|
167
|
+
// 1. Reset generic store things
|
|
169
168
|
resetStore(state, this.commit);
|
|
170
169
|
|
|
170
|
+
// 2. Reset steve specific store things
|
|
171
171
|
this.commit(`${ state.config.namespace }/resetSubscriptions`);
|
|
172
172
|
|
|
173
173
|
// Clear the podsByNamespace cache
|
|
@@ -40,10 +40,10 @@ export const WATCH_STATUSES = {
|
|
|
40
40
|
* Create a unique key for a specific resource watch's params
|
|
41
41
|
*/
|
|
42
42
|
export const keyForSubscribe = ({
|
|
43
|
-
resourceType, type, namespace, id, selector
|
|
43
|
+
resourceType, type, namespace, id, selector, mode
|
|
44
44
|
} = {}) => {
|
|
45
45
|
const keyMap = {
|
|
46
|
-
type: resourceType || type, namespace, id, selector
|
|
46
|
+
type: resourceType || type, namespace, id, selector, mode
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
return Object.entries(keyMap)
|
|
@@ -15,13 +15,12 @@ import {
|
|
|
15
15
|
HPA,
|
|
16
16
|
SECRET
|
|
17
17
|
} from '@shell/config/types';
|
|
18
|
-
import {
|
|
19
|
-
CAPI as CAPI_LAB_AND_ANO, CATTLE_PUBLIC_ENDPOINTS, STORAGE, UI_PROJECT_SECRET, UI_PROJECT_SECRET_COPY
|
|
20
|
-
} from '@shell/config/labels-annotations';
|
|
18
|
+
import { CAPI as CAPI_LAB_AND_ANO, CATTLE_PUBLIC_ENDPOINTS, STORAGE, UI_PROJECT_SECRET_COPY } from '@shell/config/labels-annotations';
|
|
21
19
|
import { Schema } from '@shell/plugins/steve/schema';
|
|
22
|
-
import {
|
|
20
|
+
import { PaginationSettingsStores } from '@shell/types/resources/settings';
|
|
23
21
|
import paginationUtils from '@shell/utils/pagination-utils';
|
|
24
22
|
import { KubeLabelSelector, KubeLabelSelectorExpression } from '@shell/types/kube/kube-api';
|
|
23
|
+
import { parseField } from '@shell/utils/sort';
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* This is a workaround for a ts build issue found in check-plugins-build.
|
|
@@ -158,6 +157,7 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
158
157
|
{ field: 'id' },
|
|
159
158
|
{ field: 'metadata.state.name' },
|
|
160
159
|
{ field: 'metadata.creationTimestamp' },
|
|
160
|
+
{ field: 'metadata.labels', startsWith: true },
|
|
161
161
|
],
|
|
162
162
|
[NODE]: [
|
|
163
163
|
{ field: 'status.nodeInfo.kubeletVersion' },
|
|
@@ -180,18 +180,12 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
180
180
|
{ field: 'spec.internal' },
|
|
181
181
|
{ field: 'spec.displayName' },
|
|
182
182
|
{ field: `status.provider` },
|
|
183
|
-
{ field: `metadata.labels["${ CAPI_LAB_AND_ANO.PROVIDER }]` },
|
|
184
183
|
{ field: `status.connected` },
|
|
185
184
|
],
|
|
186
|
-
[CONFIG_MAP]: [
|
|
187
|
-
{ field: 'metadata.labels[harvesterhci.io/cloud-init-template]' }
|
|
188
|
-
],
|
|
189
185
|
[SECRET]: [
|
|
190
|
-
{ field: `metadata.labels[${ UI_PROJECT_SECRET }]` },
|
|
191
186
|
{ field: `metadata.annotations[${ UI_PROJECT_SECRET_COPY }]` },
|
|
192
187
|
],
|
|
193
188
|
[NAMESPACE]: [
|
|
194
|
-
{ field: 'metadata.labels[field.cattle.io/projectId]' }
|
|
195
189
|
],
|
|
196
190
|
[CAPI.MACHINE]: [
|
|
197
191
|
{ field: 'spec.clusterName' }
|
|
@@ -214,7 +208,6 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
214
208
|
{ field: 'status.releaseName' },
|
|
215
209
|
],
|
|
216
210
|
[CAPI.RANCHER_CLUSTER]: [
|
|
217
|
-
{ field: `metadata.labels[${ CAPI_LAB_AND_ANO.PROVIDER }]` },
|
|
218
211
|
{ field: `status.provider` },
|
|
219
212
|
{ field: 'status.clusterName' },
|
|
220
213
|
{ field: `metadata.annotations[${ CAPI_LAB_AND_ANO.HUMAN_NAME }]` }
|
|
@@ -224,14 +217,14 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
224
217
|
{ field: 'spec.clusterIP' },
|
|
225
218
|
],
|
|
226
219
|
[INGRESS]: [
|
|
227
|
-
{ field: 'spec.rules.host' },
|
|
220
|
+
{ field: 'spec.rules.host' },
|
|
228
221
|
{ field: 'spec.ingressClassName' },
|
|
229
222
|
],
|
|
230
223
|
[HPA]: [
|
|
231
|
-
{ field: 'spec.scaleTargetRef.name' },
|
|
232
|
-
{ field: 'spec.minReplicas' },
|
|
233
|
-
{ field: 'spec.maxReplicas' },
|
|
234
|
-
{ field: 'spec.currentReplicas' },
|
|
224
|
+
{ field: 'spec.scaleTargetRef.name' },
|
|
225
|
+
{ field: 'spec.minReplicas' },
|
|
226
|
+
{ field: 'spec.maxReplicas' },
|
|
227
|
+
{ field: 'spec.currentReplicas' },
|
|
235
228
|
],
|
|
236
229
|
[PVC]: [
|
|
237
230
|
{ field: 'spec.volumeName' },
|
|
@@ -249,29 +242,29 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
249
242
|
],
|
|
250
243
|
[WORKLOAD_TYPES.CRON_JOB]: [
|
|
251
244
|
{ field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` },
|
|
252
|
-
{ field: 'spec.template.spec.containers.image' },
|
|
245
|
+
{ field: 'spec.template.spec.containers.image' },
|
|
253
246
|
],
|
|
254
247
|
[WORKLOAD_TYPES.DAEMON_SET]: [
|
|
255
248
|
{ field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` },
|
|
256
|
-
{ field: 'spec.template.spec.containers.image' },
|
|
249
|
+
{ field: 'spec.template.spec.containers.image' },
|
|
257
250
|
],
|
|
258
251
|
[WORKLOAD_TYPES.DEPLOYMENT]: [
|
|
259
252
|
{ field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` },
|
|
260
|
-
{ field: 'spec.template.spec.containers.image' },
|
|
253
|
+
{ field: 'spec.template.spec.containers.image' },
|
|
261
254
|
],
|
|
262
255
|
[WORKLOAD_TYPES.JOB]: [
|
|
263
256
|
{ field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` },
|
|
264
|
-
{ field: 'spec.template.spec.containers.image' },
|
|
257
|
+
{ field: 'spec.template.spec.containers.image' },
|
|
265
258
|
],
|
|
266
259
|
[WORKLOAD_TYPES.STATEFUL_SET]: [
|
|
267
260
|
{ field: `metadata.annotations[${ CATTLE_PUBLIC_ENDPOINTS }]` },
|
|
268
|
-
{ field: 'spec.template.spec.containers.image' },
|
|
261
|
+
{ field: 'spec.template.spec.containers.image' },
|
|
269
262
|
],
|
|
270
263
|
[WORKLOAD_TYPES.REPLICA_SET]: [
|
|
271
|
-
{ field: 'spec.template.spec.containers.image' },
|
|
264
|
+
{ field: 'spec.template.spec.containers.image' },
|
|
272
265
|
],
|
|
273
266
|
[WORKLOAD_TYPES.REPLICATION_CONTROLLER]: [
|
|
274
|
-
{ field: 'spec.template.spec.containers.image' },
|
|
267
|
+
{ field: 'spec.template.spec.containers.image' },
|
|
275
268
|
],
|
|
276
269
|
}
|
|
277
270
|
|
|
@@ -409,9 +402,13 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
409
402
|
|
|
410
403
|
const joined = opt.pagination.sort
|
|
411
404
|
.map((s) => {
|
|
412
|
-
|
|
405
|
+
// Use the same mechanism as local sorting to flip logic for asc/des
|
|
406
|
+
const { field, reverse } = parseField(s.field);
|
|
407
|
+
const asc = reverse ? !s.asc : s.asc;
|
|
408
|
+
|
|
409
|
+
this.validateField(validateFields, schema, field);
|
|
413
410
|
|
|
414
|
-
return `${
|
|
411
|
+
return `${ asc ? '' : '-' }${ this.convertArrayPath(field) }`;
|
|
415
412
|
})
|
|
416
413
|
.join(',');
|
|
417
414
|
|
|
@@ -623,7 +620,6 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
623
620
|
res.push(`filter=!${ labelKey }`);
|
|
624
621
|
break;
|
|
625
622
|
case 'Gt':
|
|
626
|
-
// Currently broken - see https://github.com/rancher/rancher/issues/50057
|
|
627
623
|
// Only applicable to node affinity (atm) - https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#operators
|
|
628
624
|
|
|
629
625
|
if (typeof exp.values !== 'string') {
|
|
@@ -636,7 +632,6 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
636
632
|
res.push(`filter=${ labelKey } > (${ exp.values })`);
|
|
637
633
|
break;
|
|
638
634
|
case 'Lt':
|
|
639
|
-
// Currently broken - see https://github.com/rancher/rancher/issues/50057
|
|
640
635
|
// Only applicable to node affinity (atm) - https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#operators
|
|
641
636
|
if (typeof exp.values !== 'string') {
|
|
642
637
|
console.error(`Skipping labelSelector to API filter param conversion for ${ exp.key }(Lt) as no value was supplied`); // eslint-disable-line no-console
|
|
@@ -657,7 +652,7 @@ class StevePaginationUtils extends NamespaceProjectFilters {
|
|
|
657
652
|
}
|
|
658
653
|
}
|
|
659
654
|
|
|
660
|
-
export const PAGINATION_SETTINGS_STORE_DEFAULTS:
|
|
655
|
+
export const PAGINATION_SETTINGS_STORE_DEFAULTS: PaginationSettingsStores = {
|
|
661
656
|
cluster: {
|
|
662
657
|
resources: {
|
|
663
658
|
enableAll: false,
|
|
@@ -670,7 +665,7 @@ export const PAGINATION_SETTINGS_STORE_DEFAULTS: PaginationSettingsStore = {
|
|
|
670
665
|
CATALOG.APP, CATALOG.OPERATION,
|
|
671
666
|
HPA, INGRESS, SERVICE,
|
|
672
667
|
PV, CONFIG_MAP, STORAGE_CLASS, PVC, SECRET,
|
|
673
|
-
WORKLOAD_TYPES.REPLICA_SET, WORKLOAD_TYPES.REPLICATION_CONTROLLER
|
|
668
|
+
WORKLOAD_TYPES.REPLICA_SET, WORKLOAD_TYPES.REPLICATION_CONTROLLER,
|
|
674
669
|
],
|
|
675
670
|
generic: true,
|
|
676
671
|
}
|
|
@@ -681,8 +676,8 @@ export const PAGINATION_SETTINGS_STORE_DEFAULTS: PaginationSettingsStore = {
|
|
|
681
676
|
enableAll: false,
|
|
682
677
|
enableSome: {
|
|
683
678
|
enabled: [
|
|
684
|
-
// { resource: CAPI.RANCHER_CLUSTER, context: ['home', 'side-bar'] },
|
|
685
|
-
// { resource: MANAGEMENT.CLUSTER, context: ['side-bar'] },
|
|
679
|
+
// { resource: CAPI.RANCHER_CLUSTER, context: ['home', 'side-bar'] },
|
|
680
|
+
// { resource: MANAGEMENT.CLUSTER, context: ['side-bar'] },
|
|
686
681
|
{ resource: CATALOG.APP, context: ['branding'] },
|
|
687
682
|
SECRET
|
|
688
683
|
],
|