@rancher/shell 3.0.10 → 3.0.12-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 (154) hide show
  1. package/assets/styles/base/_mixins.scss +31 -0
  2. package/assets/styles/base/_variables.scss +2 -0
  3. package/assets/styles/themes/_modern.scss +6 -5
  4. package/assets/translations/en-us.yaml +12 -9
  5. package/assets/translations/zh-hans.yaml +0 -3
  6. package/chart/__tests__/rancher-backup-index.test.ts +248 -0
  7. package/chart/rancher-backup/index.vue +41 -2
  8. package/components/BrandImage.vue +6 -5
  9. package/components/ConsumptionGauge.vue +12 -4
  10. package/components/DynamicContent/DynamicContentIcon.vue +3 -2
  11. package/components/EmptyProductPage.vue +76 -0
  12. package/components/ExplorerProjectsNamespaces.vue +1 -4
  13. package/components/LazyImage.vue +2 -1
  14. package/components/Resource/Detail/Card/Scaler.vue +4 -4
  15. package/components/Resource/Detail/CopyToClipboard.vue +1 -2
  16. package/components/Resource/Detail/Metadata/KeyValueRow.vue +9 -3
  17. package/components/Resource/Detail/TitleBar/__tests__/__snapshots__/index.test.ts.snap +31 -0
  18. package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +45 -1
  19. package/components/Resource/Detail/TitleBar/index.vue +1 -1
  20. package/components/Resource/Detail/ViewOptions/__tests__/__snapshots__/index.test.ts.snap +9 -0
  21. package/components/Resource/Detail/ViewOptions/__tests__/index.test.ts +62 -0
  22. package/components/Resource/Detail/ViewOptions/index.vue +2 -1
  23. package/components/ResourceList/Masthead.vue +25 -2
  24. package/components/SideNav.vue +13 -0
  25. package/components/Tabbed/index.vue +6 -0
  26. package/components/__tests__/ConsumptionGauge.test.ts +31 -0
  27. package/components/__tests__/PromptModal.test.ts +2 -0
  28. package/components/fleet/FleetClusters.vue +1 -0
  29. package/components/fleet/__tests__/FleetClusters.test.ts +71 -0
  30. package/components/form/NodeScheduling.vue +17 -3
  31. package/components/form/PrivateRegistry.vue +69 -0
  32. package/components/form/ProjectMemberEditor.vue +0 -10
  33. package/components/form/__tests__/PrivateRegistry.test.ts +133 -0
  34. package/components/formatter/WorkloadHealthScale.vue +3 -1
  35. package/components/nav/Group.vue +26 -3
  36. package/components/nav/Header.vue +32 -7
  37. package/components/nav/TopLevelMenu.helper.ts +7 -79
  38. package/components/nav/TopLevelMenu.vue +15 -1
  39. package/components/nav/__tests__/TopLevelMenu.helper.test.ts +2 -53
  40. package/config/pagination-table-headers.js +8 -1
  41. package/config/private-label.js +2 -1
  42. package/config/product/apps.js +3 -1
  43. package/config/product/auth.js +1 -0
  44. package/config/product/backup.js +1 -0
  45. package/config/product/compliance.js +1 -1
  46. package/config/product/explorer.js +25 -6
  47. package/config/product/fleet.js +1 -0
  48. package/config/product/gatekeeper.js +1 -0
  49. package/config/product/istio.js +1 -0
  50. package/config/product/logging.js +1 -0
  51. package/config/product/longhorn.js +2 -1
  52. package/config/product/manager.js +1 -0
  53. package/config/product/monitoring.js +1 -0
  54. package/config/product/navlinks.js +1 -0
  55. package/config/product/neuvector.js +2 -1
  56. package/config/product/settings.js +1 -0
  57. package/config/product/uiplugins.js +1 -0
  58. package/core/__tests__/extension-manager-impl.test.js +187 -2
  59. package/core/__tests__/plugin-products-helpers.test.ts +454 -0
  60. package/core/__tests__/plugin-products.test.ts +3219 -0
  61. package/core/extension-manager-impl.js +34 -3
  62. package/core/plugin-helpers.ts +31 -0
  63. package/core/plugin-products-base.ts +375 -0
  64. package/core/plugin-products-extending.ts +44 -0
  65. package/core/plugin-products-helpers.ts +262 -0
  66. package/core/plugin-products-top-level.ts +66 -0
  67. package/core/plugin-products-type-guards.ts +33 -0
  68. package/core/plugin-products.ts +50 -0
  69. package/core/plugin-types.ts +222 -0
  70. package/core/plugin.ts +45 -10
  71. package/core/productDebugger.js +48 -0
  72. package/core/types.ts +95 -11
  73. package/detail/__tests__/__snapshots__/fleet.cattle.io.bundle.test.ts.snap +52 -0
  74. package/detail/__tests__/fleet.cattle.io.bundle.test.ts +171 -0
  75. package/detail/__tests__/node.test.ts +83 -0
  76. package/detail/fleet.cattle.io.bundle.vue +21 -34
  77. package/detail/management.cattle.io.oidcclient.vue +2 -1
  78. package/detail/node.vue +1 -0
  79. package/dialog/ExtensionCatalogInstallDialog.vue +1 -1
  80. package/dialog/InstallExtensionDialog.vue +6 -27
  81. package/dialog/UninstallExistingExtensionDialog.vue +141 -0
  82. package/dialog/UninstallExtensionDialog.vue +4 -26
  83. package/dialog/__tests__/UninstallExistingExtensionDialog.test.ts +114 -0
  84. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -0
  85. package/edit/catalog.cattle.io.clusterrepo.vue +17 -3
  86. package/edit/cloudcredential.vue +2 -1
  87. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +11 -6
  88. package/edit/provisioning.cattle.io.cluster/__tests__/Ingress.test.ts +176 -0
  89. package/edit/provisioning.cattle.io.cluster/index.vue +5 -4
  90. package/edit/provisioning.cattle.io.cluster/rke2.vue +4 -1
  91. package/edit/provisioning.cattle.io.cluster/shared.ts +4 -2
  92. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +6 -0
  93. package/edit/provisioning.cattle.io.cluster/tabs/Ingress.vue +7 -2
  94. package/edit/secret/generic.vue +1 -0
  95. package/edit/secret/index.vue +2 -1
  96. package/edit/service.vue +2 -14
  97. package/list/management.cattle.io.feature.vue +7 -1
  98. package/list/provisioning.cattle.io.cluster.vue +0 -50
  99. package/list/workload.vue +11 -4
  100. package/mixins/brand.js +2 -1
  101. package/mixins/resource-fetch.js +12 -3
  102. package/models/catalog.cattle.io.clusterrepo.js +9 -0
  103. package/models/cluster.x-k8s.io.machinedeployment.js +8 -3
  104. package/models/management.cattle.io.authconfig.js +2 -1
  105. package/models/management.cattle.io.cluster.js +4 -3
  106. package/models/monitoring.coreos.com.receiver.js +11 -6
  107. package/models/pod.js +18 -0
  108. package/models/provisioning.cattle.io.cluster.js +2 -2
  109. package/models/workload.js +20 -2
  110. package/package.json +5 -6
  111. package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +0 -1
  112. package/pages/c/_cluster/apps/charts/index.vue +3 -8
  113. package/pages/c/_cluster/apps/charts/install.vue +8 -9
  114. package/pages/c/_cluster/istio/index.vue +4 -2
  115. package/pages/c/_cluster/longhorn/index.vue +2 -1
  116. package/pages/c/_cluster/monitoring/index.vue +2 -2
  117. package/pages/c/_cluster/neuvector/index.vue +2 -1
  118. package/pages/c/_cluster/settings/brand.vue +4 -4
  119. package/pages/c/_cluster/settings/performance.vue +0 -5
  120. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +2 -1
  121. package/pages/c/_cluster/uiplugins/__tests__/index.test.ts +231 -13
  122. package/pages/c/_cluster/uiplugins/index.vue +145 -38
  123. package/plugins/dashboard-store/__tests__/resource-class.test.ts +1 -0
  124. package/plugins/dashboard-store/actions.js +3 -2
  125. package/plugins/dashboard-store/resource-class.js +62 -6
  126. package/plugins/plugin.js +16 -0
  127. package/plugins/steve/steve-pagination-utils.ts +8 -2
  128. package/plugins/steve/subscribe.js +29 -4
  129. package/rancher-components/RcButton/RcButton.vue +3 -3
  130. package/rancher-components/RcButtonSplit/RcButtonSplit.test.ts +253 -0
  131. package/rancher-components/RcButtonSplit/RcButtonSplit.vue +158 -0
  132. package/rancher-components/RcButtonSplit/index.ts +1 -0
  133. package/scripts/test-plugins-build.sh +4 -4
  134. package/scripts/typegen.sh +13 -1
  135. package/store/__tests__/type-map.test.ts +84 -24
  136. package/store/type-map.js +42 -3
  137. package/tsconfig.paths.json +1 -0
  138. package/types/resources/pod.ts +18 -0
  139. package/types/shell/index.d.ts +8506 -2908
  140. package/types/store/dashboard-store.types.ts +5 -0
  141. package/types/store/pagination.types.ts +6 -0
  142. package/utils/__tests__/require-asset.test.ts +98 -0
  143. package/utils/async.ts +1 -5
  144. package/utils/axios.js +1 -4
  145. package/utils/brand.ts +3 -1
  146. package/utils/dynamic-importer.js +3 -2
  147. package/utils/favicon.js +4 -3
  148. package/utils/pagination-utils.ts +1 -1
  149. package/utils/require-asset.ts +95 -0
  150. package/utils/uiplugins.ts +12 -16
  151. package/utils/validators/__tests__/private-registry.test.ts +76 -0
  152. package/utils/validators/private-registry.ts +28 -0
  153. package/vue.config.js +4 -3
  154. package/components/HarvesterServiceAddOnConfig.vue +0 -207
