@rancher/shell 0.1.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 (1275) hide show
  1. package/assets/brand/federal/dark/rancher-logo.svg +104 -0
  2. package/assets/brand/federal/metadata.json +3 -0
  3. package/assets/brand/federal/rancher-logo.svg +1 -0
  4. package/assets/brand/rgs/dark/rancher-logo.svg +1 -0
  5. package/assets/brand/rgs/metadata.json +3 -0
  6. package/assets/brand/rgs/rancher-logo.svg +1 -0
  7. package/assets/brand/suse/dark/rancher-logo.svg +148 -0
  8. package/assets/brand/suse/metadata.json +3 -0
  9. package/assets/brand/suse/rancher-logo.svg +130 -0
  10. package/assets/data/aws-regions.json +29 -0
  11. package/assets/data/ec2-instance-groups.json +85 -0
  12. package/assets/fonts/lato/lato-v17-latin-700.woff +0 -0
  13. package/assets/fonts/lato/lato-v17-latin-700.woff2 +0 -0
  14. package/assets/fonts/lato/lato-v17-latin-regular.woff +0 -0
  15. package/assets/fonts/lato/lato-v17-latin-regular.woff2 +0 -0
  16. package/assets/fonts/poppins/poppins-v15-latin-300.woff +0 -0
  17. package/assets/fonts/poppins/poppins-v15-latin-300.woff2 +0 -0
  18. package/assets/fonts/poppins/poppins-v15-latin-500.woff +0 -0
  19. package/assets/fonts/poppins/poppins-v15-latin-500.woff2 +0 -0
  20. package/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff +0 -0
  21. package/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff2 +0 -0
  22. package/assets/images/field-valid.svg +16 -0
  23. package/assets/images/generic-catalog.svg +15 -0
  24. package/assets/images/generic-driver.svg +17 -0
  25. package/assets/images/pl/README.md +13 -0
  26. package/assets/images/pl/banner.svg +241 -0
  27. package/assets/images/pl/dark/banner.svg +242 -0
  28. package/assets/images/pl/dark/login-landscape.svg +291 -0
  29. package/assets/images/pl/dark/rancher-logo.svg +51 -0
  30. package/assets/images/pl/decoration-cloud-big-white.svg +1 -0
  31. package/assets/images/pl/decoration-ground.svg +1 -0
  32. package/assets/images/pl/error-desert-landscape.svg +217 -0
  33. package/assets/images/pl/half-logo.svg +23 -0
  34. package/assets/images/pl/harvester.png +0 -0
  35. package/assets/images/pl/login-landscape.svg +496 -0
  36. package/assets/images/pl/rancher-logo.svg +51 -0
  37. package/assets/images/pl/setup-step-one.svg +612 -0
  38. package/assets/images/pl/sunglasses.svg +20 -0
  39. package/assets/images/providers/aks-black.svg +28 -0
  40. package/assets/images/providers/aks.svg +31 -0
  41. package/assets/images/providers/aliyun-black.svg +14 -0
  42. package/assets/images/providers/aliyun.svg +17 -0
  43. package/assets/images/providers/aliyunecs-black.svg +13 -0
  44. package/assets/images/providers/aliyunecs.svg +21 -0
  45. package/assets/images/providers/amazonec2-black.svg +8 -0
  46. package/assets/images/providers/amazonec2.svg +19 -0
  47. package/assets/images/providers/amazoneks-black.svg +10 -0
  48. package/assets/images/providers/amazoneks.svg +14 -0
  49. package/assets/images/providers/aws.svg +38 -0
  50. package/assets/images/providers/azure-black.svg +29 -0
  51. package/assets/images/providers/azure.svg +32 -0
  52. package/assets/images/providers/azuread-black.svg +22 -0
  53. package/assets/images/providers/azuread.svg +25 -0
  54. package/assets/images/providers/azureaks-black.svg +28 -0
  55. package/assets/images/providers/azureaks.svg +31 -0
  56. package/assets/images/providers/baidu-black.svg +19 -0
  57. package/assets/images/providers/baidu.svg +25 -0
  58. package/assets/images/providers/cloudca-black.svg +45 -0
  59. package/assets/images/providers/cloudca.svg +49 -0
  60. package/assets/images/providers/cloudscale-black.svg +24 -0
  61. package/assets/images/providers/cloudscale.svg +28 -0
  62. package/assets/images/providers/custom.svg +85 -0
  63. package/assets/images/providers/digitalocean-black.svg +21 -0
  64. package/assets/images/providers/digitalocean.svg +24 -0
  65. package/assets/images/providers/equinix-black.svg +13 -0
  66. package/assets/images/providers/equinix.svg +13 -0
  67. package/assets/images/providers/exoscale.svg +1 -0
  68. package/assets/images/providers/gcp.svg +6 -0
  69. package/assets/images/providers/gke-black.svg +10 -0
  70. package/assets/images/providers/gke.svg +28 -0
  71. package/assets/images/providers/google.svg +29 -0
  72. package/assets/images/providers/googlegke-black.svg +10 -0
  73. package/assets/images/providers/googlegke.svg +28 -0
  74. package/assets/images/providers/harvester.svg +1 -0
  75. package/assets/images/providers/huaweicce-black.svg +109 -0
  76. package/assets/images/providers/huaweicce.svg +184 -0
  77. package/assets/images/providers/import.svg +99 -0
  78. package/assets/images/providers/k3s-black.svg +10 -0
  79. package/assets/images/providers/k3s.svg +15 -0
  80. package/assets/images/providers/kubernetes-black.svg +37 -0
  81. package/assets/images/providers/kubernetes.svg +99 -0
  82. package/assets/images/providers/linode.svg +54 -0
  83. package/assets/images/providers/linodelke-black.svg +40 -0
  84. package/assets/images/providers/linodelke.svg +54 -0
  85. package/assets/images/providers/local-cluster.svg +20 -0
  86. package/assets/images/providers/minikube-black.svg +25 -0
  87. package/assets/images/providers/minikube.svg +36 -0
  88. package/assets/images/providers/oci-black.svg +41 -0
  89. package/assets/images/providers/oci.svg +44 -0
  90. package/assets/images/providers/openstack-black.svg +16 -0
  91. package/assets/images/providers/openstack.svg +20 -0
  92. package/assets/images/providers/oracle.svg +66 -0
  93. package/assets/images/providers/oracleoke-black.svg +51 -0
  94. package/assets/images/providers/oracleoke.svg +55 -0
  95. package/assets/images/providers/otc-black.svg +15 -0
  96. package/assets/images/providers/otc.svg +33 -0
  97. package/assets/images/providers/otccce.svg +33 -0
  98. package/assets/images/providers/packet-black.svg +15 -0
  99. package/assets/images/providers/packet.svg +16 -0
  100. package/assets/images/providers/pinganyunecs-black.svg +26 -0
  101. package/assets/images/providers/pinganyunecs.svg +26 -0
  102. package/assets/images/providers/pnap-black.svg +43 -0
  103. package/assets/images/providers/pnap.svg +48 -0
  104. package/assets/images/providers/rackspace-black.svg +14 -0
  105. package/assets/images/providers/rackspace.svg +18 -0
  106. package/assets/images/providers/rke.svg +26 -0
  107. package/assets/images/providers/rke2.svg +26 -0
  108. package/assets/images/providers/softlayer.svg +27 -0
  109. package/assets/images/providers/tencenttke-black.svg +22 -0
  110. package/assets/images/providers/tencenttke.svg +39 -0
  111. package/assets/images/providers/vmwarevsphere-black.svg +60 -0
  112. package/assets/images/providers/vmwarevsphere.svg +51 -0
  113. package/assets/images/vendor/activedirectory.svg +20 -0
  114. package/assets/images/vendor/adfs.svg +19 -0
  115. package/assets/images/vendor/azuread.svg +18 -0
  116. package/assets/images/vendor/custom.svg +42 -0
  117. package/assets/images/vendor/email.svg +22 -0
  118. package/assets/images/vendor/freeipa.svg +26 -0
  119. package/assets/images/vendor/github.svg +13 -0
  120. package/assets/images/vendor/googleoauth.svg +9 -0
  121. package/assets/images/vendor/grafana.svg +48 -0
  122. package/assets/images/vendor/jaeger.svg +1 -0
  123. package/assets/images/vendor/keycloak.svg +30 -0
  124. package/assets/images/vendor/kiali.svg +23 -0
  125. package/assets/images/vendor/linux.svg +23 -0
  126. package/assets/images/vendor/longhorn.svg +25 -0
  127. package/assets/images/vendor/neuvector.svg +1 -0
  128. package/assets/images/vendor/okta.svg +31 -0
  129. package/assets/images/vendor/openldap.svg +34 -0
  130. package/assets/images/vendor/pagerduty.svg +26 -0
  131. package/assets/images/vendor/ping.svg +58 -0
  132. package/assets/images/vendor/prometheus.svg +14 -0
  133. package/assets/images/vendor/shibboleth.svg +481 -0
  134. package/assets/images/vendor/slack.svg +38 -0
  135. package/assets/images/vendor/webhook.svg +23 -0
  136. package/assets/images/vendor/windows.svg +13 -0
  137. package/assets/images/wechat-qr-code.jpg +0 -0
  138. package/assets/styles/app.scss +35 -0
  139. package/assets/styles/base/_basic.scss +112 -0
  140. package/assets/styles/base/_color.scss +11 -0
  141. package/assets/styles/base/_functions.scss +134 -0
  142. package/assets/styles/base/_helpers.scss +263 -0
  143. package/assets/styles/base/_mixins.scss +165 -0
  144. package/assets/styles/base/_typography.scss +69 -0
  145. package/assets/styles/base/_variables.scss +58 -0
  146. package/assets/styles/fonts/_dots.scss +18 -0
  147. package/assets/styles/fonts/_fontstack.scss +49 -0
  148. package/assets/styles/fonts/_icons.scss +101 -0
  149. package/assets/styles/fonts/_zerowidthspace.scss +8 -0
  150. package/assets/styles/global/_button.scss +182 -0
  151. package/assets/styles/global/_cards.scss +94 -0
  152. package/assets/styles/global/_columns.scss +122 -0
  153. package/assets/styles/global/_form.scss +145 -0
  154. package/assets/styles/global/_gauges.scss +55 -0
  155. package/assets/styles/global/_labeled-input.scss +130 -0
  156. package/assets/styles/global/_resource.scss +89 -0
  157. package/assets/styles/global/_select.scss +182 -0
  158. package/assets/styles/global/_table.scss +106 -0
  159. package/assets/styles/global/_tooltip.scss +197 -0
  160. package/assets/styles/themes/_dark.scss +204 -0
  161. package/assets/styles/themes/_light.scss +533 -0
  162. package/assets/styles/themes/_suse.scss +26 -0
  163. package/assets/styles/vendor/_code-mirror.scss +3 -0
  164. package/assets/styles/vendor/normalize.scss +349 -0
  165. package/assets/styles/vendor/vue-js-modal.scss +12 -0
  166. package/assets/styles/vendor/vue-select.scss +386 -0
  167. package/assets/translations/en-us.yaml +6802 -0
  168. package/assets/translations/zh-hans.yaml +7062 -0
  169. package/chart/example.vue +18 -0
  170. package/chart/istio.vue +209 -0
  171. package/chart/logging/index.vue +70 -0
  172. package/chart/monitoring/ClusterSelector.vue +213 -0
  173. package/chart/monitoring/StorageClassSelector.vue +45 -0
  174. package/chart/monitoring/alerting/index.vue +215 -0
  175. package/chart/monitoring/grafana/index.vue +319 -0
  176. package/chart/monitoring/index.vue +276 -0
  177. package/chart/monitoring/prometheus/index.vue +379 -0
  178. package/chart/monitoring/steps/uninstall-v1.vue +131 -0
  179. package/chart/rancher-alerting-drivers.vue +39 -0
  180. package/chart/rancher-backup/S3.vue +97 -0
  181. package/chart/rancher-backup/index.vue +218 -0
  182. package/chart/rancher-gatekeeper.vue +29 -0
  183. package/cloud-credential/aws.vue +98 -0
  184. package/cloud-credential/azure.vue +113 -0
  185. package/cloud-credential/digitalocean.vue +44 -0
  186. package/cloud-credential/gcp.vue +64 -0
  187. package/cloud-credential/generic.vue +84 -0
  188. package/cloud-credential/harvester.vue +149 -0
  189. package/cloud-credential/linode.vue +44 -0
  190. package/cloud-credential/s3.vue +152 -0
  191. package/cloud-credential/vmwarevsphere.vue +99 -0
  192. package/components/ActionDropdown.vue +249 -0
  193. package/components/ActionMenu.vue +312 -0
  194. package/components/AdvancedSection.vue +28 -0
  195. package/components/Alert.vue +51 -0
  196. package/components/AlertTable.vue +111 -0
  197. package/components/AssignTo.vue +162 -0
  198. package/components/AsyncButton.vue +249 -0
  199. package/components/BackLink.vue +27 -0
  200. package/components/BadgeState.vue +99 -0
  201. package/components/Banner.vue +148 -0
  202. package/components/BannerGraphic.vue +103 -0
  203. package/components/BrandImage.vue +85 -0
  204. package/components/ButtonDropdown.vue +305 -0
  205. package/components/ButtonGroup.vue +88 -0
  206. package/components/Card.vue +104 -0
  207. package/components/ChartHeading.vue +21 -0
  208. package/components/ChartReadme.vue +80 -0
  209. package/components/ClusterBadge.vue +34 -0
  210. package/components/ClusterProviderIcon.vue +95 -0
  211. package/components/CodeMirror.vue +126 -0
  212. package/components/Collapse.vue +55 -0
  213. package/components/CollapsibleCard.vue +113 -0
  214. package/components/CommunityLinks.vue +128 -0
  215. package/components/ConsumptionGauge.vue +133 -0
  216. package/components/ContainerResourceLimit.vue +216 -0
  217. package/components/CopyCode.vue +66 -0
  218. package/components/CopyToClipboard.vue +43 -0
  219. package/components/CopyToClipboardText.vue +39 -0
  220. package/components/CountBox.vue +104 -0
  221. package/components/CountGauge.vue +157 -0
  222. package/components/CruResource.vue +565 -0
  223. package/components/CruResourceFooter.vue +108 -0
  224. package/components/DashboardMetrics.vue +106 -0
  225. package/components/DashboardOptions.vue +136 -0
  226. package/components/DetailText.vue +192 -0
  227. package/components/DetailTop.vue +263 -0
  228. package/components/EmberPage.vue +609 -0
  229. package/components/EmberPageView.vue +36 -0
  230. package/components/EtcdInfoBanner.vue +57 -0
  231. package/components/EventsTable.vue +67 -0
  232. package/components/FileDiff.vue +174 -0
  233. package/components/FixedBanner.vue +228 -0
  234. package/components/Flag.vue +77 -0
  235. package/components/Glance.vue +70 -0
  236. package/components/GlobalRoleBindings.vue +376 -0
  237. package/components/GradientBox.vue +79 -0
  238. package/components/GrafanaDashboard.vue +269 -0
  239. package/components/GrowlManager.vue +160 -0
  240. package/components/HardwareResourceGauge.vue +154 -0
  241. package/components/HarvesterServiceAddOnConfig.vue +204 -0
  242. package/components/HarvesterUpgradeProgressBarList.vue +109 -0
  243. package/components/IconMessage.vue +87 -0
  244. package/components/Import.vue +206 -0
  245. package/components/IndentedPanel.vue +24 -0
  246. package/components/InfoBox.vue +78 -0
  247. package/components/InputOrDisplay.vue +67 -0
  248. package/components/KeyValueView.vue +256 -0
  249. package/components/LabelValue.vue +42 -0
  250. package/components/LandingPagePreference.vue +141 -0
  251. package/components/LazyImage.vue +55 -0
  252. package/components/Loading.vue +72 -0
  253. package/components/Markdown.vue +96 -0
  254. package/components/MessageLink.vue +64 -0
  255. package/components/ModalWithCard.vue +124 -0
  256. package/components/MoveModal.vue +135 -0
  257. package/components/NovncConsole.vue +93 -0
  258. package/components/NovncConsoleWrapper.vue +150 -0
  259. package/components/PercentageBar.vue +120 -0
  260. package/components/ProgressBarMulti.vue +156 -0
  261. package/components/PromptChangePassword.vue +106 -0
  262. package/components/PromptModal.vue +98 -0
  263. package/components/PromptRemove.vue +401 -0
  264. package/components/PromptRestore.vue +299 -0
  265. package/components/Questions/Array.vue +34 -0
  266. package/components/Questions/Boolean.vue +26 -0
  267. package/components/Questions/CloudCredential.vue +51 -0
  268. package/components/Questions/Enum.vue +29 -0
  269. package/components/Questions/Float.vue +31 -0
  270. package/components/Questions/Int.vue +31 -0
  271. package/components/Questions/Question.js +73 -0
  272. package/components/Questions/QuestionMap.vue +39 -0
  273. package/components/Questions/Reference.vue +128 -0
  274. package/components/Questions/String.vue +41 -0
  275. package/components/Questions/index.vue +489 -0
  276. package/components/Random.vue +92 -0
  277. package/components/RelatedResources.vue +181 -0
  278. package/components/RelatedWorkloadsTable.vue +44 -0
  279. package/components/ResourceCancelModal.vue +108 -0
  280. package/components/ResourceDetail/Masthead.vue +483 -0
  281. package/components/ResourceDetail/index.vue +386 -0
  282. package/components/ResourceList/Masthead.vue +176 -0
  283. package/components/ResourceList/index.vue +149 -0
  284. package/components/ResourceSummary.vue +163 -0
  285. package/components/ResourceTable.vue +401 -0
  286. package/components/ResourceYaml.vue +412 -0
  287. package/components/RoleBindings.vue +453 -0
  288. package/components/SelectIconGrid.vue +364 -0
  289. package/components/SimpleBox.vue +102 -0
  290. package/components/SingleClusterInfo.vue +171 -0
  291. package/components/SortableTable/THead.vue +221 -0
  292. package/components/SortableTable/actions.js +151 -0
  293. package/components/SortableTable/filtering.js +214 -0
  294. package/components/SortableTable/grouping.js +41 -0
  295. package/components/SortableTable/index.vue +1393 -0
  296. package/components/SortableTable/paging.js +118 -0
  297. package/components/SortableTable/selection.js +601 -0
  298. package/components/SortableTable/sorting.js +102 -0
  299. package/components/StatusTable.vue +55 -0
  300. package/components/Tabbed/Tab.vue +94 -0
  301. package/components/Tabbed/index.vue +419 -0
  302. package/components/TabbedLinks/index.vue +94 -0
  303. package/components/TableSparkLine.vue +105 -0
  304. package/components/Tag.vue +19 -0
  305. package/components/Tip.vue +40 -0
  306. package/components/TypeDescription.vue +55 -0
  307. package/components/VMConsoleBar.vue +87 -0
  308. package/components/Wizard.vue +559 -0
  309. package/components/YamlEditor.vue +266 -0
  310. package/components/__tests__/Banner.test.ts +13 -0
  311. package/components/__tests__/CopyCode.test.ts +21 -0
  312. package/components/__tests__/CruResource.test.ts +73 -0
  313. package/components/auth/AllowedPrincipals.vue +107 -0
  314. package/components/auth/AuthBanner.vue +71 -0
  315. package/components/auth/Principal.vue +169 -0
  316. package/components/auth/RoleDetailEdit.vue +724 -0
  317. package/components/auth/SelectPrincipal.vue +203 -0
  318. package/components/auth/login/github.vue +19 -0
  319. package/components/auth/login/ldap.vue +86 -0
  320. package/components/auth/login/oauth.vue +21 -0
  321. package/components/auth/login/oidc.vue +21 -0
  322. package/components/auth/login/saml.vue +23 -0
  323. package/components/dialog/AddClusterMemberDialog.vue +72 -0
  324. package/components/dialog/AddCustomBadgeDialog.vue +272 -0
  325. package/components/dialog/AddProjectMemberDialog.vue +109 -0
  326. package/components/dialog/AddonConfigConfirmationDialog.vue +76 -0
  327. package/components/dialog/DrainNode.vue +218 -0
  328. package/components/dialog/ForceMachineRemoveDialog.vue +106 -0
  329. package/components/dialog/GenericPrompt.vue +103 -0
  330. package/components/dialog/RollbackWorkloadDialog.vue +306 -0
  331. package/components/dialog/RotateCertificatesDialog.vue +196 -0
  332. package/components/dialog/RotateEncryptionKeyDialog.vue +158 -0
  333. package/components/dialog/SaveAsRKETemplateDialog.vue +122 -0
  334. package/components/dialog/ScaleMachineDownDialog.vue +127 -0
  335. package/components/dialog/harvester/AddHotplugModal.vue +159 -0
  336. package/components/dialog/harvester/BackupModal.vue +117 -0
  337. package/components/dialog/harvester/CloneTemplate.vue +125 -0
  338. package/components/dialog/harvester/EjectCDROMDialog.vue +157 -0
  339. package/components/dialog/harvester/ExportImageDialog.vue +152 -0
  340. package/components/dialog/harvester/MaintenanceDialog.vue +94 -0
  341. package/components/dialog/harvester/MigrationDialog.vue +154 -0
  342. package/components/dialog/harvester/RestoreDialog.vue +153 -0
  343. package/components/dialog/harvester/SupportBundle.vue +217 -0
  344. package/components/dialog/harvester/UnplugVolume.vue +108 -0
  345. package/components/fleet/FleetBundleResources.vue +86 -0
  346. package/components/fleet/FleetBundles.vue +127 -0
  347. package/components/fleet/FleetClusters.vue +103 -0
  348. package/components/fleet/FleetIntro.vue +60 -0
  349. package/components/fleet/FleetRepos.vue +150 -0
  350. package/components/fleet/FleetResources.vue +139 -0
  351. package/components/fleet/FleetStatus.vue +289 -0
  352. package/components/fleet/FleetSummary.vue +190 -0
  353. package/components/fleet/ResourcesSummary.vue +89 -0
  354. package/components/form/ArrayList.vue +354 -0
  355. package/components/form/ArrayListGrouped.vue +113 -0
  356. package/components/form/ArrayListSelect.vue +77 -0
  357. package/components/form/BannerSettings.vue +211 -0
  358. package/components/form/ChangePassword.vue +414 -0
  359. package/components/form/Checkbox.vue +292 -0
  360. package/components/form/ColorInput.vue +139 -0
  361. package/components/form/Command.vue +186 -0
  362. package/components/form/Conditions.vue +93 -0
  363. package/components/form/Container.vue +143 -0
  364. package/components/form/EnvVars.vue +146 -0
  365. package/components/form/FileImageSelector.vue +129 -0
  366. package/components/form/FileSelector.vue +151 -0
  367. package/components/form/Footer.vue +107 -0
  368. package/components/form/GithubPicker.vue +383 -0
  369. package/components/form/HealthCheck.vue +84 -0
  370. package/components/form/HookOption.vue +244 -0
  371. package/components/form/InputWithSelect.vue +310 -0
  372. package/components/form/KeyValue.vue +668 -0
  373. package/components/form/LabeledInput.vue +245 -0
  374. package/components/form/LabeledSelect.vue +476 -0
  375. package/components/form/LabeledTooltip.vue +116 -0
  376. package/components/form/Labels.vue +77 -0
  377. package/components/form/LifecycleHooks.vue +79 -0
  378. package/components/form/MatchExpressions.vue +278 -0
  379. package/components/form/Members/ClusterMembershipEditor.vue +63 -0
  380. package/components/form/Members/ClusterPermissionsEditor.vue +269 -0
  381. package/components/form/Members/MembershipEditor.vue +198 -0
  382. package/components/form/Members/ProjectMembershipEditor.vue +64 -0
  383. package/components/form/NameNsDescription.vue +391 -0
  384. package/components/form/Networking.vue +271 -0
  385. package/components/form/NodeAffinity.vue +158 -0
  386. package/components/form/NodeScheduling.vue +163 -0
  387. package/components/form/NotificationSettings.vue +71 -0
  388. package/components/form/Password.vue +137 -0
  389. package/components/form/PlusMinus.vue +80 -0
  390. package/components/form/PodAffinity.vue +288 -0
  391. package/components/form/PodSecurity.vue +152 -0
  392. package/components/form/Ports.vue +282 -0
  393. package/components/form/Probe.vue +313 -0
  394. package/components/form/ProjectMemberEditor.vue +290 -0
  395. package/components/form/RadioButton.vue +229 -0
  396. package/components/form/RadioGroup.vue +187 -0
  397. package/components/form/ResourceQuota/Namespace.vue +117 -0
  398. package/components/form/ResourceQuota/NamespaceRow.vue +171 -0
  399. package/components/form/ResourceQuota/Project.vue +90 -0
  400. package/components/form/ResourceQuota/ProjectRow.vue +78 -0
  401. package/components/form/ResourceQuota/shared.js +147 -0
  402. package/components/form/ResourceTabs/index.vue +174 -0
  403. package/components/form/RuleSelector.vue +170 -0
  404. package/components/form/Scheduling.vue +115 -0
  405. package/components/form/SecretSelector.vue +187 -0
  406. package/components/form/Security.vue +201 -0
  407. package/components/form/Select.vue +251 -0
  408. package/components/form/SelectOrCreateAuthSecret.vue +475 -0
  409. package/components/form/SerialConsole/index.vue +267 -0
  410. package/components/form/ServiceNameSelect.vue +158 -0
  411. package/components/form/ServicePorts.vue +281 -0
  412. package/components/form/ShellInput.vue +89 -0
  413. package/components/form/SimpleSecretSelector.vue +196 -0
  414. package/components/form/Taints.vue +83 -0
  415. package/components/form/TextAreaAutoGrow.vue +127 -0
  416. package/components/form/ToggleSwitch.vue +127 -0
  417. package/components/form/Tolerations.vue +220 -0
  418. package/components/form/UnitInput.vue +237 -0
  419. package/components/form/ValueFromResource.vue +373 -0
  420. package/components/form/WorkloadPorts.vue +476 -0
  421. package/components/form/__tests__/ArrayListGrouped.test.ts +39 -0
  422. package/components/form/__tests__/KeyValue.test.ts +18 -0
  423. package/components/form/__tests__/LabeledInput.test.ts +20 -0
  424. package/components/form/__tests__/UnitInput.test.ts +183 -0
  425. package/components/formatter/AppSummaryGraph.vue +136 -0
  426. package/components/formatter/AttachVMWithName.vue +46 -0
  427. package/components/formatter/BadgeStateFormatter.vue +60 -0
  428. package/components/formatter/Capitalize.vue +21 -0
  429. package/components/formatter/Checked.vue +20 -0
  430. package/components/formatter/CloudInitType.vue +27 -0
  431. package/components/formatter/ClusterLink.vue +92 -0
  432. package/components/formatter/CopyToClipboard.vue +18 -0
  433. package/components/formatter/Date.vue +74 -0
  434. package/components/formatter/Endpoints.vue +99 -0
  435. package/components/formatter/ExternalLink.vue +7 -0
  436. package/components/formatter/FleetSummaryGraph.vue +95 -0
  437. package/components/formatter/HarvesterBackupTargetValidation.vue +43 -0
  438. package/components/formatter/HarvesterCPUUsed.vue +122 -0
  439. package/components/formatter/HarvesterDiskState.vue +66 -0
  440. package/components/formatter/HarvesterHostName.vue +66 -0
  441. package/components/formatter/HarvesterIpAddress.vue +71 -0
  442. package/components/formatter/HarvesterMemoryUsed.vue +140 -0
  443. package/components/formatter/HarvesterMigrationState.vue +85 -0
  444. package/components/formatter/HarvesterNodeName.vue +49 -0
  445. package/components/formatter/HarvesterStorageUsed.vue +194 -0
  446. package/components/formatter/HarvesterVmState.vue +123 -0
  447. package/components/formatter/IconIsDefault.vue +34 -0
  448. package/components/formatter/IconText.vue +46 -0
  449. package/components/formatter/ImagePercentageBar.vue +86 -0
  450. package/components/formatter/IngressFullPath.vue +17 -0
  451. package/components/formatter/IngressTarget.vue +68 -0
  452. package/components/formatter/InternalExternalIP.vue +45 -0
  453. package/components/formatter/KeyValue.vue +74 -0
  454. package/components/formatter/Link.vue +149 -0
  455. package/components/formatter/LinkDetail.vue +46 -0
  456. package/components/formatter/LinkDetailImage.vue +31 -0
  457. package/components/formatter/LinkName.vue +50 -0
  458. package/components/formatter/List.vue +22 -0
  459. package/components/formatter/ListLink.vue +29 -0
  460. package/components/formatter/ListLinkDetail.vue +25 -0
  461. package/components/formatter/LiveDate.vue +139 -0
  462. package/components/formatter/LiveExpiryBadgeState.vue +66 -0
  463. package/components/formatter/LiveExpiryDate.vue +69 -0
  464. package/components/formatter/MachineSummaryGraph.vue +43 -0
  465. package/components/formatter/Number.vue +31 -0
  466. package/components/formatter/Percentage.vue +25 -0
  467. package/components/formatter/PercentageBar.vue +41 -0
  468. package/components/formatter/PodImages.vue +56 -0
  469. package/components/formatter/PodsUsage.vue +49 -0
  470. package/components/formatter/Port.vue +24 -0
  471. package/components/formatter/Principal.vue +19 -0
  472. package/components/formatter/PrincipalGroupBindings.vue +53 -0
  473. package/components/formatter/QualityText.vue +21 -0
  474. package/components/formatter/ReceiverIcons.vue +124 -0
  475. package/components/formatter/RunBookLink.vue +15 -0
  476. package/components/formatter/Scale.vue +108 -0
  477. package/components/formatter/ScanResult.vue +30 -0
  478. package/components/formatter/SecretData.vue +52 -0
  479. package/components/formatter/SecretType.vue +38 -0
  480. package/components/formatter/ServiceTargets.vue +109 -0
  481. package/components/formatter/ServiceType.vue +44 -0
  482. package/components/formatter/Shortened.vue +49 -0
  483. package/components/formatter/Si.vue +42 -0
  484. package/components/formatter/Translate.vue +32 -0
  485. package/components/formatter/VerticalScroll.vue +17 -0
  486. package/components/formatter/VirtualServiceGateways.vue +105 -0
  487. package/components/formatter/Weight.vue +132 -0
  488. package/components/formatter/WorkloadDetailEndpoints.vue +110 -0
  489. package/components/formatter/WorkloadHealthScale.vue +279 -0
  490. package/components/formatter/__tests__/PodsUsage.test.ts +38 -0
  491. package/components/graph/AspectPreserver.vue +68 -0
  492. package/components/graph/Bar.vue +70 -0
  493. package/components/graph/Circle.vue +135 -0
  494. package/components/graph/HalfCircle.vue +41 -0
  495. package/components/graph/LinePlot.vue +193 -0
  496. package/components/graph/ProgressArc.vue +88 -0
  497. package/components/nav/Favorite.vue +56 -0
  498. package/components/nav/GlobalLoading.vue +22 -0
  499. package/components/nav/Group.vue +371 -0
  500. package/components/nav/HarvesterUpgrade.vue +222 -0
  501. package/components/nav/Header.vue +875 -0
  502. package/components/nav/Jump.vue +106 -0
  503. package/components/nav/NamespaceFilter.vue +841 -0
  504. package/components/nav/TopLevelMenu.vue +710 -0
  505. package/components/nav/Type.vue +192 -0
  506. package/components/nav/WindowManager/ChartReadme.vue +45 -0
  507. package/components/nav/WindowManager/ContainerLogs.vue +670 -0
  508. package/components/nav/WindowManager/ContainerShell.vue +415 -0
  509. package/components/nav/WindowManager/KubectlShell.vue +42 -0
  510. package/components/nav/WindowManager/MachineSsh.vue +21 -0
  511. package/components/nav/WindowManager/Window.vue +97 -0
  512. package/components/nav/WindowManager/index.vue +310 -0
  513. package/components/nav/WorkspaceSwitcher.vue +147 -0
  514. package/config/cookies.js +4 -0
  515. package/config/features.js +3 -0
  516. package/config/footer.js +19 -0
  517. package/config/harvester-map.js +44 -0
  518. package/config/harvester-table-headers.js +27 -0
  519. package/config/labels-annotations.js +180 -0
  520. package/config/local-storage.js +6 -0
  521. package/config/nuxt-paths.js +7 -0
  522. package/config/page-actions.js +3 -0
  523. package/config/private-label.js +70 -0
  524. package/config/product/apps.js +115 -0
  525. package/config/product/auth.js +215 -0
  526. package/config/product/backup.js +61 -0
  527. package/config/product/cis.js +157 -0
  528. package/config/product/explorer.js +306 -0
  529. package/config/product/fleet.js +90 -0
  530. package/config/product/gatekeeper.js +119 -0
  531. package/config/product/harvester-manager.js +100 -0
  532. package/config/product/harvester.js +305 -0
  533. package/config/product/istio.js +79 -0
  534. package/config/product/legacy.js +201 -0
  535. package/config/product/logging.js +377 -0
  536. package/config/product/longhorn.js +49 -0
  537. package/config/product/manager.js +176 -0
  538. package/config/product/monitoring.js +286 -0
  539. package/config/product/multi-cluster-apps.js +73 -0
  540. package/config/product/navlinks.js +32 -0
  541. package/config/product/neuvector.js +30 -0
  542. package/config/product/settings.js +130 -0
  543. package/config/query-params.js +72 -0
  544. package/config/roles.ts +365 -0
  545. package/config/schema.js +32 -0
  546. package/config/secret.js +15 -0
  547. package/config/settings.js +194 -0
  548. package/config/system-namespaces.js +15 -0
  549. package/config/table-headers.js +908 -0
  550. package/config/types.js +292 -0
  551. package/content/docs/en-us/getting-started.md +249 -0
  552. package/content/docs/en-us/whats-new.md +108 -0
  553. package/content/docs/zh-hans/getting-started.md +248 -0
  554. package/content/docs/zh-hans/whats-new.md +56 -0
  555. package/core/plugin-routes.ts +138 -0
  556. package/core/plugin.ts +181 -0
  557. package/core/plugins-loader.js +31 -0
  558. package/core/plugins.js +293 -0
  559. package/core/types.ts +114 -0
  560. package/creators/app/.eslintignore +18 -0
  561. package/creators/app/.eslintrc.js +173 -0
  562. package/creators/app/.vscode/settings.json +23 -0
  563. package/creators/app/app.package.json +9 -0
  564. package/creators/app/babel.config.js +18 -0
  565. package/creators/app/init +95 -0
  566. package/creators/app/nuxt.config.js +6 -0
  567. package/creators/app/package.json +19 -0
  568. package/creators/app/tsconfig.json +37 -0
  569. package/creators/pkg/babel.config.js +1 -0
  570. package/creators/pkg/index.ts +14 -0
  571. package/creators/pkg/init +154 -0
  572. package/creators/pkg/nuxt.config.js +6 -0
  573. package/creators/pkg/package.json +19 -0
  574. package/creators/pkg/pkg.package.json +21 -0
  575. package/creators/pkg/tsconfig.json +49 -0
  576. package/creators/pkg/vue-shim.ts +4 -0
  577. package/creators/pkg/vue.config.js +1 -0
  578. package/detail/autoscaling.horizontalpodautoscaler/index.vue +193 -0
  579. package/detail/catalog.cattle.io.app.vue +135 -0
  580. package/detail/catalog.cattle.io.clusterrepo.vue +25 -0
  581. package/detail/cis.cattle.io.clusterscan.vue +339 -0
  582. package/detail/configmap.vue +62 -0
  583. package/detail/constraints.gatekeeper.sh.constraint.vue +46 -0
  584. package/detail/fleet.cattle.io.bundle.vue +67 -0
  585. package/detail/fleet.cattle.io.cluster.vue +76 -0
  586. package/detail/fleet.cattle.io.clustergroup.vue +60 -0
  587. package/detail/fleet.cattle.io.gitrepo.vue +115 -0
  588. package/detail/harvesterhci.io.host/HarvesterHostBasic.vue +343 -0
  589. package/detail/harvesterhci.io.host/HarvesterHostDisk.vue +200 -0
  590. package/detail/harvesterhci.io.host/HarvesterHostNetwork.vue +89 -0
  591. package/detail/harvesterhci.io.host/VirtualMachineInstance.vue +134 -0
  592. package/detail/harvesterhci.io.host/index.vue +243 -0
  593. package/detail/harvesterhci.io.management.cluster.vue +97 -0
  594. package/detail/harvesterhci.io.virtualmachinebackup/index.vue +221 -0
  595. package/detail/harvesterhci.io.virtualmachineimage.vue +118 -0
  596. package/detail/helm.cattle.io.projecthelmchart.vue +229 -0
  597. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue +279 -0
  598. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineEvents.vue +75 -0
  599. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineKeypairs.vue +114 -0
  600. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineMigration.vue +79 -0
  601. package/detail/kubevirt.io.virtualmachine/index.vue +213 -0
  602. package/detail/management.cattle.io.fleetworkspace.vue +85 -0
  603. package/detail/management.cattle.io.globalrole.vue +8 -0
  604. package/detail/management.cattle.io.roletemplate.vue +8 -0
  605. package/detail/management.cattle.io.user.vue +288 -0
  606. package/detail/namespace.vue +270 -0
  607. package/detail/networking.k8s.io.ingress.vue +57 -0
  608. package/detail/node.vue +285 -0
  609. package/detail/pod.vue +235 -0
  610. package/detail/provisioning.cattle.io.cluster.vue +719 -0
  611. package/detail/rbac.authorization.k8s.io.clusterrole.vue +8 -0
  612. package/detail/rbac.authorization.k8s.io.role.vue +8 -0
  613. package/detail/secret.vue +226 -0
  614. package/detail/service.vue +199 -0
  615. package/detail/workload/index.vue +323 -0
  616. package/edit/auth/azuread.vue +278 -0
  617. package/edit/auth/github.vue +231 -0
  618. package/edit/auth/googleoauth.vue +200 -0
  619. package/edit/auth/ldap/config.vue +238 -0
  620. package/edit/auth/ldap/index.vue +136 -0
  621. package/edit/auth/oidc.vue +259 -0
  622. package/edit/auth/saml.vue +222 -0
  623. package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +51 -0
  624. package/edit/autoscaling.horizontalpodautoscaler/index.vue +243 -0
  625. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +79 -0
  626. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +60 -0
  627. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +216 -0
  628. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +187 -0
  629. package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +61 -0
  630. package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +51 -0
  631. package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +60 -0
  632. package/edit/catalog.cattle.io.clusterrepo.vue +109 -0
  633. package/edit/cis.cattle.io.clusterscan.vue +301 -0
  634. package/edit/cis.cattle.io.clusterscanbenchmark.vue +107 -0
  635. package/edit/cis.cattle.io.clusterscanprofile.vue +142 -0
  636. package/edit/cloudcredential.vue +279 -0
  637. package/edit/configmap.vue +125 -0
  638. package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +70 -0
  639. package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +76 -0
  640. package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +50 -0
  641. package/edit/constraints.gatekeeper.sh.constraint/index.vue +331 -0
  642. package/edit/fleet.cattle.io.cluster.vue +93 -0
  643. package/edit/fleet.cattle.io.clustergroup.vue +161 -0
  644. package/edit/fleet.cattle.io.gitrepo.vue +515 -0
  645. package/edit/group.principal.vue +60 -0
  646. package/edit/harvesterhci.io.cloudtemplate.vue +123 -0
  647. package/edit/harvesterhci.io.host/HarvesterDisk.vue +263 -0
  648. package/edit/harvesterhci.io.host/index.vue +524 -0
  649. package/edit/harvesterhci.io.keypair.vue +112 -0
  650. package/edit/harvesterhci.io.managedchart/index.vue +25 -0
  651. package/edit/harvesterhci.io.managedchart/rancher-monitoring.vue +172 -0
  652. package/edit/harvesterhci.io.management.cluster.vue +136 -0
  653. package/edit/harvesterhci.io.networkattachmentdefinition.vue +210 -0
  654. package/edit/harvesterhci.io.setting/additional-ca.vue +36 -0
  655. package/edit/harvesterhci.io.setting/backup-target.vue +182 -0
  656. package/edit/harvesterhci.io.setting/http-proxy.vue +79 -0
  657. package/edit/harvesterhci.io.setting/index.vue +201 -0
  658. package/edit/harvesterhci.io.setting/overcommit-config.vue +91 -0
  659. package/edit/harvesterhci.io.setting/ssl-certificates.vue +117 -0
  660. package/edit/harvesterhci.io.setting/ssl-parameters.vue +161 -0
  661. package/edit/harvesterhci.io.setting/support-bundle-image.vue +134 -0
  662. package/edit/harvesterhci.io.setting/support-bundle-namespaces.vue +73 -0
  663. package/edit/harvesterhci.io.setting/vip-pools.vue +244 -0
  664. package/edit/harvesterhci.io.setting/vm-force-reset-policy.vue +81 -0
  665. package/edit/harvesterhci.io.virtualmachinebackup.vue +256 -0
  666. package/edit/harvesterhci.io.virtualmachineimage.vue +364 -0
  667. package/edit/harvesterhci.io.virtualmachinetemplateversion.vue +332 -0
  668. package/edit/harvesterhci.io.volume.vue +195 -0
  669. package/edit/helm.cattle.io.projecthelmchart.vue +147 -0
  670. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +210 -0
  671. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue +190 -0
  672. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue +212 -0
  673. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/basicAuth.vue +94 -0
  674. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/sshkey.vue +85 -0
  675. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue +152 -0
  676. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue +278 -0
  677. package/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue +111 -0
  678. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue +238 -0
  679. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/index.vue +142 -0
  680. package/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue +256 -0
  681. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue +392 -0
  682. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue +86 -0
  683. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue +247 -0
  684. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue +225 -0
  685. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue +162 -0
  686. package/edit/kubevirt.io.virtualmachine/index.vue +633 -0
  687. package/edit/logging-flow/Match.vue +96 -0
  688. package/edit/logging-flow/index.vue +419 -0
  689. package/edit/logging.banzaicloud.io.clusterflow.vue +7 -0
  690. package/edit/logging.banzaicloud.io.clusteroutput.vue +12 -0
  691. package/edit/logging.banzaicloud.io.flow.vue +7 -0
  692. package/edit/logging.banzaicloud.io.output/index.vue +317 -0
  693. package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +72 -0
  694. package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +79 -0
  695. package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +92 -0
  696. package/edit/logging.banzaicloud.io.output/providers/datadog.vue +80 -0
  697. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +206 -0
  698. package/edit/logging.banzaicloud.io.output/providers/file.vue +42 -0
  699. package/edit/logging.banzaicloud.io.output/providers/forward.vue +147 -0
  700. package/edit/logging.banzaicloud.io.output/providers/gcs.vue +82 -0
  701. package/edit/logging.banzaicloud.io.output/providers/gelf.vue +129 -0
  702. package/edit/logging.banzaicloud.io.output/providers/kafka.vue +146 -0
  703. package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +71 -0
  704. package/edit/logging.banzaicloud.io.output/providers/logdna.vue +56 -0
  705. package/edit/logging.banzaicloud.io.output/providers/logz.vue +102 -0
  706. package/edit/logging.banzaicloud.io.output/providers/loki.vue +144 -0
  707. package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +71 -0
  708. package/edit/logging.banzaicloud.io.output/providers/s3.vue +102 -0
  709. package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +154 -0
  710. package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +59 -0
  711. package/edit/logging.banzaicloud.io.output/providers/syslog.vue +189 -0
  712. package/edit/logging.banzaicloud.io.output/providers/utils.js +27 -0
  713. package/edit/management.cattle.io.clusterroletemplatebinding.vue +68 -0
  714. package/edit/management.cattle.io.fleetworkspace.vue +92 -0
  715. package/edit/management.cattle.io.globalrole.vue +8 -0
  716. package/edit/management.cattle.io.project.vue +271 -0
  717. package/edit/management.cattle.io.projectroletemplatebinding.vue +95 -0
  718. package/edit/management.cattle.io.roletemplate.vue +8 -0
  719. package/edit/management.cattle.io.setting.vue +157 -0
  720. package/edit/management.cattle.io.user.vue +251 -0
  721. package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +310 -0
  722. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +261 -0
  723. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +367 -0
  724. package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +144 -0
  725. package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +263 -0
  726. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +126 -0
  727. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +252 -0
  728. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +171 -0
  729. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +133 -0
  730. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +183 -0
  731. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +497 -0
  732. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +192 -0
  733. package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +106 -0
  734. package/edit/monitoring.coreos.com.prometheusrule/duration.js +41 -0
  735. package/edit/monitoring.coreos.com.prometheusrule/index.vue +192 -0
  736. package/edit/monitoring.coreos.com.receiver/auth.vue +113 -0
  737. package/edit/monitoring.coreos.com.receiver/index.vue +282 -0
  738. package/edit/monitoring.coreos.com.receiver/tls.vue +55 -0
  739. package/edit/monitoring.coreos.com.receiver/types/email.vue +78 -0
  740. package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +211 -0
  741. package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +79 -0
  742. package/edit/monitoring.coreos.com.receiver/types/slack.vue +89 -0
  743. package/edit/monitoring.coreos.com.receiver/types/webhook.add.vue +65 -0
  744. package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +24 -0
  745. package/edit/monitoring.coreos.com.receiver/types/webhook.vue +68 -0
  746. package/edit/monitoring.coreos.com.route.vue +179 -0
  747. package/edit/namespace.vue +213 -0
  748. package/edit/network.harvesterhci.io.clusternetwork/index.vue +19 -0
  749. package/edit/network.harvesterhci.io.clusternetwork/vlan.vue +134 -0
  750. package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +185 -0
  751. package/edit/networking.istio.io.destinationrule/index.vue +233 -0
  752. package/edit/networking.k8s.io.ingress/Certificate.vue +119 -0
  753. package/edit/networking.k8s.io.ingress/Certificates.vue +101 -0
  754. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +117 -0
  755. package/edit/networking.k8s.io.ingress/Rule.vue +133 -0
  756. package/edit/networking.k8s.io.ingress/RulePath.vue +178 -0
  757. package/edit/networking.k8s.io.ingress/Rules.vue +133 -0
  758. package/edit/networking.k8s.io.ingress/index.vue +150 -0
  759. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +91 -0
  760. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +50 -0
  761. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +287 -0
  762. package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +93 -0
  763. package/edit/networking.k8s.io.networkpolicy/index.vue +267 -0
  764. package/edit/node.vue +69 -0
  765. package/edit/persistentvolume/index.vue +298 -0
  766. package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +74 -0
  767. package/edit/persistentvolume/plugins/azureDisk.vue +119 -0
  768. package/edit/persistentvolume/plugins/azureFile.vue +63 -0
  769. package/edit/persistentvolume/plugins/cephfs.vue +80 -0
  770. package/edit/persistentvolume/plugins/cinder.vue +69 -0
  771. package/edit/persistentvolume/plugins/csi.vue +107 -0
  772. package/edit/persistentvolume/plugins/fc.vue +82 -0
  773. package/edit/persistentvolume/plugins/flexVolume.vue +77 -0
  774. package/edit/persistentvolume/plugins/flocker.vue +35 -0
  775. package/edit/persistentvolume/plugins/gcePersistentDisk.vue +74 -0
  776. package/edit/persistentvolume/plugins/glusterfs.vue +60 -0
  777. package/edit/persistentvolume/plugins/hostPath.vue +72 -0
  778. package/edit/persistentvolume/plugins/iscsi.vue +125 -0
  779. package/edit/persistentvolume/plugins/local.vue +32 -0
  780. package/edit/persistentvolume/plugins/longhorn.vue +88 -0
  781. package/edit/persistentvolume/plugins/nfs.vue +60 -0
  782. package/edit/persistentvolume/plugins/photonPersistentDisk.vue +48 -0
  783. package/edit/persistentvolume/plugins/portworxVolume.vue +61 -0
  784. package/edit/persistentvolume/plugins/quobyte.vue +68 -0
  785. package/edit/persistentvolume/plugins/rbd.vue +88 -0
  786. package/edit/persistentvolume/plugins/scaleIO.vue +101 -0
  787. package/edit/persistentvolume/plugins/storageos.vue +73 -0
  788. package/edit/persistentvolume/plugins/vsphereVolume.vue +43 -0
  789. package/edit/persistentvolumeclaim.vue +271 -0
  790. package/edit/provisioning.cattle.io.cluster/ACE.vue +82 -0
  791. package/edit/provisioning.cattle.io.cluster/AgentEnv.vue +37 -0
  792. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +242 -0
  793. package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +129 -0
  794. package/edit/provisioning.cattle.io.cluster/Labels.vue +30 -0
  795. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +239 -0
  796. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +154 -0
  797. package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +75 -0
  798. package/edit/provisioning.cattle.io.cluster/S3Config.vue +121 -0
  799. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +288 -0
  800. package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +42 -0
  801. package/edit/provisioning.cattle.io.cluster/import.vue +174 -0
  802. package/edit/provisioning.cattle.io.cluster/index.vue +505 -0
  803. package/edit/provisioning.cattle.io.cluster/rke2.vue +2095 -0
  804. package/edit/rbac.authorization.k8s.io.clusterrole.vue +8 -0
  805. package/edit/rbac.authorization.k8s.io.role.vue +8 -0
  806. package/edit/resources.cattle.io.backup.vue +252 -0
  807. package/edit/resources.cattle.io.restore.vue +264 -0
  808. package/edit/secret/basic.vue +54 -0
  809. package/edit/secret/generic.vue +63 -0
  810. package/edit/secret/index.vue +307 -0
  811. package/edit/secret/registry.vue +127 -0
  812. package/edit/secret/ssh.vue +74 -0
  813. package/edit/secret/tls.vue +86 -0
  814. package/edit/service.vue +487 -0
  815. package/edit/serviceaccount.vue +148 -0
  816. package/edit/storage.k8s.io.storageclass/index.vue +212 -0
  817. package/edit/storage.k8s.io.storageclass/provisioners/custom.vue +20 -0
  818. package/edit/storage.k8s.io.storageclass/provisioners/driver.longhorn.io.vue +35 -0
  819. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +159 -0
  820. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +65 -0
  821. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +32 -0
  822. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +58 -0
  823. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +105 -0
  824. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +54 -0
  825. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/no-provisioner.vue +21 -0
  826. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/portworx-volume.vue +48 -0
  827. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +51 -0
  828. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +62 -0
  829. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +76 -0
  830. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +40 -0
  831. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +67 -0
  832. package/edit/token.vue +275 -0
  833. package/edit/ui.cattle.io.navlink.vue +430 -0
  834. package/edit/workload/Job.vue +235 -0
  835. package/edit/workload/Upgrading.vue +294 -0
  836. package/edit/workload/VolumeClaimTemplate.vue +136 -0
  837. package/edit/workload/index.vue +1106 -0
  838. package/edit/workload/storage/Mount.vue +153 -0
  839. package/edit/workload/storage/__tests__/Mount.test.ts +98 -0
  840. package/edit/workload/storage/__tests__/Storage.test.ts +21 -0
  841. package/edit/workload/storage/awsElasticBlockStore.vue +54 -0
  842. package/edit/workload/storage/azureDisk.vue +80 -0
  843. package/edit/workload/storage/azureFile.vue +52 -0
  844. package/edit/workload/storage/csi/driver.longhorn.io.vue +41 -0
  845. package/edit/workload/storage/csi/index.vue +65 -0
  846. package/edit/workload/storage/ephemeralVolume/index.vue +76 -0
  847. package/edit/workload/storage/gcePersistentDisk.vue +47 -0
  848. package/edit/workload/storage/hostPath.vue +100 -0
  849. package/edit/workload/storage/index.vue +360 -0
  850. package/edit/workload/storage/nfs.vue +78 -0
  851. package/edit/workload/storage/persistentVolumeClaim/index.vue +144 -0
  852. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +224 -0
  853. package/edit/workload/storage/secret.vue +181 -0
  854. package/edit/workload/storage/vsphereVolume.vue +55 -0
  855. package/layouts/blank.vue +17 -0
  856. package/layouts/default.vue +827 -0
  857. package/layouts/error.vue +119 -0
  858. package/layouts/home.vue +84 -0
  859. package/layouts/plain.vue +89 -0
  860. package/layouts/unauthenticated.vue +26 -0
  861. package/list/catalog.cattle.io.app.vue +50 -0
  862. package/list/catalog.cattle.io.clusterrepo.vue +90 -0
  863. package/list/cis.cattle.io.clusterscan.vue +64 -0
  864. package/list/fleet.cattle.io.bundle.vue +108 -0
  865. package/list/fleet.cattle.io.cluster.vue +79 -0
  866. package/list/fleet.cattle.io.clustergroup.vue +71 -0
  867. package/list/fleet.cattle.io.clusterregistrationtoken.vue +81 -0
  868. package/list/fleet.cattle.io.gitrepo.vue +57 -0
  869. package/list/group.principal.vue +143 -0
  870. package/list/harvesterhci.io.cloudtemplate.vue +78 -0
  871. package/list/harvesterhci.io.dashboard/HarvesterUpgrade.vue +210 -0
  872. package/list/harvesterhci.io.dashboard/index.vue +774 -0
  873. package/list/harvesterhci.io.host/index.vue +174 -0
  874. package/list/harvesterhci.io.management.cluster.vue +181 -0
  875. package/list/harvesterhci.io.networkattachmentdefinition.vue +167 -0
  876. package/list/harvesterhci.io.setting.vue +241 -0
  877. package/list/harvesterhci.io.virtualmachinebackup.vue +172 -0
  878. package/list/harvesterhci.io.virtualmachineimage.vue +47 -0
  879. package/list/harvesterhci.io.virtualmachinetemplateversion.vue +177 -0
  880. package/list/harvesterhci.io.volume.vue +122 -0
  881. package/list/helm.cattle.io.projecthelmchart.vue +124 -0
  882. package/list/kubevirt.io.virtualmachine.vue +191 -0
  883. package/list/logging.banzaicloud.io.clusterflow.vue +36 -0
  884. package/list/logging.banzaicloud.io.flow.vue +41 -0
  885. package/list/management.cattle.io.cluster.vue +31 -0
  886. package/list/management.cattle.io.feature.vue +306 -0
  887. package/list/management.cattle.io.setting.vue +166 -0
  888. package/list/management.cattle.io.user.vue +121 -0
  889. package/list/monitoring.coreos.com.alertmanagerconfig.vue +89 -0
  890. package/list/namespace.vue +44 -0
  891. package/list/node.vue +191 -0
  892. package/list/persistentvolume.vue +27 -0
  893. package/list/provisioning.cattle.io.cluster.vue +162 -0
  894. package/list/service.vue +43 -0
  895. package/list/ui.cattle.io.navlink.vue +49 -0
  896. package/list/workload.vue +130 -0
  897. package/machine-config/amazonec2.vue +664 -0
  898. package/machine-config/azure.vue +445 -0
  899. package/machine-config/digitalocean.vue +228 -0
  900. package/machine-config/generic.vue +101 -0
  901. package/machine-config/harvester.vue +528 -0
  902. package/machine-config/linode.vue +186 -0
  903. package/machine-config/vmwarevsphere.vue +1018 -0
  904. package/middleware/authenticated.js +387 -0
  905. package/middleware/i18n.js +10 -0
  906. package/mixins/auth-config.js +304 -0
  907. package/mixins/back-link.js +15 -0
  908. package/mixins/brand.js +122 -0
  909. package/mixins/chart.js +384 -0
  910. package/mixins/child-hook.js +82 -0
  911. package/mixins/closeable.js +47 -0
  912. package/mixins/compact-input.js +24 -0
  913. package/mixins/create-edit-view/impl.js +200 -0
  914. package/mixins/create-edit-view/index.js +46 -0
  915. package/mixins/harvester-vm/impl.js +267 -0
  916. package/mixins/harvester-vm/index.js +1313 -0
  917. package/mixins/labeled-form-element.js +137 -0
  918. package/mixins/login.js +31 -0
  919. package/mixins/metric-poller.js +19 -0
  920. package/mixins/page-actions.js +34 -0
  921. package/mixins/v1-workload-metrics.js +43 -0
  922. package/mixins/vue-select-overrides.js +98 -0
  923. package/models/app.js +25 -0
  924. package/models/apps.daemonset.js +4 -0
  925. package/models/apps.deployment.js +13 -0
  926. package/models/apps.replicaset.js +4 -0
  927. package/models/apps.statefulset.js +4 -0
  928. package/models/autoscaling.horizontalpodautoscaler.js +44 -0
  929. package/models/batch.cronjob.js +71 -0
  930. package/models/batch.job.js +4 -0
  931. package/models/catalog.cattle.io.app.js +315 -0
  932. package/models/catalog.cattle.io.clusterrepo.js +163 -0
  933. package/models/catalog.cattle.io.operation.js +43 -0
  934. package/models/catalog.cattle.io.repo.js +4 -0
  935. package/models/chart.js +50 -0
  936. package/models/chartinstallaction.js +17 -0
  937. package/models/chartupgradeaction.js +12 -0
  938. package/models/cis.cattle.io.clusterscan.js +157 -0
  939. package/models/cis.cattle.io.clusterscanbenchmark.js +18 -0
  940. package/models/cis.cattle.io.clusterscanprofile.js +14 -0
  941. package/models/cis.cattle.io.clusterscanreport.js +62 -0
  942. package/models/cloudcredential.js +172 -0
  943. package/models/cluster/node.js +411 -0
  944. package/models/cluster.x-k8s.io.machine.js +244 -0
  945. package/models/cluster.x-k8s.io.machinedeployment.js +196 -0
  946. package/models/cluster.x-k8s.io.machineset.js +23 -0
  947. package/models/clusterroletemplatebinding.js +27 -0
  948. package/models/configmap.js +20 -0
  949. package/models/constraints.gatekeeper.sh.constraint.js +75 -0
  950. package/models/etcdbackup.js +40 -0
  951. package/models/event.js +23 -0
  952. package/models/fleet.cattle.io.bundle.js +132 -0
  953. package/models/fleet.cattle.io.cluster.js +133 -0
  954. package/models/fleet.cattle.io.clustergroup.js +62 -0
  955. package/models/fleet.cattle.io.clusterregistrationtoken.js +14 -0
  956. package/models/fleet.cattle.io.gitrepo.js +315 -0
  957. package/models/group.principal.js +71 -0
  958. package/models/harvester/configmap.js +32 -0
  959. package/models/harvester/harvesterhci.io.blockdevice.js +55 -0
  960. package/models/harvester/harvesterhci.io.keypair.js +12 -0
  961. package/models/harvester/harvesterhci.io.setting.js +127 -0
  962. package/models/harvester/harvesterhci.io.supportbundle.js +35 -0
  963. package/models/harvester/harvesterhci.io.upgrade.js +226 -0
  964. package/models/harvester/harvesterhci.io.virtualmachinebackup.js +113 -0
  965. package/models/harvester/harvesterhci.io.virtualmachineimage.js +252 -0
  966. package/models/harvester/harvesterhci.io.virtualmachinerestore.js +43 -0
  967. package/models/harvester/harvesterhci.io.virtualmachinetemplate.js +69 -0
  968. package/models/harvester/harvesterhci.io.virtualmachinetemplateversion.js +218 -0
  969. package/models/harvester/k8s.cni.cncf.io.networkattachmentdefinition.js +32 -0
  970. package/models/harvester/kubevirt.io.virtualmachine.js +850 -0
  971. package/models/harvester/kubevirt.io.virtualmachineinstance.js +142 -0
  972. package/models/harvester/management.cattle.io.managedchart.js +191 -0
  973. package/models/harvester/management.cattle.io.setting.js +40 -0
  974. package/models/harvester/network.harvesterhci.io.clusternetwork.js +100 -0
  975. package/models/harvester/network.harvesterhci.io.nodenetwork.js +34 -0
  976. package/models/harvester/node.js +260 -0
  977. package/models/harvester/persistentvolumeclaim.js +166 -0
  978. package/models/harvester/pod.js +185 -0
  979. package/models/harvesterhci.io.management.cluster.js +33 -0
  980. package/models/helm.cattle.io.projecthelmchart.js +39 -0
  981. package/models/k8s.cni.cncf.io.networkattachmentdefinition.js +93 -0
  982. package/models/logging.banzaicloud.io.clusterflow.js +36 -0
  983. package/models/logging.banzaicloud.io.clusteroutput.js +4 -0
  984. package/models/logging.banzaicloud.io.flow.js +110 -0
  985. package/models/logging.banzaicloud.io.output.js +161 -0
  986. package/models/management.cattle.io.authconfig.js +69 -0
  987. package/models/management.cattle.io.cluster.js +427 -0
  988. package/models/management.cattle.io.clusterroletemplatebinding.js +130 -0
  989. package/models/management.cattle.io.feature.js +56 -0
  990. package/models/management.cattle.io.fleetworkspace.js +74 -0
  991. package/models/management.cattle.io.globalrole.js +127 -0
  992. package/models/management.cattle.io.globalrolebinding.js +59 -0
  993. package/models/management.cattle.io.kontainerdriver.js +68 -0
  994. package/models/management.cattle.io.node.js +139 -0
  995. package/models/management.cattle.io.nodepool.js +167 -0
  996. package/models/management.cattle.io.nodetemplate.js +139 -0
  997. package/models/management.cattle.io.project.js +135 -0
  998. package/models/management.cattle.io.projectroletemplatebinding.js +150 -0
  999. package/models/management.cattle.io.roletemplate.js +173 -0
  1000. package/models/management.cattle.io.setting.js +42 -0
  1001. package/models/management.cattle.io.user.js +201 -0
  1002. package/models/metrics.k8s.io.nodemetrics.js +41 -0
  1003. package/models/monitoring.coreos.com.alertmanagerconfig.js +125 -0
  1004. package/models/monitoring.coreos.com.podmonitor.js +23 -0
  1005. package/models/monitoring.coreos.com.prometheusrule.js +29 -0
  1006. package/models/monitoring.coreos.com.receiver.js +195 -0
  1007. package/models/monitoring.coreos.com.route.js +162 -0
  1008. package/models/monitoring.coreos.com.servicemonitor.js +23 -0
  1009. package/models/namespace.js +189 -0
  1010. package/models/networking.istio.io.destinationrule.js +20 -0
  1011. package/models/networking.k8s.io.ingress.js +196 -0
  1012. package/models/persistentvolume.js +142 -0
  1013. package/models/persistentvolumeclaim.js +18 -0
  1014. package/models/pod.js +183 -0
  1015. package/models/principal.js +42 -0
  1016. package/models/projectroletemplatebinding.js +20 -0
  1017. package/models/provisioning.cattle.io.cluster.js +617 -0
  1018. package/models/rbac.authorization.k8s.io.clusterrole.js +17 -0
  1019. package/models/rbac.authorization.k8s.io.role.js +52 -0
  1020. package/models/replicationcontroller.js +4 -0
  1021. package/models/resources.cattle.io.backup.js +29 -0
  1022. package/models/resources.cattle.io.restore.js +33 -0
  1023. package/models/rke-machine-config.cattle.io.harvesterconfig.js +19 -0
  1024. package/models/rke-machine.cattle.io.amazonec2machinetemplate.js +15 -0
  1025. package/models/rke-machine.cattle.io.azuremachinetemplate.js +15 -0
  1026. package/models/rke-machine.cattle.io.digitaloceanmachinetemplate.js +15 -0
  1027. package/models/rke-machine.cattle.io.linodemachinetemplate.js +15 -0
  1028. package/models/rke-machine.cattle.io.machinetemplate.js +22 -0
  1029. package/models/rke-machine.cattle.io.vmwarevspheremachinetemplate.js +14 -0
  1030. package/models/rke.cattle.io.etcdsnapshot.js +69 -0
  1031. package/models/schema.js +17 -0
  1032. package/models/secret.js +352 -0
  1033. package/models/service.js +179 -0
  1034. package/models/storage.k8s.io.storageclass.js +121 -0
  1035. package/models/templates.gatekeeper.sh.constrainttemplate.js +23 -0
  1036. package/models/token.js +19 -0
  1037. package/models/ui.cattle.io.navlink.js +38 -0
  1038. package/models/workload.js +853 -0
  1039. package/nuxt.config.js +683 -0
  1040. package/package.json +165 -0
  1041. package/pages/about.vue +209 -0
  1042. package/pages/account/create-key.vue +17 -0
  1043. package/pages/account/index.vue +227 -0
  1044. package/pages/auth/login.vue +426 -0
  1045. package/pages/auth/logout.vue +18 -0
  1046. package/pages/auth/setup.vue +430 -0
  1047. package/pages/auth/verify.vue +134 -0
  1048. package/pages/c/_cluster/_product/_resource/_id.vue +12 -0
  1049. package/pages/c/_cluster/_product/_resource/_namespace/_id.vue +12 -0
  1050. package/pages/c/_cluster/_product/_resource/create.vue +12 -0
  1051. package/pages/c/_cluster/_product/_resource/index.vue +12 -0
  1052. package/pages/c/_cluster/_product/index.vue +15 -0
  1053. package/pages/c/_cluster/_product/members/index.vue +91 -0
  1054. package/pages/c/_cluster/_product/namespaces.vue +75 -0
  1055. package/pages/c/_cluster/_product/projectsnamespaces.vue +301 -0
  1056. package/pages/c/_cluster/apps/charts/chart.vue +307 -0
  1057. package/pages/c/_cluster/apps/charts/index.vue +595 -0
  1058. package/pages/c/_cluster/apps/charts/install.vue +1638 -0
  1059. package/pages/c/_cluster/apps/index.vue +17 -0
  1060. package/pages/c/_cluster/auth/config/_id.vue +32 -0
  1061. package/pages/c/_cluster/auth/config/index.vue +104 -0
  1062. package/pages/c/_cluster/auth/group.principal/assign-edit.vue +133 -0
  1063. package/pages/c/_cluster/auth/index.vue +19 -0
  1064. package/pages/c/_cluster/auth/roles/_resource/_id.vue +12 -0
  1065. package/pages/c/_cluster/auth/roles/_resource/create.vue +12 -0
  1066. package/pages/c/_cluster/auth/roles/index.vue +193 -0
  1067. package/pages/c/_cluster/backup/index.vue +11 -0
  1068. package/pages/c/_cluster/cis/index.vue +11 -0
  1069. package/pages/c/_cluster/ecm/index.vue +16 -0
  1070. package/pages/c/_cluster/explorer/ConfigBadge.vue +55 -0
  1071. package/pages/c/_cluster/explorer/EventsTable.vue +88 -0
  1072. package/pages/c/_cluster/explorer/explorer-utils.js +17 -0
  1073. package/pages/c/_cluster/explorer/index.vue +559 -0
  1074. package/pages/c/_cluster/explorer/tools/index.vue +482 -0
  1075. package/pages/c/_cluster/explorer/tools/pages/_page.vue +26 -0
  1076. package/pages/c/_cluster/fleet/index.vue +474 -0
  1077. package/pages/c/_cluster/gatekeeper/constraints/index.vue +90 -0
  1078. package/pages/c/_cluster/gatekeeper/index.vue +67 -0
  1079. package/pages/c/_cluster/harvester/airgapupgrade/index.vue +306 -0
  1080. package/pages/c/_cluster/harvester/console/_uid/serial.vue +51 -0
  1081. package/pages/c/_cluster/harvester/console/_uid/vnc.vue +46 -0
  1082. package/pages/c/_cluster/harvester/index.vue +24 -0
  1083. package/pages/c/_cluster/harvester/support/index.vue +154 -0
  1084. package/pages/c/_cluster/harvesterManager/index.vue +24 -0
  1085. package/pages/c/_cluster/index.vue +17 -0
  1086. package/pages/c/_cluster/istio/index.vue +139 -0
  1087. package/pages/c/_cluster/legacy/index.vue +22 -0
  1088. package/pages/c/_cluster/legacy/pages/_page.vue +26 -0
  1089. package/pages/c/_cluster/legacy/project/_page.vue +54 -0
  1090. package/pages/c/_cluster/legacy/project/index.vue +29 -0
  1091. package/pages/c/_cluster/legacy/project/pipelines.vue +74 -0
  1092. package/pages/c/_cluster/logging/index.vue +87 -0
  1093. package/pages/c/_cluster/longhorn/index.vue +68 -0
  1094. package/pages/c/_cluster/manager/cloudCredential/_id.vue +16 -0
  1095. package/pages/c/_cluster/manager/cloudCredential/create.vue +16 -0
  1096. package/pages/c/_cluster/manager/cloudCredential/index.vue +89 -0
  1097. package/pages/c/_cluster/manager/index.vue +22 -0
  1098. package/pages/c/_cluster/manager/pages/_page.vue +23 -0
  1099. package/pages/c/_cluster/mcapps/index.vue +21 -0
  1100. package/pages/c/_cluster/mcapps/pages/_page.vue +22 -0
  1101. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/index.vue +12 -0
  1102. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +310 -0
  1103. package/pages/c/_cluster/monitoring/alertmanagerconfig/index.vue +24 -0
  1104. package/pages/c/_cluster/monitoring/index.vue +207 -0
  1105. package/pages/c/_cluster/monitoring/monitor/_namespace/_id.vue +19 -0
  1106. package/pages/c/_cluster/monitoring/monitor/create.vue +27 -0
  1107. package/pages/c/_cluster/monitoring/monitor/index.vue +81 -0
  1108. package/pages/c/_cluster/monitoring/route-receiver/_id.vue +27 -0
  1109. package/pages/c/_cluster/monitoring/route-receiver/create.vue +19 -0
  1110. package/pages/c/_cluster/monitoring/route-receiver/index.vue +114 -0
  1111. package/pages/c/_cluster/navlinks/_group.vue +42 -0
  1112. package/pages/c/_cluster/neuvector/index.vue +66 -0
  1113. package/pages/c/_cluster/settings/banners.vue +279 -0
  1114. package/pages/c/_cluster/settings/brand.vue +344 -0
  1115. package/pages/c/_cluster/settings/index.vue +22 -0
  1116. package/pages/c/index.vue +9 -0
  1117. package/pages/clusters/index.vue +21 -0
  1118. package/pages/docs/_doc.vue +320 -0
  1119. package/pages/docs/toc.js +27 -0
  1120. package/pages/fail-whale.vue +111 -0
  1121. package/pages/home.vue +447 -0
  1122. package/pages/index.vue +22 -0
  1123. package/pages/plugins.vue +387 -0
  1124. package/pages/prefs.vue +233 -0
  1125. package/pages/rio/mesh.vue +505 -0
  1126. package/pages/support/index.vue +284 -0
  1127. package/pkg/auto-import.js +81 -0
  1128. package/pkg/babel.config.js +8 -0
  1129. package/pkg/dynamic-importer.lib.js +62 -0
  1130. package/pkg/import.js +10 -0
  1131. package/pkg/model-loader.lib.js +3 -0
  1132. package/pkg/tsconfig.json +49 -0
  1133. package/pkg/vue.config.js +120 -0
  1134. package/plugins/axios.js +67 -0
  1135. package/plugins/back-button.js +5 -0
  1136. package/plugins/codemirror-loader.js +5 -0
  1137. package/plugins/codemirror.js +169 -0
  1138. package/plugins/dashboard-store/actions.js +443 -0
  1139. package/plugins/dashboard-store/classify.js +35 -0
  1140. package/plugins/dashboard-store/extensions.js +22 -0
  1141. package/plugins/dashboard-store/getters.js +287 -0
  1142. package/plugins/dashboard-store/index.js +158 -0
  1143. package/plugins/dashboard-store/model-loader.js +73 -0
  1144. package/plugins/dashboard-store/mutations.js +262 -0
  1145. package/plugins/dashboard-store/normalize.js +48 -0
  1146. package/plugins/dashboard-store/rehydrate-all.js +44 -0
  1147. package/plugins/dashboard-store/resource-class.js +1813 -0
  1148. package/plugins/directives.js +41 -0
  1149. package/plugins/extend-router.js +60 -0
  1150. package/plugins/global-formatters.js +10 -0
  1151. package/plugins/i18n.js +101 -0
  1152. package/plugins/int-number.js +19 -0
  1153. package/plugins/js-yaml.js +4 -0
  1154. package/plugins/lookup.js +50 -0
  1155. package/plugins/nuxt-client-init.js +3 -0
  1156. package/plugins/plugin.js +22 -0
  1157. package/plugins/portal.js +4 -0
  1158. package/plugins/replaceall.js +19 -0
  1159. package/plugins/resize.js +5 -0
  1160. package/plugins/shortkey.js +4 -0
  1161. package/plugins/steve/actions.js +373 -0
  1162. package/plugins/steve/getters.js +105 -0
  1163. package/plugins/steve/hybrid-class.js +103 -0
  1164. package/plugins/steve/index.js +70 -0
  1165. package/plugins/steve/mutations.js +27 -0
  1166. package/plugins/steve/norman-class.js +51 -0
  1167. package/plugins/steve/performanceTesting.js +123 -0
  1168. package/plugins/steve/steve-class.js +31 -0
  1169. package/plugins/steve/subscribe.js +633 -0
  1170. package/plugins/steve/urloptions.js +47 -0
  1171. package/plugins/tooltip.js +4 -0
  1172. package/plugins/transitions.js +4 -0
  1173. package/plugins/trim-whitespace.js +37 -0
  1174. package/plugins/v-select.js +4 -0
  1175. package/plugins/vue-clipboard2.js +4 -0
  1176. package/plugins/vue-js-modal.js +4 -0
  1177. package/promptRemove/kubevirt.io.virtualmachine.vue +178 -0
  1178. package/scripts/build-pkg.sh +51 -0
  1179. package/scripts/pkgfile.js +23 -0
  1180. package/scripts/publish-pkg.sh +18 -0
  1181. package/scripts/publish-shell.sh +52 -0
  1182. package/scripts/serve-pkgs +62 -0
  1183. package/server/server-middleware.js +19 -0
  1184. package/server/server.crt +22 -0
  1185. package/server/server.csr +16 -0
  1186. package/server/server.key +27 -0
  1187. package/server/v3.ext +8 -0
  1188. package/server/verdaccio-middleware.js +56 -0
  1189. package/static/favicon.ico +0 -0
  1190. package/static/favicon.png +0 -0
  1191. package/static/loading-indicator.html +39 -0
  1192. package/store/action-menu.js +229 -0
  1193. package/store/auth.js +329 -0
  1194. package/store/aws.js +209 -0
  1195. package/store/catalog.js +661 -0
  1196. package/store/digitalocean.js +198 -0
  1197. package/store/features.js +66 -0
  1198. package/store/github.js +252 -0
  1199. package/store/growl.js +89 -0
  1200. package/store/harvester-common.js +126 -0
  1201. package/store/i18n.js +318 -0
  1202. package/store/index.js +1073 -0
  1203. package/store/linode.js +142 -0
  1204. package/store/plugins.js +222 -0
  1205. package/store/prefs.js +484 -0
  1206. package/store/type-map.js +1839 -0
  1207. package/store/uiplugins.ts +112 -0
  1208. package/store/wm.js +84 -0
  1209. package/types/index.d.ts +7 -0
  1210. package/utils/__tests__/array.test.ts +502 -0
  1211. package/utils/__tests__/object.test.ts +152 -0
  1212. package/utils/__tests__/selector.test.ts +444 -0
  1213. package/utils/alertmanagerconfig.js +162 -0
  1214. package/utils/array.ts +179 -0
  1215. package/utils/auth.js +81 -0
  1216. package/utils/aws.js +0 -0
  1217. package/utils/cluster.js +45 -0
  1218. package/utils/color.js +92 -0
  1219. package/utils/computed.js +45 -0
  1220. package/utils/create-yaml.js +359 -0
  1221. package/utils/crypto/LICENSE.txt +15 -0
  1222. package/utils/crypto/browserHashUtils.js +33 -0
  1223. package/utils/crypto/browserMd5.js +183 -0
  1224. package/utils/crypto/browserSha1.js +149 -0
  1225. package/utils/crypto/browserSha256.js +237 -0
  1226. package/utils/crypto/index.js +181 -0
  1227. package/utils/custom-validators.js +45 -0
  1228. package/utils/download.js +35 -0
  1229. package/utils/dynamic-importer.js +120 -0
  1230. package/utils/ember-page.js +30 -0
  1231. package/utils/error.js +80 -0
  1232. package/utils/gatekeeper/util.js +35 -0
  1233. package/utils/grafana.js +87 -0
  1234. package/utils/group.js +70 -0
  1235. package/utils/install-redirect.js +55 -0
  1236. package/utils/monitoring.js +73 -0
  1237. package/utils/namespace-filter.js +31 -0
  1238. package/utils/object.js +338 -0
  1239. package/utils/parse-externalid.js +139 -0
  1240. package/utils/platform.js +64 -0
  1241. package/utils/poller-sequential.js +53 -0
  1242. package/utils/poller.js +39 -0
  1243. package/utils/position.js +175 -0
  1244. package/utils/promise.js +95 -0
  1245. package/utils/queue.js +70 -0
  1246. package/utils/router.js +27 -0
  1247. package/utils/select.js +67 -0
  1248. package/utils/selector.js +227 -0
  1249. package/utils/socket.js +315 -0
  1250. package/utils/sort.js +225 -0
  1251. package/utils/stream.js +49 -0
  1252. package/utils/string.js +286 -0
  1253. package/utils/time.js +56 -0
  1254. package/utils/type-helpers.ts +9 -0
  1255. package/utils/units.js +184 -0
  1256. package/utils/url.ts +171 -0
  1257. package/utils/validators/cidr.js +5 -0
  1258. package/utils/validators/cluster-name.js +12 -0
  1259. package/utils/validators/container-images.js +24 -0
  1260. package/utils/validators/cron-schedule.js +9 -0
  1261. package/utils/validators/flow-output.js +15 -0
  1262. package/utils/validators/index.js +243 -0
  1263. package/utils/validators/kubernetes-name.js +39 -0
  1264. package/utils/validators/logging-outputs.js +11 -0
  1265. package/utils/validators/monitoring-route.js +13 -0
  1266. package/utils/validators/pod-affinity.js +128 -0
  1267. package/utils/validators/prometheusrule.js +76 -0
  1268. package/utils/validators/role-template.js +19 -0
  1269. package/utils/validators/service.js +136 -0
  1270. package/utils/validators/setting.js +48 -0
  1271. package/utils/validators/vm-datavolumes.js +38 -0
  1272. package/utils/validators/vm-image.js +32 -0
  1273. package/utils/validators/vm.js +214 -0
  1274. package/utils/version.js +127 -0
  1275. package/utils/window.js +46 -0
