@rancher/shell 0.1.4 → 0.1.21

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 (152) hide show
  1. package/assets/brand/suse/favicon.png +0 -0
  2. package/assets/images/generic-plugin.svg +1 -7
  3. package/assets/translations/en-us.yaml +81 -47
  4. package/components/CommunityLinks.vue +40 -49
  5. package/components/ExplorerProjectsNamespaces.vue +20 -3
  6. package/components/LazyImage.vue +21 -8
  7. package/components/PromptRemove.vue +2 -2
  8. package/components/ResourceList/Masthead.vue +21 -1
  9. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  10. package/components/ResourceList/index.vue +9 -23
  11. package/components/SortableTable/index.vue +13 -10
  12. package/components/Tabbed/index.vue +25 -7
  13. package/components/TypeDescription.vue +10 -1
  14. package/components/fleet/FleetClusters.vue +6 -0
  15. package/components/fleet/FleetRepos.vue +7 -1
  16. package/components/form/Command.vue +5 -0
  17. package/components/form/EnvVars.vue +5 -0
  18. package/components/form/NameNsDescription.vue +3 -1
  19. package/components/form/NodeScheduling.vue +6 -1
  20. package/components/form/PodAffinity.vue +5 -0
  21. package/components/form/ServiceNameSelect.vue +5 -0
  22. package/components/form/ValueFromResource.vue +7 -1
  23. package/components/nav/TopLevelMenu.vue +2 -1
  24. package/config/home-links.js +155 -0
  25. package/config/private-label.js +1 -1
  26. package/config/product/manager.js +0 -2
  27. package/config/product/uiplugins.js +1 -1
  28. package/config/settings.js +3 -1
  29. package/config/uiplugins.js +63 -6
  30. package/config/version.js +17 -0
  31. package/core/plugin.ts +12 -0
  32. package/core/plugins.js +29 -5
  33. package/core/types.ts +6 -0
  34. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  35. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  36. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  37. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  38. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  39. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  40. package/creators/app/init +16 -17
  41. package/creators/app/package.json +6 -0
  42. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  43. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  44. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  45. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  46. package/creators/pkg/init +1 -1
  47. package/creators/update/init +54 -0
  48. package/creators/update/package.json +20 -0
  49. package/creators/update/upgrade +56 -0
  50. package/creators/update/yarn-error.log +54 -0
  51. package/detail/workload/index.vue +1 -0
  52. package/edit/persistentvolume/index.vue +48 -13
  53. package/edit/persistentvolumeclaim.vue +31 -13
  54. package/edit/provisioning.cattle.io.cluster/rke2.vue +27 -19
  55. package/edit/workload/index.vue +19 -9
  56. package/edit/workload/mixins/workload.js +109 -114
  57. package/edit/workload/storage/index.vue +11 -17
  58. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  59. package/edit/workload/storage/secret.vue +6 -1
  60. package/list/catalog.cattle.io.app.vue +10 -9
  61. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  62. package/list/cis.cattle.io.clusterscan.vue +12 -12
  63. package/list/fleet.cattle.io.bundle.vue +33 -28
  64. package/list/fleet.cattle.io.cluster.vue +26 -22
  65. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  66. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  67. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  68. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  69. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  70. package/list/logging.banzaicloud.io.flow.vue +7 -14
  71. package/list/management.cattle.io.cluster.vue +26 -15
  72. package/list/management.cattle.io.feature.vue +13 -8
  73. package/list/management.cattle.io.user.vue +38 -19
  74. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  75. package/list/namespace.vue +14 -1
  76. package/list/node.vue +13 -16
  77. package/list/persistentvolume.vue +16 -9
  78. package/list/persistentvolumeclaim.vue +5 -8
  79. package/list/provisioning.cattle.io.cluster.vue +34 -8
  80. package/list/service.vue +24 -12
  81. package/list/ui.cattle.io.navlink.vue +6 -0
  82. package/list/workload.vue +2 -2
  83. package/middleware/authenticated.js +6 -0
  84. package/mixins/resource-fetch.js +12 -18
  85. package/mixins/resource-manager.js +126 -0
  86. package/models/catalog.cattle.io.uiplugin.js +4 -0
  87. package/models/pod.js +15 -5
  88. package/models/provisioning.cattle.io.cluster.js +4 -0
  89. package/models/workload.service.js +10 -0
  90. package/nuxt.config.js +2 -1
  91. package/package.json +1 -1
  92. package/pages/auth/login.vue +10 -0
  93. package/pages/auth/verify.vue +9 -0
  94. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  95. package/pages/c/_cluster/settings/links.vue +53 -101
  96. package/pages/c/_cluster/settings/performance.vue +90 -7
  97. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +3 -3
  98. package/pages/c/_cluster/uiplugins/InstallDialog.vue +71 -20
  99. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +21 -5
  100. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -7
  101. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +23 -15
  102. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +11 -4
  103. package/pages/c/_cluster/uiplugins/index.vue +179 -65
  104. package/pages/support/index.vue +31 -142
  105. package/plugins/dashboard-store/actions.js +19 -0
  106. package/plugins/dashboard-store/getters.js +20 -3
  107. package/plugins/dashboard-store/mutations.js +13 -7
  108. package/plugins/plugin.js +18 -15
  109. package/plugins/steve/getters.js +12 -0
  110. package/plugins/version.js +21 -0
  111. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  112. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  113. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  114. package/rancher-components/components/BadgeState/index.ts +1 -0
  115. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  116. package/rancher-components/components/Banner/Banner.vue +163 -0
  117. package/rancher-components/components/Banner/index.ts +1 -0
  118. package/rancher-components/components/Card/Card.vue +150 -0
  119. package/rancher-components/components/Card/index.ts +1 -0
  120. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  121. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  122. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  123. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  124. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  125. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  126. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  127. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  128. package/rancher-components/components/Form/Radio/index.ts +2 -0
  129. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  130. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  131. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  132. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  133. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  134. package/rancher-components/components/Form/index.ts +5 -0
  135. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  136. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  137. package/scripts/publish-shell.sh +39 -6
  138. package/scripts/record-deps.js +37 -0
  139. package/scripts/test-plugins-build.sh +8 -5
  140. package/scripts/typegen.sh +84 -0
  141. package/store/auth.js +3 -0
  142. package/store/index.js +12 -3
  143. package/types/shell/index.d.ts +3046 -0
  144. package/utils/favicon.js +8 -2
  145. package/utils/gc/gc-interval.ts +40 -0
  146. package/utils/gc/gc-root-store.js +76 -0
  147. package/utils/gc/gc-route-changed.ts +44 -0
  148. package/utils/gc/gc-types.ts +21 -0
  149. package/utils/gc/gc.ts +282 -0
  150. package/config/footer.js +0 -18
  151. package/creators/pkg/nuxt.config.js +0 -6
  152. package/yarn-error.log +0 -195
