@rancher/shell 0.5.3 → 1.2.0

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 (356) hide show
  1. package/.DS_Store +0 -0
  2. package/assets/images/providers/aks-black.svg +28 -0
  3. package/assets/images/providers/aks.svg +31 -0
  4. package/assets/styles/global/_labeled-input.scss +1 -0
  5. package/assets/styles/global/_layout.scss +0 -99
  6. package/assets/translations/en-us.yaml +76 -74
  7. package/assets/translations/zh-hans.yaml +25 -23
  8. package/babel.config.js +1 -7
  9. package/chart/gatekeeper.vue +11 -2
  10. package/chart/istio.vue +10 -1
  11. package/chart/logging/index.vue +11 -2
  12. package/chart/monitoring/alerting/index.vue +21 -7
  13. package/chart/monitoring/grafana/index.vue +2 -57
  14. package/chart/monitoring/index.vue +26 -52
  15. package/chart/monitoring/prometheus/index.vue +43 -37
  16. package/chart/rancher-backup/index.vue +10 -3
  17. package/cloud-credential/azure.vue +17 -4
  18. package/components/AsyncButton.vue +0 -9
  19. package/components/Carousel.vue +0 -1
  20. package/components/ChartPsp.vue +76 -0
  21. package/components/ClusterIconMenu.vue +9 -24
  22. package/components/CodeMirror.vue +16 -75
  23. package/components/CopyCode.vue +2 -6
  24. package/components/CopyToClipboard.vue +1 -2
  25. package/components/CopyToClipboardText.vue +9 -14
  26. package/components/CruResource.vue +0 -1
  27. package/components/EtcdInfoBanner.vue +5 -5
  28. package/components/ExplorerProjectsNamespaces.vue +1 -25
  29. package/components/FixedBanner.vue +0 -1
  30. package/components/IconOrSvg.vue +1 -1
  31. package/components/Markdown.vue +12 -16
  32. package/components/Questions/index.vue +1 -1
  33. package/components/ResourceDetail/Masthead.vue +9 -25
  34. package/components/ResourceDetail/index.vue +4 -1
  35. package/components/ResourceList/Masthead.vue +18 -1
  36. package/components/ResourceTable.vue +2 -14
  37. package/components/ResourceYaml.vue +5 -34
  38. package/components/SideNav.vue +65 -43
  39. package/components/SortableTable/THead.vue +9 -7
  40. package/components/SortableTable/index.vue +2 -1
  41. package/components/StatusTable.vue +1 -5
  42. package/components/TabTitle.vue +84 -0
  43. package/components/Tabbed/index.vue +0 -12
  44. package/components/YamlEditor.vue +0 -1
  45. package/components/__tests__/ChartPsp.test.ts +75 -0
  46. package/components/__tests__/CopyCode.test.ts +4 -5
  47. package/components/fleet/FleetBundles.vue +11 -5
  48. package/components/fleet/FleetRepos.vue +27 -62
  49. package/components/fleet/FleetResources.vue +1 -6
  50. package/components/fleet/FleetStatus.vue +3 -3
  51. package/components/fleet/FleetSummary.vue +30 -35
  52. package/components/form/ArrayList.vue +8 -1
  53. package/components/form/ArrayListSelect.vue +9 -9
  54. package/components/form/BannerSettings.vue +0 -3
  55. package/components/form/FileSelector.vue +0 -1
  56. package/components/form/KeyValue.vue +0 -2
  57. package/components/form/LabeledSelect.vue +0 -4
  58. package/components/form/Password.vue +1 -3
  59. package/components/form/Select.vue +1 -1
  60. package/components/form/SelectOrCreateAuthSecret.vue +4 -4
  61. package/components/form/__tests__/KeyValue.test.ts +1 -1
  62. package/components/formatter/Checked.vue +3 -11
  63. package/components/formatter/ClusterProvider.vue +18 -1
  64. package/components/formatter/FleetSummaryGraph.vue +11 -23
  65. package/components/formatter/LiveDate.vue +16 -0
  66. package/components/formatter/LiveDuration.vue +1 -1
  67. package/components/formatter/PercentageBar.vue +1 -1
  68. package/components/formatter/WorkloadDetailEndpoints.vue +22 -12
  69. package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
  70. package/components/nav/Group.vue +2 -2
  71. package/components/nav/Header.vue +2 -2
  72. package/components/nav/Jump.vue +9 -19
  73. package/components/nav/TopLevelMenu.vue +18 -66
  74. package/components/nav/Type.vue +7 -16
  75. package/components/nav/WindowManager/ContainerLogs.vue +19 -120
  76. package/components/nav/WindowManager/ContainerShell.vue +1 -6
  77. package/components/nav/WindowManager/index.vue +10 -11
  78. package/components/nav/__tests__/TopLevelMenu.test.ts +1 -34
  79. package/components/nav/__tests__/Type.test.ts +1 -31
  80. package/components/nuxt/nuxt-child.js +78 -14
  81. package/components/nuxt/nuxt.js +1 -1
  82. package/components/user.retention/user-retention-header.vue +34 -0
  83. package/composables/useI18n.ts +26 -0
  84. package/composables/useStore.ts +16 -0
  85. package/config/harvester-manager-types.js +0 -2
  86. package/config/home-links.js +32 -2
  87. package/config/private-label.js +0 -22
  88. package/config/product/explorer.js +4 -4
  89. package/config/product/fleet.js +1 -6
  90. package/config/product/legacy.js +1 -84
  91. package/config/product/manager.js +15 -8
  92. package/config/query-params.js +0 -1
  93. package/config/router.js +368 -385
  94. package/config/settings.ts +9 -2
  95. package/config/store.js +1 -1
  96. package/config/system-namespaces.js +0 -3
  97. package/config/table-headers.js +27 -47
  98. package/config/types.js +5 -0
  99. package/config/uiplugins.js +1 -1
  100. package/core/plugin-helpers.js +5 -3
  101. package/core/plugin-routes.ts +114 -56
  102. package/core/plugin.ts +10 -16
  103. package/core/plugins-loader.js +9 -7
  104. package/core/plugins.js +3 -0
  105. package/core/types-provisioning.ts +0 -7
  106. package/creators/app/init +0 -19
  107. package/detail/fleet.cattle.io.bundle.vue +1 -1
  108. package/detail/fleet.cattle.io.cluster.vue +1 -11
  109. package/detail/node.vue +0 -42
  110. package/detail/pod.vue +1 -68
  111. package/detail/provisioning.cattle.io.cluster.vue +8 -25
  112. package/detail/workload/index.vue +1 -15
  113. package/dialog/ScaleMachineDownDialog.vue +17 -34
  114. package/edit/auth/googleoauth.vue +5 -1
  115. package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
  116. package/edit/cloudcredential.vue +0 -2
  117. package/edit/fleet.cattle.io.gitrepo.vue +4 -3
  118. package/edit/management.cattle.io.project.vue +52 -1
  119. package/edit/management.cattle.io.setting.vue +2 -32
  120. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +1 -1
  121. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +2 -1
  122. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +1 -1
  123. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
  124. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
  125. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
  126. package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +125 -106
  127. package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
  128. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
  129. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
  130. package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
  131. package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
  132. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
  133. package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
  134. package/edit/provisioning.cattle.io.cluster/index.vue +40 -109
  135. package/edit/provisioning.cattle.io.cluster/rke2.vue +689 -152
  136. package/edit/service.vue +0 -12
  137. package/edit/token.vue +0 -1
  138. package/edit/workload/Upgrading.vue +2 -3
  139. package/edit/workload/index.vue +1 -2
  140. package/edit/workload/mixins/workload.js +1 -1
  141. package/initialize/App.js +71 -25
  142. package/initialize/client.js +162 -21
  143. package/initialize/index.js +124 -47
  144. package/initialize/layouts.ts +26 -0
  145. package/{components/templates → layouts}/blank.vue +1 -1
  146. package/{components/templates → layouts}/default.vue +98 -8
  147. package/{components/templates → layouts}/error.vue +19 -10
  148. package/{components/templates → layouts}/home.vue +1 -4
  149. package/{components/templates → layouts}/plain.vue +1 -4
  150. package/{components/templates → layouts}/standalone.vue +1 -1
  151. package/{components/templates → layouts}/unauthenticated.vue +1 -1
  152. package/list/catalog.cattle.io.app.vue +0 -1
  153. package/list/management.cattle.io.feature.vue +7 -1
  154. package/list/management.cattle.io.setting.vue +0 -1
  155. package/list/management.cattle.io.user.vue +25 -1
  156. package/list/node.vue +0 -1
  157. package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
  158. package/machine-config/azure.vue +37 -21
  159. package/machine-config/vmwarevsphere.vue +47 -42
  160. package/middleware/authenticated.js +19 -14
  161. package/mixins/auth-config.js +7 -2
  162. package/mixins/brand.js +41 -29
  163. package/mixins/fetch.server.js +73 -0
  164. package/mixins/labeled-form-element.ts +1 -6
  165. package/models/__tests__/management.cattle.io.node.ts +0 -85
  166. package/models/__tests__/namespace.test.ts +9 -49
  167. package/models/cluster/node.js +4 -4
  168. package/models/cluster.x-k8s.io.machine.js +1 -1
  169. package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
  170. package/models/fleet.cattle.io.cluster.js +0 -4
  171. package/models/fleet.cattle.io.gitrepo.js +13 -56
  172. package/models/management.cattle.io.cluster.js +3 -11
  173. package/models/management.cattle.io.kontainerdriver.js +0 -1
  174. package/models/management.cattle.io.node.js +14 -18
  175. package/models/management.cattle.io.nodepool.js +0 -17
  176. package/models/management.cattle.io.project.js +36 -0
  177. package/models/management.cattle.io.setting.js +7 -11
  178. package/models/management.cattle.io.user.js +65 -0
  179. package/models/namespace.js +1 -1
  180. package/models/pod.js +0 -20
  181. package/models/provisioning.cattle.io.cluster.js +9 -91
  182. package/models/secret.js +18 -126
  183. package/models/storage.k8s.io.storageclass.js +1 -1
  184. package/models/workload.js +0 -16
  185. package/models/workload.service.js +0 -18
  186. package/package.json +10 -12
  187. package/pages/about.vue +1 -0
  188. package/pages/account/create-key.vue +1 -0
  189. package/pages/account/index.vue +1 -0
  190. package/pages/auth/login.vue +1 -0
  191. package/pages/auth/logout.vue +2 -0
  192. package/pages/auth/setup.vue +4 -37
  193. package/pages/auth/verify.vue +8 -14
  194. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
  195. package/pages/c/_cluster/apps/charts/index.vue +58 -64
  196. package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
  197. package/pages/c/_cluster/apps/charts/install.vue +5 -5
  198. package/pages/c/_cluster/apps/index.vue +2 -0
  199. package/pages/c/_cluster/auth/index.vue +2 -0
  200. package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
  201. package/pages/c/_cluster/ecm/index.vue +2 -0
  202. package/pages/c/_cluster/explorer/index.vue +53 -56
  203. package/pages/c/_cluster/explorer/tools/index.vue +3 -171
  204. package/pages/c/_cluster/fleet/index.vue +1 -1
  205. package/pages/c/_cluster/index.vue +2 -0
  206. package/pages/c/_cluster/manager/pages/_page.vue +5 -4
  207. package/pages/c/_cluster/monitoring/index.vue +1 -17
  208. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -1
  209. package/pages/c/_cluster/settings/banners.vue +2 -0
  210. package/pages/c/_cluster/settings/brand.vue +2 -3
  211. package/pages/c/_cluster/settings/index.vue +2 -0
  212. package/pages/c/_cluster/settings/links.vue +3 -2
  213. package/pages/c/_cluster/settings/performance.vue +1 -0
  214. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
  215. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
  216. package/pages/c/_cluster/uiplugins/index.vue +2 -0
  217. package/pages/c/index.vue +9 -0
  218. package/pages/diagnostic.vue +2 -1
  219. package/pages/fail-whale.vue +1 -0
  220. package/pages/prefs.vue +1 -0
  221. package/pages/rio/mesh.vue +508 -0
  222. package/pages/support/index.vue +8 -2
  223. package/pkg/auto-import.js +1 -1
  224. package/plugins/axios.js +36 -0
  225. package/plugins/back-button.js +5 -3
  226. package/plugins/clean-html-directive.js +19 -1
  227. package/plugins/clean-tooltip-directive.js +1 -1
  228. package/plugins/codemirror-loader.js +1 -1
  229. package/plugins/codemirror.js +0 -41
  230. package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
  231. package/plugins/dashboard-store/actions.js +17 -16
  232. package/plugins/dashboard-store/classify.js +18 -1
  233. package/plugins/dashboard-store/getters.js +7 -70
  234. package/plugins/dashboard-store/index.js +12 -0
  235. package/plugins/dashboard-store/mutations.js +4 -0
  236. package/plugins/dashboard-store/resource-class.js +20 -65
  237. package/plugins/i18n.js +1 -1
  238. package/plugins/steve/__tests__/getters.spec.ts +48 -26
  239. package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
  240. package/plugins/steve/actions.js +37 -3
  241. package/plugins/steve/getters.js +24 -7
  242. package/plugins/steve/mutations.js +5 -2
  243. package/plugins/steve/norman-class.js +0 -19
  244. package/plugins/steve/steve-class.js +0 -22
  245. package/plugins/steve/subscribe.js +34 -13
  246. package/plugins/transitions.js +4 -0
  247. package/plugins/vue-clipboard2.js +4 -0
  248. package/rancher-components/Accordion/Accordion.vue +3 -2
  249. package/rancher-components/BadgeState/BadgeState.vue +3 -3
  250. package/rancher-components/Banner/Banner.test.ts +1 -5
  251. package/rancher-components/Banner/Banner.vue +2 -2
  252. package/rancher-components/Card/Card.vue +4 -4
  253. package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
  254. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
  255. package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
  256. package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
  257. package/rancher-components/Form/Radio/RadioButton.vue +13 -7
  258. package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
  259. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
  260. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
  261. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
  262. package/rancher-components/StringList/StringList.vue +8 -8
  263. package/rancher-components/components/Accordion/Accordion.vue +3 -2
  264. package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
  265. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
  266. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
  267. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
  268. package/rancher-components/components/StringList/StringList.test.ts +0 -270
  269. package/rancher-components/components/StringList/StringList.vue +18 -57
  270. package/scripts/extension/bundle +7 -19
  271. package/scripts/extension/helm/scripts/package +3 -11
  272. package/scripts/extension/parse-tag-name +4 -4
  273. package/scripts/extension/publish +9 -20
  274. package/scripts/publish-shell.sh +1 -11
  275. package/scripts/test-plugins-build.sh +9 -85
  276. package/store/catalog.js +1 -1
  277. package/store/features.js +0 -1
  278. package/store/i18n.js +0 -11
  279. package/store/index.js +13 -11
  280. package/store/prefs.js +38 -33
  281. package/store/type-map.js +82 -157
  282. package/tsconfig.default.json +46 -0
  283. package/tsconfig.json +9 -35
  284. package/types/shell/index.d.ts +404 -465
  285. package/utils/axios.js +19 -0
  286. package/utils/create-yaml.js +1 -5
  287. package/utils/custom-validators.js +2 -0
  288. package/utils/error.js +1 -16
  289. package/utils/monitoring.js +2 -37
  290. package/utils/nuxt.js +39 -18
  291. package/utils/object.js +0 -24
  292. package/utils/router.scrollBehavior.js +14 -12
  293. package/utils/socket.js +1 -0
  294. package/utils/time.js +1 -1
  295. package/utils/title.ts +3 -0
  296. package/utils/url.ts +1 -1
  297. package/utils/validators/formRules/__tests__/index.test.ts +4 -49
  298. package/utils/validators/formRules/index.ts +9 -12
  299. package/utils/validators/setting.js +10 -6
  300. package/vue.config.js +3 -24
  301. package/chart/monitoring/steps/uninstall-v1.vue +0 -135
  302. package/components/Certificates.vue +0 -164
  303. package/components/__tests__/CodeMirror.spec.ts +0 -99
  304. package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
  305. package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
  306. package/components/formatter/__tests__/Checked.test.ts +0 -19
  307. package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +0 -81
  308. package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
  309. package/composables/useCompactInput.ts +0 -20
  310. package/composables/useLabeledFormElement.ts +0 -138
  311. package/creators/app/files/.gitlab-ci.yml +0 -14
  312. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +0 -77
  313. package/edit/__tests__/service.test.ts +0 -89
  314. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
  315. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
  316. package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
  317. package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
  318. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
  319. package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
  320. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
  321. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
  322. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -147
  323. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
  324. package/mixins/v1-workload-metrics.js +0 -43
  325. package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
  326. package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
  327. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -241
  328. package/models/__tests__/secret.test.ts +0 -37
  329. package/models/__tests__/storage.k8s.io.storageclass.test.ts +0 -22
  330. package/models/__tests__/workload.test.ts +0 -91
  331. package/plugins/clean-html.js +0 -53
  332. package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
  333. package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
  334. package/plugins/index.js +0 -11
  335. package/plugins/steve/__tests__/resource-utils.test.ts +0 -159
  336. package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
  337. package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
  338. package/plugins/steve/resource-utils.ts +0 -38
  339. package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
  340. package/server/har-file.js +0 -183
  341. package/store/__tests__/type-map.test.ts +0 -1122
  342. package/tsconfig.paths.json +0 -18
  343. package/utils/azure.js +0 -24
  344. package/utils/clipboard.js +0 -5
  345. /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
  346. /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
  347. /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
  348. /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
  349. /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
  350. /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
  351. /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +0 -0
  352. /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
  353. /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
  354. /package/plugins/dashboard-store/__tests__/{actions.test.ts → actions.spec.ts} +0 -0
  355. /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
  356. /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
