@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
package/store/index.js CHANGED
@@ -263,6 +263,7 @@ export const state = () => {
263
263
  * Cache state of side nav clusters. This avoids flickering when the user changes pages and the side nav component re-renders
264
264
  */
265
265
  sideNavCache: undefined,
266
+ showWorkspaceSwitcher: true,
266
267
  };
267
268
  };
268
269
 
@@ -601,6 +602,16 @@ export const getters = {
601
602
  return getters['isRancherInHarvester'] || getters['isMultiCluster'] || !getters['isSingleProduct'];
602
603
  },
603
604
 
605
+ showWorkspaceSwitcher(state, getters) {
606
+ const product = getters['currentProduct'];
607
+
608
+ if (!product) {
609
+ return false;
610
+ }
611
+
612
+ return product.showWorkspaceSwitcher && state.showWorkspaceSwitcher;
613
+ },
614
+
604
615
  targetRoute(state) {
605
616
  return state.targetRoute;
606
617
  },
@@ -763,7 +774,11 @@ export const mutations = {
763
774
 
764
775
  setSideNavCache(state, sideNavCache) {
765
776
  state.sideNavCache = sideNavCache;
766
- }
777
+ },
778
+
779
+ showWorkspaceSwitcher(state, value) {
780
+ state.showWorkspaceSwitcher = value;
781
+ },
767
782
  };
768
783
 
