@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.
Files changed (149) hide show
  1. package/assets/styles/base/_variables.scss +1 -0
  2. package/assets/styles/themes/_dark.scss +1 -0
  3. package/assets/styles/themes/_light.scss +6 -5
  4. package/assets/translations/en-us.yaml +44 -17
  5. package/assets/translations/zh-hans.yaml +2 -2
  6. package/components/ClusterIconMenu.vue +143 -0
  7. package/components/CruResource.vue +7 -1
  8. package/components/ExplorerProjectsNamespaces.vue +11 -1
  9. package/components/FixedBanner.vue +17 -1
  10. package/components/Loading.vue +1 -1
  11. package/components/Markdown.vue +1 -1
  12. package/components/Questions/__tests__/Yaml.test.ts +3 -2
  13. package/components/SideNav.vue +1 -1
  14. package/components/SortableTable/index.vue +3 -2
  15. package/components/auth/RoleDetailEdit.vue +15 -2
  16. package/components/auth/login/saml.vue +12 -1
  17. package/components/form/LabeledSelect.vue +12 -5
  18. package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
  19. package/components/form/Members/MembershipEditor.vue +6 -1
  20. package/components/form/SelectOrCreateAuthSecret.vue +7 -0
  21. package/components/form/__tests__/KeyValue.test.ts +6 -3
  22. package/components/form/__tests__/LabeledSelect.test.ts +18 -0
  23. package/components/formatter/PodsUsage.vue +11 -36
  24. package/components/formatter/PrincipalGroupBindings.vue +8 -5
  25. package/components/formatter/__tests__/PodsUsage.test.ts +36 -19
  26. package/components/nav/Group.vue +62 -34
  27. package/components/nav/Header.vue +13 -6
  28. package/components/nav/Pinned.vue +47 -0
  29. package/components/nav/TopLevelMenu.vue +673 -325
  30. package/components/nav/Type.vue +88 -8
  31. package/config/home-links.js +1 -1
  32. package/config/product/istio.js +15 -5
  33. package/config/router.js +3 -9
  34. package/config/table-headers.js +5 -6
  35. package/config/uiplugins.js +1 -0
  36. package/core/plugin-helpers.js +3 -0
  37. package/core/types.ts +6 -1
  38. package/creators/app/files/.vscode/settings.json +0 -1
  39. package/creators/pkg/init +2 -2
  40. package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +118 -0
  41. package/detail/autoscaling.horizontalpodautoscaler/index.vue +4 -4
  42. package/detail/provisioning.cattle.io.cluster.vue +7 -5
  43. package/edit/__tests__/management.cattle.io.clusterroletemplatebinding.test.ts +58 -0
  44. package/edit/__tests__/namespace.test.ts +5 -3
  45. package/edit/fleet.cattle.io.gitrepo.vue +43 -15
  46. package/edit/logging.banzaicloud.io.output/index.vue +7 -0
  47. package/edit/management.cattle.io.clusterroletemplatebinding.vue +3 -11
  48. package/edit/namespace.vue +8 -4
  49. package/edit/provisioning.cattle.io.cluster/Basics.vue +662 -0
  50. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +9 -8
  51. package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +13 -8
  52. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -2
  53. package/edit/provisioning.cattle.io.cluster/MemberRoles.vue +40 -0
  54. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
  55. package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +71 -23
  56. package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +52 -0
  57. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +65 -142
  58. package/edit/provisioning.cattle.io.cluster/rke2.vue +253 -582
  59. package/edit/workload/storage/ContainerMountPaths.vue +7 -5
  60. package/edit/workload/storage/__tests__/Storage.test.ts +2 -2
  61. package/edit/workload/storage/persistentVolumeClaim/__tests__/persistentvolumeclaim.test.ts +36 -0
  62. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +15 -7
  63. package/initialize/App.js +2 -0
  64. package/initialize/client.js +63 -51
  65. package/initialize/index.js +7 -5
  66. package/layouts/default.vue +10 -2
  67. package/layouts/home.vue +6 -2
  68. package/layouts/plain.vue +9 -2
  69. package/list/fleet.cattle.io.cluster.vue +2 -2
  70. package/list/management.cattle.io.feature.vue +1 -1
  71. package/machine-config/amazonec2.vue +1 -0
  72. package/machine-config/vmwarevsphere.vue +48 -7
  73. package/mixins/brand.js +0 -8
  74. package/mixins/child-hook.js +2 -2
  75. package/mixins/create-edit-view/impl.js +3 -3
  76. package/mixins/fetch.client.js +3 -3
  77. package/models/__tests__/management.cattle.io.node.ts +96 -0
  78. package/models/__tests__/node.ts +74 -0
  79. package/models/cluster/node.js +6 -5
  80. package/models/cluster.x-k8s.io.machinedeployment.js +2 -2
  81. package/models/management.cattle.io.cluster.js +22 -1
  82. package/models/management.cattle.io.clusterroletemplatebinding.js +3 -3
  83. package/models/management.cattle.io.globalrole.js +17 -2
  84. package/models/management.cattle.io.node.js +6 -4
  85. package/models/management.cattle.io.projectroletemplatebinding.js +3 -3
  86. package/models/management.cattle.io.roletemplate.js +17 -2
  87. package/package.json +2 -6
  88. package/pages/__tests__/prefs.test.ts +1 -1
  89. package/pages/about.vue +2 -0
  90. package/pages/auth/setup.vue +5 -4
  91. package/pages/c/_cluster/explorer/ConfigBadge.vue +1 -0
  92. package/pages/c/_cluster/monitoring/index.vue +8 -3
  93. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +9 -66
  94. package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +182 -0
  95. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +15 -32
  96. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +8 -46
  97. package/pages/c/_cluster/uiplugins/index.vue +64 -64
  98. package/pages/diagnostic.vue +0 -39
  99. package/pages/home.vue +1 -1
  100. package/pages/prefs.vue +3 -13
  101. package/plugins/dashboard-store/normalize.js +4 -4
  102. package/plugins/dashboard-store/resource-class.js +1 -1
  103. package/plugins/int-number.js +5 -2
  104. package/plugins/positive-int-number.js +19 -0
  105. package/plugins/steve/__tests__/getters.spec.ts +15 -0
  106. package/plugins/steve/getters.js +22 -10
  107. package/public/index.html +4 -2
  108. package/rancher-components/BadgeState/BadgeState.vue +5 -1
  109. package/rancher-components/Banner/Banner.test.ts +51 -1
  110. package/rancher-components/Banner/Banner.vue +134 -53
  111. package/rancher-components/Card/Card.test.ts +37 -0
  112. package/rancher-components/Card/Card.vue +24 -7
  113. package/rancher-components/Form/Checkbox/Checkbox.test.ts +20 -29
  114. package/rancher-components/Form/Checkbox/Checkbox.vue +45 -20
  115. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +2 -8
  116. package/rancher-components/Form/LabeledInput/LabeledInput.vue +22 -10
  117. package/rancher-components/Form/Radio/RadioButton.test.ts +31 -0
  118. package/rancher-components/Form/Radio/RadioButton.vue +30 -13
  119. package/rancher-components/Form/Radio/RadioGroup.vue +26 -7
  120. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -6
  121. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +25 -38
  122. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +23 -11
  123. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +19 -5
  124. package/rancher-components/StringList/StringList.test.ts +453 -49
  125. package/rancher-components/StringList/StringList.vue +92 -58
  126. package/scripts/extension/parse-tag-name +0 -0
  127. package/store/index.js +4 -0
  128. package/store/prefs.js +4 -4
  129. package/store/type-map.js +2 -16
  130. package/types/shell/index.d.ts +26 -14
  131. package/utils/__tests__/cluster.test.ts +55 -0
  132. package/utils/__tests__/object.test.ts +21 -2
  133. package/utils/__tests__/sort.test.ts +61 -0
  134. package/utils/cluster.js +47 -1
  135. package/utils/object.js +12 -5
  136. package/utils/string.js +12 -0
  137. package/utils/validators/formRules/__tests__/index.test.ts +13 -1
  138. package/utils/validators/formRules/index.ts +4 -0
  139. package/utils/validators/role-template.js +9 -1
  140. package/utils/version.js +1 -1
  141. package/vue.config.js +1 -4
  142. package/yarn-error.log +200 -0
  143. package/content/docs/en-us/getting-started.md +0 -224
  144. package/content/docs/en-us/whats-new.md +0 -29
  145. package/content/docs/zh-hans/getting-started.md +0 -224
  146. package/content/docs/zh-hans/whats-new.md +0 -28
  147. package/pages/docs/_doc.vue +0 -345
  148. package/pages/docs/toc.js +0 -27
  149. 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('ToggleSwitch.vue', () => {
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
- (wrapper.vm as any).toggle(true);
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
- (wrapper.vm as any).toggle(false);
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
- (wrapper.vm as any).toggle(true);
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
- (wrapper.vm as any).toggle(false);
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 class="label no-select hand" :class="{ active: !state}" @click="toggle(false)">{{ offLabel }}</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 type="checkbox" :checked="state" @input="toggle(null)">
57
- <span class="slider round"></span>
60
+ <input
61
+ type="checkbox"
62
+ :checked="state"
63
+ @input="toggle(null)"
64
+ >
65
+ <span class="slider round" />
58
66
  </label>
59
- <span class="label no-select hand" :class="{ active: state}" @click="toggle(true)">{{ onLabel }}</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 ref="container" class="labeled-tooltip" :class="{[status]: true, hoverable: hover}">
40
+ <div
41
+ ref="container"
42
+ class="labeled-tooltip"
43
+ :class="{[status]: true, hoverable: hover}"
44
+ >
41
45
  <template v-if="hover">
42
- <i v-tooltip="value.content ? { ...{content: value.content, classes: [`tooltip-${status}`]}, ...value } : value" :class="{'hover':!value, [iconClass]: true}" class="icon status-icon" />
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 :class="{'hover':!value}" class="icon status-icon" />
46
- <div v-if="value" class="tooltip" x-placement="bottom">
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