@@ -1,207 +0,0 @@
1
- <script>
2
- import { mapGetters } from 'vuex';
3
- import semver from 'semver';
4
-
5
- import LabeledSelect from '@shell/components/form/LabeledSelect';
6
- import { _CREATE } from '@shell/config/query-params';
7
- import { get } from '@shell/utils/object';
8
- import { HCI as HCI_LABELS_ANNOTATIONS } from '@shell/config/labels-annotations';
9
- import { SERVICE } from '@shell/config/types';
10
- import { allHash } from '@shell/utils/promise';
11
-
12
- const HARVESTER_ADD_ON_CONFIG = [{
13
- variableName: 'ipam',
14
- key: HCI_LABELS_ANNOTATIONS.CLOUD_PROVIDER_IPAM,
15
- default: 'dhcp'
16
- }, {
17
- variableName: 'sharedService',
18
- key: HCI_LABELS_ANNOTATIONS.PRIMARY_SERVICE,
19
- default: ''
20
- }];
21
-
22
- export default {
23
- components: { LabeledSelect },
24
-
25
- props: {
26
- mode: {
27
- type: String,
28
- default: _CREATE,
29
- },
30
-
31
- value: {
32
- type: Object,
33
- default: () => {
34
- return {};
35
- }
36
- },
37
-
38
- registerBeforeHook: {
39
- type: Function,
40
- default: null
41
- },
42
- },
43
-
44
- created() {
45
- if (this.registerBeforeHook) {
46
- this.registerBeforeHook(this.willSave, 'harvesterWillSave');
47
- }
48
- },
49
-
50
- async fetch() {
51
- const inStore = this.$store.getters['currentProduct'].inStore;
52
-
53
- const hash = {
54
- rke2Versions: this.$store.dispatch('management/request', { url: '/v1-rke2-release/releases' }),
55
- services: this.$store.dispatch(`${ inStore }/findAll`, { type: SERVICE }),
56
- };
57
-
58
- const res = await allHash(hash);
59
-
60
- this.rke2Versions = res.rke2Versions;
61
- },
62
-
63
- data() {
64
- const harvesterAddOnConfig = {};
65
-
66
- HARVESTER_ADD_ON_CONFIG.forEach((c) => {
67
- harvesterAddOnConfig[c.variableName] = this.value.metadata.annotations[c.key] || c.default;
68
- });
69
-
70
- let showShareIP;
71
-
72
- if (this.value.metadata.annotations[HCI_LABELS_ANNOTATIONS.PRIMARY_SERVICE]) {
73
- showShareIP = true;
74
- } else {
75
- showShareIP = false;
76
- }
77
-
78
- return {
79
- ...harvesterAddOnConfig,
80
- showShareIP,
81
- rke2Versions: {},
82
- };
83
- },
84
-
85
- computed: {
86
- ...mapGetters(['allowedNamespaces', 'namespaces', 'currentCluster']),
87
-
88
- ipamOptions() {
89
- return [{
90
- label: 'DHCP',
91
- value: 'dhcp',
92
- }, {
93
- label: 'Pool',
94
- value: 'pool',
95
- }];
96
- },
97
-
98
- portOptions() {
99
- const ports = this.value?.spec?.ports || [];
100
-
101
- return ports.filter((p) => p.port && p.protocol === 'TCP').map((p) => p.port) || [];
102
- },
103
-
104
- serviceOptions() {
105
- const inStore = this.$store.getters['currentProduct'].inStore;
106
- const services = this.$store.getters[`${ inStore }/all`](SERVICE);
107
-
108
- const namespaces = this.namespaces();
109
-
110
- const out = services.filter((s) => {
111
- const ingress = s?.status?.loadBalancer?.ingress || [];
112
-
113
- return ingress.length > 0 &&
114
- !s?.metadata?.annotations?.['cloudprovider.harvesterhci.io/primary-service'] &&
115
- s.spec?.type === 'LoadBalancer' &&
116
- namespaces[s.metadata.namespace];
117
- });
118
-
119
- return out.map((s) => s.id);
120
- },
121
-
122
- shareIPEnabled() {
123
- const kubernetesVersion = this.currentCluster.kubernetesVersion || '';
124
- const kubernetesVersionExtension = this.currentCluster.kubernetesVersionExtension;
125
-
126
- if (kubernetesVersionExtension.startsWith('+rke2')) {
127
- const charts = ((this.rke2Versions?.data || []).find((v) => v.id === kubernetesVersion) || {}).charts;
128
- let ccmVersion = charts?.['harvester-cloud-provider']?.version || '';
129
-
130
- if (ccmVersion.endsWith('00')) {
131
- ccmVersion = ccmVersion.slice(0, -2);
132
- }
133
-
134
- return semver.satisfies(ccmVersion, '>=0.2.0');
135
- } else {
136
- return true;
137
- }
138
- },
139
- },
140
-
141
- methods: {
142
- willSave() {
143
- const errors = [];
144
-
145
- if (this.showShareIP) {
146
- if (!this.sharedService) {
147
- errors.push(this.t('validation.required', { key: this.t('servicesPage.harvester.shareIP.label') }, true));
148
- }
149
- }
150
-
151
- if (errors.length > 0) {
152
- return Promise.reject(errors);
153
- }
154
-
155
- HARVESTER_ADD_ON_CONFIG.forEach((c) => {
156
- this.value.metadata.annotations[c.key] = String(get(this, c.variableName));
157
- });
158
-
159
- if (this.showShareIP) {
160
- delete this.value.metadata.annotations[HCI_LABELS_ANNOTATIONS.CLOUD_PROVIDER_IPAM];
161
- } else {
162
- delete this.value.metadata.annotations[HCI_LABELS_ANNOTATIONS.PRIMARY_SERVICE];
163
- }
164
- },
165
-
166
- toggleShareIP() {
167
- this.showShareIP = !this.showShareIP;
168
- },
169
- },
170
- };
171
- </script>
172
-
173
- <template>
174
- <div>
175
- <div class="row mt-30">
176
- <div class="col span-6">
177
- <LabeledSelect
178
- v-if="showShareIP"
179
- v-model:value="sharedService"
180
- :mode="mode"
181
- :options="serviceOptions"
182
- :label="t('servicesPage.harvester.shareIP.label')"
183
- :disabled="mode === 'edit'"
184
- />
185
- <LabeledSelect
186
- v-else
187
- v-model:value="ipam"
188
- :mode="mode"
189
- :options="ipamOptions"
190
- :label="t('servicesPage.harvester.ipam.label')"
191
- :disabled="mode === 'edit'"
192
- />
193
- <div
194
- v-if="mode === 'create'"
195
- class="mt-10"
196
- >
197
- <a
198
- role="button"
199
- @click="toggleShareIP"
200
- >
201
- {{ showShareIP ? t('servicesPage.harvester.useIpam.label') : t('servicesPage.harvester.useShareIP.label') }}
202
- </a>
203
- </div>
204
- </div>
205
- </div>
206
- </div>
207
- </template>