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

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 (280) hide show
  1. package/assets/data/aws-regions.json +2 -0
  2. package/assets/images/providers/sks.svg +1 -0
  3. package/assets/styles/base/_helpers.scss +4 -0
  4. package/assets/styles/base/_variables.scss +1 -0
  5. package/assets/styles/global/_layout.scss +0 -1
  6. package/assets/translations/en-us.yaml +92 -34
  7. package/assets/translations/zh-hans.yaml +4 -13
  8. package/chart/monitoring/index.vue +4 -2
  9. package/components/ActionDropdownShell.vue +71 -0
  10. package/components/AppModal.vue +18 -4
  11. package/components/AsyncButton.vue +2 -0
  12. package/components/CodeMirror.vue +3 -3
  13. package/components/CommunityLinks.vue +3 -58
  14. package/components/CruResource.vue +109 -16
  15. package/components/ExplorerProjectsNamespaces.vue +19 -6
  16. package/components/FixedBanner.vue +19 -5
  17. package/components/GlobalRoleBindings.vue +5 -1
  18. package/components/GrowlManager.vue +1 -0
  19. package/components/LandingPagePreference.vue +2 -0
  20. package/components/LocaleSelector.vue +1 -1
  21. package/components/ModalManager.vue +55 -0
  22. package/components/PaginatedResourceTable.vue +7 -0
  23. package/components/PromptModal.vue +47 -8
  24. package/components/ResourceDetail/Masthead.vue +38 -13
  25. package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
  26. package/components/ResourceDetail/index.vue +47 -12
  27. package/components/ResourceList/index.vue +2 -1
  28. package/components/ResourceTable.vue +54 -19
  29. package/components/SideNav.vue +5 -1
  30. package/components/SlideInPanelManager.vue +125 -0
  31. package/components/SortableTable/THead.vue +5 -2
  32. package/components/SortableTable/actions.js +1 -1
  33. package/components/SortableTable/index.vue +54 -40
  34. package/components/SortableTable/paging.js +16 -19
  35. package/components/SortableTable/selection.js +1 -12
  36. package/components/Tabbed/index.vue +6 -0
  37. package/components/Wizard.vue +2 -2
  38. package/components/__tests__/AsyncButton.test.ts +39 -0
  39. package/components/__tests__/CruResource.test.ts +63 -0
  40. package/components/__tests__/ModalManager.spec.ts +176 -0
  41. package/components/__tests__/PromptModal.test.ts +146 -0
  42. package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
  43. package/components/auth/AuthBanner.vue +13 -11
  44. package/components/auth/Principal.vue +1 -0
  45. package/components/auth/login/ldap.vue +1 -1
  46. package/components/fleet/FleetResources.vue +21 -6
  47. package/components/form/ArrayList.vue +138 -118
  48. package/components/form/BannerSettings.vue +149 -85
  49. package/components/form/ColorInput.vue +35 -6
  50. package/components/form/EnvVars.vue +1 -0
  51. package/components/form/KeyValue.vue +10 -7
  52. package/components/form/LabeledSelect.vue +25 -23
  53. package/components/form/MatchExpressions.vue +9 -2
  54. package/components/form/NameNsDescription.vue +6 -2
  55. package/components/form/NotificationSettings.vue +15 -1
  56. package/components/form/Password.vue +1 -0
  57. package/components/form/Probe.vue +1 -0
  58. package/components/form/ResourceSelector.vue +26 -23
  59. package/components/form/ResourceTabs/index.vue +2 -1
  60. package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +15 -34
  61. package/components/form/SSHKnownHosts/index.vue +14 -11
  62. package/components/form/Select.vue +8 -15
  63. package/components/form/UnitInput.vue +13 -0
  64. package/components/form/ValueFromResource.vue +12 -12
  65. package/components/form/__tests__/ArrayList.test.ts +34 -2
  66. package/components/form/__tests__/ColorInput.test.ts +35 -0
  67. package/components/form/__tests__/KeyValue.test.ts +36 -0
  68. package/components/form/__tests__/LabeledSelect.test.ts +73 -0
  69. package/components/form/__tests__/SSHKnownHosts.test.ts +11 -2
  70. package/components/form/__tests__/Select.test.ts +34 -1
  71. package/components/form/__tests__/UnitInput.test.ts +23 -1
  72. package/components/formatter/ClusterLink.vue +5 -8
  73. package/components/formatter/Description.vue +30 -0
  74. package/components/formatter/__tests__/ClusterLink.test.ts +2 -32
  75. package/components/nav/Group.vue +12 -4
  76. package/components/nav/Header.vue +16 -43
  77. package/components/nav/NamespaceFilter.vue +134 -86
  78. package/components/nav/TopLevelMenu.vue +4 -5
  79. package/components/nav/WindowManager/ContainerLogs.vue +87 -61
  80. package/components/nav/WindowManager/ContainerLogsActions.vue +76 -0
  81. package/components/nav/WindowManager/index.vue +1 -0
  82. package/components/templates/default.vue +6 -3
  83. package/components/templates/home.vue +6 -0
  84. package/components/templates/plain.vue +6 -3
  85. package/composables/focusTrap.ts +12 -4
  86. package/config/product/explorer.js +16 -13
  87. package/config/product/manager.js +1 -28
  88. package/config/settings.ts +11 -13
  89. package/config/store.js +4 -0
  90. package/config/table-headers.js +7 -5
  91. package/config/uiplugins.js +5 -1
  92. package/core/types.ts +7 -6
  93. package/detail/catalog.cattle.io.app.vue +5 -1
  94. package/detail/fleet.cattle.io.bundle.vue +70 -6
  95. package/detail/fleet.cattle.io.gitrepo.vue +1 -1
  96. package/detail/namespace.vue +0 -3
  97. package/detail/node.vue +17 -13
  98. package/detail/provisioning.cattle.io.cluster.vue +85 -9
  99. package/detail/service.vue +0 -1
  100. package/detail/workload/index.vue +21 -34
  101. package/dialog/AddCustomBadgeDialog.vue +0 -1
  102. package/{pages/c/_cluster/uiplugins/AddExtensionRepos.vue → dialog/AddExtensionReposDialog.vue} +72 -42
  103. package/dialog/AssignToDialog.vue +176 -0
  104. package/dialog/ChangePasswordDialog.vue +106 -0
  105. package/{pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue → dialog/DeveloperLoadExtensionDialog.vue} +74 -71
  106. package/dialog/DisableAuthProviderDialog.vue +101 -0
  107. package/dialog/DrainNode.vue +1 -1
  108. package/{pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue → dialog/ExtensionCatalogInstallDialog.vue} +100 -88
  109. package/{pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue → dialog/ExtensionCatalogUninstallDialog.vue} +83 -65
  110. package/dialog/FeatureFlagListDialog.vue +288 -0
  111. package/dialog/ForceMachineRemoveDialog.vue +1 -1
  112. package/{components/Import.vue → dialog/ImportDialog.vue} +0 -5
  113. package/{pages/c/_cluster/uiplugins/InstallDialog.vue → dialog/InstallExtensionDialog.vue} +124 -106
  114. package/{components/form/SSHKnownHosts → dialog}/KnownHostsEditDialog.vue +52 -62
  115. package/dialog/MoveNamespaceDialog.vue +157 -0
  116. package/dialog/ScalePoolDownDialog.vue +1 -1
  117. package/{components/nav/Jump.vue → dialog/SearchDialog.vue} +34 -14
  118. package/{pages/c/_cluster/uiplugins/UninstallDialog.vue → dialog/UninstallExtensionDialog.vue} +67 -58
  119. package/dialog/WechatDialog.vue +57 -0
  120. package/edit/__tests__/service.test.ts +2 -1
  121. package/edit/auth/azuread.vue +1 -1
  122. package/edit/auth/github.vue +1 -1
  123. package/edit/auth/googleoauth.vue +1 -1
  124. package/edit/auth/ldap/index.vue +1 -1
  125. package/edit/auth/oidc.vue +1 -1
  126. package/edit/auth/saml.vue +1 -1
  127. package/edit/cloudcredential.vue +24 -10
  128. package/edit/management.cattle.io.user.vue +28 -3
  129. package/edit/namespace.vue +1 -4
  130. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -14
  131. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +57 -62
  132. package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +3 -14
  133. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.test.ts +72 -41
  134. package/edit/networking.k8s.io.networkpolicy/__tests__/utils/mock.json +17 -1
  135. package/edit/networking.k8s.io.networkpolicy/index.vue +18 -30
  136. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +4 -1
  137. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +26 -10
  138. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +8 -8
  139. package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +26 -12
  140. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +66 -0
  141. package/edit/provisioning.cattle.io.cluster/__tests__/utils/rke2-test-data.ts +58 -0
  142. package/edit/provisioning.cattle.io.cluster/index.vue +21 -73
  143. package/edit/provisioning.cattle.io.cluster/rke2.vue +24 -7
  144. package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +5 -3
  145. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +4 -1
  146. package/edit/service.vue +13 -28
  147. package/initialize/install-plugins.js +2 -1
  148. package/list/harvesterhci.io.management.cluster.vue +4 -1
  149. package/list/management.cattle.io.feature.vue +4 -288
  150. package/list/workload.vue +6 -1
  151. package/machine-config/azure.vue +16 -4
  152. package/mixins/resource-fetch-api-pagination.js +55 -43
  153. package/mixins/resource-fetch.js +14 -5
  154. package/mixins/vue-select-overrides.js +0 -4
  155. package/models/__tests__/workload.test.ts +1 -0
  156. package/models/cluster/node.js +1 -0
  157. package/models/cluster.js +32 -2
  158. package/models/fleet.cattle.io.cluster.js +8 -2
  159. package/models/fleet.cattle.io.gitrepo.js +8 -34
  160. package/models/management.cattle.io.cluster.js +0 -20
  161. package/models/management.cattle.io.feature.js +7 -1
  162. package/models/management.cattle.io.node.js +7 -22
  163. package/models/management.cattle.io.nodepool.js +12 -0
  164. package/models/namespace.js +12 -1
  165. package/models/provisioning.cattle.io.cluster.js +18 -64
  166. package/models/service.js +24 -9
  167. package/models/workload.js +70 -31
  168. package/package.json +1 -1
  169. package/pages/about.vue +13 -3
  170. package/pages/account/index.vue +12 -5
  171. package/pages/auth/login.vue +7 -4
  172. package/pages/auth/setup.vue +1 -0
  173. package/pages/auth/verify.vue +9 -7
  174. package/pages/c/_cluster/apps/charts/install.vue +25 -26
  175. package/pages/c/_cluster/auth/config/index.vue +10 -12
  176. package/pages/c/_cluster/explorer/EventsTable.vue +38 -33
  177. package/pages/c/_cluster/explorer/index.vue +28 -15
  178. package/pages/c/_cluster/istio/index.vue +2 -2
  179. package/pages/c/_cluster/longhorn/index.vue +3 -3
  180. package/pages/c/_cluster/monitoring/index.vue +1 -1
  181. package/pages/c/_cluster/monitoring/monitor/_namespace/_id.vue +4 -2
  182. package/pages/c/_cluster/monitoring/monitor/create.vue +4 -2
  183. package/pages/c/_cluster/monitoring/route-receiver/_id.vue +4 -2
  184. package/pages/c/_cluster/monitoring/route-receiver/create.vue +5 -2
  185. package/pages/c/_cluster/neuvector/index.vue +1 -1
  186. package/pages/c/_cluster/settings/banners.vue +60 -5
  187. package/pages/c/_cluster/settings/performance.vue +7 -26
  188. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +8 -10
  189. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +4 -7
  190. package/pages/c/_cluster/uiplugins/index.vue +98 -55
  191. package/pages/diagnostic.vue +12 -9
  192. package/pages/fail-whale.vue +8 -5
  193. package/pages/home.vue +11 -52
  194. package/pages/prefs.vue +7 -6
  195. package/plugins/clean-html.js +2 -0
  196. package/plugins/dashboard-store/__tests__/actions.test.ts +4 -1
  197. package/plugins/dashboard-store/actions.js +122 -21
  198. package/plugins/dashboard-store/getters.js +74 -3
  199. package/plugins/dashboard-store/mutations.js +10 -5
  200. package/plugins/dashboard-store/resource-class.js +23 -3
  201. package/plugins/internal-api/index.ts +37 -0
  202. package/plugins/internal-api/shared/base-api.ts +13 -0
  203. package/plugins/internal-api/shell/shell.api.ts +108 -0
  204. package/plugins/steve/__tests__/getters.test.ts +18 -11
  205. package/plugins/steve/__tests__/steve-class.test.ts +1 -0
  206. package/plugins/steve/actions.js +34 -24
  207. package/plugins/steve/getters.js +39 -10
  208. package/plugins/steve/steve-class.js +5 -0
  209. package/plugins/steve/steve-pagination-utils.ts +199 -37
  210. package/plugins/steve/worker/web-worker.advanced.js +3 -1
  211. package/public/index.html +1 -0
  212. package/rancher-components/Banner/Banner.test.ts +51 -3
  213. package/rancher-components/Banner/Banner.vue +28 -6
  214. package/rancher-components/Card/Card.vue +1 -1
  215. package/rancher-components/Form/Checkbox/Checkbox.test.ts +59 -1
  216. package/rancher-components/Form/Checkbox/Checkbox.vue +27 -3
  217. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +51 -0
  218. package/rancher-components/Form/LabeledInput/LabeledInput.vue +20 -2
  219. package/rancher-components/Form/Radio/RadioButton.test.ts +36 -1
  220. package/rancher-components/Form/Radio/RadioButton.vue +20 -4
  221. package/rancher-components/Form/Radio/RadioGroup.test.ts +60 -0
  222. package/rancher-components/Form/Radio/RadioGroup.vue +75 -35
  223. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +17 -0
  224. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +26 -1
  225. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +10 -1
  226. package/rancher-components/RcButton/RcButton.vue +2 -1
  227. package/rancher-components/RcButton/types.ts +1 -0
  228. package/rancher-components/RcDropdown/RcDropdown.vue +17 -6
  229. package/rancher-components/RcDropdown/RcDropdownItem.vue +3 -56
  230. package/rancher-components/RcDropdown/RcDropdownItemCheckbox.vue +68 -0
  231. package/rancher-components/RcDropdown/RcDropdownItemSelect.vue +92 -0
  232. package/rancher-components/RcDropdown/index.ts +2 -0
  233. package/rancher-components/RcDropdown/useDropdownItem.ts +63 -0
  234. package/scripts/extension/bundle +20 -0
  235. package/scripts/extension/helm/charts/ui-plugin-server/templates/cr.yaml +2 -1
  236. package/scripts/extension/helm/charts/ui-plugin-server/values.yaml +2 -0
  237. package/scripts/extension/helmpatch +44 -31
  238. package/scripts/extension/publish +12 -13
  239. package/scripts/typegen.sh +2 -4
  240. package/store/action-menu.js +26 -56
  241. package/store/features.js +0 -1
  242. package/store/index.js +5 -0
  243. package/store/modal.ts +71 -0
  244. package/store/slideInPanel.ts +47 -0
  245. package/store/type-map.js +8 -1
  246. package/store/type-map.utils.ts +49 -6
  247. package/types/fleet.d.ts +1 -1
  248. package/types/global-vue.d.ts +5 -0
  249. package/types/internal-api/shell/growl.d.ts +25 -0
  250. package/types/internal-api/shell/modal.d.ts +77 -0
  251. package/types/internal-api/shell/slideIn.d.ts +15 -0
  252. package/types/kube/kube-api.ts +22 -0
  253. package/types/resources/fleet.d.ts +0 -14
  254. package/types/resources/settings.d.ts +0 -4
  255. package/types/shell/index.d.ts +375 -306
  256. package/types/store/dashboard-store.types.ts +24 -1
  257. package/types/store/pagination.types.ts +19 -2
  258. package/types/vue-shim.d.ts +4 -1
  259. package/utils/__mocks__/tabbable.js +13 -0
  260. package/utils/__tests__/object.test.ts +38 -4
  261. package/utils/cluster.js +24 -20
  262. package/utils/fleet.ts +15 -73
  263. package/utils/grafana.js +1 -0
  264. package/utils/object.js +36 -5
  265. package/utils/pagination-utils.ts +6 -2
  266. package/utils/perf-setting.utils.ts +28 -0
  267. package/utils/selector-typed.ts +205 -0
  268. package/utils/selector.js +29 -6
  269. package/utils/uiplugins.ts +10 -6
  270. package/utils/v-sphere.ts +5 -1
  271. package/utils/validators/formRules/__tests__/index.test.ts +10 -1
  272. package/utils/validators/formRules/index.ts +27 -3
  273. package/components/AssignTo.vue +0 -199
  274. package/components/DisableAuthProviderModal.vue +0 -115
  275. package/components/MoveModal.vue +0 -167
  276. package/components/PromptChangePassword.vue +0 -123
  277. package/components/fleet/FleetBundleResources.vue +0 -86
  278. package/components/formatter/RKETemplateName.vue +0 -37
  279. package/dialog/SaveAsRKETemplateDialog.vue +0 -139
  280. package/types/vue-shim.d +0 -20