@@ -0,0 +1,1839 @@
1
+ // This file has 2 sections that control getting and using specializations of particular types
2
+ // over the generic info that is specified or generated from schemas.
3
+ //
4
+ // 1) Getting info about types
5
+ //
6
+ // labelFor(schema, count) Get the display label for a schema. Count is (in English) 1 or not-1 for pluralizing
7
+ // groupLabelFor(schema) Get the label for the API group of this schema's type
8
+ // isIgnored(schema) Returns true if this type should be hidden from the tree
9
+ // groupForBasicType(schema) Returns the group a type should be shown in basic view, or false-y if it shouldn't be shown.
10
+ // typeWeightFor(type, forBasic) Get the weight value for a particular type label
11
+ // groupWeightFor(group, forBasic) Get the weight value for a particular group
12
+ // headersFor(schema) Returns the column definitions for a type to give to SortableTable
13
+ // activeProducts() Returns the list of products that are installed and should be shown
14
+ //
15
+ // 2) Detecting and using custom list/detail/edit/header components
16
+ //
17
+ // hasCustomList(type) Does type have a custom list implementation?
18
+ // hasCustomDetail(type[,subType]) Does type have a custom detail implementation?
19
+ // hasCustomEdit(type[,subType]) Does type have a custom edit implementation?
20
+ // importList(type) Returns a promise that resolves to the list component for type
21
+ // importDetail(type[,subType]) Returns a promise that resolves to the detail component for type
22
+ // importEdit(type[,subType]) Returns a promise that resolves to the edit component for type
23
+ // optionsFor(schemaOrType) Return the configured options for a type (from configureType)
24
+ //
25
+ // 3) Changing specialization info about a type
26
+ // For all:
27
+ // let { thingYouWant } = DSL(instanceOfTheStore, 'product');
28
+ //
29
+ // product( Add a product into the nav
30
+ // removable, -- Is the product removable (true) or built-in (false).
31
+ // weight, -- Sort order and divider sections in the product menu. 3=global (fleet, ecm), 2=always on (apps, explorer) 1=other
32
+ // showClusterSwitcher, -- Show the cluster switcher in the header (default true)
33
+ // showNamespaceFilter, -- Show the namespace filter in the header (default false)
34
+ // showWorkspaceSwitcher, -- Show the workspace switcher in the header (conflicts with namespace) (default false)
35
+ // ifHave, -- Show this product only if the given capability is available
36
+ // ifHaveGroup, -- Show this product only if the given group exists in the store [inStore]
37
+ // ifHaveType, -- Show this product only if the given type exists in the store [inStore], This can also be specified as an object { type: TYPE, store: 'management' } if the type isn't in the current [inStore]
38
+ // ifHaveVerb, -- In combination with ifHaveTYpe, show it only if the type also has this collectionMethod
39
+ // inStore, -- Which store to look at for if* above and the left-nav, defaults to "cluster"
40
+ // public, -- If true, show to all users. If false, only show when the Developer Tools pref is on (default true)
41
+ // category, -- Group to show the product in for the nav hamburger menu
42
+ // typeStoreMap, -- An object mapping types to the store that should be used to retrieve information about the type
43
+ // })
44
+ //
45
+ // externalLink(stringOrFn) The product has an external page (function gets context object
46
+ //
47
+ // virtualType(obj) Add an item to the tree that goes to a route instead of an actual type.
48
+ // -- obj can contain anything in the objects getTree returns.
49
+ // -- obj must have a `name` that is unique among all virtual types.
50
+ // -- `cluster` is automatically added to route.params if it exists.
51
+ //
52
+ // spoofedType(obj) Create a fake type that can be treated like a normal type
53
+ //
54
+ // basicType( Mark type(s) as always shown in the top of the nav
55
+ // type(s), -- Type name or array of type names
56
+ // group -- Group to show the type(s) under; false-y for top-level.
57
+ // )
58
+ // basicType( Mark all types in group as always shown in the top of the nav
59
+ // group, -- Group to show
60
+ // asLabel -- Label to display the group as; false-y for top-level.
61
+ // )
62
+ // ignoreType(type) Never show type
63
+ // weightType( Set the weight (sorting) order of one or more types
64
+ // typeOrArrayOfTypes,
65
+ // weight, -- Higher numbers are shown first/higher up on the nav tree
66
+ // forBasic -- Apply to basic type instead of regular type tree
67
+ // )
68
+ // mapType( Remap a type id to a display name
69
+ // matchRegexOrString, -- Type to match, or regex that matches types
70
+ // replacementStringOrFn, -- String to replace the type with, or
71
+ // -- sync function: (type, capturedString, schemaObj => { return 'new-type'; }
72
+ // mapWeight, -- Priority for apply this mapping (higher numbers applied first)
73
+ // continueOnMatch -- If true, continue applying to hit other rules that might match the new type.
74
+ // )
75
+ // moveType( Change the group a type is in
76
+ // matchRegexOrString, -- Type to match, or regex that matches types
77
+ // newGroup, -- Group to move the type into
78
+ // mapWeight, -- Priority for apply this mapping (higher numbers applied first)
79
+ // )
80
+ // componentForType( Map matching types to a single component name
81
+ // ( (this is helpful if multiple types should be rendered by a single component)
82
+ // matchRegexOrString, -- Type to match, or regex that matches types
83
+ // replacementString -- String to replace the type with
84
+ // )
85
+ // configureType( Display options for a particular type
86
+ // type, -- Type to apply to
87
+ // options -- Object of options. Defaults/Supported: {
88
+ // isCreatable: true, -- If false, disable create even if schema says it's allowed
89
+ // isEditable: true, -- Ditto, for edit
90
+ // isRemovable: true, -- Ditto, for remove/delete
91
+ // showState: true, -- If false, hide state in columns and masthead
92
+ // showAge: true, -- If false, hide age in columns and masthead
93
+ // showConfigView: true -- If false, hide masthead config button in view mode
94
+ // showListMasthead: true, -- If false, hide masthead in list view
95
+ // canYaml: true,
96
+ // resource: undefined -- Use this resource in ResourceDetails instead
97
+ // resourceDetail: undefined -- Use this resource specifically for ResourceDetail's detail component
98
+ // resourceEdit: undefined -- Use this resource specifically for ResourceDetail's edit component
99
+ // depaginate: undefined -- Use this to depaginate requests for this type
100
+ // resourceEditMasthead: true -- Show the Masthead in the edit resource component
101
+ // customRoute: undefined,
102
+ // }
103
+ // )
104
+ // ignoreGroup(group): Never show group or any types in it
105
+ // weightGroup( Set the weight (sorting) of one or more groups
106
+ // groupOrArrayOfGroups, -- see weightType...
107
+ // weight
108
+ // )
109
+ // setGroupDefaultType( Set the default child type to show when the group is expanded
110
+ // groupOrArrayOfGroups, -- see setGroupDefaultType...
111
+ // defaultType
112
+ // )
113
+ // mapGroup( Remap a group name to a display name
114
+ // matchRegexOrString, -- see mapType...
115
+ // replacementString,
116
+ // mapWeight,
117
+ // continueOnMatch
118
+ // )
119
+ import { AGE, NAME, NAMESPACE as NAMESPACE_COL, STATE } from '@shell/config/table-headers';
120
+ import { COUNT, SCHEMA, MANAGEMENT, NAMESPACE } from '@shell/config/types';
121
+ import { DEV, EXPANDED_GROUPS, FAVORITE_TYPES } from '@shell/store/prefs';
122
+ import {
123
+ addObject, findBy, insertAt, isArray, removeObject, filterBy
124
+ } from '@shell/utils/array';
125
+ import { clone, get } from '@shell/utils/object';
126
+ import {
127
+ ensureRegex, escapeHtml, escapeRegex, ucFirst, pluralize
128
+ } from '@shell/utils/string';
129
+ import {
130
+ importList, importDetail, importEdit, listProducts, loadProduct, importCustomPromptRemove, resolveList, resolveEdit, resolveDetail, resolveWindowComponent, importWindowComponent
131
+
132
+ } from '@shell/utils/dynamic-importer';
133
+
134
+ import { NAME as EXPLORER } from '@shell/config/product/explorer';
135
+ import isObject from 'lodash/isObject';
136
+ import { normalizeType } from '@shell/plugins/dashboard-store/normalize';
137
+ import { sortBy } from '@shell/utils/sort';
138
+ import { haveV1Monitoring, haveV2Monitoring } from '@shell/utils/monitoring';
139
+ import { NEU_VECTOR_NAMESPACE } from '@shell/config/product/neuvector';
140
+
141
+ export const NAMESPACED = 'namespaced';
142
+ export const CLUSTER_LEVEL = 'cluster';
143
+ export const BOTH = 'both';
144
+
145
+ export const ALL = 'all';
146
+ export const BASIC = 'basic';
147
+ export const FAVORITE = 'favorite';
148
+ export const USED = 'used';
149
+
150
+ export const ROOT = 'root';
151
+
152
+ export const SPOOFED_PREFIX = '__[[spoofed]]__';
153
+ export const SPOOFED_API_PREFIX = '__[[spoofedapi]]__';
154
+
155
+ const instanceMethods = {};
156
+
157
+ const FIELD_REGEX = /^\$\.metadata\.fields\[([0-9]*)\]/;
158
+
159
+ export const IF_HAVE = {
160
+ V1_MONITORING: 'v1-monitoring',
161
+ V2_MONITORING: 'v2-monitoring',
162
+ PROJECT: 'project',
163
+ NO_PROJECT: 'no-project',
164
+ NOT_V1_ISTIO: 'not-v1-istio',
165
+ MULTI_CLUSTER: 'multi-cluster',
166
+ HARVESTER_SINGLE_CLUSTER: 'harv-multi-cluster',
167
+ NEUVECTOR_NAMESPACE: 'neuvector-namespace',
168
+ };
169
+
170
+ export function DSL(store, product, module = 'type-map') {
171
+ // store.commit(`${ module }/product`, { name: product });
172
+
173
+ return {
174
+ product(inOpt) {
175
+ const opt = {
176
+ name: product,
177
+ weight: 1,
178
+ inStore: 'cluster',
179
+ removable: true,
180
+ showClusterSwitcher: true,
181
+ showNamespaceFilter: false,
182
+ public: true,
183
+ filterMode: 'namespaces',
184
+ ...inOpt
185
+ };
186
+
187
+ for ( const k of ['ifHaveGroup', 'ifHaveType'] ) {
188
+ if ( opt[k] ) {
189
+ opt[k] = regexToString(ensureRegex(opt[k]));
190
+ }
191
+ }
192
+
193
+ store.commit(`${ module }/product`, opt);
194
+ },
195
+
196
+ basicType(types, group) {
197
+ // Support passing in a map of types and using just the values
198
+ if ( !isArray(types) && types && isObject(types) ) {
199
+ types = Object.values(types);
200
+ }
201
+
202
+ store.commit(`${ module }/basicType`, {
203
+ product, types, group
204
+ });
205
+ },
206
+
207
+ // Type- and Group-dependent
208
+ groupBy(type, field) {
209
+ store.commit(`${ module }/groupBy`, { type, field });
210
+ },
211
+
212
+ headers(type, headers) {
213
+ headers.forEach((header) => {
214
+ // If on the client, then use the value getter if there is one
215
+ if (process.client && header.getValue) {
216
+ header.value = header.getValue;
217
+ }
218
+
219
+ delete header.getValue;
220
+ });
221
+
222
+ store.commit(`${ module }/headers`, { type, headers });
223
+ },
224
+
225
+ hideBulkActions(type, field) {
226
+ store.commit(`${ module }/hideBulkActions`, { type, field });
227
+ },
228
+
229
+ configureType(match, options) {
230
+ store.commit(`${ module }/configureType`, { ...options, match });
231
+ },
232
+
233
+ componentForType(match, replace) {
234
+ store.commit(`${ module }/componentForType`, { match, replace });
235
+ },
236
+
237
+ ignoreType(regexOrString) {
238
+ store.commit(`${ module }/ignoreType`, regexOrString);
239
+ },
240
+
241
+ ignoreGroup(regexOrString) {
242
+ store.commit(`${ module }/ignoreGroup`, regexOrString);
243
+ },
244
+
245
+ weightGroup(input, weight, forBasic) {
246
+ if ( isArray(input) ) {
247
+ store.commit(`${ module }/weightGroup`, {
248
+ groups: input, weight, forBasic
249
+ });
250
+ } else {
251
+ store.commit(`${ module }/weightGroup`, {
252
+ group: input, weight, forBasic
253
+ });
254
+ }
255
+ },
256
+
257
+ setGroupDefaultType(input, defaultType) {
258
+ if ( isArray(input) ) {
259
+ store.commit(`${ module }/setGroupDefaultType`, { groups: input, defaultType });
260
+ } else {
261
+ store.commit(`${ module }/setGroupDefaultType`, { group: input, defaultType });
262
+ }
263
+ },
264
+
265
+ weightType(input, weight, forBasic) {
266
+ if ( isArray(input) ) {
267
+ store.commit(`${ module }/weightType`, {
268
+ types: input, weight, forBasic
269
+ });
270
+ } else {
271
+ store.commit(`${ module }/weightType`, {
272
+ type: input, weight, forBasic
273
+ });
274
+ }
275
+ },
276
+
277
+ mapGroup(match, replace, weight = 5, continueOnMatch = false) {
278
+ store.commit(`${ module }/mapGroup`, {
279
+ match, replace, weight, continueOnMatch
280
+ });
281
+ },
282
+
283
+ mapType(match, replace, weight = 5, continueOnMatch = false) {
284
+ store.commit(`${ module }/mapType`, {
285
+ match, replace, weight, continueOnMatch
286
+ });
287
+ },
288
+
289
+ moveType(match, group, weight = 5, continueOnMatch = false) {
290
+ store.commit(`${ module }/moveType`, {
291
+ match, group, weight,
292
+ });
293
+ },
294
+
295
+ virtualType(obj) {
296
+ store.commit(`${ module }/virtualType`, { product, obj });
297
+ },
298
+
299
+ spoofedType(obj) {
300
+ store.commit(`${ module }/spoofedType`, { product, obj });
301
+ }
302
+ };
303
+ }
304
+
305
+ let called = false;
306
+
307
+ export async function applyProducts(store, $plugin) {
308
+ if (called) {
309
+ return;
310
+ }
311
+
312
+ called = true;
313
+ for ( const product of listProducts() ) {
314
+ const impl = await loadProduct(product);
315
+
316
+ if ( impl?.init ) {
317
+ impl.init(store);
318
+ }
319
+ }
320
+ // Load the products from all plugins
321
+ $plugin.loadProducts();
322
+ }
323
+
324
+ export function productsLoaded() {
325
+ return called;
326
+ }
327
+
328
+ export const state = function() {
329
+ return {
330
+ products: [],
331
+ virtualTypes: {},
332
+ spoofedTypes: {},
333
+ basicTypes: {},
334
+ groupIgnore: [],
335
+ groupWeights: {},
336
+ groupDefaultTypes: {},
337
+ basicGroupWeights: { [ROOT]: 1000 },
338
+ groupMappings: [],
339
+ typeIgnore: [],
340
+ basicTypeWeights: {},
341
+ typeWeights: {},
342
+ typeMappings: [],
343
+ typeMoveMappings: [],
344
+ typeToComponentMappings: [],
345
+ typeOptions: [],
346
+ groupBy: {},
347
+ headers: {},
348
+ hideBulkActions: {},
349
+ schemaGeneration: 1,
350
+ cache: {
351
+ typeMove: {},
352
+ groupLabel: {},
353
+ ignore: {},
354
+ list: {},
355
+ detail: {},
356
+ edit: {},
357
+ componentFor: {},
358
+ promptRemove: {},
359
+ windowComponents: {},
360
+ },
361
+ };
362
+ };
363
+
364
+ export const getters = {
365
+ // ----------------------------------------------------------------------------
366
+ // 1 ) Getting info
367
+ // ----------------------------------------------------------------------------
368
+ // Turns a type name into a display label (e.g. management.cattle.io.cluster -> Cluster)
369
+ labelFor(state, getters, rootState, rootGetters) {
370
+ return (schema, count = 1) => {
371
+ return _applyMapping(schema, state.typeMappings, 'id', false, () => {
372
+ const key = `typeLabel."${ schema.id.toLowerCase() }"`;
373
+
374
+ if ( rootGetters['i18n/exists'](key) ) {
375
+ return rootGetters['i18n/t'](key, { count }).trim();
376
+ }
377
+
378
+ const out = schema?.attributes?.kind || schema.id || '?';
379
+
380
+ // Add spaces, but breaks typing names into jump menu naturally
381
+ // out = ucFirst(out.replace(/([a-z])([A-Z])/g,'$1 $2'));
382
+
383
+ if ( count === 1 ) {
384
+ return out;
385
+ }
386
+
387
+ // This works for most things... if you don't like it, put in a typeLabel translation for above.
388
+ return pluralize(out);
389
+ });
390
+ };
391
+ },
392
+
393
+ // Turns a group name into a display label (e.g. management.cattle.io.v3.cluster -> Cluster)
394
+ groupLabelFor(state) {
395
+ return (schemaOrName) => {
396
+ let group = schemaOrName;
397
+
398
+ if ( typeof schemaOrName === 'object' ) {
399
+ let moved = false;
400
+
401
+ for ( const rule of state.typeMoveMappings ) {
402
+ const re = stringToRegex(rule.match);
403
+
404
+ if ( schemaOrName.id.match(re) ) {
405
+ moved = true;
406
+ group = rule.replace;
407
+ }
408
+ }
409
+
410
+ if ( !moved ) {
411
+ group = group.attributes.group;
412
+ }
413
+ }
414
+
415
+ if ( typeof group !== 'string' ) {
416
+ return null;
417
+ }
418
+
419
+ const out = _applyMapping(group, state.groupMappings, null, state.cache.groupLabel, (group) => {
420
+ const match = group.match(/^(.*)\.k8s\.io$/);
421
+
422
+ if ( match ) {
423
+ return match[1].split(/\./).map(x => ucFirst(x)).join('.');
424
+ }
425
+
426
+ return group;
427
+ });
428
+
429
+ return out;
430
+ };
431
+ },
432
+
433
+ groupForBasicType(state) {
434
+ return (product, schemaId) => {
435
+ return state.basicTypes?.[product]?.[schemaId];
436
+ };
437
+ },
438
+
439
+ optionsFor(state) {
440
+ const def = {
441
+ isCreatable: true,
442
+ isEditable: true,
443
+ isRemovable: true,
444
+ showState: true,
445
+ showAge: true,
446
+ canYaml: true,
447
+ namespaced: null,
448
+ listGroups: [],
449
+ depaginate: false,
450
+ customRoute: undefined,
451
+ resourceEditMasthead: true,
452
+ };
453
+
454
+ return (schemaOrType) => {
455
+ if (!schemaOrType) {
456
+ return {};
457
+ }
458
+
459
+ const type = (typeof schemaOrType === 'object' ? schemaOrType.id : schemaOrType);
460
+ const found = state.typeOptions.find((entry) => {
461
+ const re = stringToRegex(entry.match);
462
+
463
+ return re.test(type);
464
+ });
465
+
466
+ const opts = Object.assign({}, def, found || {});
467
+
468
+ return opts;
469
+ };
470
+ },
471
+
472
+ isFavorite(state, getters, rootState, rootGetters) {
473
+ return (schemaId) => {
474
+ return rootGetters['prefs/get'](FAVORITE_TYPES).includes(schemaId) || false;
475
+ };
476
+ },
477
+
478
+ typeWeightFor(state) {
479
+ return (type, forBasic) => {
480
+ type = type?.toLowerCase();
481
+
482
+ if ( forBasic ) {
483
+ return state.basicTypeWeights[type] || 0;
484
+ } else {
485
+ return state.typeWeights[type] || 0;
486
+ }
487
+ };
488
+ },
489
+
490
+ groupWeightFor(state) {
491
+ return (group, forBasic) => {
492
+ group = group.toLowerCase();
493
+
494
+ if ( forBasic ) {
495
+ return state.basicGroupWeights[group] || 0;
496
+ } else {
497
+ return state.groupWeights[group] || 0;
498
+ }
499
+ };
500
+ },
501
+
502
+ groupDefaultTypeFor(state) {
503
+ return (group) => {
504
+ group = group.toLowerCase();
505
+
506
+ return state.groupDefaultTypes[group];
507
+ };
508
+ },
509
+
510
+ getTree(state, getters, rootState, rootGetters) {
511
+ return (productId, mode, allTypes, clusterId, namespaceMode, namespaces, currentType, search) => {
512
+ // getTree has four modes:
513
+ // - `basic` matches data types that should always be shown even if there
514
+ // are 0 of them.
515
+ // - `used` matches the data types where there are more than 0 of them
516
+ // in the current set of namespaces.
517
+ // - `all` matches all types.
518
+ // - `favorite` matches starred types.
519
+ // namespaceMode: 'namespaced', 'cluster', or 'both'
520
+ // namespaces: null means all, otherwise it will be an array of specific namespaces to include
521
+ const isBasic = mode === BASIC;
522
+
523
+ let searchRegex;
524
+
525
+ if ( search ) {
526
+ searchRegex = new RegExp(`^(.*)(${ escapeRegex(search) })(.*)$`, 'i');
527
+ }
528
+
529
+ const root = { children: [] };
530
+
531
+ // Add types from shortest to longest so that parents
532
+ // get added before children
533
+ const keys = Object.keys(allTypes).sort((a, b) => a.length - b.length);
534
+
535
+ for ( const type of keys ) {
536
+ const typeObj = allTypes[type];
537
+
538
+ if ( typeObj.schema && getters.isIgnored(typeObj.schema) ) {
539
+ // Skip ignored groups & types
540
+ continue;
541
+ }
542
+
543
+ const namespaced = typeObj.namespaced;
544
+
545
+ if ( (namespaceMode === NAMESPACED && !namespaced ) || (namespaceMode === CLUSTER_LEVEL && namespaced) ) {
546
+ // Skip types that are not the right namespace mode
547
+ continue;
548
+ }
549
+
550
+ const count = _matchingCounts(typeObj, namespaces);
551
+ const groupForBasicType = getters.groupForBasicType(productId, typeObj.name);
552
+
553
+ if ( typeObj.id === currentType ) {
554
+ // If this is the type currently being shown, always show it
555
+ } else if ( isBasic && !groupForBasicType ) {
556
+ // If we want the basic tree only return basic types;
557
+ continue;
558
+ } else if ( mode === USED && count <= 0 ) {
559
+ // If there's none of this type, ignore this entry when viewing only in-use types
560
+ // Note: count is sometimes null, which is <= 0.
561
+ continue;
562
+ }
563
+
564
+ const label = typeObj.labelKey ? rootGetters['i18n/t'](typeObj.labelKey) || typeObj.label : typeObj.label;
565
+ const virtual = !!typeObj.virtual;
566
+ let icon = typeObj.icon;
567
+
568
+ if ( (!virtual || typeObj.isSpoofed ) && !icon ) {
569
+ if ( namespaced ) {
570
+ icon = 'folder';
571
+ } else {
572
+ icon = 'globe';
573
+ }
574
+ }
575
+
576
+ const labelDisplay = highlightLabel(label, icon);
577
+
578
+ if ( !labelDisplay ) {
579
+ // Search happens in highlight and returns null if not found
580
+ continue;
581
+ }
582
+
583
+ let group;
584
+
585
+ if ( isBasic ) {
586
+ group = _ensureGroup(root, groupForBasicType, true);
587
+ } else if ( mode === FAVORITE ) {
588
+ group = _ensureGroup(root, 'starred');
589
+ group.weight = 1000;
590
+ } else if ( mode === USED ) {
591
+ group = _ensureGroup(root, `inUse::${ getters.groupLabelFor(typeObj.schema) }`);
592
+ } else {
593
+ group = _ensureGroup(root, typeObj.schema || typeObj.group || ROOT);
594
+ }
595
+
596
+ let route = typeObj.route;
597
+
598
+ // Make the default route if one isn't set
599
+ if (!route ) {
600
+ route = {
601
+ name: 'c-cluster-product-resource',
602
+ params: {
603
+ product: productId,
604
+ cluster: clusterId,
605
+ resource: typeObj.name,
606
+ }
607
+ };
608
+
609
+ typeObj.route = route;
610
+ }
611
+
612
+ // Cluster ID and Product should always be set
613
+ if ( route && typeof route === 'object' ) {
614
+ route.params = route.params || {};
615
+ route.params.cluster = clusterId;
616
+ route.params.product = productId;
617
+ }
618
+
619
+ group.children.push({
620
+ label,
621
+ labelDisplay,
622
+ mode: typeObj.mode,
623
+ count,
624
+ exact: typeObj.exact || false,
625
+ namespaced,
626
+ route,
627
+ name: typeObj.name,
628
+ weight: typeObj.weight || getters.typeWeightFor(typeObj.schema?.id || label, isBasic),
629
+ overview: !!typeObj.overview,
630
+ });
631
+ }
632
+
633
+ // Recursively sort the groups
634
+ _sortGroup(root, mode);
635
+
636
+ return root.children;
637
+
638
+ // ----------------------
639
+
640
+ function _ensureGroup(tree, schemaOrName, forBasic = false) {
641
+ let name = getters.groupLabelFor(schemaOrName);
642
+ const isRoot = ( name === ROOT || name.startsWith(`${ ROOT }::`) );
643
+
644
+ if ( name && name.includes('::') ) {
645
+ let parent;
646
+
647
+ [parent, name] = name.split('::', 2);
648
+ tree = _ensureGroup(tree, parent);
649
+ }
650
+
651
+ // Translate if an entry exists
652
+ let label = name;
653
+ const key = `nav.group."${ name }"`;
654
+
655
+ if ( rootGetters['i18n/exists'](key) ) {
656
+ label = rootGetters['i18n/t'](key);
657
+ }
658
+
659
+ let group = findBy(tree.children, 'name', name);
660
+
661
+ if ( !group ) {
662
+ group = {
663
+ name,
664
+ label,
665
+ weight: getters.groupWeightFor(name, forBasic),
666
+ defaultType: getters.groupDefaultTypeFor(name),
667
+ };
668
+
669
+ tree.children.push(group);
670
+ }
671
+
672
+ if ( isRoot ) {
673
+ group.isRoot = true;
674
+ }
675
+
676
+ if ( !group.children ) {
677
+ group.children = [];
678
+ }
679
+
680
+ return group;
681
+ }
682
+
683
+ function highlightLabel(original, icon) {
684
+ let label = escapeHtml(original);
685
+
686
+ if ( searchRegex ) {
687
+ const match = label.match(searchRegex);
688
+
689
+ if ( match ) {
690
+ label = `${ escapeHtml(match[1]) }<span class="highlight">${ escapeHtml(match[2]) }</span>${ escapeHtml(match[3]) }`;
691
+ } else {
692
+ return null;
693
+ }
694
+ }
695
+
696
+ if ( icon ) {
697
+ label = `<i class="icon icon-fw icon-${ icon }"></i>${ label }`;
698
+ }
699
+
700
+ return label;
701
+ }
702
+ };
703
+ },
704
+
705
+ isSpoofed(state, getters, rootState, rootGetters) {
706
+ return (type, product) => {
707
+ product = product || rootGetters['productId'];
708
+ const productSpoofedTypes = state.spoofedTypes[product] || [];
709
+
710
+ return productSpoofedTypes.some(st => st.type === type);
711
+ };
712
+ },
713
+
714
+ getSpoofedInstances(state, getters, rootState, rootGetters) {
715
+ return async(type, product) => {
716
+ product = product || rootGetters['productId'];
717
+ const getInstances = instanceMethods[product]?.[type] || (() => []);
718
+ const instances = await getInstances();
719
+
720
+ instances.forEach((instance) => {
721
+ const type = instance.type;
722
+ const id = instance.id;
723
+ const link = `/${ SPOOFED_PREFIX }/${ type }/${ id }`;
724
+ const apiLink = `/${ SPOOFED_API_PREFIX }/${ type }/${ id }`;
725
+
726
+ instance.links = {
727
+ remove: instance.links?.remove || link,
728
+ self: instance.links?.self || link,
729
+ update: instance.links?.update || link,
730
+ view: instance.links?.view || apiLink,
731
+ };
732
+ instance.isSpoofed = true;
733
+ });
734
+
735
+ return instances;
736
+ };
737
+ },
738
+
739
+ getSpoofedInstance(state, getters, rootState, rootGetters) {
740
+ return async(type, product, id) => {
741
+ const productInstances = await getters.getSpoofedInstances(type, product);
742
+
743
+ return productInstances.find( instance => instance.id === id);
744
+ };
745
+ },
746
+
747
+ allSpoofedTypes(state, getters, rootState, rootGetters) {
748
+ return Object.values(state.spoofedTypes).flat();
749
+ },
750
+
751
+ spoofedSchemas(state, getters, rootState, rootGetters) {
752
+ return (product) => {
753
+ const types = state.spoofedTypes[product] || [];
754
+
755
+ return types.flatMap((type) => {
756
+ const schemas = type.schemas || [];
757
+
758
+ return schemas.map(schema => ({
759
+ ...schema,
760
+ isSpoofed: true
761
+ }));
762
+ });
763
+ };
764
+ },
765
+
766
+ allSpoofedSchemas(state, getters, rootState, rootGetters) {
767
+ return getters.allSpoofedTypes.flatMap((type) => {
768
+ const schemas = type.schemas || [];
769
+
770
+ return schemas.map(schema => ({
771
+ ...schema,
772
+ isSpoofed: true
773
+ }));
774
+ });
775
+ },
776
+
777
+ allTypes(state, getters, rootState, rootGetters) {
778
+ return (product, mode = ALL) => {
779
+ const module = findBy(state.products, 'name', product).inStore;
780
+ const schemas = rootGetters[`${ module }/all`](SCHEMA);
781
+ const counts = rootGetters[`${ module }/all`](COUNT)?.[0]?.counts || {};
782
+ const isDev = rootGetters['prefs/get'](DEV);
783
+ const isBasic = mode === BASIC;
784
+
785
+ const out = {};
786
+
787
+ for ( const schema of schemas ) {
788
+ const attrs = schema.attributes || {};
789
+ const count = counts[schema.id];
790
+ const label = getters.labelFor(schema, count);
791
+ const weight = getters.typeWeightFor(schema?.id || label, isBasic);
792
+ const typeOptions = getters['optionsFor'](schema);
793
+
794
+ if ( isBasic ) {
795
+ // These are separate ifs so that things with no kind can still be basic
796
+ if ( !getters.groupForBasicType(product, schema.id) ) {
797
+ continue;
798
+ }
799
+ } else if ( mode === FAVORITE && !getters.isFavorite(schema.id) ) {
800
+ continue;
801
+ } else if ( !attrs.kind ) {
802
+ // Skip the schemas that aren't top-level types
803
+ continue;
804
+ } else if ( typeof typeOptions.ifRancherCluster !== 'undefined' && typeOptions.ifRancherCluster !== rootGetters.isRancher ) {
805
+ continue;
806
+ }
807
+
808
+ out[schema.id] = {
809
+ label,
810
+ mode,
811
+ weight,
812
+ schema,
813
+ name: schema.id,
814
+ namespaced: typeOptions.namespaced === null ? attrs.namespaced : typeOptions.namespaced,
815
+ count: count ? count.summary.count || 0 : null,
816
+ byNamespace: count ? count.namespaces : {},
817
+ revision: count ? count.revision : null,
818
+ route: typeOptions.customRoute
819
+ };
820
+ }
821
+
822
+ // Add virtual and spoofed types
823
+ if ( mode !== USED ) {
824
+ const virtualTypes = state.virtualTypes[product] || [];
825
+ const spoofedTypes = state.spoofedTypes[product] || [];
826
+ const allTypes = [...virtualTypes, ...spoofedTypes];
827
+
828
+ for ( const type of allTypes ) {
829
+ const item = clone(type);
830
+ const id = item.name;
831
+ const weight = type.weight || getters.typeWeightFor(item.label, isBasic);
832
+
833
+ // Is there a virtual/spoofed type override for schema type?
834
+ // Currently used by harvester, this should be investigated and removed if possible
835
+ if (out[id]) {
836
+ delete out[id];
837
+ }
838
+
839
+ if ( item['public'] === false && !isDev ) {
840
+ continue;
841
+ }
842
+
843
+ if (item.ifHave && !ifHave(rootGetters, item.ifHave)) {
844
+ continue;
845
+ }
846
+
847
+ if ( item.ifHaveType ) {
848
+ const targetedSchemas = typeof item.ifHaveType === 'string' ? schemas : rootGetters[`${ item.ifHaveType.store }/all`](SCHEMA);
849
+ const type = typeof item.ifHaveType === 'string' ? item.ifHaveType : item.ifHaveType?.type;
850
+
851
+ const haveIds = filterBy(targetedSchemas, 'id', normalizeType(type)).map(s => s.id);
852
+
853
+ if (!haveIds.length) {
854
+ continue;
855
+ }
856
+
857
+ if (item.ifHaveVerb && !ifHaveVerb(rootGetters, module, item.ifHaveVerb, haveIds)) {
858
+ continue;
859
+ }
860
+ }
861
+
862
+ if ( item.ifHaveSubTypes ) {
863
+ const hasSome = (item.ifHaveSubTypes || []).some((type) => {
864
+ return !!findBy(schemas, 'id', normalizeType(type));
865
+ });
866
+
867
+ if (!hasSome) {
868
+ continue;
869
+ }
870
+ }
871
+
872
+ if ( typeof item.ifRancherCluster !== 'undefined' && item.ifRancherCluster !== rootGetters.isRancher ) {
873
+ continue;
874
+ }
875
+
876
+ if ( isBasic && !getters.groupForBasicType(product, id) ) {
877
+ continue;
878
+ } else if ( mode === FAVORITE && !getters.isFavorite(id) ) {
879
+ continue;
880
+ }
881
+
882
+ item.mode = mode;
883
+ item.weight = weight;
884
+ item.label = item.label || item.name;
885
+
886
+ out[id] = item;
887
+ }
888
+ }
889
+
890
+ return out;
891
+ };
892
+ },
893
+
894
+ groupByFor(state) {
895
+ return (schema) => {
896
+ return state.groupBy[schema.id];
897
+ };
898
+ },
899
+
900
+ hideBulkActionsFor(state) {
901
+ return (schema) => {
902
+ return state.hideBulkActions[schema.id];
903
+ };
904
+ },
905
+
906
+ headersFor(state, getters, rootState, rootGetters) {
907
+ return (schema) => {
908
+ const attributes = schema.attributes || {};
909
+ const columns = attributes.columns || [];
910
+ const typeOptions = getters['optionsFor'](schema);
911
+
912
+ // A specific list has been provided
913
+ if ( state.headers[schema.id] ) {
914
+ return state.headers[schema.id].map((entry) => {
915
+ if ( typeof entry === 'string' ) {
916
+ const col = findBy(columns, 'name', entry);
917
+
918
+ if ( col ) {
919
+ return fromSchema(col, rootGetters);
920
+ } else {
921
+ return null;
922
+ }
923
+ } else {
924
+ return entry;
925
+ }
926
+ }).filter(col => !!col);
927
+ }
928
+
929
+ // Otherwise make one up from schema
930
+ const out = typeOptions.showState ? [STATE] : [];
931
+ const namespaced = attributes.namespaced || false;
932
+ let hasName = false;
933
+
934
+ for ( const col of columns ) {
935
+ if ( col.format === 'name' ) {
936
+ hasName = true;
937
+ out.push(NAME);
938
+ if ( namespaced ) {
939
+ out.push(NAMESPACE_COL);
940
+ }
941
+ } else {
942
+ out.push(fromSchema(col, rootGetters));
943
+ }
944
+ }
945
+
946
+ if ( !hasName ) {
947
+ insertAt(out, 1, NAME);
948
+ if ( namespaced ) {
949
+ insertAt(out, 2, NAMESPACE_COL);
950
+ }
951
+ }
952
+
953
+ // Age always goes last
954
+ if ( out.includes(AGE) ) {
955
+ removeObject(out, AGE);
956
+ if ( typeOptions.showAge ) {
957
+ out.push(AGE);
958
+ }
959
+ }
960
+
961
+ return out;
962
+
963
+ function rowValueGetter(index) {
964
+ return row => row.metadata?.fields?.[index];
965
+ }
966
+
967
+ function fromSchema(col, rootGetters) {
968
+ let formatter, width, formatterOpts;
969
+
970
+ if ( (col.format === '' || col.format === 'date') && col.name === 'Age' ) {
971
+ return AGE;
972
+ }
973
+
974
+ if ( col.format === 'date' || col.type === 'date' ) {
975
+ formatter = 'Date';
976
+ width = 120;
977
+ formatterOpts = { multiline: true };
978
+ }
979
+
980
+ if ( col.type === 'number' || col.type === 'int' ) {
981
+ formatter = 'Number';
982
+ }
983
+
984
+ const exists = rootGetters['i18n/exists'];
985
+ const t = rootGetters['i18n/t'];
986
+ const labelKey = `tableHeaders.${ col.name }`;
987
+ const description = col.description || '';
988
+ const tooltip = description && description[description.length - 1] === '.' ? description.slice(0, -1) : description;
989
+
990
+ // 'field' comes from the schema - typically it is of the form $.metadata.field[N]
991
+ // We will use JsonPath to look up this value, which is costly - so if we can detect this format
992
+ // Use a more efficient function to get the value
993
+ let value = col.field.startsWith('.') ? `$${ col.field }` : col.field;
994
+
995
+ if (process.client) {
996
+ const found = value.match(FIELD_REGEX);
997
+
998
+ if (found && found.length === 2) {
999
+ const fieldIndex = parseInt(found[1], 10);
1000
+
1001
+ value = rowValueGetter(fieldIndex);
1002
+ }
1003
+ }
1004
+
1005
+ return {
1006
+ name: col.name.toLowerCase(),
1007
+ label: exists(labelKey) ? t(labelKey) : col.name,
1008
+ value,
1009
+ sort: [col.field],
1010
+ formatter,
1011
+ formatterOpts,
1012
+ width,
1013
+ tooltip
1014
+ };
1015
+ }
1016
+ };
1017
+ },
1018
+
1019
+ // ------------------------------------
1020
+ // Custom list/detail/edit/header component detection
1021
+ //
1022
+ // Note: you can't refactor these into one function that does `@/${kind}/${type}`,
1023
+ // because babel needs some hardcoded idea where to look for the dependency.
1024
+ //
1025
+ // Note 2: Yes these are editing state in a getter for caching... it's ok, probably.
1026
+ // ------------------------------------
1027
+ hasCustomList(state, getters, rootState) {
1028
+ return (rawType) => {
1029
+ const key = getters.componentFor(rawType);
1030
+
1031
+ return hasCustom(state, rootState, 'list', key, key => resolveList(key));
1032
+ };
1033
+ },
1034
+
1035
+ hasCustomDetail(state, getters, rootState) {
1036
+ return (rawType, subType) => {
1037
+ const key = getters.componentFor(rawType, subType);
1038
+
1039
+ return hasCustom(state, rootState, 'detail', key, key => resolveDetail(key));
1040
+ };
1041
+ },
1042
+
1043
+ hasCustomEdit(state, getters, rootState) {
1044
+ return (rawType, subType) => {
1045
+ const key = getters.componentFor(rawType, subType);
1046
+
1047
+ return hasCustom(state, rootState, 'edit', key, key => resolveEdit(key));
1048
+ };
1049
+ },
1050
+
1051
+ hasComponent(state, getters, rootState) {
1052
+ return (path) => {
1053
+ return hasCustom(state, rootState, 'edit', path, path => resolveEdit(path));
1054
+ };
1055
+ },
1056
+
1057
+ hasCustomPromptRemove(state, getters) {
1058
+ return (rawType) => {
1059
+ const type = getters.componentFor(rawType);
1060
+
1061
+ const cache = state.cache.promptRemove;
1062
+
1063
+ if ( cache[type] !== undefined ) {
1064
+ return cache[type];
1065
+ }
1066
+
1067
+ try {
1068
+ require.resolve(`@shell/promptRemove/${ type }`);
1069
+ cache[type] = true;
1070
+ } catch (e) {
1071
+ cache[type] = false;
1072
+ }
1073
+
1074
+ return cache[type];
1075
+ };
1076
+ },
1077
+
1078
+ hasCustomWindowComponent(state, getters, rootState) {
1079
+ return (rawType, subType) => {
1080
+ const key = getters.componentFor(rawType, subType);
1081
+
1082
+ return hasCustom(state, rootState, 'windowComponents', key, key => resolveWindowComponent(key));
1083
+ };
1084
+ },
1085
+
1086
+ importComponent(state, getters) {
1087
+ return (path) => {
1088
+ return importEdit(path);
1089
+ };
1090
+ },
1091
+
1092
+ importList(state, getters, rootState) {
1093
+ return (rawType) => {
1094
+ return loadExtension(rootState, 'list', getters.componentFor(rawType), importList);
1095
+ };
1096
+ },
1097
+
1098
+ importDetail(state, getters, rootState) {
1099
+ return (rawType, subType) => {
1100
+ return loadExtension(rootState, 'detail', getters.componentFor(rawType, subType), importDetail);
1101
+ };
1102
+ },
1103
+
1104
+ importEdit(state, getters, rootState) {
1105
+ return (rawType, subType) => {
1106
+ return loadExtension(rootState, 'edit', getters.componentFor(rawType, subType), importEdit);
1107
+ };
1108
+ },
1109
+
1110
+ importCustomPromptRemove(state, getters) {
1111
+ return (rawType) => {
1112
+ const type = getters.componentFor(rawType);
1113
+
1114
+ return importCustomPromptRemove(type);
1115
+ };
1116
+ },
1117
+
1118
+ importWindowComponent(state, getters, rootState) {
1119
+ return (rawType, subType) => {
1120
+ return loadExtension(rootState, 'windowComponents', getters.componentFor(rawType, subType), importWindowComponent);
1121
+ };
1122
+ },
1123
+
1124
+ componentFor(state, getters) {
1125
+ return (type, subType) => {
1126
+ let key = type;
1127
+
1128
+ if ( subType ) {
1129
+ key = `${ type }/${ subType }`;
1130
+ }
1131
+
1132
+ if ( state.cache.componentFor[key] !== undefined ) {
1133
+ return state.cache.componentFor[key];
1134
+ }
1135
+
1136
+ let out = type;
1137
+
1138
+ const mapping = state.typeToComponentMappings.find((mapping) => {
1139
+ const re = stringToRegex(mapping.match);
1140
+
1141
+ return re.test(key);
1142
+ });
1143
+
1144
+ if ( mapping ) {
1145
+ out = mapping.replace;
1146
+ } else if ( subType ) {
1147
+ // Try again without the subType
1148
+ out = getters.componentFor(type);
1149
+ }
1150
+
1151
+ state.cache.componentFor[key] = out;
1152
+
1153
+ return out;
1154
+ };
1155
+ },
1156
+
1157
+ isIgnored(state) {
1158
+ return (schema) => {
1159
+ if ( state.cache.ignore[schema.id] !== undefined ) {
1160
+ return state.cache.ignore[schema.id];
1161
+ }
1162
+
1163
+ let out = false;
1164
+
1165
+ for ( const rule of state.groupIgnore ) {
1166
+ const group = schema?.attributes?.group;
1167
+
1168
+ if ( group && group.match(stringToRegex(rule)) ) {
1169
+ out = true;
1170
+ break;
1171
+ }
1172
+ }
1173
+
1174
+ if ( !out ) {
1175
+ for ( const rule of state.typeIgnore ) {
1176
+ if ( schema.id.match(stringToRegex(rule)) ) {
1177
+ out = true;
1178
+ break;
1179
+ }
1180
+ }
1181
+ }
1182
+
1183
+ state.cache.ignore[schema.id] = out;
1184
+
1185
+ return out;
1186
+ };
1187
+ },
1188
+
1189
+ activeProducts(state, getters, rootState, rootGetters) {
1190
+ const knownTypes = {};
1191
+ const knownGroups = {};
1192
+ const isDev = rootGetters['prefs/get'](DEV);
1193
+
1194
+ if ( state.schemaGeneration < 0 ) {
1195
+ // This does nothing, but makes activeProducts depend on schemaGeneration
1196
+ // so that it can be used to update the product list on schema change.
1197
+ return;
1198
+ }
1199
+
1200
+ return state.products.filter((p) => {
1201
+ const module = p.inStore;
1202
+
1203
+ if ( p['public'] === false && !isDev ) {
1204
+ return false;
1205
+ }
1206
+
1207
+ if ( p.ifGetter && !rootGetters[p.ifGetter] ) {
1208
+ return false;
1209
+ }
1210
+
1211
+ if ( !knownTypes[module] ) {
1212
+ const schemas = rootGetters[`${ module }/all`](SCHEMA);
1213
+
1214
+ knownTypes[module] = [];
1215
+ knownGroups[module] = [];
1216
+
1217
+ for ( const s of schemas ) {
1218
+ knownTypes[module].push(s._id);
1219
+
1220
+ if ( s._group ) {
1221
+ addObject(knownGroups[module], s._group);
1222
+ }
1223
+ }
1224
+ }
1225
+
1226
+ if ( p.ifFeature) {
1227
+ const features = Array.isArray(p.ifFeature) ? p.ifFeature : [p.ifFeature];
1228
+
1229
+ for (const f of features) {
1230
+ if (!rootGetters['features/get'](f)) {
1231
+ return false;
1232
+ }
1233
+ }
1234
+ }
1235
+
1236
+ if ( p.ifHave && !ifHave(rootGetters, p.ifHave)) {
1237
+ return false;
1238
+ }
1239
+
1240
+ if ( p.ifHaveType ) {
1241
+ const haveIds = knownTypes[module].filter(t => t.match(stringToRegex(p.ifHaveType)) );
1242
+
1243
+ if ( !haveIds.length ) {
1244
+ return false;
1245
+ }
1246
+
1247
+ if ( p.ifHaveVerb && !ifHaveVerb(rootGetters, module, p.ifHaveVerb, haveIds)) {
1248
+ return false;
1249
+ }
1250
+ }
1251
+
1252
+ if ( p.ifHaveGroup && !knownGroups[module].find(t => t.match(stringToRegex(p.ifHaveGroup)) ) ) {
1253
+ return false;
1254
+ }
1255
+
1256
+ return true;
1257
+ });
1258
+ },
1259
+
1260
+ isProductActive(state, getters) {
1261
+ return (name) => {
1262
+ if ( findBy(getters['activeProducts'], 'name', name) ) {
1263
+ return true;
1264
+ }
1265
+
1266
+ return false;
1267
+ };
1268
+ },
1269
+ };
1270
+
1271
+ export const mutations = {
1272
+ schemaChanged(state) {
1273
+ state.schemaGeneration = state.schemaGeneration + 1;
1274
+ },
1275
+
1276
+ // Remove the specified product
1277
+ remove(state, { product, plugin }) {
1278
+ const existing = state.products.findIndex(p => p.name === product);
1279
+
1280
+ // Remove the product
1281
+ if (existing !== -1) {
1282
+ state.products.splice(existing, 1);
1283
+ }
1284
+
1285
+ // Go through the basic types and remove the headers
1286
+ if (state.virtualTypes[product]) {
1287
+ delete state.virtualTypes[product];
1288
+ }
1289
+
1290
+ if (state.basicTypes[product]) {
1291
+ // Remove table header configuration
1292
+ Object.keys(state.basicTypes[product]).forEach((type) => {
1293
+ delete state.headers[type];
1294
+ delete state.basicTypeWeights[type];
1295
+ delete state.cache.ignore[type];
1296
+ // These track whether the type has a custom component
1297
+ delete state.cache.detail[type];
1298
+ delete state.cache.edit[type];
1299
+ delete state.cache.list[type];
1300
+
1301
+ // Delete all of the entries from the componentFor cache where the valye is the type
1302
+ // Can do this more efficiently
1303
+ Object.keys(state.cache.componentFor).forEach((k) => {
1304
+ const v = state.cache.componentFor[k];
1305
+
1306
+ if (v === type) {
1307
+ delete state.cache.componentFor[k];
1308
+ }
1309
+ });
1310
+ });
1311
+
1312
+ delete state.basicTypes[product];
1313
+ }
1314
+
1315
+ if (plugin) {
1316
+ // kind is list, edit, detail etc
1317
+ Object.keys(plugin.types).forEach((kind) => {
1318
+ if (state.cache[kind]) {
1319
+ Object.keys(plugin.types[kind]).forEach((type) => {
1320
+ delete state.cache[kind][type];
1321
+ });
1322
+ }
1323
+ });
1324
+ }
1325
+ },
1326
+
1327
+ product(state, obj) {
1328
+ const existing = findBy(state.products, 'name', obj.name);
1329
+
1330
+ if ( existing ) {
1331
+ Object.assign(existing, obj);
1332
+ } else {
1333
+ addObject(state.products, obj);
1334
+ }
1335
+ },
1336
+
1337
+ virtualType(state, { product, obj }) {
1338
+ if ( !state.virtualTypes[product] ) {
1339
+ state.virtualTypes[product] = [];
1340
+ }
1341
+
1342
+ const copy = clone(obj);
1343
+
1344
+ copy.virtual = true;
1345
+
1346
+ const existing = findBy(state.virtualTypes[product], 'name', copy.name);
1347
+
1348
+ if ( existing ) {
1349
+ Object.assign(existing, copy);
1350
+ } else {
1351
+ addObject(state.virtualTypes[product], copy);
1352
+ }
1353
+ },
1354
+
1355
+ spoofedType(state, { product, obj }) {
1356
+ if ( !state.spoofedTypes[product] ) {
1357
+ state.spoofedTypes[product] = [];
1358
+ }
1359
+
1360
+ const copy = clone(obj);
1361
+
1362
+ instanceMethods[product] = instanceMethods[product] || {};
1363
+ instanceMethods[product][copy.type] = copy.getInstances;
1364
+ delete copy.getInstances;
1365
+
1366
+ copy.name = copy.type;
1367
+ copy.isSpoofed = true;
1368
+ copy.virtual = true;
1369
+ copy.schemas.forEach((schema) => {
1370
+ schema.links = {
1371
+ collection: `/${ SPOOFED_PREFIX }/${ schema.id }`,
1372
+ ...(schema.links || {})
1373
+ };
1374
+ });
1375
+
1376
+ const existing = findBy(state.spoofedTypes[product], 'type', copy.type);
1377
+
1378
+ if ( existing ) {
1379
+ Object.assign(existing, copy);
1380
+ } else {
1381
+ addObject(state.spoofedTypes[product], copy);
1382
+ }
1383
+ },
1384
+
1385
+ basicType(state, { product, group, types }) {
1386
+ if ( !product ) {
1387
+ product = EXPLORER;
1388
+ }
1389
+
1390
+ if ( !group ) {
1391
+ group = ROOT;
1392
+ }
1393
+
1394
+ if ( !isArray(types) ) {
1395
+ types = [types];
1396
+ }
1397
+
1398
+ if ( !state.basicTypes[product] ) {
1399
+ state.basicTypes[product] = {};
1400
+ }
1401
+
1402
+ for ( const t of types ) {
1403
+ state.basicTypes[product][t] = group;
1404
+ }
1405
+ },
1406
+
1407
+ ignoreGroup(state, match) {
1408
+ match = ensureRegex(match);
1409
+ // State shouldn't contain actual RegExp objects, because they don't serialize
1410
+ state.groupIgnore.push(regexToString(match));
1411
+ },
1412
+
1413
+ ignoreType(state, match) {
1414
+ match = ensureRegex(match);
1415
+ state.typeIgnore.push(regexToString(match));
1416
+ },
1417
+
1418
+ groupBy(state, { type, field }) {
1419
+ state.groupBy[type] = field;
1420
+ },
1421
+
1422
+ headers(state, { type, headers }) {
1423
+ state.headers[type] = headers;
1424
+ },
1425
+
1426
+ hideBulkActions(state, { type, field }) {
1427
+ state.hideBulkActions[type] = field;
1428
+ },
1429
+
1430
+ // weightGroup({group: 'core', weight: 99}); -- higher groups are shown first
1431
+ // These operate on group names *after* mapping but *before* translation
1432
+ weightGroup(state, {
1433
+ group, groups, weight, forBasic
1434
+ }) {
1435
+ if ( !groups ) {
1436
+ groups = [];
1437
+ }
1438
+
1439
+ if ( group ) {
1440
+ groups.push(group);
1441
+ }
1442
+
1443
+ const map = forBasic ? state.basicGroupWeights : state.groupWeights;
1444
+
1445
+ for ( const g of groups ) {
1446
+ map[g.toLowerCase()] = weight;
1447
+ }
1448
+ },
1449
+
1450
+ // setGroupDefaultType({group: 'core', defaultType: 'name'});
1451
+ // By default when a group is clicked, the first item is selected - this allows
1452
+ // this behaviour to be changed and a named child type can be chosen
1453
+ // These operate on group names *after* mapping but *before* translation
1454
+ setGroupDefaultType(state, { group, groups, defaultType }) {
1455
+ if ( !groups ) {
1456
+ groups = [];
1457
+ }
1458
+
1459
+ if ( group ) {
1460
+ groups.push(group);
1461
+ }
1462
+
1463
+ for ( const g of groups ) {
1464
+ state.groupDefaultTypes[g.toLowerCase()] = defaultType;
1465
+ }
1466
+ },
1467
+
1468
+ // weightType('Cluster' 99); -- higher groups are shown first
1469
+ // These operate on *schema* type names, before mapping
1470
+ weightType(state, {
1471
+ type, types, weight, forBasic
1472
+ }) {
1473
+ if ( !types ) {
1474
+ types = [];
1475
+ }
1476
+
1477
+ if ( type ) {
1478
+ types.push(type);
1479
+ }
1480
+
1481
+ const map = forBasic ? state.basicTypeWeights : state.typeWeights;
1482
+
1483
+ for ( const t of types ) {
1484
+ map[t.toLowerCase()] = weight;
1485
+ }
1486
+ },
1487
+
1488
+ // mapGroup('ugly.thing', 'Nice Thing', 1);
1489
+ // mapGroup(/ugly.thing.(stuff)', '$1', 2);
1490
+ // mapGroup(/ugly.thing.(stuff)', function(groupStr, ruleObj, regexMatch, typeObj) { return ucFirst(group.id) } , 2);
1491
+ mapGroup(state, {
1492
+ match, replace, weight = 5, continueOnMatch = false
1493
+ }) {
1494
+ _addMapping(state.groupMappings, match, replace, weight, continueOnMatch);
1495
+ },
1496
+
1497
+ mapType(state, {
1498
+ match, replace, weight = 5, continueOnMatch = false
1499
+ }) {
1500
+ _addMapping(state.typeMappings, match, replace, weight, continueOnMatch);
1501
+ },
1502
+
1503
+ // moveType('apps.deployment', 'Core');
1504
+ moveType(state, { match, group, weight = 5 }) {
1505
+ _addMapping(state.typeMoveMappings, match, group, weight);
1506
+ },
1507
+
1508
+ componentForType(state, { match, replace }) {
1509
+ match = ensureRegex(match);
1510
+ match = regexToString(match);
1511
+ state.typeToComponentMappings.push({ match, replace });
1512
+ },
1513
+
1514
+ configureType(state, options) {
1515
+ const match = regexToString(ensureRegex(options.match));
1516
+
1517
+ const idx = state.typeOptions.findIndex(obj => obj.match === match);
1518
+ let obj = { ...options, match };
1519
+
1520
+ if ( idx >= 0 ) {
1521
+ obj = Object.assign(obj, state.typeOptions[idx]);
1522
+ state.typeOptions.splice(idx, 1, obj);
1523
+ } else {
1524
+ const obj = Object.assign({}, options, { match });
1525
+
1526
+ state.typeOptions.push(obj);
1527
+ }
1528
+ },
1529
+
1530
+ };
1531
+
1532
+ export const actions = {
1533
+ removeProduct({ commit }, metadata) {
1534
+ commit('remove', metadata);
1535
+ },
1536
+
1537
+ addFavorite({ dispatch, rootGetters }, type) {
1538
+ const types = rootGetters['prefs/get'](FAVORITE_TYPES) || [];
1539
+
1540
+ addObject(types, type);
1541
+
1542
+ dispatch('prefs/set', { key: FAVORITE_TYPES, value: types }, { root: true });
1543
+ },
1544
+
1545
+ removeFavorite({ dispatch, rootGetters }, type) {
1546
+ const types = rootGetters['prefs/get'](FAVORITE_TYPES) || [];
1547
+
1548
+ removeObject(types, type);
1549
+
1550
+ dispatch('prefs/set', { key: FAVORITE_TYPES, value: types }, { root: true });
1551
+ },
1552
+
1553
+ toggleGroup({ dispatch, rootGetters }, { group, expanded }) {
1554
+ const groups = rootGetters['prefs/get'](EXPANDED_GROUPS);
1555
+
1556
+ if ( expanded ) {
1557
+ addObject(groups, group);
1558
+ } else {
1559
+ removeObject(groups, group);
1560
+ }
1561
+
1562
+ dispatch('prefs/set', { key: EXPANDED_GROUPS, value: groups }, { root: true });
1563
+ },
1564
+
1565
+ configureType({ commit }, options) {
1566
+ commit('configureType', options);
1567
+ }
1568
+ };
1569
+
1570
+ function _sortGroup(tree, mode) {
1571
+ const by = ['weight:desc', 'namespaced', 'label'];
1572
+
1573
+ tree.children = sortBy(tree.children, by);
1574
+
1575
+ for (const entry of tree.children ) {
1576
+ if ( entry.children ) {
1577
+ _sortGroup(entry, mode);
1578
+ }
1579
+ }
1580
+ }
1581
+
1582
+ function _matchingCounts(typeObj, namespaces) {
1583
+ // That was easy
1584
+ if ( !typeObj.namespaced || !typeObj.byNamespace || namespaces === null || typeObj.count === null) {
1585
+ return typeObj.count;
1586
+ }
1587
+
1588
+ let out = 0;
1589
+
1590
+ // Otherwise start with 0 and count up
1591
+ for ( const namespace of namespaces ) {
1592
+ out += typeObj.byNamespace[namespace]?.count || 0;
1593
+ }
1594
+
1595
+ return out;
1596
+ }
1597
+
1598
+ function _applyMapping(objOrValue, mappings, keyField, cache, defaultFn) {
1599
+ let key = objOrValue;
1600
+ let found = false;
1601
+
1602
+ if ( keyField ) {
1603
+ if ( typeof objOrValue !== 'object' ) {
1604
+ return objOrValue;
1605
+ }
1606
+
1607
+ key = get(objOrValue, keyField);
1608
+
1609
+ if ( typeof key !== 'string' ) {
1610
+ return null;
1611
+ }
1612
+ }
1613
+
1614
+ if ( key && cache && cache[key] ) {
1615
+ return cache[key];
1616
+ }
1617
+
1618
+ let out = `${ key }`;
1619
+
1620
+ for ( const rule of mappings ) {
1621
+ const re = stringToRegex(rule.match);
1622
+ const captured = out.match(re);
1623
+
1624
+ if ( captured && rule.replace ) {
1625
+ out = out.replace(re, rule.replace);
1626
+
1627
+ found = true;
1628
+ if ( !rule.continueOnMatch ) {
1629
+ break;
1630
+ }
1631
+ }
1632
+ }
1633
+
1634
+ if ( !found && defaultFn ) {
1635
+ out = defaultFn(out, objOrValue);
1636
+ }
1637
+
1638
+ if ( cache ) {
1639
+ cache[key] = out;
1640
+ }
1641
+
1642
+ return out;
1643
+ }
1644
+
1645
+ function _addMapping(mappings, match, replace, weight, continueOnMatch) {
1646
+ match = regexToString(ensureRegex(match));
1647
+
1648
+ mappings.push({
1649
+ match,
1650
+ replace,
1651
+ weight,
1652
+ continueOnMatch,
1653
+ insertIndex: mappings.length,
1654
+ });
1655
+
1656
+ // Re-sort the list by weight (highest first) and insert time (oldest first)
1657
+ mappings.sort((a, b) => {
1658
+ const pri = b.weight - a.weight;
1659
+
1660
+ if ( pri ) {
1661
+ return pri;
1662
+ }
1663
+
1664
+ return a.insertIndex - b.insertIndex;
1665
+ });
1666
+ }
1667
+
1668
+ // Regexes can't be represented in state because they don't serialize to JSON..
1669
+ const regexCache = {};
1670
+
1671
+ function regexToString(regex) {
1672
+ return regex.source;
1673
+ }
1674
+
1675
+ function stringToRegex(str) {
1676
+ let out = regexCache[str];
1677
+
1678
+ if ( !out ) {
1679
+ out = new RegExp(str);
1680
+ regexCache[str] = out;
1681
+ }
1682
+
1683
+ return out;
1684
+ }
1685
+
1686
+ function ifHave(getters, option) {
1687
+ switch (option) {
1688
+ case IF_HAVE.V2_MONITORING: {
1689
+ return haveV2Monitoring(getters);
1690
+ }
1691
+ case IF_HAVE.V1_MONITORING: {
1692
+ return haveV1Monitoring(getters);
1693
+ }
1694
+ case IF_HAVE.PROJECT: {
1695
+ return !!project(getters);
1696
+ }
1697
+ case IF_HAVE.NO_PROJECT: {
1698
+ return !project(getters);
1699
+ }
1700
+ case IF_HAVE.NOT_V1_ISTIO: {
1701
+ return !isV1Istio(getters);
1702
+ }
1703
+ case IF_HAVE.MULTI_CLUSTER: {
1704
+ return getters.isMultiCluster;
1705
+ }
1706
+ case IF_HAVE.HARVESTER_SINGLE_CLUSTER: {
1707
+ return getters.isSingleVirtualCluster;
1708
+ }
1709
+ case IF_HAVE.NEUVECTOR_NAMESPACE: {
1710
+ return getters[`cluster/all`](NAMESPACE).find(n => n.metadata.name === NEU_VECTOR_NAMESPACE);
1711
+ }
1712
+ default:
1713
+ return false;
1714
+ }
1715
+ }
1716
+
1717
+ // Is V1 Istio installed?
1718
+ function isV1Istio(getters) {
1719
+ const cluster = getters['currentCluster'];
1720
+
1721
+ return !!cluster?.status?.istioEnabled;
1722
+ }
1723
+
1724
+ function ifHaveVerb(rootGetters, module, verb, haveIds) {
1725
+ for ( const haveId of haveIds ) {
1726
+ const schema = rootGetters[`${ module }/schemaFor`](haveId);
1727
+ const want = verb.toLowerCase();
1728
+ const collectionMethods = schema.collectionMethods || [];
1729
+ const resourceMethods = schema.resourceMethods || [];
1730
+ const have = [...collectionMethods, ...resourceMethods].map(x => x.toLowerCase());
1731
+
1732
+ if ( !have.includes(want) && !have.includes(`blocked-${ want }`) ) {
1733
+ return false;
1734
+ }
1735
+ }
1736
+
1737
+ return true;
1738
+ }
1739
+
1740
+ // Look at the namespace filters to determine if a project is selected
1741
+ export function project(getters) {
1742
+ const clusterId = getters['currentCluster']?.id;
1743
+
1744
+ if ( !clusterId ) {
1745
+ return null;
1746
+ }
1747
+
1748
+ const filters = getters['namespaceFilters'];
1749
+ const namespaces = [];
1750
+ let projectName = null;
1751
+
1752
+ for (const filter of filters) {
1753
+ const [type, id] = filter.split('://', 2);
1754
+
1755
+ if (type === 'project') {
1756
+ if (projectName !== null) {
1757
+ // More than one project selected
1758
+ return null;
1759
+ }
1760
+ projectName = id;
1761
+ } else if (type === 'ns') {
1762
+ namespaces.push(id);
1763
+ } else {
1764
+ // Something other than project or namespace
1765
+ return null;
1766
+ }
1767
+ }
1768
+
1769
+ // No project found?
1770
+ if (!projectName) {
1771
+ return null;
1772
+ }
1773
+
1774
+ // We have one project and a set of namespaces
1775
+ // Check that all of the namespaces belong to the project
1776
+ const project = getters['management/byId'](MANAGEMENT.PROJECT, `${ clusterId }/${ projectName }`);
1777
+
1778
+ // No additional namespaces means just the project is selected
1779
+ if (namespaces.length === 0) {
1780
+ return project;
1781
+ }
1782
+
1783
+ // Convert the project namespaces into a map so we can check existence easily
1784
+ const prjNamespaceMap = project.namespaces.reduce((m, ns) => {
1785
+ m[ns.metadata.name] = true;
1786
+
1787
+ return m;
1788
+ }, {});
1789
+
1790
+ // All of the namespace filters must belong to the project
1791
+ const found = namespaces.reduce((total, ns) => {
1792
+ return prjNamespaceMap[ns] ? total + 1 : 0;
1793
+ }, 0);
1794
+
1795
+ if (found !== namespaces.length) {
1796
+ return null;
1797
+ }
1798
+
1799
+ return project;
1800
+ }
1801
+
1802
+ function hasCustom(state, rootState, kind, key, fallback) {
1803
+ const cache = state.cache[kind];
1804
+
1805
+ if ( cache[key] !== undefined ) {
1806
+ return cache[key];
1807
+ }
1808
+
1809
+ // Check to see if the custom kind is provided by a plugin
1810
+ if (!!rootState.$plugin.getDynamic(kind, key)) {
1811
+ cache[key] = true;
1812
+
1813
+ return cache[key];
1814
+ }
1815
+
1816
+ // Fallback
1817
+ try {
1818
+ fallback(key);
1819
+ cache[key] = true;
1820
+ } catch (e) {
1821
+ cache[key] = false;
1822
+ }
1823
+
1824
+ return cache[key];
1825
+ }
1826
+
1827
+ function loadExtension(rootState, kind, key, fallback) {
1828
+ const ext = rootState.$plugin.getDynamic(kind, key);
1829
+
1830
+ if (ext) {
1831
+ if (typeof ext === 'function') {
1832
+ return ext;
1833
+ }
1834
+
1835
+ return () => ext;
1836
+ }
1837
+
1838
+ return fallback(key);
1839
+ }