@rancher/shell 3.0.0 → 3.0.1-rc.1

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 (83) hide show
  1. package/assets/brand/harvester/favicon.png +0 -0
  2. package/assets/brand/harvester/metadata.json +3 -0
  3. package/assets/images/pl/harvester.svg +1 -0
  4. package/assets/translations/en-us.yaml +25 -4
  5. package/assets/translations/zh-hans.yaml +1 -1
  6. package/components/BrandImage.vue +5 -1
  7. package/components/CopyToClipboardText.vue +2 -0
  8. package/components/CruResourceFooter.vue +1 -0
  9. package/components/DetailTop.vue +1 -1
  10. package/components/ExplorerMembers.vue +5 -1
  11. package/components/ExplorerProjectsNamespaces.vue +39 -15
  12. package/components/HardwareResourceGauge.vue +12 -2
  13. package/components/InputOrDisplay.vue +6 -2
  14. package/components/LandingPagePreference.vue +2 -2
  15. package/components/MessageLink.vue +1 -1
  16. package/components/ResourceDetail/Masthead.vue +22 -1
  17. package/components/ResourceDetail/index.vue +2 -8
  18. package/components/ResourceTable.vue +14 -6
  19. package/components/ResourceYaml.vue +1 -1
  20. package/components/SideNav.vue +1 -1
  21. package/components/TableDataUserIcon.vue +1 -1
  22. package/components/fleet/FleetRepos.vue +0 -7
  23. package/components/form/ArrayList.vue +5 -1
  24. package/components/form/ArrayListSelect.vue +5 -1
  25. package/components/form/KeyValue.vue +1 -1
  26. package/components/form/LabeledSelect.vue +26 -6
  27. package/components/form/Password.vue +7 -1
  28. package/components/form/UnitInput.vue +10 -1
  29. package/components/form/__tests__/UnitInput.test.ts +1 -0
  30. package/components/formatter/ClusterProvider.vue +3 -3
  31. package/components/formatter/ImagePercentageBar.vue +1 -1
  32. package/components/formatter/Si.vue +5 -1
  33. package/components/formatter/Translate.vue +1 -1
  34. package/components/nav/Header.vue +29 -5
  35. package/components/nav/NamespaceFilter.vue +5 -8
  36. package/components/nav/TopLevelMenu.vue +11 -11
  37. package/config/labels-annotations.js +2 -0
  38. package/config/table-headers.js +15 -0
  39. package/config/types.js +3 -0
  40. package/detail/fleet.cattle.io.bundle.vue +5 -68
  41. package/detail/fleet.cattle.io.gitrepo.vue +2 -1
  42. package/directives/clean-tooltip.js +4 -4
  43. package/edit/logging-flow/Match.vue +75 -42
  44. package/edit/logging-flow/index.vue +89 -10
  45. package/edit/logging.banzaicloud.io.output/index.vue +2 -2
  46. package/edit/management.cattle.io.project.vue +2 -2
  47. package/edit/namespace.vue +1 -1
  48. package/edit/provisioning.cattle.io.cluster/index.vue +2 -1
  49. package/edit/provisioning.cattle.io.cluster/rke2.vue +1 -3
  50. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryMirrors.vue +1 -1
  51. package/list/harvesterhci.io.management.cluster.vue +244 -0
  52. package/list/namespace.vue +16 -4
  53. package/models/__tests__/management.cattle.io.cluster.test.ts +45 -3
  54. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -86
  55. package/models/fleet.cattle.io.bundle.js +3 -1
  56. package/models/fleet.cattle.io.gitrepo.js +43 -50
  57. package/models/k8s.cni.cncf.io.networkattachmentdefinition.js +88 -0
  58. package/models/management.cattle.io.cluster.js +26 -5
  59. package/models/management.cattle.io.setting.js +25 -0
  60. package/models/provisioning.cattle.io.cluster.js +5 -14
  61. package/models/storage.k8s.io.storageclass.js +15 -4
  62. package/package.json +3 -3
  63. package/pages/auth/login.vue +3 -2
  64. package/pages/auth/setup.vue +1 -1
  65. package/pages/c/_cluster/fleet/index.vue +2 -4
  66. package/pages/c/_cluster/settings/brand.vue +4 -1
  67. package/pages/prefs.vue +22 -10
  68. package/plugins/dashboard-store/resource-class.js +11 -3
  69. package/plugins/steve/steve-pagination-utils.ts +1 -1
  70. package/rancher-components/Form/LabeledInput/LabeledInput.vue +7 -2
  71. package/store/features.js +1 -0
  72. package/store/i18n.js +5 -1
  73. package/store/prefs.js +8 -0
  74. package/types/resources/fleet.d.ts +40 -0
  75. package/types/shell/index.d.ts +428 -395
  76. package/utils/auth.js +1 -1
  77. package/utils/create-yaml.js +1 -1
  78. package/utils/favicon.js +2 -0
  79. package/utils/fleet.ts +159 -0
  80. package/utils/gc/gc.ts +1 -1
  81. package/utils/v-sphere.ts +31 -0
  82. package/utils/validators/cron-schedule.js +1 -1
  83. package/utils/validators/formRules/index.ts +1 -1
