@rancher/shell 3.0.6 → 3.0.8-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/images/pl/dark/rancher-logo.svg +131 -44
- package/assets/images/pl/rancher-logo.svg +120 -44
- package/assets/images/vendor/githubapp.svg +13 -0
- 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/_typography.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 +124 -32
- package/assets/translations/zh-hans.yaml +0 -4
- package/components/ClusterIconMenu.vue +1 -1
- package/components/ClusterProviderIcon.vue +1 -1
- package/components/CodeMirror.vue +1 -1
- package/components/IconOrSvg.vue +40 -29
- package/components/Inactivity.vue +222 -106
- package/components/InstallHelmCharts.vue +2 -2
- package/components/ResourceDetail/index.vue +2 -1
- package/components/SortableTable/index.vue +17 -2
- package/components/SortableTable/sorting.js +3 -1
- package/components/Tabbed/index.vue +5 -5
- package/components/fleet/FleetConfigMapSelector.vue +117 -0
- package/components/fleet/FleetSecretSelector.vue +127 -0
- package/components/fleet/__tests__/FleetConfigMapSelector.test.ts +125 -0
- package/components/fleet/__tests__/FleetSecretSelector.test.ts +82 -0
- package/components/form/FileImageSelector.vue +13 -4
- package/components/form/FileSelector.vue +11 -2
- package/components/form/ResourceLabeledSelect.vue +1 -0
- package/components/form/ResourceTabs/index.vue +37 -18
- package/components/form/SecretSelector.vue +6 -2
- package/components/form/__tests__/ResourceLabeledSelect.test.ts +90 -0
- package/components/nav/Group.vue +29 -9
- package/components/nav/Header.vue +7 -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/auth.js +1 -0
- package/config/product/explorer.js +4 -3
- package/config/query-params.js +1 -0
- package/config/settings.ts +8 -1
- package/config/table-headers.js +9 -0
- package/config/types.js +2 -0
- package/core/plugin.ts +18 -6
- package/core/types.ts +8 -0
- package/detail/provisioning.cattle.io.cluster.vue +1 -0
- package/dialog/AddonConfigConfirmationDialog.vue +45 -1
- package/dialog/InstallExtensionDialog.vue +71 -45
- package/dialog/UninstallExtensionDialog.vue +2 -1
- package/dialog/__tests__/InstallExtensionDialog.test.ts +111 -0
- package/edit/__tests__/fleet.cattle.io.helmop.test.ts +52 -11
- package/edit/auth/AuthProviderWarningBanners.vue +14 -1
- package/edit/auth/github-app-steps.vue +97 -0
- package/edit/auth/github-steps.vue +75 -0
- package/edit/auth/github.vue +94 -65
- package/edit/auth/oidc.vue +86 -16
- package/edit/fleet.cattle.io.helmop.vue +51 -2
- package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +15 -5
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +11 -9
- package/edit/provisioning.cattle.io.cluster/rke2.vue +56 -9
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +28 -2
- package/list/projectsecret.vue +1 -1
- package/machine-config/azure.vue +1 -1
- package/mixins/__tests__/chart.test.ts +1 -1
- package/mixins/chart.js +2 -2
- package/models/__tests__/chart.test.ts +17 -9
- package/models/__tests__/compliance.cattle.io.clusterscanprofile.spec.js +30 -0
- package/models/catalog.cattle.io.app.js +1 -1
- package/models/chart.js +3 -1
- package/models/compliance.cattle.io.clusterscanprofile.js +1 -1
- package/models/event.js +7 -0
- package/models/management.cattle.io.authconfig.js +1 -0
- package/models/provisioning.cattle.io.cluster.js +9 -0
- package/package.json +2 -2
- package/pages/auth/login.vue +5 -2
- package/pages/auth/verify.vue +1 -1
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +3 -2
- package/pages/c/_cluster/apps/charts/chart.vue +2 -2
- package/pages/c/_cluster/explorer/EventsTable.vue +92 -9
- package/pages/c/_cluster/explorer/tools/index.vue +3 -3
- package/pages/c/_cluster/settings/performance.vue +13 -26
- 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/pages/home.vue +313 -12
- package/plugins/__tests__/subscribe.events.test.ts +194 -0
- package/plugins/axios.js +2 -1
- package/plugins/dashboard-store/actions.js +4 -1
- package/plugins/dashboard-store/getters.js +1 -1
- package/plugins/dashboard-store/resource-class.js +20 -5
- 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 +12 -9
- 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/extension/publish +1 -1
- package/store/auth.js +8 -3
- package/store/aws.js +8 -6
- package/store/features.js +1 -0
- package/store/index.js +21 -25
- package/store/prefs.js +6 -0
- package/types/extension-manager.ts +8 -1
- package/types/kube/kube-api.ts +2 -1
- package/types/rancher/index.d.ts +1 -0
- package/types/resources/settings.d.ts +52 -23
- package/types/shell/index.d.ts +412 -336
- package/types/store/subscribe-events.types.ts +70 -0
- package/types/store/subscribe.types.ts +6 -22
- package/utils/__tests__/cluster.test.ts +379 -1
- package/utils/cluster.js +157 -3
- package/utils/dynamic-content/__tests__/config.test.ts +187 -0
- package/utils/dynamic-content/__tests__/index.test.ts +390 -0
- package/utils/dynamic-content/__tests__/info.test.ts +263 -0
- package/utils/dynamic-content/__tests__/new-release.test.ts +216 -0
- package/utils/dynamic-content/__tests__/support-notice.test.ts +262 -0
- package/utils/dynamic-content/__tests__/util.test.ts +235 -0
- package/utils/dynamic-content/config.ts +55 -0
- package/utils/dynamic-content/index.ts +273 -0
- package/utils/dynamic-content/info.ts +219 -0
- package/utils/dynamic-content/new-release.ts +126 -0
- package/utils/dynamic-content/support-notice.ts +169 -0
- package/utils/dynamic-content/types.d.ts +101 -0
- package/utils/dynamic-content/util.ts +122 -0
- package/utils/inactivity.ts +104 -0
- package/utils/pagination-utils.ts +105 -31
- package/utils/pagination-wrapper.ts +6 -8
- package/utils/release-notes.ts +1 -1
- 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
package/store/auth.js
CHANGED
|
@@ -17,6 +17,7 @@ const SLO_TOKENS_ENDPOINT_LOGOUT_RES_BASETYPE = ['authConfigLogoutOutput'];
|
|
|
17
17
|
|
|
18
18
|
export const BASE_SCOPES = {
|
|
19
19
|
github: ['read:org'],
|
|
20
|
+
githubapp: ['read:org'],
|
|
20
21
|
googleoauth: ['openid profile email'],
|
|
21
22
|
azuread: [],
|
|
22
23
|
keycloakoidc: ['openid profile email'],
|
|
@@ -374,11 +375,11 @@ export const actions = {
|
|
|
374
375
|
commit('cookies/remove', { key: KEY }, { root: true });
|
|
375
376
|
},
|
|
376
377
|
|
|
377
|
-
uiLogout({ commit, dispatch }) {
|
|
378
|
+
uiLogout({ commit, dispatch }, options = {}) {
|
|
378
379
|
removeEmberPage();
|
|
379
380
|
|
|
380
381
|
commit('loggedOut');
|
|
381
|
-
dispatch('onLogout',
|
|
382
|
+
dispatch('onLogout', options, { root: true });
|
|
382
383
|
|
|
383
384
|
dispatch('uiplugins/setReady', false, { root: true });
|
|
384
385
|
},
|
|
@@ -430,6 +431,10 @@ export const actions = {
|
|
|
430
431
|
} catch (e) {
|
|
431
432
|
}
|
|
432
433
|
|
|
433
|
-
|
|
434
|
+
const propagateOptions = {};
|
|
435
|
+
|
|
436
|
+
propagateOptions.sessionIdle = options.sessionIdle;
|
|
437
|
+
|
|
438
|
+
dispatch('uiLogout', propagateOptions);
|
|
434
439
|
}
|
|
435
440
|
};
|
package/store/aws.js
CHANGED
|
@@ -213,18 +213,20 @@ export const actions = {
|
|
|
213
213
|
|
|
214
214
|
list.push({
|
|
215
215
|
apiName,
|
|
216
|
-
currentGeneration:
|
|
216
|
+
currentGeneration: row.CurrentGeneration || false,
|
|
217
217
|
groupLabel,
|
|
218
218
|
instanceClass,
|
|
219
|
-
memoryBytes:
|
|
220
|
-
supportedUsageClasses:
|
|
221
|
-
|
|
219
|
+
memoryBytes: row.MemoryInfo.SizeInMiB * 1024 * 1024,
|
|
220
|
+
supportedUsageClasses: row.SupportedUsageClasses,
|
|
221
|
+
supportedArchitectures: row.ProcessorInfo.SupportedArchitectures || [],
|
|
222
|
+
label: rootGetters['i18n/t']('cluster.machineConfig.aws.sizeLabel', {
|
|
222
223
|
apiName,
|
|
223
|
-
cpu:
|
|
224
|
-
memory:
|
|
224
|
+
cpu: row.VCpuInfo.DefaultVCpus,
|
|
225
|
+
memory: row.MemoryInfo.SizeInMiB / 1024,
|
|
225
226
|
storageSize,
|
|
226
227
|
storageUnit,
|
|
227
228
|
storageType,
|
|
229
|
+
architecture: (row.ProcessorInfo.SupportedArchitectures || []).map((a) => (a === 'arm64' ? 'ARM' : a)).join(', ')
|
|
228
230
|
}),
|
|
229
231
|
});
|
|
230
232
|
}
|
package/store/features.js
CHANGED
|
@@ -37,6 +37,7 @@ export const STEVE_CACHE = create('ui-sql-cache', false);
|
|
|
37
37
|
export const UIEXTENSION = create('uiextension', true);
|
|
38
38
|
export const PROVISIONING_PRE_BOOTSTRAP = create('provisioningprebootstrap', false);
|
|
39
39
|
export const SCHEDULING_CUSTOMIZATION = create(SCHEDULING_CUSTOMIZATION_FEATURE, false);
|
|
40
|
+
export const SCC = create('rancher-scc-registration-extension', true);
|
|
40
41
|
|
|
41
42
|
// Not currently used.. no point defining ones we don't use
|
|
42
43
|
// export const EMBEDDED_CLUSTER_API = create('embedded-cluster-api', true);
|
package/store/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { BACK_TO } from '@shell/config/local-storage';
|
|
|
2
2
|
import { setBrand, setVendor } from '@shell/config/private-label';
|
|
3
3
|
import { NAME as EXPLORER } from '@shell/config/product/explorer';
|
|
4
4
|
import {
|
|
5
|
-
LOGGED_OUT, IS_SSO, IS_SLO, TIMED_OUT, UPGRADED, _FLAGGED
|
|
5
|
+
LOGGED_OUT, IS_SSO, IS_SLO, TIMED_OUT, UPGRADED, _FLAGGED, IS_SESSION_IDLE
|
|
6
6
|
} from '@shell/config/query-params';
|
|
7
7
|
import { SETTING } from '@shell/config/settings';
|
|
8
8
|
import {
|
|
@@ -40,6 +40,8 @@ import { isDevBuild } from '@shell/utils/version';
|
|
|
40
40
|
import { markRaw } from 'vue';
|
|
41
41
|
import paginationUtils from '@shell/utils/pagination-utils';
|
|
42
42
|
import { addReleaseNotesNotification } from '@shell/utils/release-notes';
|
|
43
|
+
import sideNavService from '@shell/components/nav/TopLevelMenu.helper';
|
|
44
|
+
import { fetchAndProcessDynamicContent } from '@shell/utils/dynamic-content';
|
|
43
45
|
|
|
44
46
|
// Disables strict mode for all store instances to prevent warning about changing state outside of mutations
|
|
45
47
|
// because it's more efficient to do that sometimes.
|
|
@@ -230,8 +232,8 @@ const updateActiveNamespaceCache = (state, activeNamespaceCache) => {
|
|
|
230
232
|
/**
|
|
231
233
|
* Are we in the vai enabled world where mgmt clusters are paginated?
|
|
232
234
|
*/
|
|
233
|
-
const paginateClusters = (rootGetters) => {
|
|
234
|
-
return paginationUtils.isEnabled({ rootGetters }, { store: 'management', resource: { id: MANAGEMENT.CLUSTER, context: 'side-bar' } });
|
|
235
|
+
const paginateClusters = ({ rootGetters, state }) => {
|
|
236
|
+
return paginationUtils.isEnabled({ rootGetters, $plugin: state.$plugin }, { store: 'management', resource: { id: MANAGEMENT.CLUSTER, context: 'side-bar' } });
|
|
235
237
|
};
|
|
236
238
|
|
|
237
239
|
export const state = () => {
|
|
@@ -260,11 +262,8 @@ export const state = () => {
|
|
|
260
262
|
$router: markRaw({}),
|
|
261
263
|
$route: markRaw({}),
|
|
262
264
|
$plugin: markRaw({}),
|
|
263
|
-
/**
|
|
264
|
-
* Cache state of side nav clusters. This avoids flickering when the user changes pages and the side nav component re-renders
|
|
265
|
-
*/
|
|
266
|
-
sideNavCache: undefined,
|
|
267
265
|
showWorkspaceSwitcher: true,
|
|
266
|
+
|
|
268
267
|
};
|
|
269
268
|
};
|
|
270
269
|
|
|
@@ -629,10 +628,6 @@ export const getters = {
|
|
|
629
628
|
return `${ base }/latest`;
|
|
630
629
|
},
|
|
631
630
|
|
|
632
|
-
sideNavCache(state) {
|
|
633
|
-
return state.sideNavCache;
|
|
634
|
-
},
|
|
635
|
-
|
|
636
631
|
...gcGetters
|
|
637
632
|
};
|
|
638
633
|
|
|
@@ -773,10 +768,6 @@ export const mutations = {
|
|
|
773
768
|
state.$plugin = markRaw(pluginDefinition || {});
|
|
774
769
|
},
|
|
775
770
|
|
|
776
|
-
setSideNavCache(state, sideNavCache) {
|
|
777
|
-
state.sideNavCache = sideNavCache;
|
|
778
|
-
},
|
|
779
|
-
|
|
780
771
|
showWorkspaceSwitcher(state, value) {
|
|
781
772
|
state.showWorkspaceSwitcher = value;
|
|
782
773
|
},
|
|
@@ -855,7 +846,7 @@ export const actions = {
|
|
|
855
846
|
|
|
856
847
|
res = await allHash(promises);
|
|
857
848
|
|
|
858
|
-
if (!res[MANAGEMENT.SETTING] || !paginateClusters(rootGetters)) {
|
|
849
|
+
if (!res[MANAGEMENT.SETTING] || !paginateClusters({ rootGetters, state })) {
|
|
859
850
|
// This introduces a synchronous request, however we need settings to determine if SSP is enabled
|
|
860
851
|
// Eventually it will be removed when SSP is always on
|
|
861
852
|
res[MANAGEMENT.CLUSTER] = await dispatch('management/findAll', { type: MANAGEMENT.CLUSTER, opt: { watch: false } });
|
|
@@ -900,6 +891,8 @@ export const actions = {
|
|
|
900
891
|
// Add the notification for the release notes
|
|
901
892
|
if (isRancher) {
|
|
902
893
|
await addReleaseNotesNotification(dispatch, getters);
|
|
894
|
+
|
|
895
|
+
fetchAndProcessDynamicContent(dispatch, getters, this.$axios);
|
|
903
896
|
}
|
|
904
897
|
|
|
905
898
|
if (systemNamespaces) {
|
|
@@ -1033,7 +1026,7 @@ export const actions = {
|
|
|
1033
1026
|
await dispatch('management/waitForSchema', { type: MANAGEMENT.CLUSTER });
|
|
1034
1027
|
|
|
1035
1028
|
// If SSP is on we won't have requested all clusters
|
|
1036
|
-
if (!paginateClusters(rootGetters)) {
|
|
1029
|
+
if (!paginateClusters({ rootGetters, state })) {
|
|
1037
1030
|
await dispatch('management/waitForHaveAll', { type: MANAGEMENT.CLUSTER });
|
|
1038
1031
|
}
|
|
1039
1032
|
|
|
@@ -1132,8 +1125,10 @@ export const actions = {
|
|
|
1132
1125
|
commit('updateNamespaces', { filters: ids, getters });
|
|
1133
1126
|
},
|
|
1134
1127
|
|
|
1135
|
-
async cleanNamespaces({
|
|
1136
|
-
|
|
1128
|
+
async cleanNamespaces({
|
|
1129
|
+
getters, dispatch, rootGetters, state
|
|
1130
|
+
}) {
|
|
1131
|
+
if (paginateClusters({ rootGetters, state })) {
|
|
1137
1132
|
// See https://github.com/rancher/dashboard/issues/12864
|
|
1138
1133
|
// old world...
|
|
1139
1134
|
// - loadManagement makes a request to fetch all mgmt clusters
|
|
@@ -1176,7 +1171,7 @@ export const actions = {
|
|
|
1176
1171
|
}
|
|
1177
1172
|
},
|
|
1178
1173
|
|
|
1179
|
-
async onLogout(store) {
|
|
1174
|
+
async onLogout(store, options = {}) {
|
|
1180
1175
|
const { dispatch, commit, state } = store;
|
|
1181
1176
|
|
|
1182
1177
|
store.dispatch('gcStopIntervals');
|
|
@@ -1187,6 +1182,8 @@ export const actions = {
|
|
|
1187
1182
|
}
|
|
1188
1183
|
});
|
|
1189
1184
|
|
|
1185
|
+
sideNavService.reset();
|
|
1186
|
+
|
|
1190
1187
|
await dispatch('management/unsubscribe');
|
|
1191
1188
|
commit('managementChanged', { ready: false });
|
|
1192
1189
|
commit('management/reset');
|
|
@@ -1216,7 +1213,10 @@ export const actions = {
|
|
|
1216
1213
|
window.localStorage.setItem(BACK_TO, window.location.href);
|
|
1217
1214
|
}
|
|
1218
1215
|
|
|
1219
|
-
let QUERY = (LOGGED_OUT in route.query) ? LOGGED_OUT : TIMED_OUT;
|
|
1216
|
+
let QUERY = (LOGGED_OUT in route.query) || options.sessionIdle ? LOGGED_OUT : TIMED_OUT;
|
|
1217
|
+
|
|
1218
|
+
// adds IS_SESSION_IDLE query param to login route if logout came from a session idle (check auth/logout action)
|
|
1219
|
+
QUERY += options.sessionIdle ? `&${ IS_SESSION_IDLE }` : '';
|
|
1220
1220
|
|
|
1221
1221
|
// adds IS_SSO query param to login route if logout came with an auth provider enabled
|
|
1222
1222
|
QUERY += (IS_SSO in route.query) ? `&${ IS_SSO }` : '';
|
|
@@ -1308,10 +1308,6 @@ export const actions = {
|
|
|
1308
1308
|
});
|
|
1309
1309
|
},
|
|
1310
1310
|
|
|
1311
|
-
setSideNavCache({ commit }, sideNavCache) {
|
|
1312
|
-
commit('setSideNavCache', sideNavCache);
|
|
1313
|
-
},
|
|
1314
|
-
|
|
1315
1311
|
showWorkspaceSwitcher({ commit }, value) {
|
|
1316
1312
|
commit('showWorkspaceSwitcher', value);
|
|
1317
1313
|
},
|
package/store/prefs.js
CHANGED
|
@@ -114,6 +114,12 @@ export const PROVISIONER = create('provisioner', _RKE2, { options: [_RKE1, _RKE2
|
|
|
114
114
|
export const MENU_MAX_CLUSTERS = 10;
|
|
115
115
|
// Prompt for confirm when scaling down node pool in GUI and save the pref
|
|
116
116
|
export const SCALE_POOL_PROMPT = create('scale-pool-prompt', null, { parseJSON });
|
|
117
|
+
|
|
118
|
+
// Dynamic content
|
|
119
|
+
export const READ_NEW_RELEASE = create('read-new-release', '', { parseJSON });
|
|
120
|
+
export const READ_SUPPORT_NOTICE = create('read-support-notice', '', { parseJSON });
|
|
121
|
+
export const READ_UPCOMING_SUPPORT_NOTICE = create('read-upcoming-support-notice', '', { parseJSON });
|
|
122
|
+
|
|
117
123
|
// --------------------
|
|
118
124
|
|
|
119
125
|
const cookiePrefix = 'R_';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import { EXT_IDS_VALUES } from '@shell/core/plugin';
|
|
1
2
|
import { ClusterProvisionerContext } from '@shell/core/types';
|
|
3
|
+
|
|
4
|
+
type ExtensionManagerType = { [name: string]: Function, }
|
|
5
|
+
export type ExtensionManagerTypes =
|
|
6
|
+
{ [type in EXT_IDS_VALUES]?: ExtensionManagerType } & // eslint-disable-line no-unused-vars
|
|
7
|
+
{ [name: string]: ExtensionManagerType }
|
|
8
|
+
|
|
2
9
|
export type ExtensionManager = {
|
|
3
10
|
internal(): any;
|
|
4
11
|
loadPluginAsync(plugin: any): Promise<void>;
|
|
@@ -12,7 +19,7 @@ export type ExtensionManager = {
|
|
|
12
19
|
applyPlugin(plugin: any): void;
|
|
13
20
|
register(type: string, name: string, fn: Function): void;
|
|
14
21
|
unregister(type: string, name: string, fn: Function): void;
|
|
15
|
-
getAll():
|
|
22
|
+
getAll(): ExtensionManagerTypes;
|
|
16
23
|
getPlugins(): any;
|
|
17
24
|
getDynamic(typeName: string, name: string): any;
|
|
18
25
|
getValidator(name: string): any;
|
package/types/kube/kube-api.ts
CHANGED
package/types/rancher/index.d.ts
CHANGED
|
@@ -1,26 +1,58 @@
|
|
|
1
|
-
|
|
2
1
|
export interface PaginationSettingsStore {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
resources: {
|
|
3
|
+
/**
|
|
4
|
+
* Enable for all resources in this store
|
|
5
|
+
*/
|
|
6
|
+
enableAll?: boolean,
|
|
7
|
+
/**
|
|
8
|
+
* Enable for only some resources in this store
|
|
9
|
+
*/
|
|
10
|
+
enableSome?: {
|
|
11
|
+
/**
|
|
12
|
+
* Specific resource type to enable
|
|
13
|
+
*/
|
|
14
|
+
enabled?: (string | { resource: string, context: string[]})[],
|
|
5
15
|
/**
|
|
6
|
-
*
|
|
16
|
+
* Additional resource types that do not have any custom pagination settings (headers, lists, etc) but can be generated automatically (headers from CRD additionalPrinterColumns) can be enabled
|
|
7
17
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Specific resource type to enable
|
|
12
|
-
*/
|
|
13
|
-
enabled: (string | { resource: string, context: string[]})[],
|
|
14
|
-
/**
|
|
15
|
-
* There's no hardcoded headers or custom list for the resource type, headers will be generated from schema attributes.columns
|
|
16
|
-
*/
|
|
17
|
-
generic: boolean,
|
|
18
|
-
},
|
|
19
|
-
}
|
|
18
|
+
generic?: boolean,
|
|
19
|
+
},
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
/*
|
|
24
|
+
* Determine which resources can utilise server-side pagination
|
|
25
|
+
*/
|
|
26
|
+
export interface PaginationSettingsStores {
|
|
27
|
+
[store: string]: PaginationSettingsStore
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Names of pagination features used in pagination settings (not featureflags)
|
|
32
|
+
*/
|
|
33
|
+
export type PaginationFeatureName = 'listAutoRefreshToggle' | 'listManualRefresh' | 'homePageCluster'
|
|
34
|
+
|
|
35
|
+
export type PaginationFeatureHomePageClusterConfig = {
|
|
36
|
+
threshold: number,
|
|
37
|
+
results: number,
|
|
38
|
+
pagesPerRow: number
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Details of a specific pagination feature
|
|
43
|
+
*/
|
|
44
|
+
export type PaginationFeature<Config = any> = {
|
|
45
|
+
version: number,
|
|
46
|
+
enabled: boolean,
|
|
47
|
+
configuration?: Config,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* List of specific features that can be enabled / disabled
|
|
52
|
+
*/
|
|
53
|
+
export type PaginationSettingsFeatures = {
|
|
54
|
+
[key in PaginationFeatureName]?: PaginationFeature
|
|
55
|
+
}
|
|
24
56
|
|
|
25
57
|
/**
|
|
26
58
|
* Settings to handle server side pagination
|
|
@@ -33,16 +65,12 @@ export interface PaginationSettings {
|
|
|
33
65
|
/**
|
|
34
66
|
* Should pagination be enabled for resources in a store
|
|
35
67
|
*/
|
|
36
|
-
stores?:
|
|
68
|
+
stores?: PaginationSettingsStores,
|
|
37
69
|
|
|
38
70
|
/**
|
|
39
71
|
* List of specific features that can be enabled / disabled
|
|
40
72
|
*/
|
|
41
|
-
features?:
|
|
42
|
-
[key in PaginationFeature]: {
|
|
43
|
-
enabled: boolean,
|
|
44
|
-
}
|
|
45
|
-
},
|
|
73
|
+
features?: PaginationSettingsFeatures,
|
|
46
74
|
|
|
47
75
|
/**
|
|
48
76
|
* Debounce the amount of time between a resource changing and the backend sending a resource.changes message
|
|
@@ -75,6 +103,7 @@ type ManagedFields = {
|
|
|
75
103
|
time: string;
|
|
76
104
|
};
|
|
77
105
|
|
|
106
|
+
// Note - this should now be @RancherKubeMetadata
|
|
78
107
|
type Metadata = {
|
|
79
108
|
creationTimestamp: string;
|
|
80
109
|
fields: string[];
|