@@ -1,12 +1,15 @@
1
1
  <script>
2
- import { MANAGEMENT } from '@shell/config/types';
3
- import FleetBundleResources from '@shell/components/fleet/FleetBundleResources.vue';
2
+ import { FLEET, MANAGEMENT } from '@shell/config/types';
3
+ import FleetResources from '@shell/components/fleet/FleetResources';
4
4
  import FleetUtils from '@shell/utils/fleet';
5
+ import { checkSchemasForFindAllHash } from '@shell/utils/auth';
6
+ import Loading from '@shell/components/Loading.vue';
7
+ import { FLEET as FLEET_ANNOTATIONS } from '@shell/config/labels-annotations';
5
8
 
6
9
  export default {
7
10
  name: 'FleetBundleDetail',
8
11
 
9
- components: { FleetBundleResources },
12
+ components: { Loading, FleetResources },
10
13
  props: {
11
14
  value: {
12
15
  type: Object,
@@ -14,15 +17,74 @@ export default {
14
17
  }
15
18
  },
16
19
 
20
+ data() {
21
+ return { allBundleDeployments: [] };
22
+ },
23
+
17
24
  async fetch() {
25
+ const allDispatches = await checkSchemasForFindAllHash({
26
+ allBundleDeployments: {
27
+ inStoreType: 'management',
28
+ type: FLEET.BUNDLE_DEPLOYMENT,
29
+ },
30
+
31
+ // must be loaded for bundle.targetClusters to work
32
+ allFleetClusters: {
33
+ inStoreType: 'management',
34
+ type: FLEET.CLUSTER
35
+ },
36
+ clusterGroups: {
37
+ inStoreType: 'management',
38
+ type: FLEET.CLUSTER_GROUP
39
+ }
40
+ }, this.$store);
41
+
18
42
  if (this.value.authorId && this.$store.getters['management/schemaFor'](MANAGEMENT.USER)) {
19
43
  await this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.USER }, { root: true });
20
44
  }
45
+
46
+ this.allBundleDeployments = allDispatches.allBundleDeployments || [];
21
47
  },