@@ -47,7 +47,7 @@ describe('component: KeyValue', () => {
47
47
  stubs: { CodeMirror: true }
48
48
  });
49
49
 
50
- const inputFieldTextArea = wrapper.find('[data-testid="text-area-auto-grow"]');
50
+ const inputFieldTextArea = wrapper.find('[data-testid="value-multiline"]');
51
51
 
52
52
  inputFieldTextArea.setValue('bar\n');
53
53
 
@@ -2,24 +2,16 @@
2
2
 
3
3
  export default {
4
4
  props: {
5
- // When sortabletable calculates these values it converts null and undefined to ''
6
- // passing '' to a prop typed as Boolean coerces it to true
7
5
  value: {
8
- type: [String, Boolean],
6
+ type: Boolean,
9
7
  default: true
10
8
  },
11
- },
12
-
13
- computed: {
14
- checked() {
15
- return this.value === true || this.value === 'true';
16
- }
17
- },
9
+ }
18
10
  };
19
11
  </script>
20
12
 
21
13
  <template>
22
- <span v-if="checked">
14
+ <span v-if="value">
23
15
  <i class="icon icon-checkmark" />
24
16
  </span>
25
17
  <span
@@ -6,6 +6,23 @@ export default {
6
6
  required: true
7
7
  },
