@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,345 +0,0 @@
1
- <script>
2
- import IndentedPanel from '@shell/components/IndentedPanel';
3
- import Markdown from '@shell/components/Markdown';
4
- import { generateToc } from './toc';
5
-
6
- // List and map of the available documents in the content/docs folder
7
- const docs = require.context('@shell/content/docs', true).keys();
8
- const docsMap = docs.reduce((map, obj) => {
9
- map[obj] = true;
10
-
11
- return map;
12
- }, {});
13
- const SHOW_REFRESH = false;
14
-
15
- export default {
16
- layout: 'home',
17
-
18
- components: { IndentedPanel, Markdown },
19
-
20
- asyncData({ store, params }) {
21
- const showRefresh = SHOW_REFRESH;
22
- const docName = params.doc;
23
- const defaultLocale = store.getters['i18n/default']();
24
- let locale = store.getters['i18n/current']();
25
-
26
- const getPath = (locale, docName) => {
27
- const path = `./${ locale }/${ docName }.md`;
28
-
29
- return docsMap[path] ? locale : null;
30
- };
31
-
32
- locale = getPath(locale, docName);
33
- if (!locale) {
34
- locale = getPath(defaultLocale, docName);
35
- }
36
-
37
- let sideToc = false;
38
- let doc = null;
39
-
40
- if (locale) {
41
- doc = require(`@shell/content/docs/${ locale }/${ docName }.md`);
42
- sideToc = doc?.attributes?.sideToc || false;
43
- doc.body = doc.body || '';
44
-
45
- if (sideToc) {
46
- doc.toc = generateToc(doc.body);
47
- }
48
- }
49
-
50
- return {
51
- doc,
52
- locale,
53
- docName,
54
- showRefresh,
55
- timer: null,
56
- selected: null,
57
- sideToc,
58
- };
59
- },
60
-
61
- mounted() {
62
- const main = document.getElementsByTagName('main');
63
-
64
- if (main && main.length === 1) {
65
- main[0].addEventListener('scroll', this.handleScroll);
66
- this.scroller = main[0];
67
- }
68
-
69
- this.initialHighlight();
70
- },
71
- destroyed() {
72
- clearTimeout(this.timer);
73
- if (this.scroller) {
74
- this.scroller.removeEventListener('scroll', this.handleScroll);
75
- }
76
- },
77
-
78
- methods: {
79
- goto(id) {
80
- const elm = document.getElementById(id);
81
-
82
- this.selected = id;
83
- this.initialHighlight();
84
-
85
- if (elm) {
86
- elm.scrollIntoView();
87
- }
88
- },
89
-
90
- async refresh() {
91
- this.doc = await this.$content('docs', this.locale, this.docName).fetch();
92
- },
93
-
94
- initialHighlight() {
95
- if (!this.sideToc) {
96
- return;
97
- }
98
-
99
- const id = this.selected || this.doc.toc[0].id;
100
-
101
- this.doc.toc.forEach((item) => {
102
- const tocElm = document.getElementById(`toc-link-${ item.id }`);
103
-
104
- if ( !tocElm ) {
105
- return;
106
- }
107
-
108
- if (item.id === id) {
109
- tocElm.classList.add('active');
110
- } else {
111
- tocElm.classList.remove('active');
112
- }
113
- });
114
- },
115
-
116
- handleScroll(event) {
117
- // Any code to be executed when the window is scrolled
118
- clearTimeout(this.timer);
119
- this.timer = setTimeout(() => {
120
- const top = event.srcElement.offsetTop;
121
- const y = event.srcElement.scrollTop - top - 20;
122
- let found = false;
123
-
124
- if (!this.doc?.toc || this.doc.toc.length === 0) {
125
- this.selected = null;
126
-
127
- return;
128
- }
129
-
130
- // Debounce scroll events
131
- this.doc.toc?.forEach((item) => {
132
- const elm = document.getElementById(item.id);
133
- const tocElm = document.getElementById(`toc-link-${ item.id }`);
134
-
135
- if ( !tocElm ) {
136
- return;
137
- }
138
-
139
- let active;
140
-
141
- if (this.selected) {
142
- active = item.id === this.selected;
143
- } else {
144
- active = elm.offsetTop > y;
145
- }
146
-
147
- if (!active || found) {
148
- tocElm.classList.remove('active');
149
- } else {
150
- tocElm.classList.add('active');
151
- found = true;
152
- }
153
- });
154
-
155
- if (!found & this.doc.toc) {
156
- const last = this.doc.toc[this.doc.toc.length - 1]?.id;
157
- const tocElm = document.getElementById(`toc-link-${ last }`);
158
-
159
- if ( tocElm ) {
160
- tocElm.classList.add('active');
161
- }
162
- }
163
-
164
- this.selected = null;
165
- }, 50);
166
- }
167
-
168
- }
169
- };
170
- </script>
171
- <template>
172
- <IndentedPanel>
173
- <h1 class="breadcrumbs">
174
- <nuxt-link :to="{name: 'home'}">
175
- {{ t('nav.home') }}
176
- </nuxt-link>
177
- <span v-if="doc">> {{ doc.attributes.title }}</span>
178
- <i
179
- v-if="showRefresh"
180
- class="icon icon-refresh doc-refresh"
181
- @click="refresh"
182
- />
183
- </h1>
184
- <div
185
- v-if="doc"
186
- id="doc-content"
187
- class="doc-content"
188
- :class="{'nuxt-content-side-toc': sideToc}"
189
- >
190
- <Markdown
191
- ref="scrollPanel"
192
- v-model="doc.body"
193
- class="doc-content-document"
194
- :class="{'nuxt-content-side-toc': sideToc}"
195
- />
196
-
197
- <div
198
- v-if="sideToc"
199
- class="toc"
200
- >
201
- <a
202
- v-for="bookmark in doc.toc"
203
- :id="`toc-link-${ bookmark.id }`"
204
- :key="bookmark.id"
205
- class="toc-link"
206
- :class="'depth-' + bookmark.depth"
207
- @click="goto(bookmark.id)"
208
- >
209
- {{ bookmark.text }}
210
- </a>
211
- </div>
212
- </div>
213
- <div v-else>
214
- {{ t('generic.notFound') }}
215
- </div>
216
- </IndentedPanel>
217
- </template>
218
- <style lang="scss" scoped>
219
- h1.breadcrumbs {
220
- font-size: 18px;
221
- margin: 20px 0;
222
- }
223
-
224
- .doc-content {
225
- .toc {
226
- position: fixed;
227
- width: 20%;
228
- top: 100px;
229
- right: 5%;
230
-
231
- .toc-link {
232
- display: block;
233
- margin-bottom: 10px;
234
- padding-left: 4px;
235
- border-left: 4px solid;
236
- border-color: transparent;
237
- &:hover {
238
- cursor: pointer;
239
- }
240
- &.active {
241
- border-color: var(--link) ;
242
- }
243
- }
244
- .depth-3 {
245
- margin-left: 10px;
246
- }
247
- }
248
- }
249
-
250
- .doc-refresh {
251
- cursor: pointer;
252
-
253
- &:hover {
254
- color: var(--link);
255
- }
256
- }
257
- </style>
258
- <style lang="scss">
259
- .doc-content {
260
- P {
261
- font-size: 14px;
262
- margin-bottom: 10px;
263
- line-height: 16px;
264
- }
265
-
266
- ul > li {
267
- margin-bottom: 5px;
268
- }
269
-
270
- &.nuxt-content-side-toc {
271
- .doc-content-document {
272
- width: 75%;
273
- }
274
- }
275
-
276
- .doc-icon {
277
- font-size: 18px;
278
- line-height: normal;
279
- border: 1px solid var(--border);
280
- border-radius: 5px;
281
- margin: 0 5px;
282
- }
283
-
284
- svg.doc-icon {
285
- fill: var(--body-text);
286
- }
287
- }
288
-
289
- .doc-content-document {
290
- margin-bottom: 100px;
291
- h1:not(:first-child) {
292
- margin-top: 30px;
293
- }
294
-
295
- h2 {
296
- font-size: 18px;
297
- margin: 25px 0 15px 0;
298
- text-decoration: underline;
299
- }
300
- h3 {
301
- font-size: 16px;
302
- margin: 10px 0;
303
- text-decoration: underline;
304
- }
305
- p {
306
- line-height: 20px;
307
- }
308
- p:not(:last-child) {
309
- margin-bottom: 12px;
310
- }
311
- ul {
312
- > li:not(:last-child) {
313
- margin-bottom: 10px;
314
- }
315
- }
316
- blockquote {
317
- margin: 1em 0 1em 0;
318
- border-left: 4px solid var(--info);
319
- padding-left: 5px;
320
- }
321
- table {
322
- border: 1px solid var(--border);
323
- border-collapse: collapse;
324
-
325
- thead > tr > th {
326
- background-color: var(--sortable-table-header-bg);
327
- line-height: 1.75em;
328
- }
329
-
330
- tbody > tr.table-group > td {
331
- background-color: var(--sortable-table-header-bg);
332
- font-weight: bold;
333
- }
334
-
335
- thead, tbody {
336
- tr {
337
- td, th {
338
- border: 1px solid var(--border);
339
- padding: 5px 5px;
340
- }
341
- }
342
- }
343
- }
344
- }
345
- </style>
package/pages/docs/toc.js DELETED
@@ -1,27 +0,0 @@
1
- // Generate simple Table of Contents from the markdown content
2
- // Returns an array of table of contents meatdata
3
-
4
- const TOC_REGEX = /^(#+)\s(.*)/;
5
-
6
- export function generateToc(body) {
7
- const toc = [];
8
- const lines = body.split('\n');
9
-
10
- lines.forEach((line) => {
11
- const m = line.match(TOC_REGEX);
12
-
13
- if (m && m.length === 3) {
14
- const depth = m[1].length;
15
- const text = m[2];
16
- const id = text.toLowerCase().replace(/[^\w]+/g, '-');
17
-
18
- toc.push({
19
- depth,
20
- id,
21
- text
22
- });
23
- }
24
- });
25
-
26
- return toc;
27
- }
@@ -1,34 +0,0 @@
1
- /* eslint-disable no-console */
2
- export default () => {
3
- const logTypes = ['warn', 'error'];
4
- const MAX_LOGS_STORED = 400;
5
-
6
- if (!process.env.dev) {
7
- console.logLog = console.log.bind(console);
8
- console.infoLog = console.info.bind(console);
9
- logTypes.push('log');
10
- logTypes.push('info');
11
- }
12
-
13
- console.warnLog = console.warn.bind(console);
14
- console.errorLog = console.error.bind(console);
15
- console.logs = [];
16
-
17
- logTypes.forEach((type) => {
18
- console[type] = function() {
19
- const dataLogged = {
20
- type,
21
- dateTimeUtc: new Date().toUTCString(),
22
- timestamp: Date.now(),
23
- data: Array.from(arguments)
24
- };
25
-
26
- if (console.logs.length >= MAX_LOGS_STORED) {
27
- console.logs.shift();
28
- }
29
-
30
- console.logs.push(dataLogged);
31
- console[`${ type }Log`].apply(console, arguments);
32
- };
33
- });
34
- };