@rancher/shell 3.0.5-rc.3 → 3.0.5-rc.5

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 (200) hide show
  1. package/assets/images/icons/document.svg +3 -0
  2. package/assets/images/vendor/cognito.svg +1 -0
  3. package/assets/styles/app.scss +1 -0
  4. package/assets/styles/base/_basic.scss +10 -0
  5. package/assets/styles/base/_spacing.scss +29 -0
  6. package/assets/styles/global/_layout.scss +1 -1
  7. package/assets/styles/themes/_dark.scss +25 -0
  8. package/assets/styles/themes/_light.scss +65 -0
  9. package/assets/translations/en-us.yaml +322 -24
  10. package/assets/translations/zh-hans.yaml +8 -5
  11. package/components/Certificates.vue +5 -0
  12. package/components/FilterPanel.vue +156 -0
  13. package/components/{fleet/ForceDirectedTreeChart/index.vue → ForceDirectedTreeChart.vue} +47 -41
  14. package/components/IconOrSvg.vue +14 -35
  15. package/components/PromptRemove.vue +5 -1
  16. package/components/Resource/Detail/Card/PodsCard/Bubble.vue +13 -0
  17. package/components/Resource/Detail/Card/PodsCard/composable.ts +30 -0
  18. package/components/Resource/Detail/Card/PodsCard/index.vue +118 -0
  19. package/components/Resource/Detail/Card/ResourceUsageCard/composable.ts +51 -0
  20. package/components/Resource/Detail/Card/ResourceUsageCard/index.vue +79 -0
  21. package/components/Resource/Detail/Card/Scaler.vue +89 -0
  22. package/components/Resource/Detail/Card/StateCard/composables.ts +112 -0
  23. package/components/Resource/Detail/Card/StateCard/index.vue +39 -0
  24. package/components/Resource/Detail/Card/VerticalGap.vue +11 -0
  25. package/components/Resource/Detail/Card/__tests__/Card.test.ts +36 -0
  26. package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +84 -0
  27. package/components/Resource/Detail/Card/__tests__/ResourceUsageCard.test.ts +72 -0
  28. package/components/Resource/Detail/Card/__tests__/Scaler.test.ts +87 -0
  29. package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +53 -0
  30. package/components/Resource/Detail/Card/__tests__/VerticalGap.test.ts +14 -0
  31. package/components/Resource/Detail/Card/__tests__/index.test.ts +36 -0
  32. package/components/Resource/Detail/Card/index.vue +56 -0
  33. package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +19 -0
  34. package/components/Resource/Detail/Metadata/Annotations/composable.ts +12 -0
  35. package/components/Resource/Detail/Metadata/Annotations/index.vue +26 -0
  36. package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +103 -0
  37. package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +281 -0
  38. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +111 -0
  39. package/components/Resource/Detail/Metadata/KeyValue.vue +130 -0
  40. package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +18 -0
  41. package/components/Resource/Detail/Metadata/Labels/composable.ts +12 -0
  42. package/components/Resource/Detail/Metadata/Labels/index.vue +27 -0
  43. package/components/Resource/Detail/Metadata/Rectangle.vue +32 -0
  44. package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +107 -0
  45. package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +24 -0
  46. package/components/Resource/Detail/Metadata/__tests__/index.test.ts +91 -0
  47. package/components/Resource/Detail/Metadata/composables.ts +29 -0
  48. package/components/Resource/Detail/Metadata/index.vue +66 -0
  49. package/components/Resource/Detail/Page.vue +22 -0
  50. package/components/Resource/Detail/PercentageBar.vue +40 -0
  51. package/components/Resource/Detail/ResourceRow.vue +119 -0
  52. package/components/Resource/Detail/SpacedRow.vue +14 -0
  53. package/components/Resource/Detail/StatusBar.vue +59 -0
  54. package/components/Resource/Detail/StatusRow.vue +61 -0
  55. package/components/Resource/Detail/TitleBar/Title.vue +13 -0
  56. package/components/Resource/Detail/TitleBar/Top.vue +14 -0
  57. package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +17 -0
  58. package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +17 -0
  59. package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +142 -0
  60. package/components/Resource/Detail/TitleBar/composable.ts +31 -0
  61. package/components/Resource/Detail/TitleBar/index.vue +124 -0
  62. package/components/Resource/Detail/Top/index.vue +34 -0
  63. package/components/Resource/Detail/__tests__/Page.test.ts +32 -0
  64. package/components/ResourceDetail/__tests__/index.test.ts +114 -0
  65. package/components/ResourceDetail/index.vue +64 -562
  66. package/components/ResourceDetail/legacy.vue +545 -0
  67. package/components/ResourceTable.vue +41 -7
  68. package/components/SlideInPanelManager.vue +76 -8
  69. package/components/SortableTable/index.vue +13 -2
  70. package/components/SortableTable/selection.js +21 -8
  71. package/components/StatusBadge.vue +6 -4
  72. package/components/SubtleLink.vue +25 -0
  73. package/components/Wizard.vue +12 -1
  74. package/components/YamlEditor.vue +1 -1
  75. package/components/__tests__/FilterPanel.test.ts +81 -0
  76. package/components/auth/AuthBanner.vue +2 -3
  77. package/components/auth/RoleDetailEdit.vue +45 -3
  78. package/components/auth/login/oidc.vue +6 -1
  79. package/components/fleet/FleetApplications.vue +181 -0
  80. package/components/fleet/FleetHelmOps.vue +115 -0
  81. package/components/fleet/FleetIntro.vue +58 -28
  82. package/components/fleet/FleetNoWorkspaces.vue +5 -1
  83. package/components/fleet/FleetOCIStorageSecret.vue +171 -0
  84. package/components/fleet/FleetRepos.vue +38 -76
  85. package/components/fleet/FleetResources.vue +50 -22
  86. package/components/fleet/FleetSummary.vue +26 -51
  87. package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +213 -0
  88. package/components/fleet/__tests__/FleetSummary.test.ts +39 -39
  89. package/components/fleet/dashboard/Empty.vue +73 -0
  90. package/components/fleet/dashboard/ResourceCard.vue +183 -0
  91. package/components/fleet/dashboard/ResourceCardSummary.vue +199 -0
  92. package/components/fleet/dashboard/ResourceDetails.vue +196 -0
  93. package/components/fleet/dashboard/ResourcePanel.vue +376 -0
  94. package/components/form/ArrayList.vue +6 -0
  95. package/components/form/SimpleSecretSelector.vue +8 -2
  96. package/components/form/ValueFromResource.vue +31 -19
  97. package/components/formatter/FleetApplicationClustersReady.vue +77 -0
  98. package/components/formatter/FleetApplicationSource.vue +71 -0
  99. package/components/formatter/FleetSummaryGraph.vue +7 -0
  100. package/components/nav/Header.vue +8 -7
  101. package/components/nav/TopLevelMenu.helper.ts +55 -34
  102. package/components/nav/TopLevelMenu.vue +11 -0
  103. package/components/nav/Type.vue +4 -1
  104. package/composables/useI18n.ts +12 -11
  105. package/config/labels-annotations.js +14 -11
  106. package/config/product/auth.js +1 -0
  107. package/config/product/fleet.js +70 -17
  108. package/config/query-params.js +3 -1
  109. package/config/roles.ts +1 -0
  110. package/config/router/routes.js +20 -2
  111. package/config/secret.ts +15 -0
  112. package/config/settings.ts +3 -2
  113. package/config/table-headers.js +52 -22
  114. package/config/types.js +2 -0
  115. package/core/plugin-helpers.ts +3 -2
  116. package/detail/fleet.cattle.io.cluster.vue +28 -15
  117. package/detail/fleet.cattle.io.gitrepo.vue +10 -1
  118. package/detail/fleet.cattle.io.helmop.vue +157 -0
  119. package/dialog/HelmOpForceUpdateDialog.vue +132 -0
  120. package/dialog/RedeployWorkloadDialog.vue +164 -0
  121. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +56 -67
  122. package/edit/auth/oidc.vue +159 -93
  123. package/edit/fleet.cattle.io.gitrepo.vue +26 -33
  124. package/edit/fleet.cattle.io.helmop.vue +997 -0
  125. package/edit/management.cattle.io.fleetworkspace.vue +43 -10
  126. package/list/fleet.cattle.io.gitrepo.vue +1 -1
  127. package/list/fleet.cattle.io.helmop.vue +108 -0
  128. package/list/namespace.vue +5 -2
  129. package/mixins/auth-config.js +8 -1
  130. package/mixins/preset.js +100 -0
  131. package/mixins/resource-fetch-api-pagination.js +2 -0
  132. package/mixins/resource-fetch.js +1 -1
  133. package/mixins/resource-table-watch.js +45 -0
  134. package/models/__tests__/chart.test.ts +273 -0
  135. package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
  136. package/models/chart.js +144 -2
  137. package/models/fleet-application.js +385 -0
  138. package/models/fleet.cattle.io.bundle.js +9 -8
  139. package/models/fleet.cattle.io.gitrepo.js +41 -365
  140. package/models/fleet.cattle.io.helmop.js +228 -0
  141. package/models/management.cattle.io.authconfig.js +1 -0
  142. package/models/management.cattle.io.fleetworkspace.js +12 -0
  143. package/models/workload.js +14 -18
  144. package/package.json +2 -1
  145. package/pages/auth/verify.vue +13 -1
  146. package/pages/c/_cluster/apps/charts/AddRepoLink.vue +37 -0
  147. package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +80 -0
  148. package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +54 -0
  149. package/pages/c/_cluster/apps/charts/StatusLabel.vue +33 -0
  150. package/pages/c/_cluster/apps/charts/index.vue +302 -484
  151. package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
  152. package/pages/c/_cluster/fleet/__tests__/index.test.ts +426 -0
  153. package/pages/c/_cluster/fleet/application/_resource/_id.vue +14 -0
  154. package/pages/c/_cluster/fleet/application/_resource/create.vue +14 -0
  155. package/pages/c/_cluster/fleet/application/create.vue +340 -0
  156. package/pages/c/_cluster/fleet/application/index.vue +139 -0
  157. package/pages/c/_cluster/fleet/graph/config.js +277 -0
  158. package/pages/c/_cluster/fleet/index.vue +772 -330
  159. package/pages/explorer/resource/detail/configmap.vue +19 -0
  160. package/plugins/dashboard-store/actions.js +31 -9
  161. package/plugins/dashboard-store/getters.js +34 -21
  162. package/plugins/dashboard-store/mutations.js +51 -7
  163. package/plugins/dashboard-store/resource-class.js +14 -2
  164. package/plugins/steve/__tests__/subscribe.spec.ts +66 -1
  165. package/plugins/steve/actions.js +3 -0
  166. package/plugins/steve/steve-pagination-utils.ts +14 -13
  167. package/plugins/steve/subscribe.js +229 -42
  168. package/rancher-components/BadgeState/BadgeState.vue +3 -1
  169. package/rancher-components/Form/Checkbox/Checkbox.vue +2 -2
  170. package/rancher-components/RcItemCard/RcItemCard.test.ts +189 -0
  171. package/rancher-components/RcItemCard/RcItemCard.vue +425 -0
  172. package/rancher-components/RcItemCard/RcItemCardAction.vue +24 -0
  173. package/rancher-components/RcItemCard/index.ts +2 -0
  174. package/store/auth.js +1 -0
  175. package/store/catalog.js +62 -24
  176. package/store/index.js +33 -14
  177. package/store/slideInPanel.ts +6 -0
  178. package/store/type-map.js +1 -0
  179. package/types/fleet.d.ts +35 -0
  180. package/types/resources/settings.d.ts +19 -1
  181. package/types/shell/index.d.ts +339 -272
  182. package/types/store/dashboard-store.types.ts +17 -3
  183. package/types/store/pagination.types.ts +6 -1
  184. package/types/store/subscribe.types.ts +50 -0
  185. package/utils/auth.js +32 -3
  186. package/utils/fleet-types.ts +0 -0
  187. package/utils/fleet.ts +200 -1
  188. package/utils/pagination-utils.ts +26 -1
  189. package/utils/pagination-wrapper.ts +132 -50
  190. package/utils/settings.ts +4 -1
  191. package/utils/style.ts +39 -0
  192. package/utils/validators/formRules/__tests__/index.test.ts +36 -3
  193. package/utils/validators/formRules/index.ts +10 -3
  194. package/utils/window.js +11 -7
  195. package/components/__tests__/ApplicationCard.test.ts +0 -27
  196. package/components/cards/ApplicationCard.vue +0 -145
  197. package/components/fleet/ForceDirectedTreeChart/chartIcons.js +0 -17
  198. package/config/secret.js +0 -14
  199. package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +0 -249
  200. /package/{components/form/SSHKnownHosts → dialog}/__tests__/KnownHostsEditDialog.test.ts +0 -0
