@rancher/shell 3.0.8-rc.9 → 3.0.9-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/apis/impl/apis.ts +61 -0
- package/apis/index.ts +40 -0
- package/apis/intf/modal.ts +128 -0
- package/apis/intf/shell.ts +36 -0
- package/apis/intf/slide-in.ts +100 -0
- package/apis/intf/system.ts +41 -0
- package/apis/shell/__tests__/modal.test.ts +80 -0
- package/apis/shell/__tests__/notifications.test.ts +71 -0
- package/apis/shell/__tests__/slide-in.test.ts +90 -0
- package/apis/shell/__tests__/system.test.ts +129 -0
- package/apis/shell/index.ts +38 -0
- package/apis/shell/modal.ts +41 -0
- package/apis/shell/notifications.ts +65 -0
- package/apis/shell/slide-in.ts +37 -0
- package/apis/shell/system.ts +65 -0
- package/apis/vue-shim.d.ts +11 -0
- package/assets/styles/global/_tooltip.scss +6 -1
- package/assets/translations/en-us.yaml +5 -0
- package/components/ActionMenuShell.vue +3 -1
- package/components/CruResource.vue +8 -1
- package/components/Drawer/ResourceDetailDrawer/__tests__/composables.test.ts +50 -1
- package/components/Drawer/ResourceDetailDrawer/composables.ts +19 -0
- package/components/Drawer/ResourceDetailDrawer/index.vue +3 -1
- package/components/LocaleSelector.vue +2 -2
- package/components/ModalManager.vue +11 -1
- package/components/Questions/__tests__/Yaml.test.ts +1 -1
- package/components/RelatedResources.vue +5 -0
- package/components/Resource/Detail/ResourcePopover/index.vue +5 -1
- package/components/ResourceDetail/Masthead/latest.vue +23 -21
- package/components/ResourceDetail/index.vue +3 -0
- package/components/ResourceTable.vue +54 -21
- package/components/SlideInPanelManager.vue +16 -11
- package/components/SortableTable/THead.vue +2 -1
- package/components/SortableTable/index.vue +20 -2
- package/components/Tabbed/index.vue +37 -2
- package/components/__tests__/NamespaceFilter.test.ts +49 -0
- package/components/auth/SelectPrincipal.vue +4 -0
- package/components/auth/login/ldap.vue +3 -3
- package/components/fleet/FleetSecretSelector.vue +1 -1
- package/components/form/KeyValue.vue +1 -1
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/NodeScheduling.vue +2 -2
- package/components/form/ResourceTabs/composable.ts +2 -2
- package/components/form/ResourceTabs/index.vue +0 -2
- package/components/form/__tests__/NameNsDescription.test.ts +42 -0
- package/components/formatter/LinkName.vue +5 -0
- package/components/nav/Group.vue +25 -7
- package/components/nav/Header.vue +1 -1
- package/components/nav/NamespaceFilter.vue +1 -0
- package/components/nav/Type.vue +17 -6
- package/components/nav/WindowManager/panels/TabBodyContainer.vue +1 -1
- package/components/nav/__tests__/Type.test.ts +59 -0
- package/composables/cruResource.ts +27 -0
- package/composables/focusTrap.ts +3 -1
- package/composables/resourceDetail.ts +15 -0
- package/composables/useLabeledFormElement.ts +3 -4
- package/config/product/fleet.js +1 -1
- package/config/router/navigation-guards/clusters.js +3 -3
- package/config/router/navigation-guards/products.js +1 -1
- package/config/router/routes.js +1 -5
- package/core/__tests__/extension-manager-impl.test.js +437 -0
- package/core/extension-manager-impl.js +6 -27
- package/core/plugin-helpers.ts +2 -2
- package/core/plugin.ts +9 -1
- package/core/plugins-loader.js +2 -2
- package/core/types-provisioning.ts +4 -0
- package/core/types.ts +35 -0
- package/detail/catalog.cattle.io.app.vue +1 -0
- package/detail/provisioning.cattle.io.cluster.vue +8 -6
- package/dialog/DeveloperLoadExtensionDialog.vue +1 -1
- package/dialog/MoveNamespaceDialog.vue +20 -4
- package/dialog/SearchDialog.vue +1 -0
- package/dialog/__tests__/MoveNamespaceDialog.test.ts +249 -0
- package/directives/__tests__/clean-tooltip.test.ts +298 -0
- package/directives/clean-tooltip.ts +234 -0
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +2 -2
- package/edit/__tests__/fleet.cattle.io.helmop.test.ts +98 -1
- package/edit/fleet.cattle.io.helmop.vue +5 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +21 -21
- package/edit/provisioning.cattle.io.cluster/index.vue +5 -5
- package/edit/provisioning.cattle.io.cluster/rke2.vue +8 -8
- package/edit/resources.cattle.io.restore.vue +1 -1
- package/edit/workload/Job.vue +2 -2
- package/edit/workload/__tests__/index.test.ts +123 -85
- package/edit/workload/index.vue +2 -2
- package/edit/workload/mixins/workload.js +19 -1
- package/initialize/install-plugins.js +4 -5
- package/machine-config/azure.vue +1 -1
- package/machine-config/components/GCEImage.vue +1 -1
- package/mixins/__tests__/brand.spec.ts +18 -13
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +16 -0
- package/models/chart.js +70 -74
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/provisioning.cattle.io.cluster.js +11 -3
- package/package.json +7 -7
- package/pages/auth/login.vue +3 -3
- package/pages/auth/setup.vue +1 -1
- package/pages/auth/verify.vue +3 -3
- package/pages/c/_cluster/apps/charts/index.vue +122 -24
- package/pages/c/_cluster/apps/charts/install.vue +33 -0
- package/pages/c/_cluster/explorer/__tests__/index.test.ts +1 -1
- package/pages/c/_cluster/fleet/index.vue +7 -10
- package/pages/c/_cluster/settings/index.vue +5 -0
- package/pkg/auto-import.js +3 -3
- package/pkg/dynamic-importer.lib.js +1 -1
- package/pkg/import.js +1 -1
- package/plugins/__tests__/mutations.tests.ts +179 -0
- package/plugins/dashboard-store/getters.js +1 -1
- package/plugins/dashboard-store/model-loader.js +1 -1
- package/plugins/dashboard-store/mutations.js +23 -2
- package/plugins/dashboard-store/resource-class.js +8 -3
- package/plugins/plugin.js +2 -2
- package/plugins/steve/__tests__/steve-pagination-utils.test.ts +301 -128
- package/plugins/steve/mutations.js +9 -0
- package/plugins/steve/steve-class.js +1 -1
- package/plugins/steve/steve-pagination-utils.ts +108 -43
- package/plugins/steve/subscribe.js +23 -2
- package/rancher-components/Form/Checkbox/Checkbox.vue +1 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
- package/rancher-components/RcDropdown/useDropdownContext.ts +2 -4
- package/rancher-components/RcItemCard/RcItemCard.vue +1 -1
- package/scripts/publish-shell.sh +25 -0
- package/store/__tests__/catalog.test.ts +1 -1
- package/store/__tests__/type-map.test.ts +164 -2
- package/store/auth.js +23 -11
- package/store/i18n.js +3 -3
- package/store/index.js +5 -3
- package/store/notifications.ts +2 -0
- package/store/prefs.js +2 -2
- package/store/type-map.js +17 -7
- package/types/internal-api/shell/modal.d.ts +6 -6
- package/types/notifications/index.ts +126 -15
- package/types/rancher/index.d.ts +9 -0
- package/types/shell/index.d.ts +16 -1
- package/types/store/dashboard-store.types.ts +29 -7
- package/types/vue-shim.d.ts +5 -4
- package/utils/__tests__/router.test.js +238 -0
- package/utils/cluster.js +4 -1
- package/utils/cspAdaptor.ts +32 -14
- package/utils/fleet.ts +8 -1
- package/utils/pagination-utils.ts +2 -2
- package/utils/pagination-wrapper.ts +4 -4
- package/utils/router.js +50 -0
- package/utils/unit-tests/pagination-utils.spec.ts +8 -8
- package/vue.config.js +3 -3
- package/composables/useExtensionManager.ts +0 -17
- package/core/__test__/extension-manager-impl.test.js +0 -236
- package/core/plugins.js +0 -38
- package/directives/clean-tooltip.js +0 -32
- package/plugins/internal-api/index.ts +0 -37
- package/plugins/internal-api/shared/base-api.ts +0 -13
- package/plugins/internal-api/shell/shell.api.ts +0 -108
- package/types/internal-api/shell/growl.d.ts +0 -25
- package/types/internal-api/shell/slideIn.d.ts +0 -15
package/store/notifications.ts
CHANGED
|
@@ -299,6 +299,8 @@ export const actions = {
|
|
|
299
299
|
|
|
300
300
|
// Show a growl for the notification if necessary
|
|
301
301
|
dispatch('growl/notification', notification, { root: true });
|
|
302
|
+
|
|
303
|
+
return notification.id;
|
|
302
304
|
},
|
|
303
305
|
|
|
304
306
|
async fromGrowl( { commit, getters }: any, notification: Notification) {
|
package/store/prefs.js
CHANGED
|
@@ -233,13 +233,13 @@ export const getters = {
|
|
|
233
233
|
}
|
|
234
234
|
const clusterPref = getters['get'](CLUSTER);
|
|
235
235
|
|
|
236
|
-
return { name: 'c-cluster-explorer', params: {
|
|
236
|
+
return { name: 'c-cluster-explorer', params: { cluster: clusterPref } };
|
|
237
237
|
}
|
|
238
238
|
case (!!afterLoginRoutePref.match(/.+-dashboard$/)):
|
|
239
239
|
{
|
|
240
240
|
const clusterId = afterLoginRoutePref.split('-dashboard')[0];
|
|
241
241
|
|
|
242
|
-
return { name: 'c-cluster-explorer', params: {
|
|
242
|
+
return { name: 'c-cluster-explorer', params: { cluster: clusterId } };
|
|
243
243
|
}
|
|
244
244
|
default:
|
|
245
245
|
return { name: afterLoginRoutePref };
|
package/store/type-map.js
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
// ifHave, -- Show this product only if the given capability is available
|
|
36
36
|
// ifHaveGroup, -- Show this product only if the given group exists in the store [inStore]
|
|
37
37
|
// ifHaveType, -- Show this product only if the given type exists in the store [inStore], This can also be specified as an object { type: TYPE, store: 'management' } if the type isn't in the current [inStore]
|
|
38
|
+
// ifNotHaveType, -- Hide this product if the given type exists in the store [inStore] (opposite of ifHaveType)
|
|
38
39
|
// ifHaveVerb, -- In combination with ifHaveTYpe, show it only if the type also has this collectionMethod
|
|
39
40
|
// inStore, -- Which store to look at for if* above and the left-nav, defaults to "cluster"
|
|
40
41
|
// rootProduct, -- Optional root (parent) product - if set, used to optimize navigation when product changes stays within root product
|
|
@@ -152,6 +153,7 @@ import { haveV2Monitoring } from '@shell/utils/monitoring';
|
|
|
152
153
|
import { NEU_VECTOR_NAMESPACE } from '@shell/config/product/neuvector';
|
|
153
154
|
import { createHeaders, rowValueGetter } from '@shell/store/type-map.utils';
|
|
154
155
|
import { defineAsyncComponent } from 'vue';
|
|
156
|
+
import { filterLocationValidParams } from '@shell/utils/router';
|
|
155
157
|
|
|
156
158
|
export const NAMESPACED = 'namespaced';
|
|
157
159
|
export const CLUSTER_LEVEL = 'cluster';
|
|
@@ -238,7 +240,7 @@ export function DSL(store, product, module = 'type-map') {
|
|
|
238
240
|
};
|
|
239
241
|
|
|
240
242
|
// Convert strings to regex's - we do this once here for efficiency
|
|
241
|
-
for ( const k of ['ifHaveGroup', 'ifHaveType'] ) {
|
|
243
|
+
for ( const k of ['ifHaveGroup', 'ifHaveType', 'ifNotHaveType'] ) {
|
|
242
244
|
if ( opt[k] ) {
|
|
243
245
|
if (Array.isArray(opt[k])) {
|
|
244
246
|
opt[k] = opt[k].map((r) => regexToString(ensureRegex(r)));
|
|
@@ -365,7 +367,7 @@ export function DSL(store, product, module = 'type-map') {
|
|
|
365
367
|
|
|
366
368
|
let called = false;
|
|
367
369
|
|
|
368
|
-
export async function applyProducts(store, $
|
|
370
|
+
export async function applyProducts(store, $extension) {
|
|
369
371
|
if (called) {
|
|
370
372
|
return;
|
|
371
373
|
}
|
|
@@ -379,7 +381,7 @@ export async function applyProducts(store, $plugin) {
|
|
|
379
381
|
}
|
|
380
382
|
}
|
|
381
383
|
// Load the products from all plugins
|
|
382
|
-
$
|
|
384
|
+
$extension.loadProducts();
|
|
383
385
|
}
|
|
384
386
|
|
|
385
387
|
export function productsLoaded() {
|
|
@@ -694,7 +696,7 @@ export const getters = {
|
|
|
694
696
|
}
|
|
695
697
|
};
|
|
696
698
|
|
|
697
|
-
typeObj.route = route;
|
|
699
|
+
typeObj.route = filterLocationValidParams(rootState.$router, route);
|
|
698
700
|
}
|
|
699
701
|
|
|
700
702
|
// Cluster ID and Product should always be set
|
|
@@ -711,7 +713,7 @@ export const getters = {
|
|
|
711
713
|
exact: typeObj.exact || false,
|
|
712
714
|
'exact-path': typeObj['exact-path'] || false,
|
|
713
715
|
namespaced,
|
|
714
|
-
route,
|
|
716
|
+
route: filterLocationValidParams(rootState.$router, route),
|
|
715
717
|
name: typeObj.name,
|
|
716
718
|
weight: typeObj.weight || getters.typeWeightFor(typeObj.schema?.id || label, isBasic),
|
|
717
719
|
overview: !!typeObj.overview,
|
|
@@ -1419,6 +1421,14 @@ export const getters = {
|
|
|
1419
1421
|
}
|
|
1420
1422
|
}
|
|
1421
1423
|
|
|
1424
|
+
if ( p.ifNotHaveType ) {
|
|
1425
|
+
const haveIds = knownTypes[module].filter((t) => t.match(stringToRegex(p.ifNotHaveType)) );
|
|
1426
|
+
|
|
1427
|
+
if ( haveIds.length ) {
|
|
1428
|
+
return false;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1422
1432
|
if ( p.ifHaveGroup && !knownGroups[module].find((t) => t.match(stringToRegex(p.ifHaveGroup)) ) ) {
|
|
1423
1433
|
return false;
|
|
1424
1434
|
}
|
|
@@ -2026,7 +2036,7 @@ function hasCustom(state, rootState, kind, key, fallback) {
|
|
|
2026
2036
|
}
|
|
2027
2037
|
|
|
2028
2038
|
// Check to see if the custom kind is provided by a plugin (ignore booleans)
|
|
2029
|
-
const pluginComponent = rootState.$
|
|
2039
|
+
const pluginComponent = rootState.$extension.getDynamic(kind, key);
|
|
2030
2040
|
|
|
2031
2041
|
if (typeof pluginComponent !== 'boolean' && !!pluginComponent) {
|
|
2032
2042
|
cache[key] = true;
|
|
@@ -2046,7 +2056,7 @@ function hasCustom(state, rootState, kind, key, fallback) {
|
|
|
2046
2056
|
}
|
|
2047
2057
|
|
|
2048
2058
|
function loadExtension(rootState, kind, key, fallback) {
|
|
2049
|
-
const ext = rootState.$
|
|
2059
|
+
const ext = rootState.$extension.getDynamic(kind, key);
|
|
2050
2060
|
|
|
2051
2061
|
if (ext) {
|
|
2052
2062
|
if (typeof ext === 'function') {
|
|
@@ -14,7 +14,7 @@ export interface ModalConfig {
|
|
|
14
14
|
*
|
|
15
15
|
* this.$shell.modal({
|
|
16
16
|
* component: MyCustomModal,
|
|
17
|
-
*
|
|
17
|
+
* props: { title: 'Hello Modal' }
|
|
18
18
|
* });
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
@@ -25,10 +25,10 @@ export interface ModalConfig {
|
|
|
25
25
|
*
|
|
26
26
|
* Example:
|
|
27
27
|
* ```ts
|
|
28
|
-
*
|
|
28
|
+
* props: { title: 'Hello Modal', isVisible: true }
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
props?: Record<string, any>;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Optional array of resources that the modal component might need.
|
|
@@ -47,11 +47,11 @@ export interface ModalConfig {
|
|
|
47
47
|
*
|
|
48
48
|
* Examples:
|
|
49
49
|
* ```ts
|
|
50
|
-
*
|
|
51
|
-
*
|
|
50
|
+
* width: '800px' // Width in pixels
|
|
51
|
+
* width: '75%' // Width as a percentage
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
width?: string;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Determines if clicking outside the modal will close it. Defaults to `true`.
|
|
@@ -4,36 +4,102 @@ import { RouteLocationRaw } from 'vue-router';
|
|
|
4
4
|
* Type definitions for the Notification Center
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Notification Level for a notification in the Notification Center
|
|
9
|
-
*/
|
|
10
7
|
export enum NotificationLevel {
|
|
8
|
+
/**
|
|
9
|
+
* An announcement. To be used when we want to inform on high-interest topics - news, updates, changes, scheduled maintenance, etc. E.g. “New version available!” <img class="svg-blue" src="https://raw.githubusercontent.com/rancher/icons/refs/heads/master/svg/notify-announcement.svg" width="20" />
|
|
10
|
+
*/
|
|
11
11
|
Announcement = 0, // eslint-disable-line no-unused-vars
|
|
12
|
+
/**
|
|
13
|
+
* A task that is underway. To be used when we want to inform on a process taking place - on-going actions that might take a while. E.g. “Cluster provisioning in progress”. The progress bar will also be shown if the `progress` field is set <img class="svg-blue" src="https://raw.githubusercontent.com/rancher/icons/refs/heads/master/svg/notify-busy.svg" width="20" />
|
|
14
|
+
*/
|
|
12
15
|
Task, // eslint-disable-line no-unused-vars
|
|
16
|
+
/**
|
|
17
|
+
* Information notification. To be used when we want to inform on low-interest topics. E.g. “Welcome to Rancher v2.8" <img class="svg-blue" src="https://raw.githubusercontent.com/rancher/icons/refs/heads/master/svg/notify-info.svg"/>
|
|
18
|
+
*/
|
|
13
19
|
Info, // eslint-disable-line no-unused-vars
|
|
20
|
+
/**
|
|
21
|
+
* Notification that something has completed successfully. To be used when we want to confirm a successful action was completed. E.g. “Cluster provisioning completed” <img class="svg-green" src="https://raw.githubusercontent.com/rancher/icons/refs/heads/master/svg/notify-tick.svg"/>
|
|
22
|
+
*/
|
|
14
23
|
Success, // eslint-disable-line no-unused-vars
|
|
24
|
+
/**
|
|
25
|
+
* Notification of a warning. To be used when we want to warn about a potential risk. E.g. “Nodes limitation warning” <img class="svg-orange" src="https://raw.githubusercontent.com/rancher/icons/refs/heads/master/svg/notify-warning.svg"/>
|
|
26
|
+
*/
|
|
15
27
|
Warning, // eslint-disable-line no-unused-vars
|
|
28
|
+
/**
|
|
29
|
+
* Notification of an error. To be used when we want to alert on a confirmed risk. E.g. “Extension failed to load” <img class="svg-red" src="https://raw.githubusercontent.com/rancher/icons/refs/heads/master/svg/notify-error.svg"/>
|
|
30
|
+
*/
|
|
16
31
|
Error, // eslint-disable-line no-unused-vars
|
|
17
32
|
Hidden, // eslint-disable-line no-unused-vars
|
|
18
33
|
}
|
|
19
34
|
|
|
20
35
|
/**
|
|
21
|
-
*
|
|
36
|
+
* Notification Action definition
|
|
22
37
|
*/
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
export interface NotificationAction {
|
|
39
|
+
/**
|
|
40
|
+
* Button label for the action
|
|
41
|
+
*/
|
|
42
|
+
label: string;
|
|
43
|
+
/**
|
|
44
|
+
* Href target when the button is clicked
|
|
45
|
+
*/
|
|
46
|
+
target?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Vue Route to navigate to when the button is clicked
|
|
49
|
+
*/
|
|
50
|
+
route?: RouteLocationRaw;
|
|
51
|
+
}
|
|
28
52
|
|
|
29
53
|
/**
|
|
30
|
-
*
|
|
54
|
+
* Notification Preference definition
|
|
31
55
|
*/
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
56
|
+
export interface NotificationPreference {
|
|
57
|
+
/**
|
|
58
|
+
* User preference key to use when setting the preference when the notification is marked as read
|
|
59
|
+
*/
|
|
60
|
+
key: string;
|
|
61
|
+
/**
|
|
62
|
+
* User preference value to use when setting the preference when the notification is marked as read
|
|
63
|
+
*/
|
|
64
|
+
value: string;
|
|
65
|
+
/**
|
|
66
|
+
* User preference value to use when setting the preference when the notification is marked as unread - defaults to empty string
|
|
67
|
+
*/
|
|
68
|
+
unsetValue?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Configuration object for the Notification Center
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
export interface NotificationConfig {
|
|
76
|
+
/**
|
|
77
|
+
* - **{@link NotificationAction}**
|
|
78
|
+
*
|
|
79
|
+
* Primary action to be shown in the notification
|
|
80
|
+
*/
|
|
81
|
+
primaryAction?: NotificationAction;
|
|
82
|
+
/**
|
|
83
|
+
* - **{@link NotificationAction}**
|
|
84
|
+
*
|
|
85
|
+
* Secondary to be shown in the notification
|
|
86
|
+
*/
|
|
87
|
+
secondaryAction?: NotificationAction;
|
|
88
|
+
/**
|
|
89
|
+
* Unique ID for the notification
|
|
90
|
+
*/
|
|
91
|
+
id?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Progress (0-100) for notifications of type `Task`
|
|
94
|
+
*/
|
|
95
|
+
progress?: number;
|
|
96
|
+
/**
|
|
97
|
+
* - **{@link NotificationPreference}**
|
|
98
|
+
*
|
|
99
|
+
* User Preference tied to the notification (the preference will be updated when the notification is marked read)
|
|
100
|
+
*/
|
|
101
|
+
preference?: NotificationPreference;
|
|
102
|
+
}
|
|
37
103
|
|
|
38
104
|
/**
|
|
39
105
|
* Type for Encrypted Notification data that is stored in local storage
|
|
@@ -96,3 +162,48 @@ export interface NotificationHandler {
|
|
|
96
162
|
*/
|
|
97
163
|
onReadUpdated(notification: Notification, read: boolean): void;
|
|
98
164
|
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* API for notifications in the Rancher UI Notification Center
|
|
168
|
+
* * 
|
|
169
|
+
*/
|
|
170
|
+
export interface NotificationApi {
|
|
171
|
+
/**
|
|
172
|
+
* Sends a notification to the Rancher UI Notification Center
|
|
173
|
+
*
|
|
174
|
+
* Example:
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { NotificationLevel } from '@shell/types/notifications';
|
|
177
|
+
*
|
|
178
|
+
* this.$shell.notification.send(NotificationLevel.Success, 'Some notification title', 'Hello world! Success!', {})
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* For usage with the Composition API check usage guide [here](../../shell-api#using-composition-api-in-vue).
|
|
182
|
+
*
|
|
183
|
+
* @param level The `level` specifies the importance of the notification and determines the icon that is shown in the notification
|
|
184
|
+
* @param title The notification title
|
|
185
|
+
* @param message The notification message to be displayed
|
|
186
|
+
* @param config Notifications configuration object
|
|
187
|
+
*
|
|
188
|
+
* @returns notification ID
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
send(level: NotificationLevel | NotificationLevel, title: string, message?:string, config?: NotificationConfig): Promise<string>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Update notification progress (Only valid for notifications of type `Task`)
|
|
195
|
+
*
|
|
196
|
+
* Example:
|
|
197
|
+
* ```ts
|
|
198
|
+
* this.$shell.notification.updateProgress('some-notification-id', 80)
|
|
199
|
+
* ```
|
|
200
|
+
*
|
|
201
|
+
* For usage with the Composition API check usage guide [here](../../shell-api#using-composition-api-in-vue).
|
|
202
|
+
*
|
|
203
|
+
* @param notificationId Unique ID for the notification
|
|
204
|
+
* @param progress Progress (0-100) for notifications of type `Task`
|
|
205
|
+
*
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
updateProgress(notificationId: string, progress: number): void;
|
|
209
|
+
}
|
package/types/rancher/index.d.ts
CHANGED
|
@@ -8,3 +8,12 @@ declare module '@shell/store/type-map' {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
declare module '@shell/plugins/dashboard-store';
|
|
11
|
+
|
|
12
|
+
declare module '@shell/config/query-params' {
|
|
13
|
+
export const _DETAIL: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '@shell/config/version' {
|
|
17
|
+
export const CURRENT_RANCHER_VERSION: string;
|
|
18
|
+
export function getVersionData(): any;
|
|
19
|
+
}
|
package/types/shell/index.d.ts
CHANGED
|
@@ -3255,6 +3255,7 @@ export default class Resource {
|
|
|
3255
3255
|
get $state(): any;
|
|
3256
3256
|
get $rootState(): any;
|
|
3257
3257
|
get $plugin(): any;
|
|
3258
|
+
get $extension(): any;
|
|
3258
3259
|
get customValidationRules(): any[];
|
|
3259
3260
|
get _key(): any;
|
|
3260
3261
|
get schema(): any;
|
|
@@ -4048,7 +4049,7 @@ export function filterHiddenLocalCluster(mgmtClusters: any, store: any): any;
|
|
|
4048
4049
|
export function abbreviateClusterName(input: string): string;
|
|
4049
4050
|
export function labelForAddon(store: any, name: any, configuration?: boolean): any;
|
|
4050
4051
|
export function filterOutDeprecatedPatchVersions(allVersions: any, currentVersion: any): any;
|
|
4051
|
-
export function getAllOptionsAfterCurrentVersion(store: any, versions: any, currentVersion: any, defaultVersion: any): any;
|
|
4052
|
+
export function getAllOptionsAfterCurrentVersion(store: any, versions: any, currentVersion: any, defaultVersion: any, manual?: boolean): any;
|
|
4052
4053
|
export function initSchedulingCustomization(value: any, features: any, store: any, mode: any): Promise<{
|
|
4053
4054
|
clusterAgentDefaultPC: any;
|
|
4054
4055
|
clusterAgentDefaultPDB: any;
|
|
@@ -4796,6 +4797,20 @@ export function queryParamsFor(current: any, qp: any, defaults?: {}): any;
|
|
|
4796
4797
|
export function getClusterFromRoute(to: any): any;
|
|
4797
4798
|
export function getProductFromRoute(to: any): any;
|
|
4798
4799
|
export function findMeta(route: any, key: any): any;
|
|
4800
|
+
/**
|
|
4801
|
+
* Find a route definition given a routeName
|
|
4802
|
+
* @param {*} router VueRouter instance
|
|
4803
|
+
* @param {*} routeName the name we want to look up
|
|
4804
|
+
* @returns the route definition or undefined if it wasn't found
|
|
4805
|
+
*/
|
|
4806
|
+
export function findRouteDefinitionByName(router: any, routeName: any): any;
|
|
4807
|
+
/**
|
|
4808
|
+
* Looks for the route definition and then ensures there's only valid params
|
|
4809
|
+
* @param {*} router VueRouter instance
|
|
4810
|
+
* @param {*} routeRecord an object conforming to the Route Record interface
|
|
4811
|
+
* @returns the passed in routeLocation with only valid params.
|
|
4812
|
+
*/
|
|
4813
|
+
export function filterLocationValidParams(router: any, routeRecord: any): any;
|
|
4799
4814
|
export function getPackageFromRoute(route: any): any;
|
|
4800
4815
|
export function getResourceFromRoute(to: any): any;
|
|
4801
4816
|
export function routeMatched(to: any, fn: any): boolean;
|
|
@@ -48,11 +48,6 @@ export interface ActionFindAllArgs extends ActionCoreFindArgs {
|
|
|
48
48
|
depaginate?: boolean,
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export interface ActionFindPageTransientResult<T> {
|
|
52
|
-
pagination: StorePagination,
|
|
53
|
-
data: T[],
|
|
54
|
-
}
|
|
55
|
-
|
|
56
51
|
/**
|
|
57
52
|
* Args used for findPage action
|
|
58
53
|
*/
|
|
@@ -81,19 +76,46 @@ export interface ActionFindPageArgs extends ActionCoreFindArgs {
|
|
|
81
76
|
* If true don't persist the http response to the store, just pass it back
|
|
82
77
|
*/
|
|
83
78
|
transient?: boolean,
|
|
79
|
+
/**
|
|
80
|
+
* The target minimum revision for the resource.
|
|
81
|
+
*
|
|
82
|
+
* If this is higher than the latest revision known to rancher then an error will be returned
|
|
83
|
+
*/
|
|
84
|
+
revision?: string
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Response to a transient (not stored in cache) findPage action
|
|
89
|
+
*/
|
|
90
|
+
export type ActionFindPageTransientResponse<T = any> = {
|
|
87
91
|
data: T[],
|
|
88
92
|
pagination?: StorePagination
|
|
89
|
-
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Response to the findPage action
|
|
97
|
+
*
|
|
98
|
+
* If the request was transient (not stored in cache) this will be an object contain all the details of the request
|
|
99
|
+
*
|
|
100
|
+
* If the request was not transient this will just be the array of resources
|
|
101
|
+
*/
|
|
102
|
+
export type ActionFindPageResponse<T = any> = ActionFindPageTransientResponse | T[];
|
|
90
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Args used for findPage action
|
|
106
|
+
*/
|
|
91
107
|
export interface ActionFindMatchingArgs extends ActionCoreFindArgs {
|
|
92
108
|
labelSelector: KubeLabelSelector,
|
|
93
109
|
namespaced?: string,
|
|
94
110
|
depaginate?: boolean
|
|
95
111
|
}
|
|
96
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Response to the findMatching action
|
|
115
|
+
*/
|
|
97
116
|
export type ActionFindMatchingResponse<T = any> = ActionFindPageResponse<T>
|
|
98
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Args used for findLabelSelector action
|
|
120
|
+
*/
|
|
99
121
|
export type ActionFindLabelSelectorArgs = ActionFindPageArgs | ActionFindMatchingArgs;
|
package/types/vue-shim.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import type ShellApi from '@shell/plugins/internal-api/shell/shell.api';
|
|
3
2
|
import { VuexStore } from '@shell/types/store/vuex';
|
|
4
3
|
|
|
4
|
+
// Include the types for the APIs
|
|
5
|
+
/// <reference path="../apis/vue-shim.d.ts" />
|
|
6
|
+
|
|
5
7
|
export {};
|
|
6
8
|
|
|
7
9
|
declare module 'vue' {
|
|
@@ -14,7 +16,6 @@ declare module 'vue' {
|
|
|
14
16
|
(key: string, args?: Record<string, any>, raw?: boolean): string;
|
|
15
17
|
(options: { k: string; raw?: boolean; tag?: string | Record<string, any>; escapehtml?: boolean }): string;
|
|
16
18
|
},
|
|
17
|
-
$store: VuexStore
|
|
18
|
-
$shell: ShellApi,
|
|
19
|
+
$store: VuexStore
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
+
}
|