8
8
  },
9
+ data(props) {
10
+ const mgmt = props.row?.mgmt;
11
+
12
+ return {
13
+ // The isImported getter on the provisioning cluster
14
+ // model doesn't work for imported K3s clusters, in
15
+ // which case it returns 'k3s' instead of 'imported.'
16
+ // This is the workaround.
17
+ isImported: mgmt?.providerForEmberParam === 'import' ||
18
+ // when imported cluster is GKE
19
+ !!mgmt?.spec?.gkeConfig?.imported ||
20
+ // or AKS
21
+ !!mgmt?.spec?.aksConfig?.imported ||
22
+ // or EKS
23
+ !!mgmt?.spec?.eksConfig?.imported
24
+ };
25
+ },
9
26
  };
10
27
  </script>
11
28
 
@@ -28,7 +45,7 @@ export default {
28
45
  <template v-else-if="row.isCustom">
29
46
  {{ t('cluster.provider.custom') }}
30
47
  </template>
31
- <template v-else-if="row.isImported">
48
+ <template v-else-if="isImported">
32
49
  {{ t('cluster.provider.imported') }}
33
50
  </template>
34
51
  <div class="text-muted">
@@ -12,22 +12,10 @@ export default {
12
12
  type: Object,
13
13
  required: true
14
14
  },
15
-
16
- clusterLabel: {
17
- type: String,
18
- required: false,
19
- default: null,
20
- }
21
15
  },
