@rancher/shell 0.3.24 → 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 (111) hide show
  1. package/assets/styles/themes/_light.scss +1 -1
  2. package/assets/translations/en-us.yaml +29 -7
  3. package/assets/translations/zh-hans.yaml +1 -1
  4. package/components/ClusterIconMenu.vue +143 -0
  5. package/components/CruResource.vue +7 -1
  6. package/components/ExplorerProjectsNamespaces.vue +11 -1
  7. package/components/FixedBanner.vue +17 -1
  8. package/components/Markdown.vue +1 -1
  9. package/components/Questions/__tests__/Yaml.test.ts +3 -2
  10. package/components/SortableTable/index.vue +3 -2
  11. package/components/auth/RoleDetailEdit.vue +15 -2
  12. package/components/auth/login/saml.vue +12 -1
  13. package/components/form/LabeledSelect.vue +12 -5
  14. package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
  15. package/components/form/Members/MembershipEditor.vue +6 -1
  16. package/components/form/__tests__/KeyValue.test.ts +6 -3
  17. package/components/form/__tests__/LabeledSelect.test.ts +18 -0
  18. package/components/formatter/PodsUsage.vue +11 -36
  19. package/components/formatter/PrincipalGroupBindings.vue +8 -5
  20. package/components/formatter/__tests__/PodsUsage.test.ts +36 -19
  21. package/components/nav/Group.vue +25 -27
  22. package/components/nav/Header.vue +12 -5
  23. package/components/nav/Pinned.vue +47 -0
  24. package/components/nav/TopLevelMenu.vue +233 -60
  25. package/components/nav/Type.vue +57 -3
  26. package/config/home-links.js +1 -1
  27. package/config/product/istio.js +15 -5
  28. package/config/router.js +3 -9
  29. package/config/table-headers.js +5 -6
  30. package/config/uiplugins.js +1 -0
  31. package/core/plugin-helpers.js +3 -0
  32. package/core/types.ts +6 -1
  33. package/creators/app/files/.vscode/settings.json +0 -1
  34. package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +118 -0
  35. package/detail/autoscaling.horizontalpodautoscaler/index.vue +4 -4
  36. package/detail/provisioning.cattle.io.cluster.vue +7 -5
  37. package/edit/__tests__/management.cattle.io.clusterroletemplatebinding.test.ts +58 -0
  38. package/edit/__tests__/namespace.test.ts +5 -3
  39. package/edit/management.cattle.io.clusterroletemplatebinding.vue +3 -11
  40. package/edit/namespace.vue +8 -4
  41. package/edit/provisioning.cattle.io.cluster/Basics.vue +662 -0
  42. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +6 -0
  43. package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +13 -8
  44. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -2
  45. package/edit/provisioning.cattle.io.cluster/MemberRoles.vue +40 -0
  46. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
  47. package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +71 -23
  48. package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +52 -0
  49. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +65 -142
  50. package/edit/provisioning.cattle.io.cluster/rke2.vue +194 -598
  51. package/edit/workload/storage/__tests__/Storage.test.ts +2 -2
  52. package/edit/workload/storage/persistentVolumeClaim/__tests__/persistentvolumeclaim.test.ts +36 -0
  53. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +15 -7
  54. package/initialize/index.js +5 -5
  55. package/layouts/default.vue +6 -6
  56. package/layouts/home.vue +6 -2
  57. package/layouts/plain.vue +9 -2
  58. package/list/fleet.cattle.io.cluster.vue +2 -2
  59. package/list/management.cattle.io.feature.vue +1 -1
  60. package/machine-config/vmwarevsphere.vue +48 -7
  61. package/mixins/brand.js +0 -8
  62. package/mixins/child-hook.js +2 -2
  63. package/mixins/create-edit-view/impl.js +3 -3
  64. package/models/__tests__/management.cattle.io.node.ts +96 -0
  65. package/models/__tests__/node.ts +74 -0
  66. package/models/cluster/node.js +6 -5
  67. package/models/cluster.x-k8s.io.machinedeployment.js +2 -2
  68. package/models/management.cattle.io.cluster.js +22 -1
  69. package/models/management.cattle.io.clusterroletemplatebinding.js +3 -3
  70. package/models/management.cattle.io.globalrole.js +17 -2
  71. package/models/management.cattle.io.node.js +6 -4
  72. package/models/management.cattle.io.projectroletemplatebinding.js +3 -3
  73. package/models/management.cattle.io.roletemplate.js +17 -2
  74. package/package.json +2 -6
  75. package/pages/about.vue +2 -0
  76. package/pages/auth/setup.vue +5 -4
  77. package/pages/c/_cluster/monitoring/index.vue +8 -3
  78. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +9 -66
  79. package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +182 -0
  80. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +15 -32
  81. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +8 -46
  82. package/pages/c/_cluster/uiplugins/index.vue +64 -64
  83. package/pages/diagnostic.vue +0 -39
  84. package/pages/home.vue +1 -1
  85. package/plugins/dashboard-store/normalize.js +4 -4
  86. package/plugins/int-number.js +5 -2
  87. package/plugins/positive-int-number.js +19 -0
  88. package/plugins/steve/__tests__/getters.spec.ts +15 -0
  89. package/plugins/steve/getters.js +22 -10
  90. package/rancher-components/Form/LabeledInput/LabeledInput.vue +0 -8
  91. package/rancher-components/Form/Radio/RadioButton.test.ts +3 -7
  92. package/store/index.js +4 -0
  93. package/store/prefs.js +1 -0
  94. package/types/shell/index.d.ts +13 -4
  95. package/utils/__tests__/cluster.test.ts +55 -0
  96. package/utils/__tests__/object.test.ts +21 -2
  97. package/utils/cluster.js +47 -1
  98. package/utils/object.js +12 -5
  99. package/utils/validators/formRules/__tests__/index.test.ts +13 -1
  100. package/utils/validators/formRules/index.ts +4 -0
  101. package/utils/validators/role-template.js +9 -1
  102. package/utils/version.js +1 -1
  103. package/yarn-error.log +16 -16
  104. package/components/ClusterProviderIconMenu.vue +0 -161
  105. package/content/docs/en-us/getting-started.md +0 -224
  106. package/content/docs/en-us/whats-new.md +0 -29
  107. package/content/docs/zh-hans/getting-started.md +0 -224
  108. package/content/docs/zh-hans/whats-new.md +0 -28
  109. package/pages/docs/_doc.vue +0 -345
  110. package/pages/docs/toc.js +0 -27
  111. 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
- };