@rancher/shell 3.0.9 → 3.0.11

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 (104) hide show
  1. package/assets/styles/base/_color.scss +4 -0
  2. package/assets/styles/themes/_light.scss +6 -6
  3. package/assets/styles/themes/_modern.scss +14 -6
  4. package/assets/translations/en-us.yaml +9 -10
  5. package/chart/__tests__/rancher-backup-index.test.ts +248 -0
  6. package/chart/rancher-backup/index.vue +41 -2
  7. package/components/BrandImage.vue +6 -5
  8. package/components/ConsumptionGauge.vue +12 -4
  9. package/components/CopyToClipboard.vue +28 -0
  10. package/components/CopyToClipboardText.vue +4 -0
  11. package/components/CruResource.vue +1 -0
  12. package/components/DynamicContent/DynamicContentIcon.vue +3 -2
  13. package/components/ExplorerProjectsNamespaces.vue +1 -4
  14. package/components/GlobalRoleBindings.vue +1 -5
  15. package/components/LazyImage.vue +2 -1
  16. package/components/Resource/Detail/Card/Scaler.vue +4 -4
  17. package/components/ResourceDetail/index.vue +0 -21
  18. package/components/Tabbed/index.vue +6 -0
  19. package/components/__tests__/ConsumptionGauge.test.ts +31 -0
  20. package/components/__tests__/CruResource.test.ts +35 -1
  21. package/components/form/ProjectMemberEditor.vue +0 -10
  22. package/components/nav/TopLevelMenu.helper.ts +7 -79
  23. package/components/nav/__tests__/TopLevelMenu.helper.test.ts +2 -53
  24. package/composables/useIsNewDetailPageEnabled.test.ts +98 -0
  25. package/composables/useIsNewDetailPageEnabled.ts +12 -0
  26. package/config/private-label.js +2 -1
  27. package/config/product/apps.js +1 -0
  28. package/config/product/explorer.js +11 -1
  29. package/config/table-headers.js +0 -9
  30. package/config/types.js +0 -1
  31. package/core/__tests__/extension-manager-impl.test.js +187 -2
  32. package/core/extension-manager-impl.js +4 -2
  33. package/core/plugin-helpers.ts +31 -0
  34. package/detail/__tests__/node.test.ts +83 -0
  35. package/detail/management.cattle.io.oidcclient.vue +2 -1
  36. package/detail/node.vue +1 -0
  37. package/edit/auth/github-app-steps.vue +2 -0
  38. package/edit/auth/github-steps.vue +2 -0
  39. package/edit/catalog.cattle.io.clusterrepo.vue +17 -3
  40. package/edit/cloudcredential.vue +2 -1
  41. package/edit/management.cattle.io.user.vue +60 -35
  42. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +11 -6
  43. package/edit/provisioning.cattle.io.cluster/index.vue +5 -4
  44. package/edit/provisioning.cattle.io.cluster/shared.ts +4 -2
  45. package/edit/secret/generic.vue +1 -0
  46. package/edit/secret/index.vue +2 -1
  47. package/edit/service.vue +2 -14
  48. package/edit/token.vue +29 -68
  49. package/list/management.cattle.io.feature.vue +7 -1
  50. package/list/provisioning.cattle.io.cluster.vue +0 -49
  51. package/mixins/brand.js +2 -1
  52. package/models/catalog.cattle.io.clusterrepo.js +9 -0
  53. package/models/cluster.x-k8s.io.machinedeployment.js +8 -3
  54. package/models/management.cattle.io.authconfig.js +2 -1
  55. package/models/management.cattle.io.cluster.js +4 -3
  56. package/models/monitoring.coreos.com.receiver.js +11 -6
  57. package/models/provisioning.cattle.io.cluster.js +2 -2
  58. package/models/token.js +0 -4
  59. package/package.json +12 -12
  60. package/pages/account/index.vue +67 -96
  61. package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +66 -9
  62. package/pages/c/_cluster/apps/charts/index.vue +3 -8
  63. package/pages/c/_cluster/apps/charts/install.vue +8 -9
  64. package/pages/c/_cluster/explorer/index.vue +2 -19
  65. package/pages/c/_cluster/istio/index.vue +4 -2
  66. package/pages/c/_cluster/longhorn/index.vue +2 -1
  67. package/pages/c/_cluster/monitoring/index.vue +2 -2
  68. package/pages/c/_cluster/neuvector/index.vue +2 -1
  69. package/pages/c/_cluster/settings/performance.vue +0 -5
  70. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +2 -1
  71. package/pages/c/_cluster/uiplugins/index.vue +2 -1
  72. package/pkg/auto-import.js +41 -0
  73. package/plugins/dashboard-store/resource-class.js +2 -2
  74. package/plugins/steve/__tests__/steve-class.test.ts +1 -1
  75. package/plugins/steve/steve-class.js +3 -3
  76. package/plugins/steve/steve-pagination-utils.ts +2 -5
  77. package/plugins/steve/subscribe.js +29 -4
  78. package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.vue +7 -7
  79. package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +5 -2
  80. package/rancher-components/RcButton/RcButton.vue +3 -3
  81. package/rancher-components/RcButtonSplit/RcButtonSplit.test.ts +253 -0
  82. package/rancher-components/RcButtonSplit/RcButtonSplit.vue +158 -0
  83. package/rancher-components/RcButtonSplit/index.ts +1 -0
  84. package/rancher-components/RcIcon/types.ts +2 -2
  85. package/rancher-components/RcSection/RcSection.test.ts +323 -0
  86. package/rancher-components/RcSection/RcSection.vue +252 -0
  87. package/rancher-components/RcSection/RcSectionActions.test.ts +212 -0
  88. package/rancher-components/RcSection/RcSectionActions.vue +85 -0
  89. package/rancher-components/RcSection/RcSectionBadges.test.ts +149 -0
  90. package/rancher-components/RcSection/RcSectionBadges.vue +29 -0
  91. package/rancher-components/RcSection/index.ts +12 -0
  92. package/rancher-components/RcSection/types.ts +86 -0
  93. package/scripts/test-plugins-build.sh +9 -8
  94. package/types/shell/index.d.ts +93 -108
  95. package/utils/__tests__/require-asset.test.ts +98 -0
  96. package/utils/async.ts +1 -5
  97. package/utils/brand.ts +3 -1
  98. package/utils/favicon.js +4 -3
  99. package/utils/require-asset.ts +95 -0
  100. package/utils/style.ts +17 -0
  101. package/utils/units.js +14 -5
  102. package/vue.config.js +4 -3
  103. package/components/HarvesterServiceAddOnConfig.vue +0 -207
  104. package/models/ext.cattle.io.token.js +0 -48