22
48
 
23
49
  computed: {
24
50
  bundleResources() {
25
- return FleetUtils.resourcesFromBundleStatus(this.value?.status);
51
+ if (!this.allBundleDeployments) {
52
+ return [];
53
+ }
54
+
55
+ const bundleDeploymentsByClusterId = this.allBundleDeployments
56
+ .reduce((res, bd) => {
57
+ if (this.value.id === FleetUtils.bundleIdFromBundleDeploymentLabels(bd.metadata?.labels)) {
58
+ res[FleetUtils.clusterIdFromBundleDeploymentLabels(bd.metadata?.labels)] = bd;
59
+ }
60
+
61
+ return res;
62
+ }, {});
63
+
64
+ return this.value.targetClusters.reduce((res, cluster) => {
65
+ const bd = bundleDeploymentsByClusterId[cluster.id];
66
+
67
+ if (bd) {
68
+ FleetUtils.resourcesFromBundleDeploymentStatus(bd.status)
69
+ .forEach((r) => {
70
+ const type = FleetUtils.resourceType(r);
71
+ const key = `${ cluster.id }-${ type }-${ r.namespace }-${ r.name }`;
72
+
73
+ res.push({
74
+ ...r,
75
+ key,
76
+ type,
77
+ id: FleetUtils.resourceId(r),
78
+ clusterId: cluster.id,
79
+ clusterName: cluster.nameDisplay,
80
+
81
+ detailLocation: FleetUtils.detailLocation(r, cluster.metadata.labels[FLEET_ANNOTATIONS.CLUSTER_NAME]),
82
+ });
83
+ });
84
+ }
85
+
86
+ return res;
87
+ }, []);
26
88
  },
27
89
  resourceCount() {
28
90
  return this.bundleResources.length;
@@ -38,8 +100,10 @@ export default {
38
100
  <h2>{{ t('fleet.bundles.resources') }}</h2>
39
101
  <span>{{ resourceCount }}</span>
40
102
  </div>
41
- <FleetBundleResources
42
- :value="bundleResources"
103
+ <Loading v-if="$fetchState.pending" />
104
+ <FleetResources
105
+ v-else
106
+ :rows="bundleResources"
43
107
  />
44
108
  </div>
45
109
  </template>
@@ -141,7 +141,7 @@ export default {
141
141
  name="resources"
142
142
  :weight="20"
143
143
  >
144
- <FleetResources :value="value" />
144
+ <FleetResources :rows="value.resourcesStatuses" />
145
145
  </Tab>
146
146
  </ResourceTabs>
147
147
  </div>
@@ -5,7 +5,6 @@ import ResourceTabs from '@shell/components/form/ResourceTabs';
5
5
  import { COUNT, WORKLOAD_TYPES } from '@shell/config/types';
6
6
  import { WORKLOAD_SCHEMA } from '@shell/config/schema';
7
7
  import { getStatesByType } from '@shell/plugins/dashboard-store/resource-class';
8
- import MoveModal from '@shell/components/MoveModal';
9
8
  import Tab from '@shell/components/Tabbed/Tab';
10
9
  import ResourceTable from '@shell/components/ResourceTable';
11
10
  import SortableTable from '@shell/components/SortableTable';
@@ -20,7 +19,6 @@ export default {
20
19
  ResourceTable,
21
20
  ResourceTabs,
22
21
  Loading,
23
- MoveModal,
24
22
  Tab,
25
23
  SortableTable
26
24
  },
@@ -264,6 +262,5 @@ export default {
264
262
  />
265
263
  </Tab>
266
264
  </ResourceTabs>
267
- <MoveModal />
268
265
  </div>
269
266
  </template>
package/detail/node.vue CHANGED
@@ -49,23 +49,25 @@ export default {
49
49
  },
50
50
 
51
51
  async fetch() {
52
- this.filterByApi = this.$store.getters[`cluster/paginationEnabled`](POD);
52
+ if (this.podSchema) {
53
+ this.filterByApi = this.$store.getters[`cluster/paginationEnabled`](POD);
53
54
 
54
- if (this.filterByApi) {
55
+ if (this.filterByApi) {
55
56
  // Only get pods associated with this node. The actual values used are from a get all in node model `pods` getter (this works as it just gets all...)
56
- const opt = { // Of type ActionFindPageArgs
57
- pagination: new FilterArgs({
58
- sort: [{ field: 'metadata.name', asc: true }],
59
- filters: PaginationParamFilter.createSingleField({
60
- field: 'spec.nodeName',
61
- value: this.value.id,
57
+ const opt = { // Of type ActionFindPageArgs
58
+ pagination: new FilterArgs({
59
+ sort: [{ field: 'metadata.name', asc: true }],
60
+ filters: PaginationParamFilter.createSingleField({
61
+ field: 'spec.nodeName',
62
+ value: this.value.id,
63
+ })
62
64
  })
63
- })
64
- };
65
+ };
65
66
 
66
- this.$store.dispatch(`cluster/findPage`, { type: POD, opt });
67
- } else {
68
- this.$store.dispatch('cluster/findAll', { type: POD });
67
+ this.$store.dispatch(`cluster/findPage`, { type: POD, opt });
68
+ } else {
69
+ this.$store.dispatch('cluster/findAll', { type: POD });
70
+ }
69
71
  }
70
72
 
71
73
  this.showMetrics = await allDashboardsExist(this.$store, this.currentCluster.id, [NODE_METRICS_DETAIL_URL, NODE_METRICS_SUMMARY_URL]);
@@ -97,6 +99,7 @@ export default {
97
99
  VALUE,
98
100
  EFFECT
99
101
  ],
102
+ podSchema,
100
103
  podTableHeaders: this.$store.getters['type-map/headersFor'](podSchema),
101
104
  NODE_METRICS_DETAIL_URL,
102
105
  NODE_METRICS_SUMMARY_URL,
@@ -241,6 +244,7 @@ export default {
241
244
  @update:value="$emit('input', $event)"
242
245
  >
243
246
  <Tab
247
+ v-if="podSchema"
244
248
  name="pods"
245
249
  :label="t('node.detail.tab.pods')"
246
250
  :weight="4"
@@ -215,6 +215,41 @@ export default {
215
215
  },
216
216
 
217
217
  data() {
218
+ const noneGroupOption = {
219
+ tooltipKey: 'resourceTable.groupBy.none',
220
+ icon: 'icon-list-flat',
221
+ value: 'none',
222
+ };
223
+ const poolColumn = {
224
+ name: 'pool',
225
+ labelKey: 'cluster.machinePool.name.label',
226
+ value: 'spec.nodePoolName',
227
+ getValue: (row) => row.spec.nodePoolName,
228
+ sort: ['spec.nodePoolName'],
229
+ };
230
+ const poolGroupOption = {
231
+ tooltipKey: 'resourceTable.groupBy.pool',
232
+ icon: 'icon-cluster',
233
+ hideColumn: poolColumn.name,
234
+ value: 'spec.nodePoolName',
235
+ field: 'spec.nodePoolName'
236
+ };
237
+
238
+ const machineColumn = {
239
+ name: 'pool',
240
+ labelKey: 'cluster.machinePool.name.label',
241
+ value: 'pool.nameDisplay',
242
+ getValue: (row) => row.pool.nameDisplay,
243
+ sort: ['pool.nameDisplay'],
244
+ };
245
+ const machineGroupOption = {
246
+ tooltipKey: 'resourceTable.groupBy.pool',
247
+ icon: 'icon-cluster',
248
+ hideColumn: machineColumn.name,
249
+ value: 'poolId',
250
+ field: 'poolId'
251
+ };
252
+
218
253
  return {
219
254
 
220
255
  allMachines: [],
@@ -250,7 +285,25 @@ export default {
250
285
  conditions: true, // in ResourceTabs
251
286
  },
252
287
 
253
- showWindowsWarning: false
288
+ showWindowsWarning: false,
289
+
290
+ machineColumn,
291
+ poolColumn,
292
+
293
+ noneGroupOption,
294
+
295
+ machineGroupOption,
296
+ machineGroupOptions: [
297
+ noneGroupOption,
298
+ machineGroupOption
299
+ ],
300
+
301
+ poolGroupOption,
302
+ poolGroupOptions: [
303
+ noneGroupOption,
304
+ poolGroupOption,
305
+ ]
306
+
254
307
  };
255
308
  },
256
309
 
@@ -395,7 +448,7 @@ export default {
395
448
 
396
449
  showSnapshots() {
397
450
  if (this.value.isRke1) {
398
- return this.$store.getters['rancher/canList'](NORMAN.ETCD_BACKUP) && this.extDetailTabs.snapshots;
451
+ return false;
399
452
  } else if (this.value.isRke2) {
400
453
  return this.$store.getters['management/canList'](SNAPSHOT) && this.extDetailTabs.snapshots;
401
454
  }
@@ -403,6 +456,10 @@ export default {
403
456
  return false;
404
457
  },
405
458
 
459
+ isRke1() {
460
+ return this.value.isRke1;
461
+ },
462
+
406
463
  showEksNodeGroupWarning() {
407
464
  if ( this.value.provisioner === 'EKS' && this.value.state !== STATES_ENUM.ACTIVE) {
408
465
  const desiredTotal = this.value.eksNodeGroups.filter((g) => g.desiredSize === 0);
@@ -416,7 +473,7 @@ export default {
416
473
  },
417
474
 
418
475
  machineHeaders() {
419
- return [
476
+ const headers = [
420
477
  STATE,
421
478
  NAME_COL,
422
479
  {
@@ -433,11 +490,23 @@ export default {
433
490
  ROLES,
434
491
  AGE,
435
492
  ];
493
+
494
+ if (!this.value.isCustom) {
495
+ headers.splice(3, 0, this.machineColumn);
496
+ }
497
+
498
+ return headers;
436
499
  },
437
500
 
438
501
  mgmtNodeSchemaHeaders() {
439
- return [
440
- STATE, NAME_COL,
502
+ // Remove Cluster name being a link
503
+ const RKE1_NAME_COL = {
504
+ ...NAME_COL,
505
+ formatter: undefined
506
+ };
507
+
508
+ const headers = [
509
+ STATE, RKE1_NAME_COL,
441
510
  {
442
511
  name: 'node-name',
443
512
  labelKey: 'tableHeaders.machineNodeName',
@@ -452,6 +521,12 @@ export default {
452
521
  ROLES,
453
522
  AGE
454
523
  ];
524
+
525
+ if (!this.value.isCustom) {
526
+ headers.splice(3, 0, this.poolColumn);
527
+ }
528
+
529
+ return headers;
455
530
  },
456
531
 
457
532
  rke1Snapshots() {
@@ -772,11 +847,11 @@ export default {
772
847
  :schema="machineSchema"
773
848
  :headers="machineHeaders"
774
849
  default-sort-by="name"
775
- :group-by="value.isCustom ? null : 'poolId'"
776
850
  group-ref="pool"
851
+ :group-default="machineGroupOption.value"
777
852
  :group-sort="['pool.nameDisplay']"
853
+ :group-options="value.isCustom ? [noneGroupOption] : machineGroupOptions"
778
854
  :sort-generation-fn="machineSortGenerationFn"
779
- :hide-grouping-controls="true"
780
855
  >
781
856
  <template #main-row:isFake="{fullColspan}">
782
857
  <tr class="main-row">
@@ -859,9 +934,10 @@ export default {
859
934
  :schema="mgmtNodeSchema"
860
935
  :headers="mgmtNodeSchemaHeaders"
861
936
  :rows="nodes"
862
- :group-by="value.isCustom ? null : 'spec.nodePoolName'"
863
937
  group-ref="pool"
938
+ :group-default="poolGroupOption.value"
864
939
  :group-sort="['pool.nameDisplay']"
940
+ :group-options="value.isCustom ? [noneGroupOption] : poolGroupOptions"
865
941
  :sort-generation-fn="nodeSortGenerationFn"
866
942
  :hide-grouping-controls="true"
867
943
  >
@@ -901,7 +977,7 @@ export default {
901
977
  </div>
902
978
  </div>
903
979
  <div
904
- v-if="group.ref"
980
+ v-if="group.ref && !isRke1"
905
981
  class="right group-header-buttons"
906
982
  >
907
983
  <MachineSummaryGraph
@@ -83,7 +83,6 @@ export default {
83
83
 
84
84
  return {
85
85
  servicePortInfoHeaders,
86
- pods: [],
87
86
  podTableHeaders: this.$store.getters['type-map/headersFor'](
88
87
  this.$store.getters['cluster/schemaFor'](POD)
89
88
  ),
@@ -47,16 +47,20 @@ export default {
47
47
  } catch {}
48
48
 
49
49
  const hash = {
50
- // Used in conjunction with `matches/match/label selectors`. Requires https://github.com/rancher/dashboard/issues/10417 to fix
51
- allPods: this.$store.dispatch('cluster/findAll', { type: POD }),
52
- // Used in conjunction with `matches/match/label selectors`. Requires https://github.com/rancher/dashboard/issues/10417 to fix
53
- allServices: this.$store.dispatch('cluster/findAll', { type: SERVICE }),
54
50
  allIngresses: this.$store.dispatch('cluster/findAll', { type: INGRESS }),
55
51
  // Nodes should be fetched because they may be referenced in the target
56
52
  // column of a service list item.
57
53
  allNodes: hasNodes ? this.$store.dispatch('cluster/findAll', { type: NODE }) : []
58
54
  };
59
55
 
56
+ if (this.podSchema) {
57
+ hash.pods = this.value.fetchPods();
58
+ }
59
+
60
+ if (this.serviceSchema) {
61
+ hash.servicesInNamespace = this.$store.dispatch('cluster/findAll', { type: SERVICE, opt: { namespaced: this.value.metadata.namespace } });
62
+ }
63
+
60
64
  if (this.value.type === WORKLOAD_TYPES.CRON_JOB) {
61
65
  hash.jobs = this.value.matchingJobs();
62
66
  }
@@ -87,8 +91,7 @@ export default {
87
91
 
88
92
  data() {
89
93
  return {
90
- allPods: [],
91
- allServices: [],
94
+ servicesInNamespace: [],
92
95
  allIngresses: [],
93
96
  matchingServices: [],
94
97
  matchingIngresses: [],
@@ -180,22 +183,6 @@ export default {
180
183
  }, 0);
181
184
  },
182
185
 
183
- podRestarts() {
184
- return this.value.pods.reduce((total, pod) => {
185
- const { status:{ containerStatuses = [] } } = pod;
186
-
187
- if (containerStatuses.length) {
188
- total += containerStatuses.reduce((tot, container) => {
189
- tot += container.restartCount;
190
-
191
- return tot;
192
- }, 0);
193
- }
194
-
195
- return total;
196
- }, 0);
197
- },
198
-
199
186
  podHeaders() {
200
187
  return this.$store.getters['type-map/headersFor'](this.podSchema).filter((h) => !h.name || h.name !== NAMESPACE_COL.name);
201
188
  },
@@ -213,12 +200,16 @@ export default {
213
200
  },
214
201
 
215
202
  showPodGaugeCircles() {
216
- const podGauges = Object.values(this.value.podGauges);
203
+ const podGauges = Object.values(this.podGauges);
217
204
  const total = this.value.pods.length;
218
205
 
219
206
  return !podGauges.find((pg) => pg.count === total);
220
207
  },
221
208
 
209
+ podGauges() {
210
+ return this.value.calcPodGauges(this.value.pods);
211
+ },
212
+
222
213
  showJobGaugeCircles() {
223
214
  const jobGauges = Object.values(this.value.jobGauges);
224
215
  const total = this.isCronJob ? this.totalRuns : this.value.pods.length;
@@ -230,6 +221,7 @@ export default {
230
221
  return !!SCALABLE_TYPES.includes(this.value.type) && this.value.canUpdate;
231
222
  },
232
223
  },
224
+
233
225
  methods: {
234
226
  async scale(isUp) {
235
227
  try {
@@ -256,15 +248,13 @@ export default {
256
248
  if (!this.serviceSchema) {
257
249
  return [];
258
250
  }
259
- const matchingPods = this.value.pods;
260
251
 
261
- // Find Services that have selectors that match this
262
- // workload's Pod(s).
263
- const matchingServices = this.allServices.filter((service) => {
252
+ // Find Services that have selectors that match this workload's Pod(s).
253
+ this.matchingServices = this.servicesInNamespace.filter((service) => {
264
254
  const selector = service.spec.selector;
265
255
 
266
- for (let i = 0; i < matchingPods.length; i++) {
267
- const pod = matchingPods[i];
256
+ for (let i = 0; i < this.value.pods.length; i++) {
257
+ const pod = this.value.pods[i];
268
258
 
269
259
  if (service.metadata?.namespace === this.value.metadata?.namespace && matches(pod, selector)) {
270
260
  return true;
@@ -273,8 +263,6 @@ export default {
273
263
 
274
264
  return false;
275
265
  });
276
-
277
- this.matchingServices = matchingServices;
278
266
  },
279
267
  findMatchingIngresses() {
280
268
  if (!this.ingressSchema) {
@@ -358,7 +346,7 @@ export default {
358
346
  </template>
359
347
  <template v-else>
360
348
  <CountGauge
361
- v-for="(group, key) in value.podGauges"
349
+ v-for="(group, key) in podGauges"
362
350
  :key="key"
363
351
  :total="value.pods.length"
364
352
  :useful="group.count || 0"
@@ -387,13 +375,12 @@ export default {
387
375
  />
388
376
  </Tab>
389
377
  <Tab
390
- v-else
378
+ v-else-if="value.podMatchExpression"
391
379
  name="pods"
392
380
  :label="t('tableHeaders.pods')"
393
381
  :weight="4"
394
382
  >
395
383
  <ResourceTable
396
- v-if="value.pods"
397
384
  :rows="value.pods"
398
385
  :headers="podHeaders"
399
386
  key-field="id"
@@ -213,7 +213,6 @@ export default {
213
213
  <Card
214
214
  class="prompt-badge"
215
215
  :show-highlight-border="false"
216
- :trigger-focus-trap="true"
217
216
  >
218
217
  <template #title>
219
218
  <h4 class="text-default-text">
@@ -1,22 +1,32 @@
1
1
  <script>
2
- import { CATALOG } from '@shell/config/types';
3
- import Dialog from '@shell/components/Dialog.vue';
2
+ import AsyncButton from '@shell/components/AsyncButton';
4
3
  import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
4
+ import { CATALOG } from '@shell/config/types';
5
5
  import { UI_PLUGINS_REPOS } from '@shell/config/uiplugins';
6
6
  import { isRancherPrime } from '@shell/config/version';
7
7
 
8
8
  export default {
9
- emits: ['done'],
9
+ emits: ['close'],
10
+
11
+ components: { AsyncButton, Checkbox },
10
12
 
11
- components: {
12
- Checkbox,
13
- Dialog,
13
+ props: {
14
+ /**
15
+ * Callback to update install status on extensions main screen
16
+ */
17
+ done: {
18
+ type: Function,
19
+ default: () => {}
20
+ },
14
21
  },
15
22
 
16
23
  async fetch() {
17
24
  if (this.$store.getters['management/schemaFor'](CATALOG.CLUSTER_REPO)) {
18
25
  this.repos = await this.$store.dispatch('management/findAll', { type: CATALOG.CLUSTER_REPO, opt: { force: true } });
19
26
  }
27
+
28
+ this.addRepos.official = isRancherPrime() && !this.hasRancherUIPluginsRepo;
29
+ this.addRepos.partners = !this.hasRancherUIPartnersPluginsRepo;
20
30
  },
21
31
 
22
32
  data() {
@@ -25,8 +35,8 @@ export default {
25
35
  repos: [],
26
36
  prime: isRancherPrime(),
27
37
  addRepos: {
28
- official: true,
29
- partners: true
38
+ official: false,
39
+ partners: false
30
40
  },
31
41
  reposInfo: {
32
42
  official: {
@@ -57,14 +67,6 @@ export default {
57
67
  },
58
68
 
59
69
  methods: {
60
- showDialog() {
61
- this.addRepos = {
62
- official: isRancherPrime() && !this.hasRancherUIPluginsRepo,
63
- partners: !this.hasRancherUIPartnersPluginsRepo,
64
- };
65
- this.isDialogActive = true;
66
- },
67
-
68
70
  async doAddRepos(btnCb) {
69
71
  this.errors = [];
70
72
  const promises = [];
@@ -96,24 +98,20 @@ export default {
96
98
  });
97
99
  }
98
100
 
99
- this.$emit('done');
101
+ this.done();
102
+ this.$emit('close');
100
103
 
101
104
  btnCb(true);
102
105
  },
103
106
  }
104
107
  };
105
108
  </script>
109
+
106
110
  <template>
107
- <Dialog
108
- v-if="isDialogActive"
109
- name="add-extensions-repos"
110
- :title="t('plugins.addRepos.title')"
111
- mode="add"
112
- data-testid="add-extensions-repos-modal"
113
- :return-focus-selector="returnFocusSelector"
114
- @okay="doAddRepos"
115
- @closed="isDialogActive = false"
116
- >
111
+ <div class="modal-dialog">
112
+ <h4>
113
+ {{ t('plugins.addRepos.title') }}
114
+ </h4>
117
115
  <p class="mb-20">
118
116
  {{ t('plugins.addRepos.prompt', {}, true) }}
119
117
  </p>
@@ -124,7 +122,7 @@ export default {
124
122
  >
125
123
  <Checkbox
126
124
  v-model:value="addRepos.official"
127
- :disabled="hasRancherUIPluginsRepo"
125
+ :disabled="$fetchState.pending || hasRancherUIPluginsRepo"
128
126
  :primary="true"
129
127
  label-key="plugins.setup.install.addRancherRepo"
130
128
  data-testid="add-extensions-repos-modal-add-official-repo"
@@ -142,7 +140,7 @@ export default {
142
140
  >
143
141
  <Checkbox
144
142
  v-model:value="addRepos.partners"
145
- :disabled="hasRancherUIPartnersPluginsRepo"
143
+ :disabled="$fetchState.pending || hasRancherUIPartnersPluginsRepo"
146
144
  :primary="true"
147
145
  label-key="plugins.setup.install.addPartnersRancherRepo"
148
146
  data-testid="add-extensions-repos-modal-add-partners-repo"
@@ -154,22 +152,54 @@ export default {
154
152
  ({{ t('plugins.setup.installed') }})
155
153
  </div>
156
154
  </div>
157
- </Dialog>
155
+ <div class="dialog-buttons mt-20">
156
+ <button
157
+ class="btn role-secondary"
158
+ @click="$emit('close')"
159
+ >
160
+ {{ t('generic.cancel') }}
161
+ </button>
162
+ <AsyncButton
163
+ mode="add"
164
+ class="ml-10"
165
+ @click="doAddRepos"
166
+ />
167
+ </div>
168
+ </div>
158
169
  </template>
170
+
159
171
  <style lang="scss" scoped>
160
- .enable-plugin-support {
161
- font-size: 14px;
162
- margin-top: 20px;
163
- }
172
+ .modal-dialog {
173
+ padding: 10px;
164
174
 
165
- .plugin-setup-error {
166
- font-size: 14px;
167
- color: var(--error);
168
- margin: 10px 0 0 0;
169
- }
175
+ h4 {
176
+ font-weight: bold;
177
+ }
178
+
179
+ .enable-plugin-support {
180
+ font-size: 14px;
181
+ margin-top: 20px;
182
+ }
183
+
184
+ .plugin-setup-error {
185
+ font-size: 14px;
186
+ color: var(--error);
187
+ margin: 10px 0 0 0;
188
+ }
189
+
190
+ .checkbox-info {
191
+ margin-left: 20px;
192
+ opacity: 0.7;
193
+ }
170
194
 
171
- .checkbox-info {
172
- margin-left: 20px;
173
- opacity: 0.7;
195
+ .dialog-buttons {
196
+ display: flex;
197
+ justify-content: flex-end;
198
+ margin-top: 10px;
199
+
200
+ > *:not(:last-child) {
201
+ margin-right: 10px;
202
+ }
203
+ }
174
204
  }
175
205
  </style>