@@ -0,0 +1,228 @@
1
+ import { parse } from '@shell/utils/url';
2
+ import { insertAt } from '@shell/utils/array';
3
+ import { set } from '@shell/utils/object';
4
+ import { SOURCE_TYPE } from '@shell/config/product/fleet';
5
+ import FleetUtils from '@shell/utils/fleet';
6
+ import { FLEET } from '@shell/config/types';
7
+ import { FLEET as FLEET_ANNOTATIONS } from '@shell/config/labels-annotations';
8
+ import FleetApplication from '@shell/models/fleet-application';
9
+
10
+ export default class HelmOp extends FleetApplication {
11
+ applyDefaults() {
12
+ const spec = this.spec || {};
13
+ const meta = this.metadata || {};
14
+
15
+ meta.namespace = this.$rootGetters['workspace'];
16
+
17
+ spec.helm = spec.helm || {};
18
+
19
+ spec['correctDrift'] = { enabled: false };
20
+
21
+ set(this, 'spec', spec);
22
+ set(this, 'metadata', meta);
23
+ }
24
+
25
+ get _availableActions() {
26
+ const out = super._availableActions;
27
+
28
+ insertAt(out, 0, {
29
+ action: 'pause',
30
+ label: this.t('fleet.helmOp.actions.pause.label'),
31
+ icon: 'icon icon-pause',
32
+ bulkable: true,
33
+ enabled: !!this.links.update && !this.spec?.paused
34
+ });
35
+
36
+ insertAt(out, 1, {
37
+ action: 'unpause',
38
+ label: this.t('fleet.helmOp.actions.unpause.label'),
39
+ icon: 'icon icon-play',
40
+ bulkable: true,
41
+ enabled: !!this.links.update && this.spec?.paused === true
42
+ });
43
+
44
+ insertAt(out, 2, {
45
+ action: 'enablePollingAction',
46
+ label: this.t('fleet.helmOp.actions.enablePolling.label'),
47
+ icon: 'icon icon-endpoints_connected',
48
+ bulkable: true,
49
+ enabled: !!this.links.update && !!this.spec?.disablePolling
50
+ });
51
+
52
+ insertAt(out, 3, {
53
+ action: 'disablePollingAction',
54
+ label: this.t('fleet.helmOp.actions.disablePolling.label'),
55
+ icon: 'icon icon-endpoints_disconnected',
56
+ bulkable: true,
57
+ enabled: !!this.links.update && !this.spec?.disablePolling
58
+ });
59
+
60
+ insertAt(out, 4, {
61
+ action: 'forceUpdate',
62
+ label: this.t('fleet.helmOp.actions.forceUpdate.label'),
63
+ icon: 'icon icon-refresh',
64
+ bulkable: true,
65
+ bulkAction: 'forceUpdateBulk',
66
+ enabled: !!this.links.update
67
+ });
68
+
69
+ insertAt(out, 5, { divider: true });
70
+
71
+ return out;
72
+ }
73
+
74
+ forceUpdate(resources = [this]) {
75
+ this.$dispatch('promptModal', {
76
+ componentProps: { helmOps: resources },
77
+ component: 'HelmOpForceUpdateDialog'
78
+ });
79
+ }
80
+
81
+ forceUpdateBulk(resources) {
82
+ this.$dispatch('promptModal', {
83
+ componentProps: { helmOps: resources },
84
+ component: 'HelmOpForceUpdateDialog'
85
+ });
86
+ }
87
+
88
+ get dashboardIcon() {
89
+ return FleetUtils.dashboardIcons[FLEET.HELM_OP];
90
+ }
91
+
92
+ get resourceIcon() {
93
+ return FleetUtils.resourceIcons[FLEET.HELM_OP];
94
+ }
95
+
96
+ github(value) {
97
+ const url = (value || '');
98
+
99
+ const matchHttps = url.match(FleetUtils.GIT_HTTPS_REGEX);
100
+
101
+ if (matchHttps) {
102
+ return matchHttps[1];
103
+ }
104
+
105
+ const matchSSH = url.match(FleetUtils.GIT_SSH_REGEX);
106
+
107
+ if (matchSSH) {
108
+ return FleetUtils.parseSSHUrl(matchSSH[0]).repoPath;
109
+ }
110
+
111
+ return false;
112
+ }
113
+
114
+ repoDisplay(repo) {
115
+ if (!repo) {
116
+ return null;
117
+ }
118
+
119
+ const github = this.github(repo);
120
+
121
+ if (github) {
122
+ return github;
123
+ }
124
+
125
+ repo = repo.replace(/.git$/, '');
126
+ repo = repo.replace(/^https:\/\//, '');
127
+ repo = repo.replace(/^oci:\/\//, '');
128
+ repo = repo.replace(/\/+$/, '');
129
+
130
+ return repo;
131
+ }
132
+
133
+ /**
134
+ * Source type examples:
135
+ *
136
+ * tarball:
137
+ * chart: https://github.com/rancher/fleet-helm-charts/releases/download/fleet-0.12.1-beta.2/fleet-0.12.1-beta.2.tgz
138
+ * repo:
139
+ * repo: https://rancher.github.io/fleet-helm-charts/
140
+ * chart: fleet-agent
141
+ * version: 0.12.1-beta.2
142
+ * oci:
143
+ * chart: oci://ghcr.io/rancher/fleet-test-configmap-chart
144
+ * version: the-tag
145
+ */
146
+ get sourceType() {
147
+ if (this.spec.helm?.repo && this.spec.helm?.chart) {
148
+ return SOURCE_TYPE.REPO;
149
+ }
150
+
151
+ if (this.spec.helm?.chart?.startsWith('oci://')) {
152
+ return SOURCE_TYPE.OCI;
153
+ }
154
+
155
+ if (this.spec.helm?.chart) {
156
+ return SOURCE_TYPE.TARBALL;
157
+ }
158
+
159
+ return null;
160
+ }
161
+
162
+ get source() {
163
+ let value = '';
164
+
165
+ switch (this.sourceType) {
166
+ case SOURCE_TYPE.REPO:
167
+ value = this.spec.helm?.repo || '';
168
+ break;
169
+ case SOURCE_TYPE.OCI: {
170
+ const parsed = parse(this.spec.helm?.chart || '');
171
+
172
+ value = parsed?.host ? `oci://${ parsed?.host }` : '';
173
+ break;
174
+ }
175
+ case SOURCE_TYPE.TARBALL:
176
+ value = this.spec.helm?.chart || ''; // TODO ellipsis and tooltip
177
+ }
178
+
179
+ const matchHttps = value.match(FleetUtils.HTTP_REGEX);
180
+ const matchOCI = value.match(FleetUtils.OCI_REGEX);
181
+ const matchSSH = value.match(FleetUtils.GIT_SSH_REGEX);
182
+
183
+ if (matchSSH) {
184
+ const { sshUserAndHost, repoPath } = FleetUtils.parseSSHUrl(matchSSH[0]);
185
+
186
+ value = `https://${ sshUserAndHost.replace('git@', '') }/${ repoPath }`;
187
+ }
188
+
189
+ return {
190
+ value,
191
+ display: this.repoDisplay(value),
192
+ icon: 'icon icon-application',
193
+ showLink: matchHttps || matchSSH || matchOCI
194
+ };
195
+ }
196
+
197
+ get sourceSub() {
198
+ let chart = '';
199
+ const version = this.spec.helm.version || '';
200
+
201
+ switch (this.sourceType) {
202
+ case SOURCE_TYPE.REPO:
203
+ chart = this.spec.helm.chart || '';
204
+ break;
205
+ case SOURCE_TYPE.OCI: {
206
+ const parsed = parse(this.spec.helm.chart || '');
207
+
208
+ chart = parsed?.path ? parsed?.path.substring(1) : '';
209
+ break;
210
+ }
211
+ }
212
+
213
+ const value = chart && version ? chart.concat(':', version) : chart;
214
+
215
+ return {
216
+ value,
217
+ display: value,
218
+ };
219
+ }
220
+
221
+ get bundles() {
222
+ return this.$getters['matching'](FLEET.BUNDLE, { [FLEET_ANNOTATIONS.HELM_NAME]: this.name }, this.namespace);
223
+ }
224
+
225
+ get bundleDeployments() {
226
+ return this.$getters['matching'](FLEET.BUNDLE_DEPLOYMENT, { [FLEET_ANNOTATIONS.HELM_NAME]: this.name });
227
+ }
228
+ }
@@ -16,6 +16,7 @@ export const configType = {
16
16
  github: 'oauth',
17
17
  keycloakoidc: 'oidc',
18
18
  genericoidc: 'oidc',
19
+ cognito: 'oidc',
19
20
  };
20
21
 
21
22
  const imageOverrides = { keycloakoidc: 'keycloak', genericoidc: 'openid' };
@@ -1,6 +1,7 @@
1
1
  import { COUNT, FLEET, NORMAN } from '@shell/config/types';
2
2
  import { filterBy } from '@shell/utils/array';
3
3
  import HybridModel from '@shell/plugins/steve/hybrid-class';
4
+ import { FLEET as FLEET_ANNOTATIONS } from '@shell/config/labels-annotations';
4
5
 
5
6
  export default class Workspace extends HybridModel {
6
7
  get isLocal() {
@@ -41,6 +42,13 @@ export default class Workspace extends HybridModel {
41
42
  return forWorkspace;
42
43
  }
43
44
 
45
+ get helmOps() {
46
+ const all = this.$getters['all'](FLEET.HELM_OP);
47
+ const forWorkspace = filterBy(all, 'namespace', this.id);
48
+
49
+ return forWorkspace;
50
+ }
51
+
44
52
  get basicNorman() {
45
53
  if (this.id) {
46
54
  return this.$dispatch(`rancher/find`, { id: this.id, type: NORMAN.FLEET_WORKSPACES }, { root: true });
@@ -87,4 +95,8 @@ export default class Workspace extends HybridModel {
87
95
  get confirmRemove() {
88
96
  return true;
89
97
  }
98
+
99
+ get systemAnnotations() {
100
+ return [FLEET_ANNOTATIONS.OCI_STORAGE_SECRET_DEFAULT];
101
+ }
90
102
  }
@@ -1,5 +1,5 @@
1
1
  import { findBy, insertAt } from '@shell/utils/array';
2
- import { TIMESTAMP, CATTLE_PUBLIC_ENDPOINTS } from '@shell/config/labels-annotations';
2
+ import { CATTLE_PUBLIC_ENDPOINTS } from '@shell/config/labels-annotations';
3
3
  import { WORKLOAD_TYPES, SERVICE, POD } from '@shell/config/types';
4
4
  import { get, set } from '@shell/utils/object';
5
5
  import day from 'dayjs';
@@ -48,11 +48,12 @@ export default class Workload extends WorkloadService {
48
48
  });
49
49
 
50
50
  insertAt(out, 0, {
51
- action: 'redeploy',
52
- label: this.t('action.redeploy'),
53
- icon: 'icon icon-refresh',
54
- enabled: !!this.links.update,
55
- bulkable: true,
51
+ action: 'redeploy',
52
+ label: this.t('action.redeploy'),
53
+ icon: 'icon icon-refresh',
54
+ enabled: !!this.links.update,
55
+ bulkable: true,
56
+ bulkAction: 'redeploy'
56
57
  });
57
58
 
58
59
  insertAt(out, 0, {
@@ -444,19 +445,14 @@ export default class Workload extends WorkloadService {
444
445
  return out;
445
446
  }
446
447
 
447
- redeploy() {
448
- const now = (new Date()).toISOString().replace(/\.\d+Z$/, 'Z');
448
+ redeploy(resources = this) {
449
+ const workloads = Array.isArray(resources) ? resources : [resources];
449
450
 
450
- if ( !this.spec.template.metadata ) {
451
- set(this.spec.template, 'metadata', {});
452
- }
453
-
454
- const annotations = this.spec.template.metadata.annotations || {};
455
-
456
- annotations[TIMESTAMP] = now;
457
- set(this.spec.template.metadata, 'annotations', annotations);
458
-
459
- this.save();
451
+ this.$dispatch('promptModal', {
452
+ modalWidth: '500px',
453
+ componentProps: { workloads },
454
+ component: 'RedeployWorkloadDialog'
455
+ });
460
456
  }
461
457
 
462
458
  // match existing container ports with services created for this workload
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rancher/shell",
3
- "version": "3.0.5-rc.3",
3
+ "version": "3.0.5-rc.5",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -56,6 +56,7 @@
56
56
  "babel-plugin-module-resolver": "4.0.0",
57
57
  "babel-preset-vue": "2.0.2",
58
58
  "cache-loader": "4.1.0",
59
+ "chart.js": "4.4.8",
59
60
  "clipboard-polyfill": "4.0.1",
60
61
  "codemirror-editor-vue3": "2.8.0",
61
62
  "codemirror": ">=5.64.0 <6",
@@ -6,6 +6,7 @@ import { get } from '@shell/utils/object';
6
6
  import { base64Decode } from '@shell/utils/crypto';
7
7
  import loadPlugins from '@shell/plugins/plugin';
8
8
  import { LOGIN_ERRORS } from '@shell/store/auth';
9
+ import { AUTH_BROADCAST_CHANNEL_NAME } from '@shell/utils/auth';
9
10
 
10
11
  const samlProviders = ['ping', 'adfs', 'keycloak', 'okta', 'shibboleth'];
11
12
 
@@ -13,11 +14,22 @@ const oauthProviders = ['github', 'googleoauth', 'azuread'];
13
14
 
14
15
  function reply(err, code) {
15
16
  try {
16
- window.opener.window.onAuthTest(err, code);
17
+ // If we have access to the opener, then use the `onAuthTest` callback
18
+ if (window.opener) {
19
+ window.opener.window.onAuthTest(err, code);
20
+ } else {
21
+ // Otherwise, use a broadcast channel
22
+ const bc = new BroadcastChannel(AUTH_BROADCAST_CHANNEL_NAME);
23
+ const msg = { err, code };
24
+
25
+ bc.postMessage(JSON.stringify(msg));
26
+ bc.close();
27
+ }
17
28
  setTimeout(() => {
18
29
  window.close();
19
30
  }, 250);
20
31
  } catch (e) {
32
+ console.error('Error replying to authentication verification', e); // eslint-disable-line no-console
21
33
  window.close();
22
34
  }
23
35
  }
@@ -0,0 +1,37 @@
1
+ <script setup lang="ts">
2
+
3
+ defineProps<{
4
+ clusterId: string;
5
+ }>();
6
+
7
+ </script>
8
+
9
+ <template>
10
+ <router-link
11
+ :to="`/c/${clusterId}/apps/catalog.cattle.io.clusterrepo/create`"
12
+ target="_blank"
13
+ class="add-repo-link"
14
+ tabindex="0"
15
+ :aria-label="t('catalog.charts.addNewRepo.ariaLabel')"
16
+ >
17
+ <span class="sr-only">{{ t('generic.opensInNewTab') }}</span>
18
+ + <span class="secondary-text-link">{{ t('catalog.charts.addNewRepo.label') }}</span>
19
+ </router-link>
20
+ </template>
21
+
22
+ <style scoped lang="scss">
23
+ .add-repo-link {
24
+ all: unset;
25
+ cursor: pointer;
26
+ color: var(--link-text-secondary);
27
+ margin-left: 4px;
28
+
29
+ &:focus-visible, &:focus {
30
+ @include focus-outline;
31
+ }
32
+
33
+ span {
34
+ margin-left: 4px;
35
+ }
36
+ }
37
+ </style>
@@ -0,0 +1,80 @@
1
+ <script setup lang="ts">
2
+ import { RcItemCardAction } from '@components/RcItemCard';
3
+
4
+ interface FooterItem {
5
+ icon?: string;
6
+ iconTooltip?: Record<{key?: string, text?: string}>;
7
+ labels: string[];
8
+ }
9
+
10
+ const emit = defineEmits<{(e: 'click:item', type: string, label: string): void; }>();
11
+
12
+ defineProps<{
13
+ items: FooterItem[];
14
+ }>();
15
+
16
+ function onClickItem(type: string, label: string) {
17
+ emit('click:item', type, label);
18
+ }
19
+
20
+ </script>
21
+
22
+ <template>
23
+ <div class="app-chart-card-footer">
24
+ <div
25
+ v-for="(footerItem, i) in items"
26
+ :key="i"
27
+ class="app-chart-card-footer-item"
28
+ data-testid="app-chart-card-footer-item"
29
+ >
30
+ <i
31
+ v-if="footerItem.icon"
32
+ v-clean-tooltip="t(footerItem.iconTooltip?.key)"
33
+ :class="['icon', 'app-chart-card-footer-item-icon', footerItem.icon]"
34
+ />
35
+ <rc-item-card-action
36
+ v-for="(label, j) in footerItem.labels"
37
+ :key="j"
38
+ class="app-chart-card-footer-item-text secondary-text-link"
39
+ data-testid="app-chart-card-footer-item-text"
40
+ tabindex="0"
41
+ :aria-label="t('catalog.charts.appChartCard.footerItem.ariaLabel')"
42
+ @click="onClickItem(footerItem.type, label)"
43
+ @keydown.enter="onClickItem(footerItem.type, label)"
44
+ @keydown.space.prevent="onClickItem(footerItem.type, label)"
45
+ >
46
+ {{ label }}<span v-if="footerItem.labels.length > 1 && j !== footerItem.labels.length - 1">, </span>
47
+ </rc-item-card-action>
48
+ </div>
49
+ </div>
50
+ </template>
51
+
52
+ <style scoped lang="scss">
53
+ .app-chart-card-footer {
54
+ display: flex;
55
+ flex-wrap: wrap;
56
+
57
+ &-item {
58
+ display: flex;
59
+ align-items: center;
60
+ color: var(--link-text-secondary);
61
+ margin-top: 8px;
62
+ margin-right: 8px;
63
+
64
+ &-text {
65
+ text-transform: capitalize;
66
+ margin-right: 8px;
67
+ }
68
+
69
+ &-icon {
70
+ width: 20px;
71
+ height: 20px;
72
+ display: flex;
73
+ font-size: 19px;
74
+ align-items: center;
75
+ justify-content: center;
76
+ margin-right: 8px;
77
+ }
78
+ }
79
+ }
80
+ </style>
@@ -0,0 +1,54 @@
1
+ <script setup lang="ts">
2
+
3
+ interface SubHeaderItem {
4
+ icon: string;
5
+ iconTooltip?: Record<{key?: string, text?: string}>;
6
+ label: string;
7
+ }
8
+
9
+ defineProps<{
10
+ items: SubHeaderItem[];
11
+ }>();
12
+
13
+ </script>
14
+
15
+ <template>
16
+ <div class="app-chart-card-sub-header">
17
+ <div
18
+ v-for="(subHeaderItem, i) in items"
19
+ :key="i"
20
+ class="app-chart-card-sub-header-item"
21
+ data-testid="app-chart-card-version"
22
+ >
23
+ <i
24
+ v-clean-tooltip="t(subHeaderItem.iconTooltip.key)"
25
+ :class="['icon', 'app-chart-card-sub-header-item-icon', subHeaderItem.icon]"
26
+ />
27
+ <p>{{ subHeaderItem.label }}</p>
28
+ </div>
29
+ </div>
30
+ </template>
31
+
32
+ <style scoped lang="scss">
33
+ .app-chart-card-sub-header {
34
+ display: flex;
35
+ gap: var(--gap-md);
36
+ color: var(--link-text-secondary);
37
+ margin-bottom: 8px;
38
+
39
+ &-item {
40
+ display: flex;
41
+ align-items: center;
42
+ }
43
+
44
+ &-item-icon {
45
+ width: 20px;
46
+ height: 20px;
47
+ display: flex;
48
+ font-size: 19px;
49
+ align-items: center;
50
+ justify-content: center;
51
+ margin-right: 8px;
52
+ }
53
+ }
54
+ </style>
@@ -0,0 +1,33 @@
1
+ <script setup lang="ts">
2
+
3
+ defineProps<{
4
+ label: string;
5
+ icon: string;
6
+ iconColor?: string;
7
+ tooltip?: string;
8
+ }>();
9
+
10
+ </script>
11
+
12
+ <template>
13
+ <div class="status-label">
14
+ {{ label }}
15
+ <i
16
+ v-clean-tooltip.right="tooltip"
17
+ :class="['icon', icon, iconColor]"
18
+ />
19
+ </div>
20
+ </template>
21
+
22
+ <style scoped lang="scss">
23
+ .status-label {
24
+ display: flex;
25
+ align-items: flex-end;
26
+ gap: var(--gap);
27
+ margin-left: 4px;
28
+
29
+ .icon {
30
+ &.warning { color: var(--warning); }
31
+ }
32
+ }
33
+ </style>