@@ -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>
@@ -1,48 +0,0 @@
1
- import SteveModel from '@shell/plugins/steve/steve-class';
2
-
3
- export default class SteveToken extends SteveModel {
4
- // for now, we are only showing the new tokens in the UI. Later we will be able to edit a few of it's fields
5
- get _availableActions() {
6
- return super._availableActions.filter((a) => ['viewInApi', 'promptRemove'].includes(a.action));
7
- }
8
-
9
- cleanForSave(data) {
10
- const val = super.cleanForSave(data);
11
-
12
- delete val.type;
13
-
14
- return val;
15
- }
16
-
17
- get isDeprecated() {
18
- return undefined;
19
- }
20
-
21
- get state() {
22
- return this.isExpired ? 'expired' : !this.spec?.enabled ? 'inactive' : 'active';
23
- }
24
-
25
- get isExpired() {
26
- return this.status?.expired;
27
- }
28
-
29
- get expiresAt() {
30
- return this.status?.expiresAt || '';
31
- }
32
-
33
- get lastUsedAt() {
34
- return this.status?.lastUsedAt || '';
35
- }
36
-
37
- get description() {
38
- return this.spec?.description || '';
39
- }
40
-
41
- get clusterId() {
42
- return this.spec?.clusterName || '';
43
- }
44
-
45
- get created() {
46
- return this.metadata?.creationTimestamp;
47
- }
48
- }