@rancher/shell 0.3.23 → 0.3.25
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/_variables.scss +1 -0
- package/assets/styles/themes/_dark.scss +1 -0
- package/assets/styles/themes/_light.scss +6 -5
- package/assets/translations/en-us.yaml +44 -17
- package/assets/translations/zh-hans.yaml +2 -2
- package/components/ClusterIconMenu.vue +143 -0
- package/components/CruResource.vue +7 -1
- package/components/ExplorerProjectsNamespaces.vue +11 -1
- package/components/FixedBanner.vue +17 -1
- package/components/Loading.vue +1 -1
- package/components/Markdown.vue +1 -1
- package/components/Questions/__tests__/Yaml.test.ts +3 -2
- package/components/SideNav.vue +1 -1
- package/components/SortableTable/index.vue +3 -2
- package/components/auth/RoleDetailEdit.vue +15 -2
- package/components/auth/login/saml.vue +12 -1
- package/components/form/LabeledSelect.vue +12 -5
- package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
- package/components/form/Members/MembershipEditor.vue +6 -1
- package/components/form/SelectOrCreateAuthSecret.vue +7 -0
- package/components/form/__tests__/KeyValue.test.ts +6 -3
- package/components/form/__tests__/LabeledSelect.test.ts +18 -0
- package/components/formatter/PodsUsage.vue +11 -36
- package/components/formatter/PrincipalGroupBindings.vue +8 -5
- package/components/formatter/__tests__/PodsUsage.test.ts +36 -19
- package/components/nav/Group.vue +62 -34
- package/components/nav/Header.vue +13 -6
- package/components/nav/Pinned.vue +47 -0
- package/components/nav/TopLevelMenu.vue +673 -325
- package/components/nav/Type.vue +88 -8
- package/config/home-links.js +1 -1
- package/config/product/istio.js +15 -5
- package/config/router.js +3 -9
- package/config/table-headers.js +5 -6
- package/config/uiplugins.js +1 -0
- package/core/plugin-helpers.js +3 -0
- package/core/types.ts +6 -1
- package/creators/app/files/.vscode/settings.json +0 -1
- package/creators/pkg/init +2 -2
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +118 -0
- package/detail/autoscaling.horizontalpodautoscaler/index.vue +4 -4
- package/detail/provisioning.cattle.io.cluster.vue +7 -5
- package/edit/__tests__/management.cattle.io.clusterroletemplatebinding.test.ts +58 -0
- package/edit/__tests__/namespace.test.ts +5 -3
- package/edit/fleet.cattle.io.gitrepo.vue +43 -15
- package/edit/logging.banzaicloud.io.output/index.vue +7 -0
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +3 -11
- package/edit/namespace.vue +8 -4
- package/edit/provisioning.cattle.io.cluster/Basics.vue +662 -0
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +9 -8
- package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +13 -8
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -2
- package/edit/provisioning.cattle.io.cluster/MemberRoles.vue +40 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +71 -23
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +52 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +65 -142
- package/edit/provisioning.cattle.io.cluster/rke2.vue +253 -582
- package/edit/workload/storage/ContainerMountPaths.vue +7 -5
- package/edit/workload/storage/__tests__/Storage.test.ts +2 -2
- package/edit/workload/storage/persistentVolumeClaim/__tests__/persistentvolumeclaim.test.ts +36 -0
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +15 -7
- package/initialize/App.js +2 -0
- package/initialize/client.js +63 -51
- package/initialize/index.js +7 -5
- package/layouts/default.vue +10 -2
- package/layouts/home.vue +6 -2
- package/layouts/plain.vue +9 -2
- package/list/fleet.cattle.io.cluster.vue +2 -2
- package/list/management.cattle.io.feature.vue +1 -1
- package/machine-config/amazonec2.vue +1 -0
- package/machine-config/vmwarevsphere.vue +48 -7
- package/mixins/brand.js +0 -8
- package/mixins/child-hook.js +2 -2
- package/mixins/create-edit-view/impl.js +3 -3
- package/mixins/fetch.client.js +3 -3
- package/models/__tests__/management.cattle.io.node.ts +96 -0
- package/models/__tests__/node.ts +74 -0
- package/models/cluster/node.js +6 -5
- package/models/cluster.x-k8s.io.machinedeployment.js +2 -2
- package/models/management.cattle.io.cluster.js +22 -1
- package/models/management.cattle.io.clusterroletemplatebinding.js +3 -3
- package/models/management.cattle.io.globalrole.js +17 -2
- package/models/management.cattle.io.node.js +6 -4
- package/models/management.cattle.io.projectroletemplatebinding.js +3 -3
- package/models/management.cattle.io.roletemplate.js +17 -2
- package/package.json +2 -6
- package/pages/__tests__/prefs.test.ts +1 -1
- package/pages/about.vue +2 -0
- package/pages/auth/setup.vue +5 -4
- package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -0
- package/pages/c/_cluster/monitoring/index.vue +8 -3
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +9 -66
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +182 -0
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +15 -32
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +8 -46
- package/pages/c/_cluster/uiplugins/index.vue +64 -64
- package/pages/diagnostic.vue +0 -39
- package/pages/home.vue +1 -1
- package/pages/prefs.vue +3 -13
- package/plugins/dashboard-store/normalize.js +4 -4
- package/plugins/dashboard-store/resource-class.js +1 -1
- package/plugins/int-number.js +5 -2
- package/plugins/positive-int-number.js +19 -0
- package/plugins/steve/__tests__/getters.spec.ts +15 -0
- package/plugins/steve/getters.js +22 -10
- package/public/index.html +4 -2
- package/rancher-components/BadgeState/BadgeState.vue +5 -1
- package/rancher-components/Banner/Banner.test.ts +51 -1
- package/rancher-components/Banner/Banner.vue +134 -53
- package/rancher-components/Card/Card.test.ts +37 -0
- package/rancher-components/Card/Card.vue +24 -7
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +20 -29
- package/rancher-components/Form/Checkbox/Checkbox.vue +45 -20
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +2 -8
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +22 -10
- package/rancher-components/Form/Radio/RadioButton.test.ts +31 -0
- package/rancher-components/Form/Radio/RadioButton.vue +30 -13
- package/rancher-components/Form/Radio/RadioGroup.vue +26 -7
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -6
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +25 -38
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +23 -11
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +19 -5
- package/rancher-components/StringList/StringList.test.ts +453 -49
- package/rancher-components/StringList/StringList.vue +92 -58
- package/scripts/extension/parse-tag-name +0 -0
- package/store/index.js +4 -0
- package/store/prefs.js +4 -4
- package/store/type-map.js +2 -16
- package/types/shell/index.d.ts +26 -14
- package/utils/__tests__/cluster.test.ts +55 -0
- package/utils/__tests__/object.test.ts +21 -2
- package/utils/__tests__/sort.test.ts +61 -0
- package/utils/cluster.js +47 -1
- package/utils/object.js +12 -5
- package/utils/string.js +12 -0
- package/utils/validators/formRules/__tests__/index.test.ts +13 -1
- package/utils/validators/formRules/index.ts +4 -0
- package/utils/validators/role-template.js +9 -1
- package/utils/version.js +1 -1
- package/vue.config.js +1 -4
- package/yarn-error.log +200 -0
- package/content/docs/en-us/getting-started.md +0 -224
- package/content/docs/en-us/whats-new.md +0 -29
- package/content/docs/zh-hans/getting-started.md +0 -224
- package/content/docs/zh-hans/whats-new.md +0 -28
- package/pages/docs/_doc.vue +0 -345
- package/pages/docs/toc.js +0 -27
- package/plugins/console.js +0 -34
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { shallowMount, Wrapper } from '@vue/test-utils';
|
|
2
2
|
import { ToggleSwitch } from './index';
|
|
3
3
|
|
|
4
|
-
describe('
|
|
4
|
+
describe('toggleSwitch.vue', () => {
|
|
5
5
|
it('renders falsy by default', () => {
|
|
6
6
|
const wrapper = shallowMount(ToggleSwitch);
|
|
7
7
|
|
|
8
|
-
const toggleInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement
|
|
8
|
+
const toggleInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
|
|
9
9
|
|
|
10
10
|
expect(toggleInput.checked).toBeFalsy();
|
|
11
11
|
});
|
|
@@ -13,71 +13,58 @@ describe('ToggleSwitch.vue', () => {
|
|
|
13
13
|
it('renders a true value', () => {
|
|
14
14
|
const wrapper = shallowMount(
|
|
15
15
|
ToggleSwitch,
|
|
16
|
-
{
|
|
17
|
-
propsData: {
|
|
18
|
-
value: true
|
|
19
|
-
}
|
|
20
|
-
});
|
|
16
|
+
{ propsData: { value: true } });
|
|
21
17
|
|
|
22
|
-
const toggleInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement
|
|
18
|
+
const toggleInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
|
|
23
19
|
|
|
24
20
|
expect(toggleInput.checked).toBe(true);
|
|
25
21
|
});
|
|
26
22
|
|
|
27
|
-
it('updates from falsy to truthy when props change', async
|
|
23
|
+
it('updates from falsy to truthy when props change', async() => {
|
|
28
24
|
const wrapper = shallowMount(ToggleSwitch);
|
|
29
|
-
|
|
30
|
-
const toggleInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement
|
|
25
|
+
|
|
26
|
+
const toggleInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
|
|
31
27
|
|
|
32
28
|
expect(toggleInput.checked).toBe(false);
|
|
33
29
|
|
|
34
30
|
await wrapper.setProps({ value: true });
|
|
35
|
-
|
|
31
|
+
|
|
36
32
|
expect(toggleInput.checked).toBe(true);
|
|
37
33
|
});
|
|
38
34
|
|
|
39
|
-
it('emits an input event with a true value', async
|
|
40
|
-
const wrapper = shallowMount(ToggleSwitch);
|
|
35
|
+
it('emits an input event with a true value', async() => {
|
|
36
|
+
const wrapper: Wrapper<InstanceType<typeof ToggleSwitch>> = shallowMount(ToggleSwitch);
|
|
41
37
|
|
|
42
|
-
|
|
38
|
+
wrapper.vm.toggle(true);
|
|
43
39
|
|
|
44
40
|
await wrapper.vm.$nextTick();
|
|
45
41
|
|
|
46
42
|
expect(wrapper.emitted().input?.length).toBe(1);
|
|
47
43
|
expect(wrapper.emitted().input?.[0][0]).toBe(true);
|
|
48
|
-
|
|
49
44
|
});
|
|
50
45
|
|
|
51
|
-
it('emits an input event with a false value', async
|
|
52
|
-
const wrapper = shallowMount(
|
|
46
|
+
it('emits an input event with a false value', async() => {
|
|
47
|
+
const wrapper: Wrapper<InstanceType<typeof ToggleSwitch>> = shallowMount(
|
|
53
48
|
ToggleSwitch,
|
|
54
|
-
{
|
|
55
|
-
propsData: {
|
|
56
|
-
value: true
|
|
57
|
-
}
|
|
58
|
-
}
|
|
49
|
+
{ propsData: { value: true } }
|
|
59
50
|
);
|
|
60
51
|
|
|
61
|
-
|
|
52
|
+
wrapper.vm.toggle(false);
|
|
62
53
|
|
|
63
54
|
await wrapper.vm.$nextTick();
|
|
64
55
|
|
|
65
56
|
expect(wrapper.emitted().input?.length).toBe(1);
|
|
66
57
|
expect(wrapper.emitted().input?.[0][0]).toBe(false);
|
|
67
|
-
})
|
|
58
|
+
});
|
|
68
59
|
|
|
69
|
-
it('emits an input event with a custom onValue', async
|
|
60
|
+
it('emits an input event with a custom onValue', async() => {
|
|
70
61
|
const onValue = 'THE TRUTH';
|
|
71
62
|
|
|
72
|
-
const wrapper = shallowMount(
|
|
63
|
+
const wrapper: Wrapper<InstanceType<typeof ToggleSwitch>> = shallowMount(
|
|
73
64
|
ToggleSwitch,
|
|
74
|
-
{
|
|
75
|
-
propsData: {
|
|
76
|
-
onValue,
|
|
77
|
-
}
|
|
78
|
-
});
|
|
65
|
+
{ propsData: { onValue } });
|
|
79
66
|
|
|
80
|
-
|
|
67
|
+
wrapper.vm.toggle(true);
|
|
81
68
|
|
|
82
69
|
await wrapper.vm.$nextTick();
|
|
83
70
|
|
|
@@ -85,10 +72,10 @@ describe('ToggleSwitch.vue', () => {
|
|
|
85
72
|
expect(wrapper.emitted().input?.[0][0]).toBe(onValue);
|
|
86
73
|
});
|
|
87
74
|
|
|
88
|
-
it('emits an input event with a custom offValue', async
|
|
75
|
+
it('emits an input event with a custom offValue', async() => {
|
|
89
76
|
const offValue = 'NOT THE TRUTH';
|
|
90
77
|
|
|
91
|
-
const wrapper = shallowMount(
|
|
78
|
+
const wrapper: Wrapper<InstanceType<typeof ToggleSwitch>> = shallowMount(
|
|
92
79
|
ToggleSwitch,
|
|
93
80
|
{
|
|
94
81
|
propsData: {
|
|
@@ -97,11 +84,11 @@ describe('ToggleSwitch.vue', () => {
|
|
|
97
84
|
}
|
|
98
85
|
});
|
|
99
86
|
|
|
100
|
-
|
|
87
|
+
wrapper.vm.toggle(false);
|
|
101
88
|
|
|
102
89
|
await wrapper.vm.$nextTick();
|
|
103
90
|
|
|
104
91
|
expect(wrapper.emitted().input?.length).toBe(1);
|
|
105
92
|
expect(wrapper.emitted().input?.[0][0]).toBe(offValue);
|
|
106
|
-
})
|
|
93
|
+
});
|
|
107
94
|
});
|
|
@@ -31,13 +31,6 @@ export default Vue.extend({
|
|
|
31
31
|
return { state: false as boolean | string | number };
|
|
32
32
|
},
|
|
33
33
|
|
|
34
|
-
methods: {
|
|
35
|
-
toggle(neu: boolean | string | number) {
|
|
36
|
-
this.state = neu === null ? !this.state : neu;
|
|
37
|
-
this.$emit('input', this.state ? this.onValue : this.offValue);
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
|
|
41
34
|
watch: {
|
|
42
35
|
value: {
|
|
43
36
|
handler() {
|
|
@@ -45,18 +38,37 @@ export default Vue.extend({
|
|
|
45
38
|
},
|
|
46
39
|
immediate: true
|
|
47
40
|
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
methods: {
|
|
44
|
+
toggle(neu: boolean | string | number) {
|
|
45
|
+
this.state = neu === null ? !this.state : neu;
|
|
46
|
+
this.$emit('input', this.state ? this.onValue : this.offValue);
|
|
47
|
+
}
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
53
|
<span class="toggle-container">
|
|
54
|
-
<span
|
|
54
|
+
<span
|
|
55
|
+
class="label no-select hand"
|
|
56
|
+
:class="{ active: !state}"
|
|
57
|
+
@click="toggle(false)"
|
|
58
|
+
>{{ offLabel }}</span>
|
|
55
59
|
<label class="switch hand">
|
|
56
|
-
<input
|
|
57
|
-
|
|
60
|
+
<input
|
|
61
|
+
type="checkbox"
|
|
62
|
+
:checked="state"
|
|
63
|
+
@input="toggle(null)"
|
|
64
|
+
>
|
|
65
|
+
<span class="slider round" />
|
|
58
66
|
</label>
|
|
59
|
-
<span
|
|
67
|
+
<span
|
|
68
|
+
class="label no-select hand"
|
|
69
|
+
:class="{ active: state}"
|
|
70
|
+
@click="toggle(true)"
|
|
71
|
+
>{{ onLabel }}</span>
|
|
60
72
|
</span>
|
|
61
73
|
</template>
|
|
62
74
|
|
|
@@ -37,13 +37,28 @@ export default Vue.extend({
|
|
|
37
37
|
</script>
|
|
38
38
|
|
|
39
39
|
<template>
|
|
40
|
-
<div
|
|
40
|
+
<div
|
|
41
|
+
ref="container"
|
|
42
|
+
class="labeled-tooltip"
|
|
43
|
+
:class="{[status]: true, hoverable: hover}"
|
|
44
|
+
>
|
|
41
45
|
<template v-if="hover">
|
|
42
|
-
<i
|
|
46
|
+
<i
|
|
47
|
+
v-clean-tooltip="value.content ? { ...{content: value.content, classes: [`tooltip-${status}`]}, ...value } : value"
|
|
48
|
+
:class="{'hover':!value, [iconClass]: true}"
|
|
49
|
+
class="icon status-icon"
|
|
50
|
+
/>
|
|
43
51
|
</template>
|
|
44
52
|
<template v-else>
|
|
45
|
-
<i
|
|
46
|
-
|
|
53
|
+
<i
|
|
54
|
+
:class="{'hover':!value}"
|
|
55
|
+
class="icon status-icon"
|
|
56
|
+
/>
|
|
57
|
+
<div
|
|
58
|
+
v-if="value"
|
|
59
|
+
class="tooltip"
|
|
60
|
+
x-placement="bottom"
|
|
61
|
+
>
|
|
47
62
|
<div class="tooltip-arrow" />
|
|
48
63
|
<div class="tooltip-inner">
|
|
49
64
|
{{ value }}
|
|
@@ -69,7 +84,6 @@ export default Vue.extend({
|
|
|
69
84
|
position: absolute;
|
|
70
85
|
right: 30px;
|
|
71
86
|
top: $input-padding-lg;
|
|
72
|
-
font-size: 20px;
|
|
73
87
|
z-index: z-index(hoverOverContent);
|
|
74
88
|
}
|
|
75
89
|
|