@@ -40,6 +40,7 @@ export default {
40
40
  allBundles: {
41
41
  inStoreType: 'management',
42
42
  type: FLEET.BUNDLE,
43
+ opt: { excludeFields: ['metadata.managedFields', 'spec.resources'] },
43
44
  },
44
45
  gitRepos: {
45
46
  inStoreType: 'management',
@@ -300,7 +301,7 @@ export default {
300
301
  </script>
301
302
 
302
303
  <template>
303
- <div class="fleet-dashboard">
304
+ <div>
304
305
  <Loading v-if="$fetchState.pending" />
305
306
  <!-- no git repos -->
306
307
  <FleetNoWorkspaces
@@ -450,9 +451,6 @@ export default {
450
451
  </template>
451
452
 
452
453
  <style lang="scss" scoped>
453
- .fleet-dashboard {
454
- min-height: 100vh;
455
- }
456
454
  .fleet-empty-dashboard {
457
455
  flex: 1;
458
456
  display: flex;
@@ -141,6 +141,9 @@ export default {
141
141
  const schema = this.$store.getters[`management/schemaFor`](MANAGEMENT.SETTING);
142
142
 
143
143
  return schema?.resourceMethods?.includes('PUT') ? _EDIT : _VIEW;
144
+ },
145
+ customLinkColor() {
146
+ return { color: this.uiLinkColor };
144
147
  }
145
148
  },
146
149
 
@@ -564,7 +567,7 @@ export default {
564
567
  component-testid="link"
565
568
  />
566
569
  <span class="col link-example">
567
- <a>
570
+ <a :style="customLinkColor">
568
571
  {{ t('branding.linkColor.example') }}
569
572
  </a>
570
573
  </span>
package/pages/prefs.vue CHANGED
@@ -40,6 +40,11 @@ export default {
40
40
  scalingDownPrompt: mapPref(SCALE_POOL_PROMPT),
41
41
 
42
42
  ...mapGetters(['isSingleProduct']),
43
+ ...mapGetters({ hasMultipleLocales: 'i18n/hasMultipleLocales' }),
44
+
45
+ isHarvester() {
46
+ return this.isSingleProduct?.productName === 'harvester';
47
+ },
43
48
 
44
49
  theme: {
45
50
  get() {
@@ -182,7 +187,10 @@ export default {
182
187
  </h1>
183
188
 
184
189
  <!-- Language -->
185
- <div class="mt-10 mb-10">
190
+ <div
191
+ v-if="hasMultipleLocales && !isHarvester"
192
+ class="mt-10 mb-10"
193
+ >
186
194
  <h4 v-t="'prefs.language'" />
187
195
  <div class="row">
188
196
  <div class="col span-4">
@@ -194,7 +202,6 @@ export default {
194
202
  </div>
195
203
  <!-- Theme -->
196
204
  <div class="mt-10 mb-10">
197
- <hr>
198
205
  <h4 v-t="'prefs.theme.label'" />
199
206
  <ButtonGroup
200
207
  v-model:value="theme"
@@ -262,7 +269,10 @@ export default {
262
269
  </div>
263
270
  </div>
264
271
  <!-- Confirmation setting -->
265
- <div class="col adv-features mt-10 mb-10">
272
+ <div
273
+ v-if="!isSingleProduct"
274
+ class="col adv-features mt-10 mb-10"
275
+ >
266
276
  <hr>
267
277
  <h4 v-t="'prefs.confirmationSetting.title'" />
268
278
  <Checkbox
@@ -282,13 +292,15 @@ export default {
282
292
  :label="t('prefs.advFeatures.viewInApi', {}, true)"
283
293
  class="mt-10"
284
294
  />
285
- <br>
286
- <Checkbox
287
- v-model:value="allNamespaces"
288
- data-testid="prefs__allNamespaces"
289
- :label="t('prefs.advFeatures.allNamespaces', {}, true)"
290
- class="mt-20"
291
- />
295
+ <template v-if="!isHarvester">
296
+ <br>
297
+ <Checkbox
298
+ v-model:value="allNamespaces"
299
+ data-testid="prefs__allNamespaces"
300
+ :label="t('prefs.advFeatures.allNamespaces', {}, true)"
301
+ class="mt-20"
302
+ />
303
+ </template>
292
304
  <br>
293
305
  <Checkbox
294
306
  v-model:value="themeShortcut"
@@ -9,7 +9,7 @@ import {
9
9
  AS,
10
10
  MODE
11
11
  } from '@shell/config/query-params';
12
- import { VIEW_IN_API } from '@shell/store/prefs';
12
+ import { VIEW_IN_API, DEV } from '@shell/store/prefs';
13
13
  import { addObject, addObjects, findBy, removeAt } from '@shell/utils/array';
14
14
  import CustomValidators from '@shell/utils/custom-validators';
15
15
  import { downloadFile, generateZip } from '@shell/utils/download';
@@ -84,6 +84,7 @@ export const STATES_ENUM = {
84
84
  DISCONNECTED: 'disconnected',
85
85
  DRAINED: 'drained',
86
86
  DRAINING: 'draining',
87
+ ENABLED: 'enabled',
87
88
  ERR_APPLIED: 'errapplied',
88
89
  ERROR: 'error',
89
90
  ERRORING: 'erroring',
@@ -232,6 +233,9 @@ export const STATES = {
232
233
  [STATES_ENUM.DRAINING]: {
233
234
  color: 'warning', icon: 'tag', label: 'Draining', compoundIcon: 'warning'
234
235
  },
236
+ [STATES_ENUM.ENABLED]: {
237
+ color: 'success', icon: 'dot-open', label: 'Enabled', compoundIcon: 'checkmark'
238
+ },
235
239
  [STATES_ENUM.ERR_APPLIED]: {
236
240
  color: 'error', icon: 'error', label: 'Error Applied', compoundIcon: 'error'
237
241
  },
@@ -997,7 +1001,11 @@ export default class Resource {
997
1001
  }
998
1002
 
999
1003
  get canViewInApi() {
1000
- return this.hasLink('self') && this.$rootGetters['prefs/get'](VIEW_IN_API);
1004
+ try {
1005
+ return this.hasLink('self') && this.$rootGetters['prefs/get'](VIEW_IN_API);
1006
+ } catch {
1007
+ return this.hasLink('self') && this.$rootGetters['prefs/get'](DEV);
1008
+ }
1001
1009
  }
1002
1010
 
1003
1011
  get canYaml() {
@@ -1055,7 +1063,7 @@ export default class Resource {
1055
1063
 
1056
1064
  async doActionGrowl(actionName, body, opt = {}) {
1057
1065
  try {
1058
- await this.$dispatch('resourceAction', {
1066
+ return await this.$dispatch('resourceAction', {
1059
1067
  resource: this,
1060
1068
  actionName,
1061
1069
  body,
@@ -6,7 +6,7 @@ import { uniq } from '@shell/utils/array';
6
6
  import {
7
7
  CONFIG_MAP, MANAGEMENT, NAMESPACE, NODE, POD
8
8
  } from '@shell/config/types';
9
- import { Schema } from 'plugins/steve/schema';
9
+ import { Schema } from '@shell/plugins/steve/schema';
10
10
 
11
11
  class NamespaceProjectFilters {
12
12
  /**
@@ -177,11 +177,16 @@ export default defineComponent({
177
177
  if (this.type !== 'cron' || !this.value) {
178
178
  return;
179
179
  }
180
- if (typeof this.value === 'string' && !isValidCron(this.value)) {
180
+ // refer https://github.com/GuillaumeRochat/cron-validator#readme
181
+ if (!isValidCron(this.value as string, {
182
+ alias: true,
183
+ allowBlankDay: true,
184
+ allowSevenAsSunday: true,
185
+ })) {
181
186
  return this.t('generic.invalidCron');
182
187
  }
183
188
  try {
184
- const hint = cronstrue.toString(this.value || '');
189
+ const hint = cronstrue.toString(this.value as string || '', { verbose: true });
185
190
 
186
191
  return hint;
187
192
  } catch (e) {
package/store/features.js CHANGED
@@ -35,6 +35,7 @@ export const HARVESTER_CONTAINER = create('harvester-baremetal-container-workloa
35
35
  export const FLEET_WORKSPACE_BACK = create('provisioningv2-fleet-workspace-back-population', false);
36
36
  export const STEVE_CACHE = create('ui-sql-cache', false);
37
37
  export const UIEXTENSION = create('uiextension', true);
38
+ export const PROVISIONING_PRE_BOOTSTRAP = create('provisioningprebootstrap', false);
38
39
 
39
40
  // Not currently used.. no point defining ones we don't use
40
41
  // export const EMBEDDED_CLUSTER_API = create('embedded-cluster-api', true);
package/store/i18n.js CHANGED
@@ -58,6 +58,10 @@ export const getters = {
58
58
  return out;
59
59
  },
60
60
 
61
+ hasMultipleLocales(state) {
62
+ return state.available.length > 1;
63
+ },
64
+
61
65
  t: (state) => (key, args, language) => {
62
66
  if (state.selected === NONE && !language) {
63
67
  return `%${ key }%`;
@@ -333,7 +337,7 @@ export const actions = {
333
337
 
334
338
  commit('setSelected', locale);
335
339
 
336
- // Ony update the preference if the locale changed
340
+ // Only update the preference if the locale changed
337
341
  if (currentLocale !== locale) {
338
342
  dispatch('prefs/set', {
339
343
  key: 'locale',
package/store/prefs.js CHANGED
@@ -233,6 +233,14 @@ export const getters = {
233
233
  default:
234
234
  return { name: afterLoginRoutePref };
235
235
  }
236
+ },
237
+
238
+ dev: (state, getters) => {
239
+ try {
240
+ return getters['get'](PLUGIN_DEVELOPER);
241
+ } catch {
242
+ return getters['get'](DEV);
243
+ }
236
244
  }
237
245
  };
238
246
 
@@ -0,0 +1,40 @@
1
+ export interface BundleResourceKey {
2
+ kind: string,
3
+ apiVersion: string,
4
+ namespace?: string,
5
+ name: string,
6
+ }
7
+
8
+ export interface BundleDeploymentResource extends BundleResourceKey {
9
+ createdAt?: string,
10
+ }
11
+
12
+ export interface BundleModifiedResource extends BundleResourceKey {
13
+ missing?: boolean,
14
+ delete?: boolean,
15
+ patch: string,
16
+ }
17
+
18
+ export interface BundleNonReadyResource extends BundleResourceKey {
19
+ summary: { [state: string]: string }
20
+ }
21
+
22
+ export interface BundleNonReadyBundle {
23
+ modifiedStatus: BundleModifiedResource[],
24
+ nonReadyStatus: BundleNonReadyResource[],
25
+ }
26
+
27
+ export interface BundleDeploymentStatus {
28
+ resources?: BundleDeploymentResource[],
29
+ modifiedStatus?: BundleModifiedResource[],
30
+ nonReadyStatus?: BundleNonReadyResource[],
31
+ }
32
+
33
+ export interface BundleStatusSummary {
34
+ nonReadyResources?: BundleNonReadyBundle[],
35
+ }
36
+
37
+ export interface BundleStatus {
38
+ resourceKey?: BundleResourceKey[],
39
+ summary?: BundleStatusSummary,
40
+ }