@@ -0,0 +1 @@
1
+ export { default as BadgeState } from './BadgeState.vue';
@@ -0,0 +1,13 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import { Banner } from './index';
3
+
4
+ describe('component: Banner', () => {
5
+ it('should display text based on label', () => {
6
+ const label = 'test';
7
+ const wrapper = mount(Banner, { propsData: { label } });
8
+
9
+ const element = wrapper.find('span').element;
10
+
11
+ expect(element.textContent).toBe(label);
12
+ });
13
+ });
@@ -0,0 +1,163 @@
1
+ <script lang="ts">
2
+ import Vue from 'vue';
3
+ import { nlToBr } from '@shell/utils/string';
4
+ import { stringify } from '@shell/utils/error';
5
+
6
+ export default Vue.extend({
7
+ props: {
8
+ /**
9
+ * A color class that represents the color of the banner.
10
+ * @values primary, secondary, success, warning, error, info
11
+ */
12
+ color: {
13
+ type: String,
14
+ default: 'secondary'
15
+ },
16
+ /**
17
+ * The label to display as the banner's default content.
18
+ */
19
+ label: {
20
+ type: [String, Error, Object],
21
+ default: null
22
+ },
23
+ /**
24
+ * The i18n key for the label to display as the banner's default content.
25
+ */
26
+ labelKey: {
27
+ type: String,
28
+ default: null
29
+ },
30
+ /**
31
+ * Toggles the banner's close button.
32
+ */
33
+ closable: {
34
+ type: Boolean,
35
+ default: false
36
+ },
37
+ /**
38
+ * Toggles the stacked class for the banner.
39
+ */
40
+ stacked: {
41
+ type: Boolean,
42
+ default: false
43
+ }
44
+ },
45
+ computed: {
46
+ /**
47
+ * Return message text as label.
48
+ */
49
+ messageLabel(): string | void {
50
+ return !(typeof this.label === 'string') ? stringify(this.label) : undefined;
51
+ }
52
+ },
53
+ methods: { nlToBr }
54
+ });
55
+ </script>
56
+ <template>
57
+ <div
58
+ class="banner"
59
+ :class="{
60
+ [color]: true,
61
+ closable,
62
+ stacked
63
+ }"
64
+ >
65
+ <slot>
66
+ <t v-if="labelKey" :k="labelKey" :raw="true" />
67
+ <span v-else-if="messageLabel">{{ messageLabel }}</span>
68
+ <span v-else v-html="nlToBr(label)" />
69
+ </slot>
70
+ <div v-if="closable" class="closer" @click="$emit('close')">
71
+ <i class="icon icon-2x icon-close closer-icon" />
72
+ </div>
73
+ </div>
74
+ </template>
75
+
76
+ <style lang="scss" scoped>
77
+ $left-border-size: 4px;
78
+
79
+ .banner {
80
+ padding: 10px;
81
+ margin: 15px 0;
82
+ width: 100%;
83
+ transition: all 0.2s ease;
84
+ position: relative;
85
+ line-height: 20px;
86
+
87
+ &.stacked {
88
+ padding: 0 10px;
89
+ margin: 0;
90
+ transition: none;
91
+ &:first-child {
92
+ padding-top: 10px;
93
+ }
94
+ &:last-child {
95
+ padding-bottom: 10px;
96
+ }
97
+ }
98
+
99
+ &.closable {
100
+ padding-right: 40px;
101
+ }
102
+
103
+ .closer {
104
+ display: flex;
105
+ align-items: center;
106
+
107
+ cursor: pointer;
108
+ position: absolute;
109
+ top: 0;
110
+ right: 0;
111
+ bottom: 0;
112
+ width: 40px;
113
+ line-height: 42px;
114
+ text-align: center;
115
+
116
+ .closer-icon {
117
+ font-size: 22px;
118
+ opacity: 0.7;
119
+
120
+ &:hover {
121
+ opacity: 1;
122
+ color: var(--link);
123
+ }
124
+ }
125
+ }
126
+
127
+ &.primary {
128
+ background: var(--primary);
129
+ border-left: solid $left-border-size var(--primary);
130
+ color: var(--body-text);
131
+ }
132
+
133
+ &.secondary {
134
+ background: var(--default-banner-bg);
135
+ border-left: solid $left-border-size var(--default);
136
+ color: var(--body-text);
137
+ }
138
+
139
+ &.success {
140
+ background: var(--success-banner-bg);
141
+ border-left: solid $left-border-size var(--success);
142
+ color: var(--body-text);
143
+ }
144
+
145
+ &.info {
146
+ background: var(--info-banner-bg);
147
+ border-left: solid $left-border-size var(--info);
148
+ color: var(--body-text);
149
+ }
150
+
151
+ &.warning {
152
+ background: var(--warning-banner-bg);
153
+ border-left: solid $left-border-size var(--warning);
154
+ color: var(--body-text);
155
+ }
156
+
157
+ &.error {
158
+ background: var(--error-banner-bg);
159
+ border-left: solid $left-border-size var(--error);
160
+ color: var(--error);
161
+ }
162
+ }
163
+ </style>
@@ -0,0 +1 @@
1
+ export { default as Banner } from './Banner.vue';
@@ -0,0 +1,150 @@
1
+ <script lang="ts">
2
+ import Vue from 'vue';
3
+
4
+ export default Vue.extend({
5
+ name: 'Card',
6
+ props: {
7
+ /**
8
+ * The card's title.
9
+ */
10
+ title: {
11
+ type: String,
12
+ default: ''
13
+ },
14
+ /**
15
+ * The text content for the card's body.
16
+ */
17
+ content: {
18
+ type: String,
19
+ default: ''
20
+ },
21
+ /**
22
+ * The function to invoke when the default action button is clicked.
23
+ */
24
+ buttonAction: {
25
+ type: Function,
26
+ default: (): void => { }
27
+ },
28
+ /**
29
+ * The text for the default action button.
30
+ */
31
+ buttonText: {
32
+ type: String,
33
+ default: 'go'
34
+ },
35
+ /**
36
+ * Toggles the card's highlight-border class.
37
+ */
38
+ showHighlightBorder: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ /**
43
+ * Toggles the card's Actions section.
44
+ */
45
+ showActions: {
46
+ type: Boolean,
47
+ default: true
48
+ },
49
+ sticky: {
50
+ type: Boolean,
51
+ default: false,
52
+ },
53
+ }
54
+ });
55
+ </script>
56
+
57
+ <template>
58
+ <div class="card-container" :class="{'highlight-border': showHighlightBorder, 'card-sticky': sticky}">
59
+ <div class="card-wrap">
60
+ <div class="card-title">
61
+ <slot name="title">
62
+ {{ title }}
63
+ </slot>
64
+ </div>
65
+ <hr />
66
+ <div class="card-body">
67
+ <slot name="body">
68
+ {{ content }}
69
+ </slot>
70
+ </div>
71
+ <div v-if="showActions" class="card-actions">
72
+ <slot name="actions">
73
+ <button class="btn role-primary" @click="buttonAction">
74
+ {{ buttonText }}
75
+ </button>
76
+ </slot>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </template>
81
+
82
+ <style lang='scss'>
83
+ .card-container {
84
+ &.highlight-border {
85
+ border-left: 5px solid var(--primary);
86
+ }
87
+ border-radius: var(--border-radius);
88
+ display: flex;
89
+ flex-basis: 40%;
90
+ margin: 10px;
91
+ min-height: 100px;
92
+ padding: 10px;
93
+ box-shadow: 0 0 20px var(--shadow);
94
+ &:not(.top) {
95
+ align-items: top;
96
+ flex-direction: row;
97
+ justify-content: start;
98
+ }
99
+ .card-wrap {
100
+ width: 100%;
101
+ }
102
+ & .card-body {
103
+ color: var(--input-label);
104
+ display: flex;
105
+ flex-direction: column;
106
+ justify-content: center;
107
+ }
108
+ & .card-actions {
109
+ align-self: end;
110
+ display: flex;
111
+ padding-top: 20px;
112
+ }
113
+ & .card-title {
114
+ align-items: center;
115
+ display: flex;
116
+ width: 100%;
117
+ h5 {
118
+ margin: 0;
119
+ }
120
+ .flex-right {
121
+ margin-left: auto;
122
+ }
123
+ }
124
+
125
+ // Sticky mode will stick header and footer to top and bottom with content in the middle scrolling
126
+ &.card-sticky {
127
+ // display: flex;
128
+ // flex-direction: column;
129
+ overflow: hidden;
130
+
131
+ .card-wrap {
132
+ display: flex;
133
+ flex-direction: column;
134
+
135
+ .card-body {
136
+ justify-content: flex-start;
137
+ overflow: scroll;
138
+ }
139
+
140
+ > * {
141
+ flex: 0;
142
+ }
143
+
144
+ .card-body {
145
+ flex: 1;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ </style>
@@ -0,0 +1 @@
1
+ export { default as Card } from './Card.vue';
@@ -0,0 +1,77 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import { Checkbox } from './index';
3
+
4
+ describe('Checkbox.vue', () => {
5
+ it('is unchecked by default', () => {
6
+ const wrapper = shallowMount(Checkbox);
7
+ const cbInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
8
+
9
+ expect(cbInput.checked).toBe(false);
10
+ });
11
+
12
+ it('renders a true value', () => {
13
+ const wrapper = shallowMount(Checkbox, { propsData: { value: true } });
14
+ const cbInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
15
+
16
+ expect(cbInput.checked).toBe(true);
17
+ });
18
+
19
+ it('updates from false to true when props change', async () => {
20
+ const wrapper = shallowMount(Checkbox);
21
+ const cbInput = wrapper.find('input[type="checkbox"]').element as HTMLInputElement;
22
+
23
+ expect(cbInput.checked).toBe(false);
24
+
25
+ await wrapper.setProps({ value: true });
26
+
27
+ expect(cbInput.checked).toBe(true);
28
+ });
29
+
30
+ it('emits an input event with a true value', async () => {
31
+ const wrapper = shallowMount(Checkbox);
32
+ const event = {
33
+ target: { tagName: 'input', href: null },
34
+ stopPropagation: () => { },
35
+ preventDefault: () => { }
36
+ };
37
+
38
+ (wrapper.vm as any).clicked(event);
39
+ await wrapper.vm.$nextTick();
40
+
41
+ expect(wrapper.emitted().input?.length).toBe(1);
42
+ expect(wrapper.emitted().input?.[0][0]).toBe(true);
43
+ });
44
+
45
+ it('emits an input event with a custom valueWhenTrue', async () => {
46
+ const valueWhenTrue = 'BIG IF TRUE';
47
+ const event = {
48
+ target: { tagName: 'input', href: null },
49
+ stopPropagation: () => { },
50
+ preventDefault: () => { }
51
+ };
52
+
53
+ const wrapper = shallowMount(Checkbox, { propsData: { value: false, valueWhenTrue } });
54
+
55
+ (wrapper.vm as any).clicked(event);
56
+ await wrapper.vm.$nextTick();
57
+
58
+ expect(wrapper.emitted().input?.length).toBe(1);
59
+ expect(wrapper.emitted().input?.[0][0]).toBe(valueWhenTrue);
60
+ });
61
+
62
+ it('updates from valueWhenTrue to falsy', async () => {
63
+ const valueWhenTrue = 'REAL HUGE IF FALSE';
64
+ const event = {
65
+ target: { tagName: 'input', href: null },
66
+ stopPropagation: () => { },
67
+ preventDefault: () => { }
68
+ };
69
+
70
+ const wrapper = shallowMount(Checkbox, { propsData: { value: valueWhenTrue, valueWhenTrue } });
71
+
72
+ (wrapper.vm as any).clicked(event);
73
+ await wrapper.vm.$nextTick();
74
+
75
+ expect(wrapper.emitted().input?.[0][0]).toBe(null);
76
+ })
77
+ });