769
784
  export const actions = {
@@ -801,7 +816,7 @@ export const actions = {
801
816
 
802
817
  const promises = {
803
818
  // Features checks on its own if they are available
804
- features: dispatch('features/loadServer'),
819
+ [MANAGEMENT.FEATURE]: dispatch('features/loadServer'),
805
820
  };
806
821
 
807
822
  const toWatch = [
@@ -816,33 +831,33 @@ export const actions = {
816
831
  }
817
832
 
818
833
  if ( getters['management/schemaFor'](COUNT) ) {
819
- promises['counts'] = dispatch('management/findAll', { type: COUNT, opt: { watch: false } });
834
+ promises[COUNT] = dispatch('management/findAll', { type: COUNT, opt: { watch: false } });
820
835
  toWatch.push(COUNT);
821
836
  }
822
837
 
823
838
  if ( getters['management/canList'](MANAGEMENT.SETTING) ) {
824
- promises['settings'] = dispatch('management/findAll', { type: MANAGEMENT.SETTING, opt: { watch: false } });
839
+ promises[MANAGEMENT.SETTING] = dispatch('management/findAll', { type: MANAGEMENT.SETTING, opt: { watch: false } });
825
840
  toWatch.push(MANAGEMENT.SETTING);
826
841
  }
827
842
 
828
843
  if ( getters['management/schemaFor'](NAMESPACE) ) {
829
- promises['namespaces'] = dispatch('management/findAll', { type: NAMESPACE, opt: { watch: false } });
844
+ promises[NAMESPACE] = dispatch('management/findAll', { type: NAMESPACE, opt: { watch: false } });
830
845
  toWatch.push(NAMESPACE);
831
846
  }
832
847
 
833
848
  const fleetSchema = getters['management/schemaFor'](FLEET.WORKSPACE);
834
849
 
835
850
  if (fleetSchema?.links?.collection) {
836
- promises['workspaces'] = dispatch('management/findAll', { type: FLEET.WORKSPACE, opt: { watch: false } });
851
+ promises[FLEET.WORKSPACE] = dispatch('management/findAll', { type: FLEET.WORKSPACE, opt: { watch: false } });
837
852
  toWatch.push(FLEET.WORKSPACE);
838
853
  }
839
854
 
840
855
  res = await allHash(promises);
841
856
 
842
- if (!res.settings || !paginateClusters(rootGetters)) {
857
+ if (!res[MANAGEMENT.SETTING] || !paginateClusters(rootGetters)) {
843
858
  // This introduces a synchronous request, however we need settings to determine if SSP is enabled
844
859
  // Eventually it will be removed when SSP is always on
845
- res.clusters = await dispatch('management/findAll', { type: MANAGEMENT.CLUSTER, opt: { watch: false } });
860
+ res[MANAGEMENT.CLUSTER] = await dispatch('management/findAll', { type: MANAGEMENT.CLUSTER, opt: { watch: false } });
846
861
  toWatch.push(MANAGEMENT.CLUSTER);
847
862
  }
848
863
 
@@ -854,7 +869,7 @@ export const actions = {
854
869
  const isMultiCluster = getters['isMultiCluster'];
855
870
 
856
871
  // If the local cluster is a Harvester cluster and 'rancher-manager-support' is true, it means that the embedded Rancher is being used.
857
- const localCluster = res.clusters?.find((c) => c.id === 'local');
872
+ const localCluster = res[MANAGEMENT.CLUSTER]?.find((c) => c.id === 'local');
858
873
 
859
874
  if (localCluster?.isHarvester) {
860
875
  const harvesterSetting = await dispatch('cluster/findAll', { type: HCI.SETTING, opt: { url: `/v1/harvester/${ HCI.SETTING }s` } });
@@ -869,9 +884,9 @@ export const actions = {
869
884
  }
870
885
  }
871
886
 
872
- const pl = res.settings?.find((x) => x.id === 'ui-pl')?.value;
873
- const brand = res.settings?.find((x) => x.id === SETTING.BRAND)?.value;
874
- const systemNamespaces = res.settings?.find((x) => x.id === SETTING.SYSTEM_NAMESPACES);
887
+ const pl = res[MANAGEMENT.SETTING]?.find((x) => x.id === 'ui-pl')?.value;
888
+ const brand = res[MANAGEMENT.SETTING]?.find((x) => x.id === SETTING.BRAND)?.value;
889
+ const systemNamespaces = res[MANAGEMENT.SETTING]?.find((x) => x.id === SETTING.SYSTEM_NAMESPACES);
875
890
 
876
891
  if ( pl ) {
877
892
  setVendor(pl);
@@ -892,10 +907,10 @@ export const actions = {
892
907
  isRancher,
893
908
  });
894
909
 
895
- if ( res.workspaces ) {
910
+ if ( res[FLEET.WORKSPACE] ) {
896
911
  commit('updateWorkspace', {
897
912
  value: getters['prefs/get'](WORKSPACE),
898
- all: res.workspaces,
913
+ all: res[FLEET.WORKSPACE],
899
914
  getters
900
915
  });
901
916
  }
@@ -1291,5 +1306,9 @@ export const actions = {
1291
1306
  commit('setSideNavCache', sideNavCache);
1292
1307
  },
1293
1308
 
1309
+ showWorkspaceSwitcher({ commit }, value) {
1310
+ commit('showWorkspaceSwitcher', value);
1311
+ },
1312
+
1294
1313
  ...gcActions
1295
1314
  };
@@ -3,18 +3,21 @@ import { MutationTree, GetterTree, ActionTree } from 'vuex';
3
3
 
4
4
  export interface SlideInPanelState {
5
5
  isOpen: boolean;
6
+ isClosing: boolean;
6
7
  component: Component | null;
7
8
  componentProps: Record<string, any>;
8
9
  }
9
10
 
10
11
  const state = (): SlideInPanelState => ({
11
12
  isOpen: false,
13
+ isClosing: false,
12
14
  component: null,
13
15
  componentProps: {}
14
16
  });
15
17
 
16
18
  const getters: GetterTree<SlideInPanelState, any> = {
17
19
  isOpen: (state) => state.isOpen,
20
+ isClosing: (state) => state.isClosing,
18
21
  component: (state) => state.component,
19
22
  componentProps: (state) => state.componentProps
20
23
  };
@@ -26,12 +29,15 @@ const mutations: MutationTree<SlideInPanelState> = {
26
29
  state.componentProps = payload.componentProps || {};
27
30
  },
28
31
  close(state) {
32
+ state.isClosing = true;
29
33
  state.isOpen = false;
30
34
 
31
35
  // Delay clearing component/props for 500ms (same as transition duration)
32
36
  setTimeout(() => {
33
37
  state.component = null;
34
38
  state.componentProps = {};
39
+
40
+ state.isClosing = false;
35
41
  }, 500);
36
42
  }
37
43
  };
package/store/type-map.js CHANGED
@@ -526,6 +526,7 @@ export const getters = {
526
526
  customRoute: undefined,
527
527
  resourceEditMasthead: true,
528
528
  custom: {},
529
+ subTypes: [],
529
530
  };
530
531
 
531
532
  return (schemaOrType, pagination) => {
package/types/fleet.d.ts CHANGED
@@ -1 +1,36 @@
1
1
  export type WorkloadType = 'workload' | 'pods' | 'apps.deployments' | 'replicasets' | 'daemonsets' | 'statefulsets' | 'jobs' | 'cronjobs'
2
+
3
+ export interface FleetResourceState {
4
+ count: number,
5
+ label: string,
6
+ color?: string,
7
+ status?: string
8
+ }
9
+
10
+ export interface FleetDashboardState {
11
+ index: number,
12
+ id: string,
13
+ label: string,
14
+ color: string,
15
+ icon: string,
16
+ stateBackground: string
17
+ }
18
+
19
+ export interface FleetDashboardResourceStates {
20
+ stateDisplay: string,
21
+ stateSort: string,
22
+ statePanel: FleetDashboardState,
23
+ resources: object[]
24
+ }
25
+
26
+ // TODO complete type definition
27
+ export interface Application {
28
+ id: string,
29
+ metadata: {
30
+ namespace: string,
31
+ name: string,
32
+ }
33
+ _detailLocation: {
34
+ name: string
35
+ }
36
+ }
@@ -20,6 +20,8 @@ export interface PaginationSettingsStore {
20
20
  }
21
21
  }
22
22
 
23
+ export type PaginationFeature = 'listAutoRefreshToggle' | 'listManualRefresh'
24
+
23
25
  /**
24
26
  * Settings to handle server side pagination
25
27
  */
@@ -31,7 +33,23 @@ export interface PaginationSettings {
31
33
  /**
32
34
  * Should pagination be enabled for resources in a store
33
35
  */
34
- stores: PaginationSettingsStore | undefined
36
+ stores?: PaginationSettingsStore,
37
+
38
+ /**
39
+ * List of specific features that can be enabled / disabled
40
+ */
41
+ features?: {
42
+ [key in PaginationFeature]: { // eslint-disable-line no-unused-vars
43
+ enabled: boolean,
44
+ }
45
+ },
46
+
47
+ /**
48
+ * Debounce the amount of time between a resource changing and the backend sending a resource.changes message
49
+ *
50
+ * This greatly reduces spam in systems with high resource churn. It needs to be more than it takes for the UI to make a http request to fetch changes
51
+ */
52
+ resourceChangesDebounceMs?: number
35
53
  }
36
54
 
37
55
  type Links = {