22
16
 
23
17
  computed: {
24
18
  summary() {
25
- if (this.clusterLabel) {
26
- return this.row.clusterResourceStatus.find((x) => {
27
- return x.clusterLabel === this.clusterLabel;
28
- })?.status.resourceCounts || {};
29
- }
30
-
31
19
  return this.row.status?.resourceCounts || {};
32
20
  },
33
21
 
@@ -85,7 +73,7 @@ export default {
85
73
  >
86
74
  <td
87
75
  class="text-left pr-20"
88
- :class="{ [obj.textColor]: true }"
76
+ :class="{[obj.textColor]: true}"
89
77
  >
90
78
  {{ obj.label }}
91
79
  </td>
@@ -106,17 +94,17 @@ export default {
106
94
  </template>
107
95
 
108
96
  <style lang="scss">
109
- .col-scale {
110
- position: relative;
97
+ .col-scale {
98
+ position: relative;
111
99
 
112
- .trigger {
113
- width: 100%;
100
+ .trigger {
101
+ width: 100%;
102
+ }
114
103
  }
115
- }
116
104
 
117
- .scale {
118
- margin: 0;
119
- padding: 0;
120
- line-height: initial;
121
- }
105
+ .scale {
106
+ margin: 0;
107
+ padding: 0;
108
+ line-height: initial;
109
+ }
122
110
  </style>
@@ -34,6 +34,16 @@ export default {
34
34
  showTooltip: {
35
35
  type: Boolean,
36
36
  default: true
37
+ },
38
+
39
+ /**
40
+ * Determines if the live date should behave like a countdown by comparing
41
+ * the provided value and the current date. When the countdown reaches 0, a
42
+ * "-" is rendered.
43
+ */
44
+ isCountdown: {
45
+ type: Boolean,
46
+ default: false,
37
47
  }
38
48
  },
39
49
 
@@ -104,6 +114,12 @@ export default {
104
114
  return 300;
105
115
  }
106
116
 
117
+ if (this.isCountdown && now.valueOf() > this.dayValue?.valueOf()) {
118
+ this.label = '-';
119
+
120
+ return 300;
121
+ }
122
+
107
123
  const diff = diffFrom(this.dayValue, now);
108
124
  const prefix = (diff.diff < 0 || !this.addPrefix ? '' : '-');
109
125
 
@@ -57,7 +57,7 @@ export default {
57
57
  const now = day();
58
58
 
59
59
  from = from || now;
60
- const seconds = Math.abs(value.diff(from, 'seconds'));
60
+ const seconds = Math.abs(value.diff(now, 'seconds'));
61
61
 
62
62
  return elapsedTime(seconds);
63
63
  },
@@ -30,7 +30,7 @@ export default {
30
30
  </script>
31
31
 
32
32
  <template>
33
- <p v-if="!value || value === '0' || isNaN(value)">
33
+ <p v-if="!value || value === '0'">
34
34
  {{ t('generic.na') }}
35
35
  </p>
36
36
  <PercentageBarComponent
@@ -27,7 +27,6 @@ export default {
27
27
 
28
28
  try {
29
29
  out = JSON.parse(this.value);
30
-
31
30
  out.forEach((endpoint) => {
32
31
  let protocol = 'http';
33
32
 
@@ -35,19 +34,10 @@ export default {
35
34
  protocol = 'https';
36
35
  }
37
36
 
38
- const linkDefaultDisplay = endpoint.port ? `${ endpoint.port }/${ endpoint.protocol }` : endpoint.protocol;
39
-
40
- // If there's an ingress and it has a hostname, we use the hostname address instead
41
- // https://github.com/rancher/dashboard/issues/8087
42
- if (endpoint.ingressName && endpoint.hostname) {
43
- endpoint.link = `${ protocol }://${ endpoint.hostname }${ endpoint.path }`;
44
- endpoint.linkDisplay = endpoint.link;
45
- } else if (endpoint.addresses && endpoint.addresses.length) {
37
+ if (endpoint.addresses) {
46
38
  endpoint.link = `${ protocol }://${ endpoint.addresses[0] }:${ endpoint.port }`;
47
- endpoint.linkDisplay = linkDefaultDisplay;
48
39
  } else if (externalIp) {
49
40
  endpoint.link = `${ protocol }://${ externalIp }:${ endpoint.port }`;
50
- endpoint.linkDisplay = linkDefaultDisplay;
51
41
  } else {
52
42
  endpoint.display = `[${ this.t('servicesPage.anyNode') }]:${ endpoint.port }`;
53
43
  }
@@ -59,6 +49,26 @@ export default {
59
49
  }
60
50
  }
61
51
 
52
+ return null;
53
+ },
54
+
55
+ protocol() {
56
+ const { parsed } = this;
57
+
58
+ if ( parsed) {
59
+ if (this.parsed[0].protocol) {
60
+ return this.parsed[0].protocol;
61
+ }
62
+
63
+ const match = parsed.match(/^([^:]+):\/\//);
64
+
65
+ if ( match ) {
66
+ return match[1];
67
+ } else {
68
+ return 'link';
69
+ }
70
+ }
71
+
62
72
  return null;
63
73
  }
64
74
  },
@@ -80,7 +90,7 @@ export default {
80
90
  :href="endpoint.link"
81
91
  target="_blank"
82
92
  rel="nofollow noopener noreferrer"
83
- >{{ endpoint.linkDisplay }}</a>
93
+ ><span v-if="endpoint.port">{{ endpoint.port }}/</span>{{ endpoint.protocol }}</a>
84
94
  </template>
85
95
  </span>
86
96
  </template>
@@ -0,0 +1,28 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import ClusterProvider from '@shell/components/formatter/ClusterProvider.vue';
3
+
4
+ describe('component: ClusterProvider', () => {
5
+ const importedGkeClusterInfo = { mgmt: { spec: { gkeConfig: { imported: true } } } };
6
+ const importedAksClusterInfo = { mgmt: { spec: { aksConfig: { imported: true } } } };
7
+ const importedEksClusterInfo = { mgmt: { spec: { eksConfig: { imported: true } } } };
8
+ const notImportedGkeClusterInfo = { mgmt: { spec: { gkeConfig: { imported: false } } } };
9
+ const importedClusterInfoWithProviderForEmberParam = { mgmt: { providerForEmberParam: 'import' } };
10
+
11
+ describe('isImported', () => {
12
+ const testCases = [
13
+ [importedGkeClusterInfo, true],
14
+ [importedAksClusterInfo, true],
15
+ [importedEksClusterInfo, true],
16
+ [notImportedGkeClusterInfo, false],
17
+ [importedClusterInfoWithProviderForEmberParam, true],
18
+ [{}, false],
19
+ ];
20
+
21
+ it.each(testCases)('should return the isImported value properly based on the props data', (row, expected) => {
22
+ const wrapper = mount(ClusterProvider, { propsData: { row } });
23
+
24
+ expect(wrapper.vm.$data.isImported).toBe(expected);
25
+ }
26
+ );
27
+ });
28
+ });
@@ -390,8 +390,8 @@ export default {
390
390
  }
391
391
  }
392
392
 
393
- .body ::v-deep > .child.router-link-active,
394
- .header ::v-deep > .child.router-link-exact-active {
393
+ .body ::v-deep > .child.nuxt-link-active,
394
+ .header ::v-deep > .child.nuxt-link-exact-active {
395
395
  padding: 0;
396
396
 
397
397
  A, A I {
@@ -311,7 +311,7 @@ export default {
311
311
  product: this.currentProduct.name,
312
312
  cluster: this.currentCluster,
313
313
  };
314
- const enabled = action.enabled ? action.enabled.apply(this, [this.ctx]) : true;
314
+ const enabled = action.enabled ? action.enabled.apply(this, [opts]) : true;
315
315
 
316
316
  if (fn && enabled) {
317
317
  fn.apply(this, [opts, [], { $route: this.$route }]);
@@ -432,7 +432,6 @@ export default {
432
432
  >
433
433
  <BrandImage
434
434
  class="side-menu-logo-img"
435
- data-testid="header-side-menu__brand-img"
436
435
  file-name="rancher-logo.svg"
437
436
  />
438
437
  </div>
@@ -442,6 +441,7 @@ export default {
442
441
 
443
442
  <div class="rd-header-right">
444
443
  <component :is="navHeaderRight" />
444
+
445
445
  <div
446
446
  v-if="showFilter"
447
447
  class="top"
@@ -2,8 +2,7 @@
2
2
  import debounce from 'lodash/debounce';
3
3
  import Group from '@shell/components/nav/Group';
4
4
  import { isMac } from '@shell/utils/platform';
5
- import { BOTH, TYPE_MODES } from '@shell/store/type-map';
6
- import { COUNT } from '@shell/config/types';
5
+ import { BOTH, ALL } from '@shell/store/type-map';
7
6
 
8
7
  export default {
9
8
  components: { Group },
@@ -32,26 +31,17 @@ export default {
32
31
  methods: {
33
32
  updateMatches() {
34
33
  const clusterId = this.$store.getters['clusterId'];
35
- const productId = this.$store.getters['productId'];
36
- const product = this.$store.getters['currentProduct'];
34
+ const isAllNamespaces = this.$store.getters['isAllNamespaces'];
35
+ const product = this.$store.getters['productId'];
37
36
 
38
- const allTypesByMode = this.$store.getters['type-map/allTypes'](productId, [TYPE_MODES.ALL]) || {};
39
- const allTypes = allTypesByMode[TYPE_MODES.ALL];
40
- const out = this.$store.getters['type-map/getTree'](productId, TYPE_MODES.ALL, allTypes, clusterId, BOTH, null, this.value);
37
+ let namespaces = null;
41
38
 
42
- // Suplement the output with count info. Usualy the `Type` component would handle this individualy... but scales real bad so give it
43
- // some help
44
- const counts = this.$store.getters[`${ product.inStore }/all`](COUNT)?.[0]?.counts || {};
39
+ if ( !isAllNamespaces ) {
40
+ namespaces = Object.keys(this.$store.getters['activeNamespaceCache']);
41
+ }
45
42
 
46
- out.forEach((o) => {
47
- o.children?.forEach((t) => {
48
- const count = counts[t.name];
49
-
50
- t.count = count ? count.summary.count || 0 : null;
51
- t.byNamespace = count ? count.namespaces : {};
52
- t.revision = count ? count.revision : null;
53
- });
54
- });
43
+ const allTypes = this.$store.getters['type-map/allTypes'](product) || {};
44
+ const out = this.$store.getters['type-map/getTree'](product, ALL, allTypes, clusterId, BOTH, namespaces, null, this.value);
55
45
 
56
46
  this.groups = out;
57
47
 
@@ -13,7 +13,6 @@ import { getVersionInfo } from '@shell/utils/version';
13
13
  import { LEGACY } from '@shell/store/features';
14
14
  import { SETTING } from '@shell/config/settings';
15
15
  import { filterOnlyKubernetesClusters, filterHiddenLocalCluster } from '@shell/utils/cluster';
16
- import { getProductFromRoute } from '@shell/middleware/authenticated';
17
16
  import { isRancherPrime } from '@shell/config/version';
18
17
  import Pinned from '@shell/components/nav/Pinned';
19
18
 
@@ -52,11 +51,13 @@ export default {
52
51
  ...mapGetters(['clusterId']),
53
52
  ...mapGetters(['clusterReady', 'isRancher', 'currentCluster', 'currentProduct', 'isRancherInHarvester']),
54
53
  ...mapGetters({ features: 'features/get' }),
54
+
55
55
  value: {
56
56
  get() {
57
57
  return this.$store.getters['productId'];
58
58
  },
59
59
  },
60
+
60
61
  sideMenuStyle() {
61
62
  return {
62
63
  marginBottom: this.globalBannerSettings?.footerFont,
@@ -73,7 +74,6 @@ export default {
73
74
  const {
74
75
  showFooter, showHeader, bannerFooter, bannerHeader, banner
75
76
  } = parsed;
76
-
77
77
  // add defaults to accomodate older JSON structures for banner definitions without breaking the UI
78
78
  // https://github.com/rancher/dashboard/issues/10140
79
79
  const bannerHeaderFontSize = bannerHeader?.fontSize || banner?.fontSize || '14px';
@@ -169,6 +169,7 @@ export default {
169
169
 
170
170
  return `min-height: ${ height }px`;
171
171
  },
172
+
172
173
  clusterFilterCount() {
173
174
  return this.clusterFilter ? this.clustersFiltered.length : this.clusters.length;
174
175
  },
@@ -245,15 +246,7 @@ export default {
245
246
 
246
247
  hasSupport() {
247
248
  return isRancherPrime() || this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SUPPORTED )?.value === 'true';
248
- },
249
-
250
- isCurrRouteClusterExplorer() {
251
- return this.$route?.name?.startsWith('c-cluster');
252
- },
253
-
254
- productFromRoute() {
255
- return getProductFromRoute(this.$route);
256
- },
249
+ }
257
250
  },
258
251
 
259
252
  watch: {
@@ -284,16 +277,6 @@ export default {
284
277
  return `${ lineHeightInEm }em`;
285
278
  },
286
279
 
287
- checkActiveRoute(obj, isClusterRoute) {
288
- // for Cluster links in main nav: check if route is a cluster explorer one + check if route cluster matches cluster obj id + check if curr product matches route product
289
- if (isClusterRoute) {
290
- return this.isCurrRouteClusterExplorer && this.$route?.params?.cluster === obj?.id && this.productFromRoute === this.currentProduct?.name;
291
- }
292
-
293
- // for remaining main nav items, check if curr product matches route product is enough
294
- return this.productFromRoute === obj?.value;
295
- },
296
-
297
280
  handler(e) {
298
281
  if (e.keyCode === KEY.ESCAPE ) {
299
282
  this.hide();
@@ -373,10 +356,7 @@ export default {
373
356
  /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /></svg>
374
357
  </div>
375
358
  <div class="side-menu-logo">
376
- <BrandImage
377
- data-testid="side-menu__brand-img"
378
- file-name="rancher-logo.svg"
379
- />
359
+ <BrandImage file-name="rancher-logo.svg" />
380
360
  </div>
381
361
  </div>
382
362
 
@@ -425,10 +405,6 @@ export default {
425
405
  v-model="clusterFilter"
426
406
  :placeholder="t('nav.search.placeholder')"
427
407
  >
428
- <i
429
- class="magnifier icon icon-search"
430
- :class="{ active: clusterFilter }"
431
- />
432
408
  <i
433
409
  v-if="clusterFilter"
434
410
  class="icon icon-close"
@@ -463,7 +439,6 @@ export default {
463
439
  <nuxt-link
464
440
  class="option"
465
441
  :to="a.to"
466
- :class="{'active-menu-link': checkActiveRoute(a) }"
467
442
  >
468
443
  <IconOrSvg
469
444
  :icon="a.icon"
@@ -495,7 +470,6 @@ export default {
495
470
  v-if="c.ready"
496
471
  :data-testid="`menu-cluster-${ c.id }`"
497
472
  class="cluster selector option"
498
- :class="{'active-menu-link': checkActiveRoute(c, true) }"
499
473
  :to="{ name: 'c-cluster-explorer', params: { cluster: c.id } }"
500
474
  >
501
475
  <ClusterIconMenu
@@ -545,7 +519,6 @@ export default {
545
519
  v-if="c.ready"
546
520
  :data-testid="`menu-cluster-${ c.id }`"
547
521
  class="cluster selector option"
548
- :class="{'active-menu-link': checkActiveRoute(c, true) }"
549
522
  :to="{ name: 'c-cluster-explorer', params: { cluster: c.id } }"
550
523
  >
551
524
  <ClusterIconMenu
@@ -623,7 +596,6 @@ export default {
623
596
  >
624
597
  <nuxt-link
625
598
  class="option"
626
- :class="{'active-menu-link': checkActiveRoute(a) }"
627
599
  :to="a.to"
628
600
  >
629
601
  <IconOrSvg
@@ -651,7 +623,6 @@ export default {
651
623
  >
652
624
  <nuxt-link
653
625
  class="option"
654
- :class="{'active-menu-link': checkActiveRoute(a) }"
655
626
  :to="a.to"
656
627
  >
657
628
  <IconOrSvg
@@ -681,7 +652,6 @@ export default {
681
652
  >
682
653
  <nuxt-link
683
654
  class="option"
684
- :class="{'active-menu-link': checkActiveRoute(a) }"
685
655
  :to="a.to"
686
656
  >
687
657
  <IconOrSvg
@@ -793,7 +763,6 @@ export default {
793
763
 
794
764
  &.menu-open {
795
765
  width: 300px;
796
- box-shadow: 3px 1px 3px var(--shadow);
797
766
  }
798
767
 
799
768
  .title {
@@ -801,6 +770,7 @@ export default {
801
770
  height: 55px;
802
771
  flex: 0 0 55px;
803
772
  width: 100%;
773
+ border-bottom: 1px solid var(--nav-border);
804
774
  justify-content: flex-start;
805
775
  align-items: center;
806
776
 
@@ -901,7 +871,7 @@ export default {
901
871
  margin-right: 16px;
902
872
  }
903
873
 
904
- &.router-link-active, &.active-menu-link {
874
+ &.nuxt-link-active {
905
875
  background: var(--primary-hover-bg);
906
876
  color: var(--primary-hover-text);
907
877
 
@@ -953,31 +923,13 @@ export default {
953
923
  position: relative;
954
924
  > input {
955
925
  background-color: transparent;
926
+ margin-bottom: 8px;
956
927
  padding-right: 35px;
957
- padding-left: 25px;
958
- height: 32px;
959
- }
960
- > .magnifier {
961
- position: absolute;
962
- top: 12px;
963
- left: 8px;
964
- width: 12px;
965
- height: 12px;
966
- font-size: 12px;
967
- opacity: 0.4;
968
-
969
- &.active {
970
- opacity: 1;
971
-
972
- &:hover {
973
- color: var(--body-text);
974
- }
975
- }
976
928
  }
977
929
  > i {
978
930
  position: absolute;
979
- font-size: 12px;
980
- top: 12px;
931
+ font-size: $clear-search-size;
932
+ top: 11px;
981
933
  right: 8px;
982
934
  opacity: 0.7;
983
935
  cursor: pointer;
@@ -1014,10 +966,10 @@ export default {
1014
966
  height: 42px;
1015
967
 
1016
968
  .search {
1017
- transition: all 0.25s ease-in-out;
969
+ transition: all 0.5s ease-in-out;
1018
970
  transition-delay: 2s;
1019
971
  width: 72%;
1020
- height: 36px;
972
+ height: 42px;
1021
973
 
1022
974
  input {
1023
975
  height: 100%;
@@ -1043,7 +995,7 @@ export default {
1043
995
  font-size: 14px;
1044
996
  }
1045
997
 
1046
- .router-link-active {
998
+ .nuxt-link-active {
1047
999
  &:hover {
1048
1000
  text-decoration: none;
1049
1001
  }
@@ -1073,7 +1025,7 @@ export default {
1073
1025
  hr {
1074
1026
  margin: 0;
1075
1027
  width: 94%;
1076
- transition: all 0.25s ease-in-out;
1028
+ transition: all 0.5s ease-in-out;
1077
1029
  max-width: 100%;
1078
1030
  }
1079
1031
  }
@@ -1100,7 +1052,7 @@ export default {
1100
1052
  text-transform: uppercase;
1101
1053
 
1102
1054
  span {
1103
- transition: all 0.25s ease-in-out;
1055
+ transition: all 0.5s ease-in-out;
1104
1056
  display: flex;
1105
1057
  max-height: 16px;
1106
1058
  }
@@ -1109,7 +1061,7 @@ export default {
1109
1061
  margin: 0;
1110
1062
  max-width: 50px;
1111
1063
  width: 0;
1112
- transition: all 0.25s ease-in-out;
1064
+ transition: all 0.5s ease-in-out;
1113
1065
  }
1114
1066
  }
1115
1067
 
@@ -1221,12 +1173,12 @@ export default {
1221
1173
  }
1222
1174
 
1223
1175
  .fade-enter-active, .fade-leave-active {
1224
- transition: all 0.25s;
1176
+ transition: all 0.2s;
1225
1177
  transition-timing-function: ease;
1226
1178
  }
1227
1179
 
1228
1180
  .fade-leave-active {
1229
- transition: all 0.25s;
1181
+ transition: all 0.4s;
1230
1182
  }
1231
1183
 
1232
1184
  .fade-leave-to {
@@ -1,8 +1,9 @@
1
1
  <script>
2
2
  import Favorite from '@shell/components/nav/Favorite';
3
- import { TYPE_MODES } from '@shell/store/type-map';
3
+ import { FAVORITE, USED } from '@shell/store/type-map';
4
+ import { linkActiveClass } from '@shell/config/router';
4
5
 
5
- const showFavoritesFor = [TYPE_MODES.FAVORITE, TYPE_MODES.USED];
6
+ const showFavoritesFor = [FAVORITE, USED];
6
7
 
7
8
  export default {
8
9
 
@@ -30,6 +31,7 @@ export default {
30
31
  near: false,
31
32
  over: false,
32
33
  menuPath: this.type.route ? this.$router.resolve(this.type.route)?.route?.path : undefined,
34
+ linkActiveClass
33
35
  };
34
36
  },
35
37
 
@@ -90,23 +92,12 @@ export default {
90
92
  },
91
93
 
92
94
  showCount() {
93
- return this.count !== undefined;
95
+ return typeof this.type.count !== 'undefined';
94
96
  },
95
97
 
96
98
  namespaceIcon() {
97
99
  return this.type.namespaced;
98
100
  },
99
-
100
- count() {
101
- if (this.type.count !== undefined) {
102
- return this.type.count;
103
- }
104
-
105
- const inStore = this.$store.getters['currentStore'](this.type.name);
106
-
107
- return this.$store.getters[`${ inStore }/count`]({ name: this.type.name });
108
- }
109
-
110
101
  },
111
102
 
112
103
  methods: {
@@ -143,7 +134,7 @@ export default {
143
134
  :to="type.route"
144
135
  tag="li"
145
136
  class="child nav-type"
146
- :class="{'root': isRoot, [`depth-${depth}`]: true, 'router-link-active': isCurrent}"
137
+ :class="{'root': isRoot, [`depth-${depth}`]: true, [linkActiveClass]: isCurrent}"
147
138
  :exact="type.exact"
148
139
  >
149
140
  <a
@@ -173,7 +164,7 @@ export default {
173
164
  v-if="namespaceIcon"
174
165
  class="icon icon-namespace namespaced"
175
166
  />
176
- {{ count }}
167
+ {{ type.count }}
177
168
  </span>
178
169
  </a>
179
170
  </n-link>