@rancher/shell 3.0.8-rc.10 → 3.0.8-rc.13
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 +90 -0
- package/apis/intf/shell.ts +36 -0
- package/apis/intf/slide-in.ts +98 -0
- package/apis/intf/system.ts +34 -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 +54 -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 +33 -0
- package/apis/shell/system.ts +65 -0
- package/apis/vue-shim.d.ts +11 -0
- 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/ModalManager.vue +11 -1
- package/components/ResourceDetail/index.vue +3 -0
- package/components/ResourceTable.vue +54 -21
- package/components/SlideInPanelManager.vue +16 -11
- package/components/SortableTable/index.vue +20 -2
- package/components/Tabbed/index.vue +37 -2
- package/components/auth/login/ldap.vue +3 -3
- package/components/form/NodeScheduling.vue +2 -2
- package/components/form/ResourceTabs/composable.ts +2 -2
- package/components/nav/Group.vue +9 -2
- package/components/nav/Header.vue +1 -1
- package/components/nav/Type.vue +8 -3
- 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/config/router/navigation-guards/clusters.js +3 -3
- package/config/router/navigation-guards/products.js +1 -1
- 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/provisioning.cattle.io.cluster.vue +8 -6
- package/dialog/DeveloperLoadExtensionDialog.vue +1 -1
- package/dialog/SearchDialog.vue +1 -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/workload/index.vue +1 -1
- package/initialize/install-plugins.js +4 -5
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/provisioning.cattle.io.cluster.js +1 -1
- package/package.json +3 -3
- 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/install.vue +33 -0
- package/pages/c/_cluster/fleet/index.vue +4 -7
- package/pkg/auto-import.js +3 -3
- package/pkg/dynamic-importer.lib.js +1 -1
- package/pkg/import.js +1 -1
- package/plugins/dashboard-store/getters.js +1 -1
- package/plugins/dashboard-store/model-loader.js +1 -1
- package/plugins/dashboard-store/resource-class.js +6 -2
- package/plugins/plugin.js +2 -2
- package/plugins/steve/__tests__/steve-pagination-utils.test.ts +301 -128
- package/plugins/steve/steve-class.js +1 -1
- package/plugins/steve/steve-pagination-utils.ts +108 -43
- 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 +1 -1
- package/store/i18n.js +3 -3
- package/store/index.js +5 -3
- package/store/notifications.ts +2 -0
- package/store/type-map.js +14 -5
- 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 +1 -0
- package/types/vue-shim.d.ts +5 -4
- package/utils/pagination-utils.ts +2 -2
- package/utils/pagination-wrapper.ts +1 -1
- 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/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
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { GrowlConfig } from '@shell/types/internal-api/shell/growl';
|
|
2
|
-
import { ModalConfig } from '@shell/types/internal-api/shell/modal';
|
|
3
|
-
import { SlideInConfig } from '@shell/types/internal-api/shell/slideIn';
|
|
4
|
-
|
|
5
|
-
import { BaseApi } from '@shell/plugins/internal-api/shared/base-api';
|
|
6
|
-
|
|
7
|
-
export default class ShellApi extends BaseApi {
|
|
8
|
-
static apiName() {
|
|
9
|
-
return 'shell';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Dispatches a growl notification.
|
|
14
|
-
*
|
|
15
|
-
* @param config - Configuration for the growl notification.
|
|
16
|
-
* - If `message` is a string, it is treated as the main content of the notification.
|
|
17
|
-
* - If `message` is a `DetailedMessage` object, `title` and `description` are extracted.
|
|
18
|
-
*
|
|
19
|
-
* Example:
|
|
20
|
-
* ```ts
|
|
21
|
-
* this.$shell.growl({ message: 'Operation successful!', type: 'success' });
|
|
22
|
-
* this.$shell.growl({ message: { title: 'Warning', description: 'Check your input.' }, type: 'warning' });
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
protected growl(config: GrowlConfig): void {
|
|
26
|
-
const { type = 'error', timeout = 5000 } = config;
|
|
27
|
-
|
|
28
|
-
let title = '';
|
|
29
|
-
let description = '';
|
|
30
|
-
|
|
31
|
-
if (typeof config.message === 'string') {
|
|
32
|
-
description = config.message;
|
|
33
|
-
} else {
|
|
34
|
-
title = config.message.title || '';
|
|
35
|
-
description = config.message.description;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
this.$store.dispatch(
|
|
39
|
-
`growl/${ type }`,
|
|
40
|
-
{
|
|
41
|
-
title,
|
|
42
|
-
message: description,
|
|
43
|
-
timeout,
|
|
44
|
-
},
|
|
45
|
-
{ root: true }
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Opens a modal by committing to the Vuex store.
|
|
51
|
-
*
|
|
52
|
-
* This method updates the store's `modal` module to show a modal with the
|
|
53
|
-
* specified configuration. The modal is rendered using the `ModalManager` component,
|
|
54
|
-
* and its content is dynamically loaded based on the `component` field in the configuration.
|
|
55
|
-
*
|
|
56
|
-
* @param config A `ModalConfig` object defining the modal’s content and behavior.
|
|
57
|
-
*
|
|
58
|
-
* Example:
|
|
59
|
-
* ```ts
|
|
60
|
-
* this.$shell.modal({
|
|
61
|
-
* component: MyCustomModal,
|
|
62
|
-
* componentProps: { title: 'Hello Modal' },
|
|
63
|
-
* resources: [someResource],
|
|
64
|
-
* modalWidth: '800px',
|
|
65
|
-
* closeOnClickOutside: false
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
protected modal(config: ModalConfig): void {
|
|
70
|
-
this.$store.commit('modal/openModal', {
|
|
71
|
-
component: config.component,
|
|
72
|
-
componentProps: config.componentProps || {},
|
|
73
|
-
resources: config.resources || [],
|
|
74
|
-
modalWidth: config.modalWidth || '600px',
|
|
75
|
-
closeOnClickOutside: config.closeOnClickOutside ?? true,
|
|
76
|
-
// modalSticky: config.modalSticky ?? false // Not implemented yet
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Opens the slide-in panel with the specified component and props.
|
|
82
|
-
*
|
|
83
|
-
* This method commits the `open` mutation to the `slideInPanel` Vuex module,
|
|
84
|
-
* which sets the current component to be rendered and its associated props.
|
|
85
|
-
* The slide-in panel becomes visible after the mutation.
|
|
86
|
-
*
|
|
87
|
-
* @param config - The configuration object for the slide-in panel.
|
|
88
|
-
*
|
|
89
|
-
* Example Usage:
|
|
90
|
-
* ```ts
|
|
91
|
-
* import MyComponent from '@/components/MyComponent.vue';
|
|
92
|
-
*
|
|
93
|
-
* this.$shell.slideInPanel({
|
|
94
|
-
* component: MyComponent,
|
|
95
|
-
* componentProps: { foo: 'bar' }
|
|
96
|
-
* });
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* @param config.component - A Vue component (imported SFC, functional component, etc.) to be rendered in the panel.
|
|
100
|
-
* @param config.componentProps - (Optional) Props to pass to the component. These should align with the component's defined props.
|
|
101
|
-
*/
|
|
102
|
-
protected slideInPanel(config: SlideInConfig): void {
|
|
103
|
-
this.$store.commit('slideInPanel/open', {
|
|
104
|
-
component: config.component,
|
|
105
|
-
componentProps: config.componentProps || {}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface DetailedMessage {
|
|
2
|
-
title?: string;
|
|
3
|
-
description: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface GrowlConfig {
|
|
7
|
-
/**
|
|
8
|
-
* The content of the notification message.
|
|
9
|
-
* Either a simple string or an object with `title` and `description` for detailed notifications.
|
|
10
|
-
*/
|
|
11
|
-
message: string | DetailedMessage;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Optional type of the growl notification.
|
|
15
|
-
* Determines the visual style of the notification.
|
|
16
|
-
* Defaults to `'error'` if not provided.
|
|
17
|
-
*/
|
|
18
|
-
type?: 'success' | 'info' | 'warning' | 'error';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Optional duration (in milliseconds) for which the notification should be displayed.
|
|
22
|
-
* Defaults to `5000` milliseconds. A value of `0` keeps the notification indefinitely.
|
|
23
|
-
*/
|
|
24
|
-
timeout?: number;
|
|
25
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Component } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Configuration object for opening a slide-in panel.
|
|
5
|
-
*
|
|
6
|
-
* @property component - The Vue component to render in the slide-in panel.
|
|
7
|
-
* This should be a valid Vue Component, such as an imported SFC or functional component.
|
|
8
|
-
*
|
|
9
|
-
* @property componentProps - (Optional) An object containing props to be passed to the component rendered in the slide-in panel.
|
|
10
|
-
* Keys should match the props defined in the provided component.
|
|
11
|
-
*/
|
|
12
|
-
export interface SlideInConfig {
|
|
13
|
-
component: Component | null;
|
|
14
|
-
componentProps?: Record<string, any>;
|
|
15
|
-
}
|