dashboard-shell-shell 1.0.111

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 (1603) hide show
  1. package/assets/brand/csp/dark/rancher-logo.svg +148 -0
  2. package/assets/brand/csp/favicon.png +0 -0
  3. package/assets/brand/csp/metadata.json +3 -0
  4. package/assets/brand/csp/rancher-logo.svg +130 -0
  5. package/assets/brand/federal/dark/rancher-logo.svg +104 -0
  6. package/assets/brand/federal/metadata.json +3 -0
  7. package/assets/brand/federal/rancher-logo.svg +1 -0
  8. package/assets/brand/harvester/favicon.png +0 -0
  9. package/assets/brand/harvester/metadata.json +3 -0
  10. package/assets/brand/rgs/dark/rancher-logo.svg +1 -0
  11. package/assets/brand/rgs/metadata.json +3 -0
  12. package/assets/brand/rgs/rancher-logo.svg +1 -0
  13. package/assets/brand/suse/dark/rancher-logo.svg +1 -0
  14. package/assets/brand/suse/favicon.png +0 -0
  15. package/assets/brand/suse/metadata.json +3 -0
  16. package/assets/brand/suse/rancher-logo.svg +1 -0
  17. package/assets/data/aws-regions.json +39 -0
  18. package/assets/data/ec2-instance-groups.json +85 -0
  19. package/assets/fonts/lato/lato-v17-latin-700.woff +0 -0
  20. package/assets/fonts/lato/lato-v17-latin-700.woff2 +0 -0
  21. package/assets/fonts/lato/lato-v17-latin-regular.woff +0 -0
  22. package/assets/fonts/lato/lato-v17-latin-regular.woff2 +0 -0
  23. package/assets/fonts/poppins/poppins-v15-latin-300.woff +0 -0
  24. package/assets/fonts/poppins/poppins-v15-latin-300.woff2 +0 -0
  25. package/assets/fonts/poppins/poppins-v15-latin-500.woff +0 -0
  26. package/assets/fonts/poppins/poppins-v15-latin-500.woff2 +0 -0
  27. package/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff +0 -0
  28. package/assets/fonts/roboto-mono/roboto-mono-v13-latin-regular.woff2 +0 -0
  29. package/assets/images/featured/img1.jpg +0 -0
  30. package/assets/images/featured.jpg +0 -0
  31. package/assets/images/field-valid.svg +16 -0
  32. package/assets/images/generic-catalog.svg +15 -0
  33. package/assets/images/generic-driver.svg +17 -0
  34. package/assets/images/generic-plugin.svg +1 -0
  35. package/assets/images/pl/README.md +13 -0
  36. package/assets/images/pl/banner.svg +241 -0
  37. package/assets/images/pl/dark/banner.svg +242 -0
  38. package/assets/images/pl/dark/login-landscape.svg +291 -0
  39. package/assets/images/pl/dark/rancher-logo.svg +51 -0
  40. package/assets/images/pl/decoration-cloud-big-white.svg +1 -0
  41. package/assets/images/pl/decoration-ground.svg +1 -0
  42. package/assets/images/pl/error-desert-landscape.svg +217 -0
  43. package/assets/images/pl/half-logo.svg +23 -0
  44. package/assets/images/pl/harvester.png +0 -0
  45. package/assets/images/pl/harvester.svg +1 -0
  46. package/assets/images/pl/login-landscape.svg +496 -0
  47. package/assets/images/pl/rancher-logo.svg +51 -0
  48. package/assets/images/pl/setup-step-one.svg +612 -0
  49. package/assets/images/pl/sunglasses.svg +20 -0
  50. package/assets/images/providers/aliyun-black.svg +14 -0
  51. package/assets/images/providers/aliyun.svg +17 -0
  52. package/assets/images/providers/aliyunecs-black.svg +13 -0
  53. package/assets/images/providers/aliyunecs.svg +21 -0
  54. package/assets/images/providers/amazonec2-black.svg +8 -0
  55. package/assets/images/providers/amazonec2.svg +19 -0
  56. package/assets/images/providers/amazoneks-black.svg +10 -0
  57. package/assets/images/providers/amazoneks.svg +14 -0
  58. package/assets/images/providers/aws.svg +38 -0
  59. package/assets/images/providers/azure-black.svg +29 -0
  60. package/assets/images/providers/azure.svg +32 -0
  61. package/assets/images/providers/azuread-black.svg +22 -0
  62. package/assets/images/providers/azuread.svg +25 -0
  63. package/assets/images/providers/azureaks-black.svg +28 -0
  64. package/assets/images/providers/azureaks.svg +31 -0
  65. package/assets/images/providers/baidu-black.svg +19 -0
  66. package/assets/images/providers/baidu.svg +25 -0
  67. package/assets/images/providers/cloudca-black.svg +45 -0
  68. package/assets/images/providers/cloudca.svg +49 -0
  69. package/assets/images/providers/cloudscale-black.svg +24 -0
  70. package/assets/images/providers/cloudscale.svg +28 -0
  71. package/assets/images/providers/custom.svg +85 -0
  72. package/assets/images/providers/digitalocean-black.svg +21 -0
  73. package/assets/images/providers/digitalocean.svg +24 -0
  74. package/assets/images/providers/equinix-black.svg +13 -0
  75. package/assets/images/providers/equinix.svg +13 -0
  76. package/assets/images/providers/exoscale.svg +1 -0
  77. package/assets/images/providers/gcp.svg +6 -0
  78. package/assets/images/providers/gke-black.svg +10 -0
  79. package/assets/images/providers/gke.svg +28 -0
  80. package/assets/images/providers/google.svg +29 -0
  81. package/assets/images/providers/googlegke-black.svg +10 -0
  82. package/assets/images/providers/googlegke.svg +28 -0
  83. package/assets/images/providers/harvester.svg +1 -0
  84. package/assets/images/providers/huaweicce-black.svg +109 -0
  85. package/assets/images/providers/huaweicce.svg +184 -0
  86. package/assets/images/providers/import.svg +99 -0
  87. package/assets/images/providers/k3s-black.svg +10 -0
  88. package/assets/images/providers/k3s.svg +15 -0
  89. package/assets/images/providers/kubernetes-black.svg +37 -0
  90. package/assets/images/providers/kubernetes.svg +99 -0
  91. package/assets/images/providers/linode.svg +54 -0
  92. package/assets/images/providers/linodelke-black.svg +40 -0
  93. package/assets/images/providers/linodelke.svg +54 -0
  94. package/assets/images/providers/local-cluster.svg +20 -0
  95. package/assets/images/providers/minikube-black.svg +25 -0
  96. package/assets/images/providers/minikube.svg +36 -0
  97. package/assets/images/providers/nutanix.svg +12 -0
  98. package/assets/images/providers/oci-black.svg +41 -0
  99. package/assets/images/providers/oci.svg +44 -0
  100. package/assets/images/providers/openstack-black.svg +16 -0
  101. package/assets/images/providers/openstack.svg +20 -0
  102. package/assets/images/providers/oracle.svg +66 -0
  103. package/assets/images/providers/oracleoke-black.svg +51 -0
  104. package/assets/images/providers/oracleoke.svg +55 -0
  105. package/assets/images/providers/otc-black.svg +15 -0
  106. package/assets/images/providers/otc.svg +33 -0
  107. package/assets/images/providers/otccce.svg +33 -0
  108. package/assets/images/providers/outscale.svg +19 -0
  109. package/assets/images/providers/ovhcloudmks.svg +122 -0
  110. package/assets/images/providers/ovhcloudpubliccloud.svg +122 -0
  111. package/assets/images/providers/packet-black.svg +15 -0
  112. package/assets/images/providers/packet.svg +16 -0
  113. package/assets/images/providers/pinganyunecs-black.svg +26 -0
  114. package/assets/images/providers/pinganyunecs.svg +26 -0
  115. package/assets/images/providers/pnap-black.svg +43 -0
  116. package/assets/images/providers/pnap.svg +48 -0
  117. package/assets/images/providers/rackspace-black.svg +14 -0
  118. package/assets/images/providers/rackspace.svg +18 -0
  119. package/assets/images/providers/rke.svg +26 -0
  120. package/assets/images/providers/rke2.svg +26 -0
  121. package/assets/images/providers/softlayer.svg +27 -0
  122. package/assets/images/providers/tencenttke-black.svg +22 -0
  123. package/assets/images/providers/tencenttke.svg +39 -0
  124. package/assets/images/providers/vmwarevsphere-black.svg +60 -0
  125. package/assets/images/providers/vmwarevsphere.svg +51 -0
  126. package/assets/images/vendor/activedirectory.svg +20 -0
  127. package/assets/images/vendor/adfs.svg +19 -0
  128. package/assets/images/vendor/azuread.svg +18 -0
  129. package/assets/images/vendor/custom.svg +42 -0
  130. package/assets/images/vendor/email.svg +22 -0
  131. package/assets/images/vendor/freeipa.svg +26 -0
  132. package/assets/images/vendor/github.svg +13 -0
  133. package/assets/images/vendor/googleoauth.svg +9 -0
  134. package/assets/images/vendor/grafana.svg +48 -0
  135. package/assets/images/vendor/jaeger.svg +1 -0
  136. package/assets/images/vendor/keycloak.svg +30 -0
  137. package/assets/images/vendor/kiali.svg +23 -0
  138. package/assets/images/vendor/linux.svg +23 -0
  139. package/assets/images/vendor/longhorn.svg +25 -0
  140. package/assets/images/vendor/neuvector.svg +1 -0
  141. package/assets/images/vendor/okta.svg +31 -0
  142. package/assets/images/vendor/openid.svg +18 -0
  143. package/assets/images/vendor/openldap.svg +34 -0
  144. package/assets/images/vendor/pagerduty.svg +26 -0
  145. package/assets/images/vendor/ping.svg +58 -0
  146. package/assets/images/vendor/prometheus.svg +14 -0
  147. package/assets/images/vendor/shibboleth.svg +481 -0
  148. package/assets/images/vendor/slack.svg +38 -0
  149. package/assets/images/vendor/webhook.svg +23 -0
  150. package/assets/images/vendor/windows.svg +13 -0
  151. package/assets/images/wechat-qr-code.jpg +0 -0
  152. package/assets/styles/app.scss +34 -0
  153. package/assets/styles/base/_basic.scss +146 -0
  154. package/assets/styles/base/_color.scss +11 -0
  155. package/assets/styles/base/_functions.scss +134 -0
  156. package/assets/styles/base/_helpers.scss +267 -0
  157. package/assets/styles/base/_mixins.scss +163 -0
  158. package/assets/styles/base/_typography.scss +69 -0
  159. package/assets/styles/base/_variables.scss +70 -0
  160. package/assets/styles/fonts/_dots.scss +18 -0
  161. package/assets/styles/fonts/_fontstack.scss +49 -0
  162. package/assets/styles/fonts/_icons.scss +101 -0
  163. package/assets/styles/fonts/_zerowidthspace.scss +8 -0
  164. package/assets/styles/global/_button.scss +222 -0
  165. package/assets/styles/global/_cards.scss +94 -0
  166. package/assets/styles/global/_columns.scss +126 -0
  167. package/assets/styles/global/_form.scss +146 -0
  168. package/assets/styles/global/_gauges.scss +55 -0
  169. package/assets/styles/global/_labeled-input.scss +140 -0
  170. package/assets/styles/global/_layout.scss +165 -0
  171. package/assets/styles/global/_resource.scss +89 -0
  172. package/assets/styles/global/_select.scss +193 -0
  173. package/assets/styles/global/_table.scss +106 -0
  174. package/assets/styles/global/_tooltip.scss +165 -0
  175. package/assets/styles/themes/_csp.scss +25 -0
  176. package/assets/styles/themes/_dark.scss +232 -0
  177. package/assets/styles/themes/_light.scss +556 -0
  178. package/assets/styles/themes/_suse.scss +26 -0
  179. package/assets/styles/vendor/_code-mirror.scss +3 -0
  180. package/assets/styles/vendor/normalize.scss +349 -0
  181. package/assets/styles/vendor/vue-select.scss +391 -0
  182. package/assets/translations/en-us.yaml +8103 -0
  183. package/assets/translations/zh-hans.yaml +7678 -0
  184. package/babel.config.js +35 -0
  185. package/chart/__tests__/S3.test.ts +64 -0
  186. package/chart/example.vue +18 -0
  187. package/chart/gatekeeper.vue +69 -0
  188. package/chart/istio.vue +284 -0
  189. package/chart/logging/index.vue +84 -0
  190. package/chart/monitoring/ClusterSelector.vue +215 -0
  191. package/chart/monitoring/StorageClassSelector.vue +49 -0
  192. package/chart/monitoring/alerting/index.vue +188 -0
  193. package/chart/monitoring/grafana/index.vue +378 -0
  194. package/chart/monitoring/index.vue +364 -0
  195. package/chart/monitoring/prometheus/index.vue +373 -0
  196. package/chart/rancher-backup/S3.vue +190 -0
  197. package/chart/rancher-backup/index.vue +260 -0
  198. package/cloud-credential/__tests__/azure.test.ts +43 -0
  199. package/cloud-credential/__tests__/harvester.test.ts +18 -0
  200. package/cloud-credential/aws.vue +109 -0
  201. package/cloud-credential/azure.vue +132 -0
  202. package/cloud-credential/digitalocean.vue +55 -0
  203. package/cloud-credential/gcp.vue +82 -0
  204. package/cloud-credential/generic.vue +100 -0
  205. package/cloud-credential/harvester.vue +125 -0
  206. package/cloud-credential/linode.vue +58 -0
  207. package/cloud-credential/pnap.vue +92 -0
  208. package/cloud-credential/s3.vue +143 -0
  209. package/cloud-credential/vmwarevsphere.vue +109 -0
  210. package/components/ActionDropdown.vue +248 -0
  211. package/components/ActionMenu.vue +366 -0
  212. package/components/ActionMenuShell.vue +105 -0
  213. package/components/AdvancedSection.vue +40 -0
  214. package/components/Alert.vue +55 -0
  215. package/components/AlertTable.vue +123 -0
  216. package/components/AppModal.vue +231 -0
  217. package/components/AssignTo.vue +185 -0
  218. package/components/AsyncButton.vue +315 -0
  219. package/components/AwsComplianceBanner.vue +47 -0
  220. package/components/BackLink.vue +44 -0
  221. package/components/BannerGraphic.vue +94 -0
  222. package/components/BrandImage.vue +135 -0
  223. package/components/ButtonDropdown.vue +318 -0
  224. package/components/ButtonGroup.vue +120 -0
  225. package/components/ButtonMultiAction.vue +51 -0
  226. package/components/Carousel.vue +397 -0
  227. package/components/Certificates.vue +161 -0
  228. package/components/ChartHeading.vue +25 -0
  229. package/components/ChartReadme.vue +100 -0
  230. package/components/ClusterBadge.vue +48 -0
  231. package/components/ClusterIconMenu.vue +189 -0
  232. package/components/ClusterProviderIcon.vue +131 -0
  233. package/components/CodeMirror.vue +488 -0
  234. package/components/Collapse.vue +87 -0
  235. package/components/CollapsibleCard.vue +121 -0
  236. package/components/CommunityLinks.vue +216 -0
  237. package/components/CompoundStatusBadge.vue +53 -0
  238. package/components/ConsumptionGauge.vue +148 -0
  239. package/components/ContainerResourceLimit.vue +254 -0
  240. package/components/CopyCode.vue +74 -0
  241. package/components/CopyToClipboard.vue +44 -0
  242. package/components/CopyToClipboardText.vue +82 -0
  243. package/components/CountBox.vue +114 -0
  244. package/components/CountGauge.vue +180 -0
  245. package/components/CreateDriver.vue +81 -0
  246. package/components/CruResource.vue +931 -0
  247. package/components/CruResourceFooter.vue +127 -0
  248. package/components/DashboardMetrics.vue +125 -0
  249. package/components/DashboardOptions.vue +147 -0
  250. package/components/DetailText.vue +215 -0
  251. package/components/DetailTop.vue +374 -0
  252. package/components/Dialog.vue +136 -0
  253. package/components/DisableAuthProviderModal.vue +114 -0
  254. package/components/DraggableZone.vue +181 -0
  255. package/components/EmberPage.vue +622 -0
  256. package/components/EmberPageView.vue +39 -0
  257. package/components/EtcdInfoBanner.vue +76 -0
  258. package/components/ExplorerMembers.vue +453 -0
  259. package/components/ExplorerProjectsNamespaces.vue +612 -0
  260. package/components/ExtensionPanel.vue +42 -0
  261. package/components/FileDiff.vue +184 -0
  262. package/components/FixedBanner.vue +277 -0
  263. package/components/Flag.vue +83 -0
  264. package/components/Glance.vue +79 -0
  265. package/components/GlobalRoleBindings.vue +425 -0
  266. package/components/GradientBox.vue +82 -0
  267. package/components/GrafanaDashboard.vue +321 -0
  268. package/components/GroupPanel.vue +57 -0
  269. package/components/GrowlManager.vue +212 -0
  270. package/components/HardwareResourceGauge.vue +170 -0
  271. package/components/HarvesterServiceAddOnConfig.vue +207 -0
  272. package/components/IconMessage.vue +101 -0
  273. package/components/IconOrSvg.vue +184 -0
  274. package/components/Import.vue +260 -0
  275. package/components/Inactivity.vue +236 -0
  276. package/components/IndentedPanel.vue +26 -0
  277. package/components/InfoBox.vue +84 -0
  278. package/components/InputOrDisplay.vue +65 -0
  279. package/components/KeyValueView.vue +283 -0
  280. package/components/LabelValue.vue +42 -0
  281. package/components/LandingPagePreference.vue +152 -0
  282. package/components/LazyImage.vue +70 -0
  283. package/components/Loading.vue +85 -0
  284. package/components/LocaleSelector.vue +175 -0
  285. package/components/LogItem.vue +69 -0
  286. package/components/Markdown.vue +138 -0
  287. package/components/MessageLink.vue +79 -0
  288. package/components/ModalWithCard.vue +137 -0
  289. package/components/MoveModal.vue +166 -0
  290. package/components/PaginatedResourceTable.vue +133 -0
  291. package/components/PercentageBar.vue +127 -0
  292. package/components/PodSecurityAdmission.vue +306 -0
  293. package/components/ProgressBarMulti.vue +173 -0
  294. package/components/PromptChangePassword.vue +123 -0
  295. package/components/PromptModal.vue +109 -0
  296. package/components/PromptRemove.vue +471 -0
  297. package/components/PromptRestore.vue +327 -0
  298. package/components/Questions/Array.vue +38 -0
  299. package/components/Questions/Boolean.vue +37 -0
  300. package/components/Questions/CloudCredential.vue +54 -0
  301. package/components/Questions/Enum.vue +53 -0
  302. package/components/Questions/Float.vue +41 -0
  303. package/components/Questions/Int.vue +41 -0
  304. package/components/Questions/Question.js +145 -0
  305. package/components/Questions/QuestionMap.vue +45 -0
  306. package/components/Questions/Radio.vue +35 -0
  307. package/components/Questions/Reference.vue +167 -0
  308. package/components/Questions/String.vue +51 -0
  309. package/components/Questions/Yaml.vue +48 -0
  310. package/components/Questions/__tests__/Boolean.test.ts +125 -0
  311. package/components/Questions/__tests__/Float.test.ts +125 -0
  312. package/components/Questions/__tests__/Int.test.ts +125 -0
  313. package/components/Questions/__tests__/String.test.ts +125 -0
  314. package/components/Questions/__tests__/Yaml.test.ts +125 -0
  315. package/components/Questions/__tests__/utils/questions-defaults.ts +20 -0
  316. package/components/Questions/index.vue +522 -0
  317. package/components/Random.vue +100 -0
  318. package/components/RelatedResources.vue +187 -0
  319. package/components/ResourceCancelModal.vue +127 -0
  320. package/components/ResourceDetail/Masthead.vue +692 -0
  321. package/components/ResourceDetail/__tests__/Masthead.test.ts +61 -0
  322. package/components/ResourceDetail/index.vue +534 -0
  323. package/components/ResourceList/Masthead.vue +246 -0
  324. package/components/ResourceList/ResourceLoadingIndicator.vue +137 -0
  325. package/components/ResourceList/index.vue +306 -0
  326. package/components/ResourceList/resource-list.config.js +7 -0
  327. package/components/ResourceSummary.vue +173 -0
  328. package/components/ResourceTable.vue +661 -0
  329. package/components/ResourceYaml.vue +403 -0
  330. package/components/RoleBindings.vue +470 -0
  331. package/components/SelectIconGrid.vue +414 -0
  332. package/components/Setting.vue +115 -0
  333. package/components/SideNav.vue +568 -0
  334. package/components/SimpleBox.vue +121 -0
  335. package/components/SingleClusterInfo.vue +199 -0
  336. package/components/SortableTable/THead.vue +526 -0
  337. package/components/SortableTable/actions.js +153 -0
  338. package/components/SortableTable/advanced-filtering.js +272 -0
  339. package/components/SortableTable/debug.js +117 -0
  340. package/components/SortableTable/filtering.js +290 -0
  341. package/components/SortableTable/grouping.js +48 -0
  342. package/components/SortableTable/index.vue +2089 -0
  343. package/components/SortableTable/paging.js +147 -0
  344. package/components/SortableTable/selection.js +640 -0
  345. package/components/SortableTable/sortable-config.ts +4 -0
  346. package/components/SortableTable/sorting.js +129 -0
  347. package/components/StatusTable.vue +61 -0
  348. package/components/TabTitle.vue +78 -0
  349. package/components/Tabbed/Tab.vue +129 -0
  350. package/components/Tabbed/index.vue +569 -0
  351. package/components/TableDataUserIcon.vue +47 -0
  352. package/components/TableSparkLine.vue +108 -0
  353. package/components/Tag.vue +19 -0
  354. package/components/Tip.vue +43 -0
  355. package/components/TypeDescription.vue +65 -0
  356. package/components/Wizard.vue +704 -0
  357. package/components/YamlEditor.vue +296 -0
  358. package/components/__tests__/AppModal.test.ts +106 -0
  359. package/components/__tests__/ApplicationCard.test.ts +27 -0
  360. package/components/__tests__/AsyncButton.test.ts +148 -0
  361. package/components/__tests__/BackLink.test.ts +33 -0
  362. package/components/__tests__/ButtonGroup.test.ts +121 -0
  363. package/components/__tests__/ButtonMultiAction.test.ts +31 -0
  364. package/components/__tests__/Carousel.test.ts +72 -0
  365. package/components/__tests__/Certificates.test.ts +31 -0
  366. package/components/__tests__/ClusterBadge.test.ts +32 -0
  367. package/components/__tests__/CodeMirror.test.ts +93 -0
  368. package/components/__tests__/Collapse.test.ts +44 -0
  369. package/components/__tests__/CollapsibleCard.test.ts +64 -0
  370. package/components/__tests__/ConsumptionGauge.test.ts +88 -0
  371. package/components/__tests__/ContainerResourceLimit.test.ts +35 -0
  372. package/components/__tests__/CopyCode.test.ts +16 -0
  373. package/components/__tests__/CruResource.test.ts +155 -0
  374. package/components/__tests__/EtcdInfoBanner.test.ts +39 -0
  375. package/components/__tests__/FixedBanner.test.ts +114 -0
  376. package/components/__tests__/GrowlManager.test.ts +146 -0
  377. package/components/__tests__/NamespaceFilter.test.ts +247 -0
  378. package/components/__tests__/PercentageBar.test.ts +32 -0
  379. package/components/__tests__/PodSecurityAdmission.test.ts +440 -0
  380. package/components/__tests__/ProjectRow.test.ts +59 -0
  381. package/components/__tests__/PromptRestore.test.ts +139 -0
  382. package/components/__tests__/SimpleBox.spec.ts +28 -0
  383. package/components/__tests__/TabTitle.test.ts +136 -0
  384. package/components/auth/AllowedPrincipals.vue +122 -0
  385. package/components/auth/AuthBanner.vue +104 -0
  386. package/components/auth/AzureWarning.vue +77 -0
  387. package/components/auth/Principal.vue +212 -0
  388. package/components/auth/RoleDetailEdit.vue +808 -0
  389. package/components/auth/SelectPrincipal.vue +260 -0
  390. package/components/auth/__tests__/Principal.test.ts +40 -0
  391. package/components/auth/__tests__/RoleDetailEdit.test.ts +83 -0
  392. package/components/auth/login/github.vue +23 -0
  393. package/components/auth/login/ldap.vue +106 -0
  394. package/components/auth/login/oauth.vue +26 -0
  395. package/components/auth/login/oidc.vue +32 -0
  396. package/components/auth/login/saml.vue +39 -0
  397. package/components/cards/ApplicationCard.vue +145 -0
  398. package/components/fleet/FleetBundleResources.vue +86 -0
  399. package/components/fleet/FleetBundles.vue +136 -0
  400. package/components/fleet/FleetClusters.vue +208 -0
  401. package/components/fleet/FleetIntro.vue +65 -0
  402. package/components/fleet/FleetNoWorkspaces.vue +62 -0
  403. package/components/fleet/FleetRepos.vue +184 -0
  404. package/components/fleet/FleetResources.vue +83 -0
  405. package/components/fleet/FleetStatus.vue +301 -0
  406. package/components/fleet/FleetSummary.vue +210 -0
  407. package/components/fleet/ForceDirectedTreeChart/chartIcons.js +17 -0
  408. package/components/fleet/ForceDirectedTreeChart/index.vue +565 -0
  409. package/components/fleet/ResourcesSummary.vue +93 -0
  410. package/components/fleet/__tests__/FleetSummary.test.ts +362 -0
  411. package/components/form/ArrayList.vue +418 -0
  412. package/components/form/ArrayListGrouped.vue +141 -0
  413. package/components/form/ArrayListSelect.vue +103 -0
  414. package/components/form/BannerSettings.vue +220 -0
  415. package/components/form/ChangePassword.vue +461 -0
  416. package/components/form/ClusterAppearance.vue +132 -0
  417. package/components/form/ColorInput.vue +200 -0
  418. package/components/form/Command.vue +213 -0
  419. package/components/form/Conditions.vue +93 -0
  420. package/components/form/EnvVars.vue +154 -0
  421. package/components/form/Error.vue +66 -0
  422. package/components/form/FileImageSelector.vue +140 -0
  423. package/components/form/FileSelector.vue +169 -0
  424. package/components/form/Footer.vue +116 -0
  425. package/components/form/GitPicker.vue +590 -0
  426. package/components/form/HealthCheck.vue +86 -0
  427. package/components/form/HookOption.vue +258 -0
  428. package/components/form/InputWithSelect.vue +329 -0
  429. package/components/form/KeyValue.vue +962 -0
  430. package/components/form/LabeledSelect.vue +723 -0
  431. package/components/form/Labels.vue +151 -0
  432. package/components/form/LifecycleHooks.vue +87 -0
  433. package/components/form/MatchExpressions.vue +446 -0
  434. package/components/form/Members/ClusterMembershipEditor.vue +61 -0
  435. package/components/form/Members/ClusterPermissionsEditor.vue +314 -0
  436. package/components/form/Members/MembershipEditor.vue +230 -0
  437. package/components/form/Members/ProjectMembershipEditor.vue +63 -0
  438. package/components/form/Members/__tests__/MembershipEditor.test.ts +62 -0
  439. package/components/form/NameNsDescription.vue +554 -0
  440. package/components/form/Networking.vue +273 -0
  441. package/components/form/NodeAffinity.vue +250 -0
  442. package/components/form/NodeScheduling.vue +202 -0
  443. package/components/form/NotificationSettings.vue +71 -0
  444. package/components/form/Password.vue +185 -0
  445. package/components/form/PlusMinus.vue +109 -0
  446. package/components/form/PodAffinity.vue +497 -0
  447. package/components/form/Ports.vue +310 -0
  448. package/components/form/Probe.vue +374 -0
  449. package/components/form/ProjectMemberEditor.vue +342 -0
  450. package/components/form/ResourceLabeledSelect.vue +154 -0
  451. package/components/form/ResourceQuota/Namespace.vue +117 -0
  452. package/components/form/ResourceQuota/NamespaceRow.vue +220 -0
  453. package/components/form/ResourceQuota/Project.vue +103 -0
  454. package/components/form/ResourceQuota/ProjectRow.vue +115 -0
  455. package/components/form/ResourceQuota/shared.js +147 -0
  456. package/components/form/ResourceSelector.vue +146 -0
  457. package/components/form/ResourceTabs/index.vue +292 -0
  458. package/components/form/RuleSelector.vue +184 -0
  459. package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +193 -0
  460. package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +104 -0
  461. package/components/form/SSHKnownHosts/index.vue +101 -0
  462. package/components/form/SchedulingCustomization.vue +85 -0
  463. package/components/form/SecretSelector.vue +269 -0
  464. package/components/form/Security.vue +247 -0
  465. package/components/form/Select.vue +370 -0
  466. package/components/form/SelectOrCreateAuthSecret.vue +693 -0
  467. package/components/form/ServiceNameSelect.vue +168 -0
  468. package/components/form/ServicePorts.vue +340 -0
  469. package/components/form/ShellInput.vue +91 -0
  470. package/components/form/SimpleSecretSelector.vue +258 -0
  471. package/components/form/Taints.vue +98 -0
  472. package/components/form/Tolerations.vue +315 -0
  473. package/components/form/UnitInput.vue +257 -0
  474. package/components/form/ValueFromResource.vue +394 -0
  475. package/components/form/WorkloadPorts.vue +514 -0
  476. package/components/form/__tests__/ArrayList.test.ts +124 -0
  477. package/components/form/__tests__/ArrayListGrouped.test.ts +41 -0
  478. package/components/form/__tests__/BannerSettings.test.ts +54 -0
  479. package/components/form/__tests__/ColorInput.test.ts +27 -0
  480. package/components/form/__tests__/Command.test.ts +64 -0
  481. package/components/form/__tests__/Error.test.ts +56 -0
  482. package/components/form/__tests__/FileImageSelector.test.ts +42 -0
  483. package/components/form/__tests__/FileSelector.test.ts +76 -0
  484. package/components/form/__tests__/HookOption.test.ts +28 -0
  485. package/components/form/__tests__/InputWithSelect.test.ts +42 -0
  486. package/components/form/__tests__/KeyValue.test.ts +179 -0
  487. package/components/form/__tests__/LabeledSelect.test.ts +217 -0
  488. package/components/form/__tests__/MatchExpressions.test.ts +78 -0
  489. package/components/form/__tests__/NameNsDescription.test.ts +72 -0
  490. package/components/form/__tests__/NodeAffinity.test.ts +39 -0
  491. package/components/form/__tests__/NodeScheduling.test.ts +44 -0
  492. package/components/form/__tests__/PodAffinity.test.ts +47 -0
  493. package/components/form/__tests__/Probe.test.ts +74 -0
  494. package/components/form/__tests__/SSHKnownHosts.test.ts +59 -0
  495. package/components/form/__tests__/Security.test.ts +55 -0
  496. package/components/form/__tests__/Select.test.ts +30 -0
  497. package/components/form/__tests__/SelectOrCreateAuthSecret.test.ts +34 -0
  498. package/components/form/__tests__/ServiceNameSelect.test.ts +42 -0
  499. package/components/form/__tests__/Taints.test.ts +71 -0
  500. package/components/form/__tests__/UnitInput.test.ts +256 -0
  501. package/components/form/labeled-select-utils/labeled-select-pagination.ts +151 -0
  502. package/components/form/labeled-select-utils/labeled-select.utils.ts +122 -0
  503. package/components/formatter/AppSummaryGraph.vue +154 -0
  504. package/components/formatter/BadgeStateFormatter.vue +63 -0
  505. package/components/formatter/Capitalize.vue +28 -0
  506. package/components/formatter/Checked.vue +31 -0
  507. package/components/formatter/CloudCredExpired.vue +69 -0
  508. package/components/formatter/CloudCredPublicData.vue +30 -0
  509. package/components/formatter/ClusterLink.vue +117 -0
  510. package/components/formatter/ClusterProvider.vue +38 -0
  511. package/components/formatter/CopyToClipboard.vue +18 -0
  512. package/components/formatter/Date.vue +74 -0
  513. package/components/formatter/DelayedValue.vue +46 -0
  514. package/components/formatter/Endpoints.vue +106 -0
  515. package/components/formatter/ExtensionCache.vue +74 -0
  516. package/components/formatter/ExternalLink.vue +11 -0
  517. package/components/formatter/FleetClusterSummaryGraph.vue +27 -0
  518. package/components/formatter/FleetSummaryGraph.vue +122 -0
  519. package/components/formatter/IconIsDefault.vue +34 -0
  520. package/components/formatter/IconText.vue +49 -0
  521. package/components/formatter/ImageName.vue +23 -0
  522. package/components/formatter/ImagePercentageBar.vue +86 -0
  523. package/components/formatter/IngressFullPath.vue +22 -0
  524. package/components/formatter/IngressTarget.vue +96 -0
  525. package/components/formatter/InternalExternalIP.vue +62 -0
  526. package/components/formatter/InvolvedObjectLink.vue +54 -0
  527. package/components/formatter/KeyValue.vue +78 -0
  528. package/components/formatter/Link.vue +189 -0
  529. package/components/formatter/LinkDetail.vue +58 -0
  530. package/components/formatter/LinkDetailImage.vue +31 -0
  531. package/components/formatter/LinkName.vue +66 -0
  532. package/components/formatter/List.vue +22 -0
  533. package/components/formatter/ListLink.vue +37 -0
  534. package/components/formatter/ListLinkDetail.vue +30 -0
  535. package/components/formatter/LiveDate.vue +167 -0
  536. package/components/formatter/LiveDuration.vue +78 -0
  537. package/components/formatter/LiveExpiryBadgeState.vue +79 -0
  538. package/components/formatter/LiveExpiryDate.vue +87 -0
  539. package/components/formatter/LivePodRestarts.vue +50 -0
  540. package/components/formatter/MachineSummaryGraph.vue +108 -0
  541. package/components/formatter/Number.vue +34 -0
  542. package/components/formatter/Percentage.vue +25 -0
  543. package/components/formatter/PercentageBar.vue +41 -0
  544. package/components/formatter/PodImages.vue +72 -0
  545. package/components/formatter/PodsUsage.vue +29 -0
  546. package/components/formatter/Port.vue +24 -0
  547. package/components/formatter/Principal.vue +22 -0
  548. package/components/formatter/PrincipalGroupBindings.vue +59 -0
  549. package/components/formatter/QualityText.vue +21 -0
  550. package/components/formatter/RKETemplateName.vue +37 -0
  551. package/components/formatter/ReceiverIcons.vue +132 -0
  552. package/components/formatter/RunBookLink.vue +20 -0
  553. package/components/formatter/Scale.vue +143 -0
  554. package/components/formatter/ScanResult.vue +33 -0
  555. package/components/formatter/SecretData.vue +55 -0
  556. package/components/formatter/SecretType.vue +41 -0
  557. package/components/formatter/ServiceTargets.vue +121 -0
  558. package/components/formatter/ServiceType.vue +54 -0
  559. package/components/formatter/Shortened.vue +55 -0
  560. package/components/formatter/Si.vue +46 -0
  561. package/components/formatter/Translate.vue +32 -0
  562. package/components/formatter/VerticalScroll.vue +17 -0
  563. package/components/formatter/VirtualServiceGateways.vue +111 -0
  564. package/components/formatter/WorkloadDetailEndpoints.vue +107 -0
  565. package/components/formatter/WorkloadHealthScale.vue +339 -0
  566. package/components/formatter/__tests__/Checked.test.ts +19 -0
  567. package/components/formatter/__tests__/ClusterLink.test.ts +101 -0
  568. package/components/formatter/__tests__/Date.test.ts +60 -0
  569. package/components/formatter/__tests__/LinkDetail.test.ts +72 -0
  570. package/components/formatter/__tests__/LiveDate.test.ts +90 -0
  571. package/components/formatter/__tests__/PodsUsage.test.ts +55 -0
  572. package/components/formatter/__tests__/Si.test.ts +35 -0
  573. package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +81 -0
  574. package/components/graph/AspectPreserver.vue +79 -0
  575. package/components/graph/Bar.vue +81 -0
  576. package/components/graph/Circle.vue +164 -0
  577. package/components/graph/HalfCircle.vue +46 -0
  578. package/components/graph/LinePlot.vue +189 -0
  579. package/components/graph/ProgressArc.vue +94 -0
  580. package/components/nav/Favorite.vue +56 -0
  581. package/components/nav/GlobalLoading.vue +25 -0
  582. package/components/nav/Group.vue +462 -0
  583. package/components/nav/Header.vue +1156 -0
  584. package/components/nav/HeaderPageActionMenu.vue +22 -0
  585. package/components/nav/Jump.vue +128 -0
  586. package/components/nav/NamespaceFilter.vue +1155 -0
  587. package/components/nav/Pinned.vue +52 -0
  588. package/components/nav/TopLevelMenu.helper.ts +562 -0
  589. package/components/nav/TopLevelMenu.vue +1602 -0
  590. package/components/nav/Type.vue +292 -0
  591. package/components/nav/WindowManager/ChartReadme.vue +48 -0
  592. package/components/nav/WindowManager/ContainerLogs.vue +877 -0
  593. package/components/nav/WindowManager/ContainerShell.vue +585 -0
  594. package/components/nav/WindowManager/KubectlShell.vue +42 -0
  595. package/components/nav/WindowManager/MachineSsh.vue +21 -0
  596. package/components/nav/WindowManager/Window.vue +105 -0
  597. package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +197 -0
  598. package/components/nav/WindowManager/__tests__/ContainerShell.test.ts +571 -0
  599. package/components/nav/WindowManager/index.vue +587 -0
  600. package/components/nav/WorkspaceSwitcher.vue +190 -0
  601. package/components/nav/__tests__/TopLevelMenu.test.ts +598 -0
  602. package/components/nav/__tests__/Type.test.ts +491 -0
  603. package/components/templates/blank.vue +20 -0
  604. package/components/templates/default.vue +263 -0
  605. package/components/templates/home.vue +126 -0
  606. package/components/templates/plain.vue +134 -0
  607. package/components/templates/standalone.vue +9 -0
  608. package/components/templates/unauthenticated.vue +26 -0
  609. package/components/user.retention/user-retention-header.vue +34 -0
  610. package/composables/focusTrap.ts +68 -0
  611. package/composables/useClickOutside.ts +81 -0
  612. package/composables/useCompactInput.test.ts +36 -0
  613. package/composables/useCompactInput.ts +20 -0
  614. package/composables/useI18n.ts +26 -0
  615. package/composables/useLabeledFormElement.test.ts +135 -0
  616. package/composables/useLabeledFormElement.ts +153 -0
  617. package/composables/useUserRetentionValidation.test.ts +178 -0
  618. package/composables/useUserRetentionValidation.ts +201 -0
  619. package/config/__test__/home-links.test.ts +57 -0
  620. package/config/cookies.js +4 -0
  621. package/config/elemental-types.js +9 -0
  622. package/config/features.js +6 -0
  623. package/config/harvester-manager-types.js +3 -0
  624. package/config/home-links.js +209 -0
  625. package/config/labels-annotations.js +192 -0
  626. package/config/local-storage.js +6 -0
  627. package/config/page-actions.js +4 -0
  628. package/config/pagination-table-headers.js +80 -0
  629. package/config/persistentVolume.ts +108 -0
  630. package/config/pod-security-admission.ts +82 -0
  631. package/config/private-label.js +94 -0
  632. package/config/product/apps.js +148 -0
  633. package/config/product/auth.js +218 -0
  634. package/config/product/backup.js +61 -0
  635. package/config/product/cis.js +158 -0
  636. package/config/product/explorer.js +632 -0
  637. package/config/product/fleet.js +100 -0
  638. package/config/product/gatekeeper.js +119 -0
  639. package/config/product/istio.js +89 -0
  640. package/config/product/legacy.js +62 -0
  641. package/config/product/logging.js +377 -0
  642. package/config/product/longhorn.js +49 -0
  643. package/config/product/manager.js +217 -0
  644. package/config/product/monitoring.js +287 -0
  645. package/config/product/navlinks.js +32 -0
  646. package/config/product/neuvector.js +30 -0
  647. package/config/product/settings.js +161 -0
  648. package/config/product/uiplugins.js +18 -0
  649. package/config/query-params.js +79 -0
  650. package/config/roles.ts +409 -0
  651. package/config/router/index.js +26 -0
  652. package/config/router/navigation-guards/attempt-first-login.js +73 -0
  653. package/config/router/navigation-guards/authentication.js +64 -0
  654. package/config/router/navigation-guards/clusters.js +132 -0
  655. package/config/router/navigation-guards/i18n.js +13 -0
  656. package/config/router/navigation-guards/index.js +23 -0
  657. package/config/router/navigation-guards/install-redirect.js +95 -0
  658. package/config/router/navigation-guards/load-initial-settings.js +15 -0
  659. package/config/router/navigation-guards/page-title.js +12 -0
  660. package/config/router/navigation-guards/products.js +15 -0
  661. package/config/router/navigation-guards/record-last-route.js +24 -0
  662. package/config/router/navigation-guards/runtime-extension-route.js +31 -0
  663. package/config/router/navigation-guards/server-upgrade-growl.js +19 -0
  664. package/config/router/routes.js +488 -0
  665. package/config/schema.js +32 -0
  666. package/config/secret.js +14 -0
  667. package/config/settings.ts +258 -0
  668. package/config/store.js +184 -0
  669. package/config/system-namespaces.js +18 -0
  670. package/config/table-headers.js +1115 -0
  671. package/config/types.js +353 -0
  672. package/config/uiplugins.js +272 -0
  673. package/config/version.js +33 -0
  674. package/config/workload.ts +1 -0
  675. package/core/plugin-helpers.ts +220 -0
  676. package/core/plugin-routes.ts +144 -0
  677. package/core/plugin.ts +367 -0
  678. package/core/plugins-loader.js +31 -0
  679. package/core/plugins.js +471 -0
  680. package/core/types-provisioning.ts +361 -0
  681. package/core/types.ts +661 -0
  682. package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +135 -0
  683. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +119 -0
  684. package/detail/__tests__/service.test.ts +62 -0
  685. package/detail/autoscaling.horizontalpodautoscaler/index.vue +254 -0
  686. package/detail/catalog.cattle.io.app.vue +181 -0
  687. package/detail/catalog.cattle.io.clusterrepo.vue +35 -0
  688. package/detail/cis.cattle.io.clusterscan.vue +372 -0
  689. package/detail/configmap.vue +81 -0
  690. package/detail/constraints.gatekeeper.sh.constraint.vue +66 -0
  691. package/detail/fleet.cattle.io.bundle.vue +63 -0
  692. package/detail/fleet.cattle.io.cluster.vue +99 -0
  693. package/detail/fleet.cattle.io.clustergroup.vue +76 -0
  694. package/detail/fleet.cattle.io.gitrepo.vue +148 -0
  695. package/detail/harvesterhci.io.management.cluster.vue +104 -0
  696. package/detail/helm.cattle.io.projecthelmchart.vue +249 -0
  697. package/detail/management.cattle.io.fleetworkspace.vue +100 -0
  698. package/detail/management.cattle.io.globalrole.vue +8 -0
  699. package/detail/management.cattle.io.roletemplate.vue +11 -0
  700. package/detail/management.cattle.io.user.vue +312 -0
  701. package/detail/namespace.vue +269 -0
  702. package/detail/networking.k8s.io.ingress.vue +74 -0
  703. package/detail/node.vue +330 -0
  704. package/detail/pod.vue +255 -0
  705. package/detail/provisioning.cattle.io.cluster.vue +1134 -0
  706. package/detail/rbac.authorization.k8s.io.clusterrole.vue +8 -0
  707. package/detail/rbac.authorization.k8s.io.role.vue +8 -0
  708. package/detail/secret.vue +313 -0
  709. package/detail/service.vue +202 -0
  710. package/detail/workload/index.vue +541 -0
  711. package/dialog/AddClusterMemberDialog.vue +86 -0
  712. package/dialog/AddCustomBadgeDialog.vue +465 -0
  713. package/dialog/AddProjectMemberDialog.vue +181 -0
  714. package/dialog/AddonConfigConfirmationDialog.vue +101 -0
  715. package/dialog/DeactivateDriverDialog.vue +138 -0
  716. package/dialog/DiagnosticTimingsDialog.vue +141 -0
  717. package/dialog/DrainNode.vue +247 -0
  718. package/dialog/ForceMachineRemoveDialog.vue +131 -0
  719. package/dialog/GenericPrompt.vue +135 -0
  720. package/dialog/GitRepoForceUpdateDialog.vue +132 -0
  721. package/dialog/RollbackWorkloadDialog.vue +308 -0
  722. package/dialog/RotateCertificatesDialog.vue +205 -0
  723. package/dialog/RotateEncryptionKeyDialog.vue +191 -0
  724. package/dialog/SaveAsRKETemplateDialog.vue +139 -0
  725. package/dialog/ScaleMachineDownDialog.vue +156 -0
  726. package/dialog/ScalePoolDownDialog.vue +121 -0
  727. package/dialog/SloDialog.vue +97 -0
  728. package/directives/clean-html.js +15 -0
  729. package/directives/clean-tooltip.js +32 -0
  730. package/directives/focus.js +47 -0
  731. package/directives/int-number.js +21 -0
  732. package/directives/positive-int-number.js +19 -0
  733. package/directives/strip-html-aria-label.js +19 -0
  734. package/directives/trim-whitespace.js +19 -0
  735. package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +87 -0
  736. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +246 -0
  737. package/edit/__tests__/kontainerDriver.test.ts +110 -0
  738. package/edit/__tests__/management.cattle.io.clusterroletemplatebinding.test.ts +71 -0
  739. package/edit/__tests__/management.cattle.io.setting.test.ts +109 -0
  740. package/edit/__tests__/monitoring.coreos.com.prometheusrule.test.ts +57 -0
  741. package/edit/__tests__/namespace.test.ts +49 -0
  742. package/edit/__tests__/nodeDriver.test.ts +89 -0
  743. package/edit/__tests__/service.test.ts +100 -0
  744. package/edit/__tests__/ui.cattle.io.navlink.test.ts +114 -0
  745. package/edit/auth/AuthProviderWarningBanners.vue +34 -0
  746. package/edit/auth/__tests__/AuthProviderWarningBanners.test.ts +19 -0
  747. package/edit/auth/__tests__/azuread.test.ts +238 -0
  748. package/edit/auth/__tests__/oidc.test.ts +151 -0
  749. package/edit/auth/azuread.vue +537 -0
  750. package/edit/auth/github.vue +269 -0
  751. package/edit/auth/googleoauth.vue +256 -0
  752. package/edit/auth/ldap/__tests__/config.test.ts +58 -0
  753. package/edit/auth/ldap/config.vue +403 -0
  754. package/edit/auth/ldap/index.vue +156 -0
  755. package/edit/auth/oidc.vue +412 -0
  756. package/edit/auth/saml.vue +432 -0
  757. package/edit/autoscaling.horizontalpodautoscaler/external-metric.vue +58 -0
  758. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +130 -0
  759. package/edit/autoscaling.horizontalpodautoscaler/index.vue +343 -0
  760. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +79 -0
  761. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +60 -0
  762. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +220 -0
  763. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +198 -0
  764. package/edit/autoscaling.horizontalpodautoscaler/object-metric.vue +71 -0
  765. package/edit/autoscaling.horizontalpodautoscaler/pod-metric.vue +58 -0
  766. package/edit/autoscaling.horizontalpodautoscaler/resource-metric.vue +65 -0
  767. package/edit/catalog.cattle.io.clusterrepo.vue +336 -0
  768. package/edit/cis.cattle.io.clusterscan.vue +377 -0
  769. package/edit/cis.cattle.io.clusterscanbenchmark.vue +153 -0
  770. package/edit/cis.cattle.io.clusterscanprofile.vue +150 -0
  771. package/edit/cloudcredential.vue +319 -0
  772. package/edit/configmap.vue +163 -0
  773. package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +72 -0
  774. package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +78 -0
  775. package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +52 -0
  776. package/edit/constraints.gatekeeper.sh.constraint/index.vue +368 -0
  777. package/edit/fleet.cattle.io.cluster.vue +105 -0
  778. package/edit/fleet.cattle.io.clustergroup.vue +187 -0
  779. package/edit/fleet.cattle.io.gitrepo.vue +910 -0
  780. package/edit/group.principal.vue +65 -0
  781. package/edit/helm.cattle.io.projecthelmchart.vue +163 -0
  782. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +94 -0
  783. package/edit/kontainerDriver.vue +67 -0
  784. package/edit/logging-flow/Match.vue +142 -0
  785. package/edit/logging-flow/index.vue +549 -0
  786. package/edit/logging.banzaicloud.io.clusterflow.vue +7 -0
  787. package/edit/logging.banzaicloud.io.clusteroutput.vue +12 -0
  788. package/edit/logging.banzaicloud.io.flow.vue +7 -0
  789. package/edit/logging.banzaicloud.io.output/__tests__/logging.banzaicloud.io.output.test.ts +279 -0
  790. package/edit/logging.banzaicloud.io.output/index.vue +386 -0
  791. package/edit/logging.banzaicloud.io.output/providers/__tests__/loki.test.ts +13 -0
  792. package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +77 -0
  793. package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +94 -0
  794. package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +112 -0
  795. package/edit/logging.banzaicloud.io.output/providers/datadog.vue +95 -0
  796. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +234 -0
  797. package/edit/logging.banzaicloud.io.output/providers/file.vue +47 -0
  798. package/edit/logging.banzaicloud.io.output/providers/forward.vue +152 -0
  799. package/edit/logging.banzaicloud.io.output/providers/gcs.vue +102 -0
  800. package/edit/logging.banzaicloud.io.output/providers/gelf.vue +167 -0
  801. package/edit/logging.banzaicloud.io.output/providers/kafka.vue +166 -0
  802. package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +76 -0
  803. package/edit/logging.banzaicloud.io.output/providers/logdna.vue +72 -0
  804. package/edit/logging.banzaicloud.io.output/providers/logz.vue +107 -0
  805. package/edit/logging.banzaicloud.io.output/providers/loki.vue +172 -0
  806. package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +71 -0
  807. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +225 -0
  808. package/edit/logging.banzaicloud.io.output/providers/redis.vue +142 -0
  809. package/edit/logging.banzaicloud.io.output/providers/s3.vue +122 -0
  810. package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +180 -0
  811. package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +59 -0
  812. package/edit/logging.banzaicloud.io.output/providers/syslog.vue +234 -0
  813. package/edit/logging.banzaicloud.io.output/providers/utils.js +27 -0
  814. package/edit/management.cattle.io.clusterroletemplatebinding.vue +71 -0
  815. package/edit/management.cattle.io.fleetworkspace.vue +245 -0
  816. package/edit/management.cattle.io.globalrole.vue +8 -0
  817. package/edit/management.cattle.io.node.vue +72 -0
  818. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +111 -0
  819. package/edit/management.cattle.io.project.vue +255 -0
  820. package/edit/management.cattle.io.projectroletemplatebinding.vue +96 -0
  821. package/edit/management.cattle.io.roletemplate.vue +11 -0
  822. package/edit/management.cattle.io.setting.vue +264 -0
  823. package/edit/management.cattle.io.user.vue +264 -0
  824. package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +324 -0
  825. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +287 -0
  826. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +423 -0
  827. package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +152 -0
  828. package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +272 -0
  829. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +175 -0
  830. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +282 -0
  831. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +203 -0
  832. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +140 -0
  833. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +230 -0
  834. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +534 -0
  835. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +229 -0
  836. package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +112 -0
  837. package/edit/monitoring.coreos.com.prometheusrule/index.vue +223 -0
  838. package/edit/monitoring.coreos.com.receiver/auth.vue +142 -0
  839. package/edit/monitoring.coreos.com.receiver/index.vue +357 -0
  840. package/edit/monitoring.coreos.com.receiver/tls.vue +72 -0
  841. package/edit/monitoring.coreos.com.receiver/types/__tests__/email.test.ts +57 -0
  842. package/edit/monitoring.coreos.com.receiver/types/email.vue +130 -0
  843. package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +237 -0
  844. package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +97 -0
  845. package/edit/monitoring.coreos.com.receiver/types/slack.vue +88 -0
  846. package/edit/monitoring.coreos.com.receiver/types/webhook.add.vue +65 -0
  847. package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +28 -0
  848. package/edit/monitoring.coreos.com.receiver/types/webhook.vue +93 -0
  849. package/edit/monitoring.coreos.com.route.vue +237 -0
  850. package/edit/namespace.vue +282 -0
  851. package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +194 -0
  852. package/edit/networking.istio.io.destinationrule/index.vue +237 -0
  853. package/edit/networking.k8s.io.ingress/Certificate.vue +134 -0
  854. package/edit/networking.k8s.io.ingress/Certificates.vue +111 -0
  855. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +145 -0
  856. package/edit/networking.k8s.io.ingress/IngressClass.vue +65 -0
  857. package/edit/networking.k8s.io.ingress/Rule.vue +188 -0
  858. package/edit/networking.k8s.io.ingress/RulePath.vue +224 -0
  859. package/edit/networking.k8s.io.ingress/Rules.vue +155 -0
  860. package/edit/networking.k8s.io.ingress/index.vue +300 -0
  861. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +108 -0
  862. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +50 -0
  863. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +401 -0
  864. package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +93 -0
  865. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.test.ts +180 -0
  866. package/edit/networking.k8s.io.networkpolicy/__tests__/utils/mock.json +158 -0
  867. package/edit/networking.k8s.io.networkpolicy/__tests__/utils/selectors.test.ts +45 -0
  868. package/edit/networking.k8s.io.networkpolicy/index.vue +299 -0
  869. package/edit/node.vue +82 -0
  870. package/edit/nodeDriver.vue +72 -0
  871. package/edit/persistentvolume/__tests__/persistentvolume.test.ts +93 -0
  872. package/edit/persistentvolume/index.vue +380 -0
  873. package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +90 -0
  874. package/edit/persistentvolume/plugins/azureDisk.vue +136 -0
  875. package/edit/persistentvolume/plugins/azureFile.vue +78 -0
  876. package/edit/persistentvolume/plugins/cephfs.vue +109 -0
  877. package/edit/persistentvolume/plugins/cinder.vue +89 -0
  878. package/edit/persistentvolume/plugins/csi.vue +209 -0
  879. package/edit/persistentvolume/plugins/fc.vue +101 -0
  880. package/edit/persistentvolume/plugins/flexVolume.vue +102 -0
  881. package/edit/persistentvolume/plugins/flocker.vue +45 -0
  882. package/edit/persistentvolume/plugins/gcePersistentDisk.vue +90 -0
  883. package/edit/persistentvolume/plugins/glusterfs.vue +70 -0
  884. package/edit/persistentvolume/plugins/hostPath.vue +82 -0
  885. package/edit/persistentvolume/plugins/iscsi.vue +170 -0
  886. package/edit/persistentvolume/plugins/local.vue +37 -0
  887. package/edit/persistentvolume/plugins/longhorn.vue +99 -0
  888. package/edit/persistentvolume/plugins/nfs.vue +70 -0
  889. package/edit/persistentvolume/plugins/photonPersistentDisk.vue +58 -0
  890. package/edit/persistentvolume/plugins/portworxVolume.vue +71 -0
  891. package/edit/persistentvolume/plugins/quobyte.vue +88 -0
  892. package/edit/persistentvolume/plugins/rbd.vue +127 -0
  893. package/edit/persistentvolume/plugins/scaleIO.vue +146 -0
  894. package/edit/persistentvolume/plugins/storageos.vue +98 -0
  895. package/edit/persistentvolume/plugins/vsphereVolume.vue +63 -0
  896. package/edit/persistentvolumeclaim.vue +395 -0
  897. package/edit/pod.vue +27 -0
  898. package/edit/policy.poddisruptionbudget.vue +152 -0
  899. package/edit/provisioning.cattle.io.cluster/AgentEnv.vue +40 -0
  900. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +303 -0
  901. package/edit/provisioning.cattle.io.cluster/Labels.vue +46 -0
  902. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +324 -0
  903. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +306 -0
  904. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +564 -0
  905. package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.test.ts +129 -0
  906. package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +182 -0
  907. package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +54 -0
  908. package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +72 -0
  909. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +546 -0
  910. package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +391 -0
  911. package/edit/provisioning.cattle.io.cluster/index.vue +733 -0
  912. package/edit/provisioning.cattle.io.cluster/rke2.vue +2547 -0
  913. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +49 -0
  914. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +112 -0
  915. package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +221 -0
  916. package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +335 -0
  917. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +700 -0
  918. package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +219 -0
  919. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +374 -0
  920. package/edit/provisioning.cattle.io.cluster/tabs/MemberRoles.vue +40 -0
  921. package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +153 -0
  922. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +138 -0
  923. package/edit/provisioning.cattle.io.cluster/tabs/networking/ACE.vue +73 -0
  924. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +214 -0
  925. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +211 -0
  926. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryMirrors.vue +138 -0
  927. package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +66 -0
  928. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +149 -0
  929. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +155 -0
  930. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +76 -0
  931. package/edit/rbac.authorization.k8s.io.clusterrole.vue +8 -0
  932. package/edit/rbac.authorization.k8s.io.role.vue +8 -0
  933. package/edit/resources.cattle.io.backup.vue +454 -0
  934. package/edit/resources.cattle.io.restore.vue +326 -0
  935. package/edit/secret/__tests__/ssh.test.ts +79 -0
  936. package/edit/secret/basic.vue +64 -0
  937. package/edit/secret/generic.vue +64 -0
  938. package/edit/secret/index.vue +407 -0
  939. package/edit/secret/registry.vue +145 -0
  940. package/edit/secret/ssh.vue +106 -0
  941. package/edit/secret/tls.vue +94 -0
  942. package/edit/service.vue +549 -0
  943. package/edit/serviceaccount.vue +193 -0
  944. package/edit/storage.k8s.io.storageclass/index.vue +307 -0
  945. package/edit/storage.k8s.io.storageclass/provisioners/custom.vue +25 -0
  946. package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +114 -0
  947. package/edit/storage.k8s.io.storageclass/provisioners/driver.longhorn.io.vue +40 -0
  948. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +180 -0
  949. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +75 -0
  950. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +47 -0
  951. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +69 -0
  952. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +117 -0
  953. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +99 -0
  954. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/no-provisioner.vue +21 -0
  955. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/portworx-volume.vue +83 -0
  956. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +91 -0
  957. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +117 -0
  958. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +116 -0
  959. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +65 -0
  960. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +97 -0
  961. package/edit/token.vue +316 -0
  962. package/edit/ui.cattle.io.navlink.vue +461 -0
  963. package/edit/workload/Job.vue +339 -0
  964. package/edit/workload/Upgrading.vue +372 -0
  965. package/edit/workload/VolumeClaimTemplate.vue +136 -0
  966. package/edit/workload/__tests__/Job.test.ts +72 -0
  967. package/edit/workload/__tests__/Upgrading.test.ts +61 -0
  968. package/edit/workload/__tests__/index.test.ts +103 -0
  969. package/edit/workload/index.vue +676 -0
  970. package/edit/workload/mixins/workload.js +1067 -0
  971. package/edit/workload/storage/ContainerMountPaths.vue +171 -0
  972. package/edit/workload/storage/Mount.vue +157 -0
  973. package/edit/workload/storage/__tests__/Mount.test.ts +102 -0
  974. package/edit/workload/storage/__tests__/Storage.test.ts +106 -0
  975. package/edit/workload/storage/awsElasticBlockStore.vue +73 -0
  976. package/edit/workload/storage/azureDisk.vue +104 -0
  977. package/edit/workload/storage/azureFile.vue +74 -0
  978. package/edit/workload/storage/csi/driver.longhorn.io.vue +48 -0
  979. package/edit/workload/storage/csi/index.vue +122 -0
  980. package/edit/workload/storage/emptyDir.vue +88 -0
  981. package/edit/workload/storage/ephemeralVolume/index.vue +108 -0
  982. package/edit/workload/storage/gcePersistentDisk.vue +73 -0
  983. package/edit/workload/storage/hostPath.vue +115 -0
  984. package/edit/workload/storage/index.vue +339 -0
  985. package/edit/workload/storage/nfs.vue +78 -0
  986. package/edit/workload/storage/persistentVolumeClaim/__tests__/persistentvolumeclaim.test.ts +38 -0
  987. package/edit/workload/storage/persistentVolumeClaim/index.vue +154 -0
  988. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +256 -0
  989. package/edit/workload/storage/secret.vue +186 -0
  990. package/edit/workload/storage/vsphereVolume.vue +73 -0
  991. package/initialize/App.vue +70 -0
  992. package/initialize/app-extended.js +112 -0
  993. package/initialize/entry-helpers.js +147 -0
  994. package/initialize/entry.js +33 -0
  995. package/initialize/install-components.js +11 -0
  996. package/initialize/install-directives.js +61 -0
  997. package/initialize/install-plugins.js +128 -0
  998. package/list/__tests__/workload.test.ts +55 -0
  999. package/list/catalog.cattle.io.app.vue +76 -0
  1000. package/list/catalog.cattle.io.clusterrepo.vue +83 -0
  1001. package/list/cis.cattle.io.clusterscan.vue +76 -0
  1002. package/list/fleet.cattle.io.bundle.vue +127 -0
  1003. package/list/fleet.cattle.io.cluster.vue +95 -0
  1004. package/list/fleet.cattle.io.clustergroup.vue +88 -0
  1005. package/list/fleet.cattle.io.clusterregistrationtoken.vue +94 -0
  1006. package/list/fleet.cattle.io.gitrepo.vue +108 -0
  1007. package/list/group.principal.vue +153 -0
  1008. package/list/harvesterhci.io.management.cluster.vue +244 -0
  1009. package/list/helm.cattle.io.projecthelmchart.vue +157 -0
  1010. package/list/logging.banzaicloud.io.clusterflow.vue +44 -0
  1011. package/list/logging.banzaicloud.io.flow.vue +45 -0
  1012. package/list/management.cattle.io.cluster.vue +54 -0
  1013. package/list/management.cattle.io.feature.vue +367 -0
  1014. package/list/management.cattle.io.fleetworkspace.vue +44 -0
  1015. package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +51 -0
  1016. package/list/management.cattle.io.setting.vue +117 -0
  1017. package/list/management.cattle.io.user.vue +178 -0
  1018. package/list/monitoring.coreos.com.alertmanagerconfig.vue +83 -0
  1019. package/list/namespace.vue +79 -0
  1020. package/list/networking.k8s.io.ingress.vue +39 -0
  1021. package/list/node.vue +418 -0
  1022. package/list/persistentvolume.vue +89 -0
  1023. package/list/persistentvolumeclaim.vue +32 -0
  1024. package/list/provisioning.cattle.io.cluster.vue +318 -0
  1025. package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +47 -0
  1026. package/list/service.vue +48 -0
  1027. package/list/ui.cattle.io.navlink.vue +72 -0
  1028. package/list/workload.vue +187 -0
  1029. package/machine-config/__tests__/vmwarevsphere.test.ts +257 -0
  1030. package/machine-config/amazonec2.vue +702 -0
  1031. package/machine-config/azure.vue +901 -0
  1032. package/machine-config/digitalocean.vue +231 -0
  1033. package/machine-config/generic.vue +103 -0
  1034. package/machine-config/linode.vue +189 -0
  1035. package/machine-config/pnap.vue +288 -0
  1036. package/machine-config/vmwarevsphere-config.ts +17 -0
  1037. package/machine-config/vmwarevsphere.vue +1252 -0
  1038. package/mixins/__tests__/auth-config.test.ts +74 -0
  1039. package/mixins/__tests__/chart.test.ts +104 -0
  1040. package/mixins/__tests__/create-edit-view.test.ts +56 -0
  1041. package/mixins/auth-config.js +332 -0
  1042. package/mixins/back-link.js +15 -0
  1043. package/mixins/brand.js +211 -0
  1044. package/mixins/browser-tab-visibility.js +31 -0
  1045. package/mixins/chart.js +557 -0
  1046. package/mixins/child-hook.js +82 -0
  1047. package/mixins/closeable.js +47 -0
  1048. package/mixins/compact-input.ts +25 -0
  1049. package/mixins/create-edit-view/impl.js +201 -0
  1050. package/mixins/create-edit-view/index.js +48 -0
  1051. package/mixins/fetch.client.js +90 -0
  1052. package/mixins/form-validation.js +197 -0
  1053. package/mixins/labeled-form-element.ts +225 -0
  1054. package/mixins/login.js +31 -0
  1055. package/mixins/metric-poller.js +19 -0
  1056. package/mixins/page-actions.js +36 -0
  1057. package/mixins/resource-fetch-api-pagination.js +339 -0
  1058. package/mixins/resource-fetch-namespaced.js +90 -0
  1059. package/mixins/resource-fetch.js +290 -0
  1060. package/mixins/resource-manager.js +109 -0
  1061. package/mixins/vue-select-overrides.js +102 -0
  1062. package/models/__tests__/apps.deployment.test.ts +93 -0
  1063. package/models/__tests__/batch.cronjob.test.ts +88 -0
  1064. package/models/__tests__/catalog.cattle.io.app.test.ts +148 -0
  1065. package/models/__tests__/cluster.test.ts +44 -0
  1066. package/models/__tests__/fleet.cattle.io.cluster.test.ts +36 -0
  1067. package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +157 -0
  1068. package/models/__tests__/management.cattle.io.cluster.test.ts +23 -0
  1069. package/models/__tests__/management.cattle.io.node.ts +181 -0
  1070. package/models/__tests__/management.cattle.io.nodepool.ts +83 -0
  1071. package/models/__tests__/namespace.test.ts +165 -0
  1072. package/models/__tests__/node.test.ts +74 -0
  1073. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +155 -0
  1074. package/models/__tests__/schema.tests.ts +24 -0
  1075. package/models/__tests__/secret.test.ts +80 -0
  1076. package/models/__tests__/steve-schema.test.ts +73 -0
  1077. package/models/__tests__/storage.k8s.io.storageclass.test.ts +22 -0
  1078. package/models/__tests__/workload.test.ts +91 -0
  1079. package/models/app.js +25 -0
  1080. package/models/apps.controllerrevision.js +7 -0
  1081. package/models/apps.daemonset.js +22 -0
  1082. package/models/apps.deployment.js +71 -0
  1083. package/models/apps.replicaset.js +11 -0
  1084. package/models/apps.statefulset.js +49 -0
  1085. package/models/autoscaling.horizontalpodautoscaler.js +44 -0
  1086. package/models/batch.cronjob.js +85 -0
  1087. package/models/batch.job.js +19 -0
  1088. package/models/catalog.cattle.io.app.js +488 -0
  1089. package/models/catalog.cattle.io.clusterrepo.js +223 -0
  1090. package/models/catalog.cattle.io.operation.js +43 -0
  1091. package/models/catalog.cattle.io.repo.js +4 -0
  1092. package/models/catalog.cattle.io.uiplugin.js +37 -0
  1093. package/models/chart.js +50 -0
  1094. package/models/chartinstallaction.js +17 -0
  1095. package/models/chartupgradeaction.js +12 -0
  1096. package/models/cis.cattle.io.clusterscan.js +179 -0
  1097. package/models/cis.cattle.io.clusterscanbenchmark.js +18 -0
  1098. package/models/cis.cattle.io.clusterscanprofile.js +31 -0
  1099. package/models/cis.cattle.io.clusterscanreport.js +62 -0
  1100. package/models/cloudcredential.js +336 -0
  1101. package/models/cluster/node.js +487 -0
  1102. package/models/cluster/schema.js +6 -0
  1103. package/models/cluster.js +44 -0
  1104. package/models/cluster.x-k8s.io.machine.js +272 -0
  1105. package/models/cluster.x-k8s.io.machinedeployment.js +228 -0
  1106. package/models/cluster.x-k8s.io.machineset.js +23 -0
  1107. package/models/clusterroletemplatebinding.js +31 -0
  1108. package/models/configmap.js +20 -0
  1109. package/models/constraints.gatekeeper.sh.constraint.js +121 -0
  1110. package/models/driver.js +63 -0
  1111. package/models/etcdbackup.js +45 -0
  1112. package/models/event.js +34 -0
  1113. package/models/fleet.cattle.io.bundle.js +168 -0
  1114. package/models/fleet.cattle.io.cluster.js +221 -0
  1115. package/models/fleet.cattle.io.clustergroup.js +62 -0
  1116. package/models/fleet.cattle.io.clusterregistrationtoken.js +14 -0
  1117. package/models/fleet.cattle.io.gitrepo.js +548 -0
  1118. package/models/group.principal.js +71 -0
  1119. package/models/helm.cattle.io.projecthelmchart.js +38 -0
  1120. package/models/k8s.cni.cncf.io.networkattachmentdefinition.js +88 -0
  1121. package/models/kontainerdriver.js +85 -0
  1122. package/models/logging.banzaicloud.io.clusterflow.js +36 -0
  1123. package/models/logging.banzaicloud.io.clusteroutput.js +4 -0
  1124. package/models/logging.banzaicloud.io.flow.js +114 -0
  1125. package/models/logging.banzaicloud.io.output.js +173 -0
  1126. package/models/management/schema.js +6 -0
  1127. package/models/management.cattle.io.authconfig.js +70 -0
  1128. package/models/management.cattle.io.cluster.js +501 -0
  1129. package/models/management.cattle.io.clusterroletemplatebinding.js +143 -0
  1130. package/models/management.cattle.io.feature.js +56 -0
  1131. package/models/management.cattle.io.fleetworkspace.js +90 -0
  1132. package/models/management.cattle.io.gitreporestriction.js +5 -0
  1133. package/models/management.cattle.io.globalrole.js +172 -0
  1134. package/models/management.cattle.io.globalrolebinding.js +59 -0
  1135. package/models/management.cattle.io.kontainerdriver.js +90 -0
  1136. package/models/management.cattle.io.node.js +179 -0
  1137. package/models/management.cattle.io.nodepool.js +185 -0
  1138. package/models/management.cattle.io.nodetemplate.js +139 -0
  1139. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
  1140. package/models/management.cattle.io.project.js +182 -0
  1141. package/models/management.cattle.io.projectroletemplatebinding.js +150 -0
  1142. package/models/management.cattle.io.roletemplate.js +216 -0
  1143. package/models/management.cattle.io.setting.js +71 -0
  1144. package/models/management.cattle.io.user.js +302 -0
  1145. package/models/metrics.k8s.io.nodemetrics.js +41 -0
  1146. package/models/monitoring.coreos.com.alertmanagerconfig.js +126 -0
  1147. package/models/monitoring.coreos.com.podmonitor.js +23 -0
  1148. package/models/monitoring.coreos.com.prometheusrule.js +38 -0
  1149. package/models/monitoring.coreos.com.receiver.js +197 -0
  1150. package/models/monitoring.coreos.com.route.js +162 -0
  1151. package/models/monitoring.coreos.com.servicemonitor.js +23 -0
  1152. package/models/namespace.js +262 -0
  1153. package/models/networking.istio.io.destinationrule.js +19 -0
  1154. package/models/networking.k8s.io.ingress.js +209 -0
  1155. package/models/nodedriver.js +93 -0
  1156. package/models/persistentvolume.js +43 -0
  1157. package/models/persistentvolumeclaim.js +63 -0
  1158. package/models/pod.js +279 -0
  1159. package/models/principal.js +42 -0
  1160. package/models/projectroletemplatebinding.js +35 -0
  1161. package/models/provisioning.cattle.io.cluster.js +1091 -0
  1162. package/models/rbac.authorization.k8s.io.clusterrole.js +17 -0
  1163. package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
  1164. package/models/rbac.authorization.k8s.io.role.js +52 -0
  1165. package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
  1166. package/models/replicationcontroller.js +4 -0
  1167. package/models/resources.cattle.io.backup.js +29 -0
  1168. package/models/resources.cattle.io.restore.js +33 -0
  1169. package/models/rke-machine-config.cattle.io.harvesterconfig.js +19 -0
  1170. package/models/rke-machine.cattle.io.amazonec2machinetemplate.js +15 -0
  1171. package/models/rke-machine.cattle.io.azuremachinetemplate.js +15 -0
  1172. package/models/rke-machine.cattle.io.digitaloceanmachinetemplate.js +15 -0
  1173. package/models/rke-machine.cattle.io.linodemachinetemplate.js +15 -0
  1174. package/models/rke-machine.cattle.io.machinetemplate.js +22 -0
  1175. package/models/rke-machine.cattle.io.pnapmachinetemplate.js +15 -0
  1176. package/models/rke-machine.cattle.io.vmwarevspheremachinetemplate.js +14 -0
  1177. package/models/rke.cattle.io.etcdsnapshot.js +76 -0
  1178. package/models/schema.js +38 -0
  1179. package/models/secret.js +473 -0
  1180. package/models/service.js +193 -0
  1181. package/models/steve-schema.ts +254 -0
  1182. package/models/storage.k8s.io.storageclass.js +164 -0
  1183. package/models/templates.gatekeeper.sh.constrainttemplate.js +23 -0
  1184. package/models/token.js +19 -0
  1185. package/models/ui.cattle.io.navlink.js +38 -0
  1186. package/models/workload.js +688 -0
  1187. package/models/workload.service.js +341 -0
  1188. package/package.json +173 -0
  1189. package/pages/404.vue +15 -0
  1190. package/pages/__tests__/prefs.test.ts +96 -0
  1191. package/pages/about.vue +303 -0
  1192. package/pages/account/create-key.vue +16 -0
  1193. package/pages/account/index.vue +252 -0
  1194. package/pages/auth/login.vue +591 -0
  1195. package/pages/auth/logout.vue +44 -0
  1196. package/pages/auth/setup.vue +521 -0
  1197. package/pages/auth/verify.vue +198 -0
  1198. package/pages/c/_cluster/_product/_resource/_id.vue +12 -0
  1199. package/pages/c/_cluster/_product/_resource/_namespace/_id.vue +12 -0
  1200. package/pages/c/_cluster/_product/_resource/create.vue +12 -0
  1201. package/pages/c/_cluster/_product/_resource/index.vue +12 -0
  1202. package/pages/c/_cluster/_product/index.vue +15 -0
  1203. package/pages/c/_cluster/_product/members/index.vue +8 -0
  1204. package/pages/c/_cluster/_product/namespaces.vue +77 -0
  1205. package/pages/c/_cluster/_product/projectsnamespaces.vue +6 -0
  1206. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +18 -0
  1207. package/pages/c/_cluster/apps/charts/chart.vue +452 -0
  1208. package/pages/c/_cluster/apps/charts/index.vue +718 -0
  1209. package/pages/c/_cluster/apps/charts/install.helpers.js +15 -0
  1210. package/pages/c/_cluster/apps/charts/install.vue +2050 -0
  1211. package/pages/c/_cluster/auth/config/_id.vue +35 -0
  1212. package/pages/c/_cluster/auth/config/index.vue +116 -0
  1213. package/pages/c/_cluster/auth/group.principal/assign-edit.vue +138 -0
  1214. package/pages/c/_cluster/auth/roles/_resource/_id.vue +12 -0
  1215. package/pages/c/_cluster/auth/roles/_resource/create.vue +12 -0
  1216. package/pages/c/_cluster/auth/roles/index.vue +215 -0
  1217. package/pages/c/_cluster/auth/user.retention/index.vue +323 -0
  1218. package/pages/c/_cluster/ecm/index.vue +14 -0
  1219. package/pages/c/_cluster/explorer/ConfigBadge.vue +64 -0
  1220. package/pages/c/_cluster/explorer/EventsTable.vue +121 -0
  1221. package/pages/c/_cluster/explorer/__tests__/index.test.ts +264 -0
  1222. package/pages/c/_cluster/explorer/explorer-utils.js +17 -0
  1223. package/pages/c/_cluster/explorer/index.vue +1002 -0
  1224. package/pages/c/_cluster/explorer/tools/__tests__/index.test.ts +71 -0
  1225. package/pages/c/_cluster/explorer/tools/index.vue +397 -0
  1226. package/pages/c/_cluster/explorer/tools/pages/_page.vue +29 -0
  1227. package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +249 -0
  1228. package/pages/c/_cluster/fleet/index.vue +506 -0
  1229. package/pages/c/_cluster/gatekeeper/constraints/index.vue +90 -0
  1230. package/pages/c/_cluster/gatekeeper/index.vue +78 -0
  1231. package/pages/c/_cluster/istio/index.vue +149 -0
  1232. package/pages/c/_cluster/legacy/pages/_page.vue +29 -0
  1233. package/pages/c/_cluster/legacy/project/_page.vue +57 -0
  1234. package/pages/c/_cluster/legacy/project/index.vue +32 -0
  1235. package/pages/c/_cluster/legacy/project/pipelines.vue +96 -0
  1236. package/pages/c/_cluster/logging/index.vue +94 -0
  1237. package/pages/c/_cluster/longhorn/__tests__/longhorn.index.test.ts +92 -0
  1238. package/pages/c/_cluster/longhorn/index.vue +107 -0
  1239. package/pages/c/_cluster/manager/cloudCredential/_id.vue +15 -0
  1240. package/pages/c/_cluster/manager/cloudCredential/create.vue +15 -0
  1241. package/pages/c/_cluster/manager/cloudCredential/index.vue +158 -0
  1242. package/pages/c/_cluster/manager/drivers/kontainerDriver/_id.vue +12 -0
  1243. package/pages/c/_cluster/manager/drivers/kontainerDriver/create.vue +15 -0
  1244. package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +91 -0
  1245. package/pages/c/_cluster/manager/drivers/nodeDriver/_id.vue +12 -0
  1246. package/pages/c/_cluster/manager/drivers/nodeDriver/create.vue +15 -0
  1247. package/pages/c/_cluster/manager/drivers/nodeDriver/index.vue +60 -0
  1248. package/pages/c/_cluster/manager/jwt.authentication/index.vue +244 -0
  1249. package/pages/c/_cluster/manager/pages/_page.vue +22 -0
  1250. package/pages/c/_cluster/mcapps/pages/_page.vue +22 -0
  1251. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/index.vue +12 -0
  1252. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +320 -0
  1253. package/pages/c/_cluster/monitoring/alertmanagerconfig/index.vue +24 -0
  1254. package/pages/c/_cluster/monitoring/index.vue +202 -0
  1255. package/pages/c/_cluster/monitoring/monitor/_namespace/_id.vue +19 -0
  1256. package/pages/c/_cluster/monitoring/monitor/create.vue +27 -0
  1257. package/pages/c/_cluster/monitoring/monitor/index.vue +99 -0
  1258. package/pages/c/_cluster/monitoring/route-receiver/_id.vue +27 -0
  1259. package/pages/c/_cluster/monitoring/route-receiver/create.vue +19 -0
  1260. package/pages/c/_cluster/monitoring/route-receiver/index.vue +133 -0
  1261. package/pages/c/_cluster/navlinks/_group.vue +42 -0
  1262. package/pages/c/_cluster/neuvector/index.vue +75 -0
  1263. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +128 -0
  1264. package/pages/c/_cluster/settings/banners.vue +361 -0
  1265. package/pages/c/_cluster/settings/brand.vue +648 -0
  1266. package/pages/c/_cluster/settings/index.vue +20 -0
  1267. package/pages/c/_cluster/settings/links.vue +167 -0
  1268. package/pages/c/_cluster/settings/performance.vue +515 -0
  1269. package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +175 -0
  1270. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +551 -0
  1271. package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +193 -0
  1272. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +134 -0
  1273. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +261 -0
  1274. package/pages/c/_cluster/uiplugins/InstallDialog.vue +366 -0
  1275. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +503 -0
  1276. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +83 -0
  1277. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +152 -0
  1278. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +76 -0
  1279. package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +77 -0
  1280. package/pages/c/_cluster/uiplugins/index.vue +1288 -0
  1281. package/pages/clusters/index.vue +21 -0
  1282. package/pages/diagnostic.vue +532 -0
  1283. package/pages/fail-whale.vue +197 -0
  1284. package/pages/home.vue +848 -0
  1285. package/pages/index.vue +54 -0
  1286. package/pages/prefs.vue +367 -0
  1287. package/pages/support/index.vue +263 -0
  1288. package/pkg/auto-import.js +118 -0
  1289. package/pkg/babel.config.js +8 -0
  1290. package/pkg/dynamic-importer.lib.js +82 -0
  1291. package/pkg/dynamic-plugin-loader.js +28 -0
  1292. package/pkg/import.js +10 -0
  1293. package/pkg/model-loader-require.lib.js +3 -0
  1294. package/pkg/tsconfig.json +65 -0
  1295. package/pkg/vue.config.js +146 -0
  1296. package/plugins/axios.js +31 -0
  1297. package/plugins/clean-html.js +103 -0
  1298. package/plugins/codemirror-loader.js +5 -0
  1299. package/plugins/codemirror.js +359 -0
  1300. package/plugins/dashboard-store/__tests__/actions.test.ts +250 -0
  1301. package/plugins/dashboard-store/__tests__/getters.test.ts +100 -0
  1302. package/plugins/dashboard-store/__tests__/mutations.test.ts +391 -0
  1303. package/plugins/dashboard-store/__tests__/resource-class.test.ts +49 -0
  1304. package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +7 -0
  1305. package/plugins/dashboard-store/actions.js +784 -0
  1306. package/plugins/dashboard-store/classify.js +18 -0
  1307. package/plugins/dashboard-store/getters.js +457 -0
  1308. package/plugins/dashboard-store/index.js +53 -0
  1309. package/plugins/dashboard-store/model-loader-require.js +12 -0
  1310. package/plugins/dashboard-store/model-loader.js +76 -0
  1311. package/plugins/dashboard-store/mutations.js +548 -0
  1312. package/plugins/dashboard-store/normalize.js +48 -0
  1313. package/plugins/dashboard-store/resource-class.js +1902 -0
  1314. package/plugins/ember-cookie.js +13 -0
  1315. package/plugins/extend-router.js +80 -0
  1316. package/plugins/floating-vue.js +1 -0
  1317. package/plugins/formatters.js +15 -0
  1318. package/plugins/global-formatters.js +20 -0
  1319. package/plugins/i18n.js +136 -0
  1320. package/plugins/js-yaml.js +4 -0
  1321. package/plugins/nuxt-client-init.js +3 -0
  1322. package/plugins/plugin.js +93 -0
  1323. package/plugins/replaceall.js +19 -0
  1324. package/plugins/shortkey.js +282 -0
  1325. package/plugins/steve/__tests__/getters.test.ts +214 -0
  1326. package/plugins/steve/__tests__/header-warnings.test.ts +238 -0
  1327. package/plugins/steve/__tests__/mutations.test.ts +50 -0
  1328. package/plugins/steve/__tests__/resource-utils.test.ts +159 -0
  1329. package/plugins/steve/__tests__/steve-class.test.ts +59 -0
  1330. package/plugins/steve/__tests__/subscribe.spec.ts +109 -0
  1331. package/plugins/steve/__tests__/utils/mutation.test.helpers.ts +105 -0
  1332. package/plugins/steve/__tests__/utils/steve-mocks.ts +31 -0
  1333. package/plugins/steve/accept-or-reject-socket-message.ts +103 -0
  1334. package/plugins/steve/actions.js +386 -0
  1335. package/plugins/steve/caches/resourceCache.js +60 -0
  1336. package/plugins/steve/getters.js +342 -0
  1337. package/plugins/steve/header-warnings.ts +91 -0
  1338. package/plugins/steve/hybrid-class.js +102 -0
  1339. package/plugins/steve/index.js +76 -0
  1340. package/plugins/steve/mutations.js +210 -0
  1341. package/plugins/steve/norman-class.js +198 -0
  1342. package/plugins/steve/performanceTesting.js +128 -0
  1343. package/plugins/steve/projectAndNamespaceFiltering.utils.ts +80 -0
  1344. package/plugins/steve/resource-utils.ts +38 -0
  1345. package/plugins/steve/resourceWatcher.js +251 -0
  1346. package/plugins/steve/schema.d.ts +22 -0
  1347. package/plugins/steve/schema.utils.js +25 -0
  1348. package/plugins/steve/steve-class.js +61 -0
  1349. package/plugins/steve/steve-description-class.js +36 -0
  1350. package/plugins/steve/steve-pagination-utils.ts +513 -0
  1351. package/plugins/steve/subscribe.js +1092 -0
  1352. package/plugins/steve/worker/index.js +24 -0
  1353. package/plugins/steve/worker/web-worker.advanced.js +320 -0
  1354. package/plugins/steve/worker/web-worker.basic.js +116 -0
  1355. package/plugins/steve-create-worker.js +14 -0
  1356. package/plugins/version.js +11 -0
  1357. package/promptRemove/management.cattle.io.fleetworkspace.vue +98 -0
  1358. package/promptRemove/management.cattle.io.globalrole.vue +49 -0
  1359. package/promptRemove/management.cattle.io.project.vue +131 -0
  1360. package/promptRemove/management.cattle.io.roletemplate.vue +51 -0
  1361. package/promptRemove/mixin/roleDeletionCheck.js +105 -0
  1362. package/promptRemove/pod.vue +132 -0
  1363. package/public/index.html +74 -0
  1364. package/rancher-components/Accordion/Accordion.test.ts +45 -0
  1365. package/rancher-components/Accordion/Accordion.vue +86 -0
  1366. package/rancher-components/Accordion/index.ts +1 -0
  1367. package/rancher-components/BadgeState/BadgeState.test.ts +12 -0
  1368. package/rancher-components/BadgeState/BadgeState.vue +118 -0
  1369. package/rancher-components/BadgeState/index.ts +1 -0
  1370. package/rancher-components/Banner/Banner.test.ts +59 -0
  1371. package/rancher-components/Banner/Banner.vue +257 -0
  1372. package/rancher-components/Banner/index.ts +1 -0
  1373. package/rancher-components/Card/Card.test.ts +37 -0
  1374. package/rancher-components/Card/Card.vue +187 -0
  1375. package/rancher-components/Card/index.ts +1 -0
  1376. package/rancher-components/Form/Checkbox/Checkbox.test.ts +68 -0
  1377. package/rancher-components/Form/Checkbox/Checkbox.vue +488 -0
  1378. package/rancher-components/Form/Checkbox/index.ts +1 -0
  1379. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +57 -0
  1380. package/rancher-components/Form/LabeledInput/LabeledInput.vue +471 -0
  1381. package/rancher-components/Form/LabeledInput/index.ts +1 -0
  1382. package/rancher-components/Form/Radio/RadioButton.test.ts +33 -0
  1383. package/rancher-components/Form/Radio/RadioButton.vue +304 -0
  1384. package/rancher-components/Form/Radio/RadioGroup.test.ts +27 -0
  1385. package/rancher-components/Form/Radio/RadioGroup.vue +298 -0
  1386. package/rancher-components/Form/Radio/index.ts +2 -0
  1387. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +199 -0
  1388. package/rancher-components/Form/TextArea/index.ts +1 -0
  1389. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +94 -0
  1390. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +192 -0
  1391. package/rancher-components/Form/ToggleSwitch/index.ts +1 -0
  1392. package/rancher-components/Form/index.ts +5 -0
  1393. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +140 -0
  1394. package/rancher-components/LabeledTooltip/index.ts +1 -0
  1395. package/rancher-components/RcButton/RcButton.test.ts +97 -0
  1396. package/rancher-components/RcButton/RcButton.vue +95 -0
  1397. package/rancher-components/RcButton/index.ts +2 -0
  1398. package/rancher-components/RcButton/types.ts +17 -0
  1399. package/rancher-components/RcDropdown/RcDropdown.vue +124 -0
  1400. package/rancher-components/RcDropdown/RcDropdownItem.vue +121 -0
  1401. package/rancher-components/RcDropdown/RcDropdownMenu.vue +66 -0
  1402. package/rancher-components/RcDropdown/RcDropdownSeparator.vue +6 -0
  1403. package/rancher-components/RcDropdown/RcDropdownTrigger.vue +42 -0
  1404. package/rancher-components/RcDropdown/index.ts +5 -0
  1405. package/rancher-components/RcDropdown/types.ts +49 -0
  1406. package/rancher-components/RcDropdown/useDropdownCollection.ts +46 -0
  1407. package/rancher-components/RcDropdown/useDropdownContext.ts +113 -0
  1408. package/rancher-components/StringList/StringList.test.ts +754 -0
  1409. package/rancher-components/StringList/StringList.vue +645 -0
  1410. package/rancher-components/StringList/index.ts +1 -0
  1411. package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +69 -0
  1412. package/scripts/build-pkg.sh +102 -0
  1413. package/scripts/clean +6 -0
  1414. package/scripts/drone-build-pkg.sh +31 -0
  1415. package/scripts/extension/bundle +86 -0
  1416. package/scripts/extension/helm/charts/ui-plugin-server/.helmignore +23 -0
  1417. package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +18 -0
  1418. package/scripts/extension/helm/charts/ui-plugin-server/templates/_helpers.tpl +63 -0
  1419. package/scripts/extension/helm/charts/ui-plugin-server/templates/cr.yaml +14 -0
  1420. package/scripts/extension/helm/charts/ui-plugin-server/values.yaml +8 -0
  1421. package/scripts/extension/helm/package/Dockerfile +27 -0
  1422. package/scripts/extension/helm/package/nginx.conf +17 -0
  1423. package/scripts/extension/helm/scripts/package +31 -0
  1424. package/scripts/extension/helm/scripts/patch +128 -0
  1425. package/scripts/extension/helm/scripts/version +31 -0
  1426. package/scripts/extension/helmpatch +67 -0
  1427. package/scripts/extension/parse-tag-name +39 -0
  1428. package/scripts/extension/publish +476 -0
  1429. package/scripts/pkgfile.js +23 -0
  1430. package/scripts/publish-pkg.sh +18 -0
  1431. package/scripts/publish-shell.sh +115 -0
  1432. package/scripts/record-deps.js +37 -0
  1433. package/scripts/serve-pkgs +71 -0
  1434. package/scripts/sync-shell-deps +37 -0
  1435. package/scripts/test-plugins-build.sh +248 -0
  1436. package/scripts/typegen.sh +102 -0
  1437. package/scripts/vue-migrate.js +686 -0
  1438. package/server/har-file.js +183 -0
  1439. package/server/server-middleware.js +11 -0
  1440. package/server/server.crt +22 -0
  1441. package/server/server.csr +16 -0
  1442. package/server/server.key +27 -0
  1443. package/server/v3.ext +8 -0
  1444. package/static/favicon.ico +0 -0
  1445. package/static/favicon.png +0 -0
  1446. package/static/loading-indicator.html +39 -0
  1447. package/store/__tests__/auth.test.ts +120 -0
  1448. package/store/__tests__/catalog.test.ts +207 -0
  1449. package/store/__tests__/index.test.ts +110 -0
  1450. package/store/__tests__/type-map.test.ts +1122 -0
  1451. package/store/action-menu.js +240 -0
  1452. package/store/auth.js +409 -0
  1453. package/store/aws.js +256 -0
  1454. package/store/catalog.js +666 -0
  1455. package/store/cru-resource.ts +26 -0
  1456. package/store/customisation.js +35 -0
  1457. package/store/digitalocean.js +198 -0
  1458. package/store/features.js +73 -0
  1459. package/store/github.js +109 -0
  1460. package/store/gitlab.js +159 -0
  1461. package/store/growl.js +98 -0
  1462. package/store/i18n.js +356 -0
  1463. package/store/index.js +1290 -0
  1464. package/store/linode.js +142 -0
  1465. package/store/plugins.js +210 -0
  1466. package/store/pnap.js +128 -0
  1467. package/store/prefs.js +531 -0
  1468. package/store/resource-fetch.js +44 -0
  1469. package/store/store-types.js +7 -0
  1470. package/store/type-map.js +2057 -0
  1471. package/store/type-map.utils.ts +243 -0
  1472. package/store/uiplugins.ts +67 -0
  1473. package/store/wm.js +95 -0
  1474. package/tsconfig.json +48 -0
  1475. package/tsconfig.paths.json +21 -0
  1476. package/types/api.d.ts +1 -0
  1477. package/types/components/labeledSelect.ts +50 -0
  1478. package/types/components/paginatedResourceTable.ts +25 -0
  1479. package/types/components/resourceLabeledSelect.ts +48 -0
  1480. package/types/fleet.d.ts +1 -0
  1481. package/types/form.ts +1 -0
  1482. package/types/generic.ts +2 -0
  1483. package/types/rancher/index.d.ts +9 -0
  1484. package/types/resources/fleet.d.ts +57 -0
  1485. package/types/resources/pod-security-admission.ts +36 -0
  1486. package/types/resources/settings.d.ts +93 -0
  1487. package/types/resources/userPreferences.d.ts +13 -0
  1488. package/types/shell/index.d.ts +4704 -0
  1489. package/types/store/dashboard-store.types.ts +46 -0
  1490. package/types/store/pagination.types.ts +470 -0
  1491. package/types/store/type-map.ts +30 -0
  1492. package/types/store/vuex.d.ts +17 -0
  1493. package/types/t.ts +1 -0
  1494. package/types/vue-shim.d +20 -0
  1495. package/types/vue-shim.d.ts +20 -0
  1496. package/utils/__mocks__/socket.js +21 -0
  1497. package/utils/__tests__/array.test.ts +514 -0
  1498. package/utils/__tests__/cluster.test.ts +57 -0
  1499. package/utils/__tests__/create-yaml.test.ts +490 -0
  1500. package/utils/__tests__/formatter.test.ts +77 -0
  1501. package/utils/__tests__/grafana.test.ts +44 -0
  1502. package/utils/__tests__/kontainer.test.ts +180 -0
  1503. package/utils/__tests__/object.test.ts +409 -0
  1504. package/utils/__tests__/pod-security-admission.test.ts +61 -0
  1505. package/utils/__tests__/selector.test.ts +444 -0
  1506. package/utils/__tests__/sort.test.ts +61 -0
  1507. package/utils/__tests__/string.test.ts +91 -0
  1508. package/utils/__tests__/version.test.ts +18 -0
  1509. package/utils/alertmanagerconfig.js +181 -0
  1510. package/utils/array.ts +256 -0
  1511. package/utils/async.ts +38 -0
  1512. package/utils/auth.js +334 -0
  1513. package/utils/aws.js +0 -0
  1514. package/utils/axios.js +171 -0
  1515. package/utils/azure.js +24 -0
  1516. package/utils/banners.js +103 -0
  1517. package/utils/clipboard.js +5 -0
  1518. package/utils/cluster.js +298 -0
  1519. package/utils/color.js +147 -0
  1520. package/utils/computed.js +45 -0
  1521. package/utils/config.js +4 -0
  1522. package/utils/cookie-universal.js +10 -0
  1523. package/utils/create-yaml.js +518 -0
  1524. package/utils/crypto/LICENSE.txt +15 -0
  1525. package/utils/crypto/browserHashUtils.js +51 -0
  1526. package/utils/crypto/browserMd5.js +183 -0
  1527. package/utils/crypto/browserSha1.js +149 -0
  1528. package/utils/crypto/browserSha256.js +237 -0
  1529. package/utils/crypto/index.js +181 -0
  1530. package/utils/custom-validators.js +32 -0
  1531. package/utils/dom.js +15 -0
  1532. package/utils/download.js +35 -0
  1533. package/utils/duration.js +43 -0
  1534. package/utils/dynamic-importer.js +134 -0
  1535. package/utils/ember-page.js +30 -0
  1536. package/utils/error.js +131 -0
  1537. package/utils/favicon.js +49 -0
  1538. package/utils/fleet.ts +191 -0
  1539. package/utils/formatter.js +13 -0
  1540. package/utils/gatekeeper/util.js +35 -0
  1541. package/utils/gc/gc-interval.ts +40 -0
  1542. package/utils/gc/gc-root-store.js +76 -0
  1543. package/utils/gc/gc-route-changed.ts +44 -0
  1544. package/utils/gc/gc-types.ts +21 -0
  1545. package/utils/gc/gc.ts +282 -0
  1546. package/utils/git.ts +92 -0
  1547. package/utils/grafana.js +114 -0
  1548. package/utils/ingress.ts +64 -0
  1549. package/utils/kontainer.ts +190 -0
  1550. package/utils/kube.js +9 -0
  1551. package/utils/monitoring.js +63 -0
  1552. package/utils/namespace-filter.js +43 -0
  1553. package/utils/object.js +501 -0
  1554. package/utils/pagination-utils.ts +176 -0
  1555. package/utils/pagination-wrapper.ts +70 -0
  1556. package/utils/parse-externalid.js +139 -0
  1557. package/utils/platform.js +64 -0
  1558. package/utils/pod-security-admission.ts +39 -0
  1559. package/utils/poller-sequential.js +53 -0
  1560. package/utils/poller.js +39 -0
  1561. package/utils/position.js +172 -0
  1562. package/utils/promise.js +115 -0
  1563. package/utils/queue.js +70 -0
  1564. package/utils/router.js +119 -0
  1565. package/utils/select.js +65 -0
  1566. package/utils/selector.js +229 -0
  1567. package/utils/settings.ts +108 -0
  1568. package/utils/socket.js +409 -0
  1569. package/utils/sort.js +225 -0
  1570. package/utils/stream.js +49 -0
  1571. package/utils/string.js +362 -0
  1572. package/utils/svg-filter.js +301 -0
  1573. package/utils/time.js +121 -0
  1574. package/utils/title.ts +3 -0
  1575. package/utils/type-helpers.ts +9 -0
  1576. package/utils/uiplugins.ts +319 -0
  1577. package/utils/unit-tests/ChildRenderingRouterLinkStub.ts +36 -0
  1578. package/utils/units.js +184 -0
  1579. package/utils/url.ts +171 -0
  1580. package/utils/v-sphere.ts +285 -0
  1581. package/utils/validators/__tests__/cidr.test.ts +33 -0
  1582. package/utils/validators/cidr.js +14 -0
  1583. package/utils/validators/cluster-name.js +12 -0
  1584. package/utils/validators/container-images.js +24 -0
  1585. package/utils/validators/cron-schedule.js +14 -0
  1586. package/utils/validators/flow-output.js +15 -0
  1587. package/utils/validators/formRules/__tests__/index.test.ts +1218 -0
  1588. package/utils/validators/formRules/index.ts +535 -0
  1589. package/utils/validators/index.js +244 -0
  1590. package/utils/validators/kubernetes-name.js +39 -0
  1591. package/utils/validators/logging-outputs.js +11 -0
  1592. package/utils/validators/monitoring-route.js +13 -0
  1593. package/utils/validators/pod-affinity.js +128 -0
  1594. package/utils/validators/prometheusrule.js +76 -0
  1595. package/utils/validators/role-template.js +27 -0
  1596. package/utils/validators/service.js +136 -0
  1597. package/utils/validators/setting.js +9 -0
  1598. package/utils/version.js +128 -0
  1599. package/utils/versions.ts +39 -0
  1600. package/utils/width.js +39 -0
  1601. package/utils/window.js +46 -0
  1602. package/vue-config-helper.js +135 -0
  1603. package/vue.config.js +577 -0
@@ -0,0 +1,1902 @@
1
+ import { NORMAN_NAME } from '@shell/config/labels-annotations';
2
+ import {
3
+ _CLONE,
4
+ _CONFIG,
5
+ _EDIT,
6
+ _UNFLAG,
7
+ _VIEW,
8
+ _YAML,
9
+ AS,
10
+ MODE
11
+ } from '@shell/config/query-params';
12
+ import { VIEW_IN_API, DEV } from '@shell/store/prefs';
13
+ import { addObject, addObjects, findBy, removeAt } from '@shell/utils/array';
14
+ import CustomValidators from '@shell/utils/custom-validators';
15
+ import { downloadFile, generateZip } from '@shell/utils/download';
16
+ import { clone, get } from '@shell/utils/object';
17
+ import { eachLimit } from '@shell/utils/promise';
18
+ import { sortableNumericSuffix } from '@shell/utils/sort';
19
+ import { escapeHtml, ucFirst } from '@shell/utils/string';
20
+ import {
21
+ validateChars,
22
+ validateDnsLikeTypes,
23
+ validateLength,
24
+ } from '@shell/utils/validators';
25
+ import formRulesGenerator from '@shell/utils/validators/formRules/index';
26
+ import { waitFor } from '@shell/utils/async';
27
+ import jsyaml from 'js-yaml';
28
+ import compact from 'lodash/compact';
29
+ import forIn from 'lodash/forIn';
30
+ import isEmpty from 'lodash/isEmpty';
31
+ import isFunction from 'lodash/isFunction';
32
+ import isString from 'lodash/isString';
33
+ import { markRaw } from 'vue';
34
+
35
+ import { ExtensionPoint, ActionLocation } from '@shell/core/types';
36
+ import { getApplicableExtensionEnhancements } from '@shell/core/plugin-helpers';
37
+
38
+ export const DNS_LIKE_TYPES = ['dnsLabel', 'dnsLabelRestricted', 'hostname'];
39
+
40
+ const REMAP_STATE = {
41
+ disabled: 'inactive',
42
+ notapplied: 'Not Applied',
43
+ notready: 'Not Ready',
44
+ waitapplied: 'Wait Applied',
45
+ outofsync: 'Out of Sync',
46
+ 'in-progress': 'In Progress',
47
+ gitupdating: 'Git Updating',
48
+ errapplied: 'Err Applied',
49
+ waitcheckin: 'Wait Check-In',
50
+ off: 'Disabled',
51
+ waitingforinfrastructure: 'Waiting for Infra',
52
+ waitingfornoderef: 'Waiting for Node Ref'
53
+ };
54
+
55
+ const DEFAULT_COLOR = 'warning';
56
+ const DEFAULT_ICON = 'x';
57
+
58
+ const DEFAULT_WAIT_INTERVAL = 1000;
59
+ const DEFAULT_WAIT_TMIMEOUT = 30000;
60
+
61
+ export const STATES_ENUM = {
62
+ IN_USE: 'in-use',
63
+ IN_PROGRESS: 'in-progress',
64
+ PENDING_ROLLBACK: 'pending-rollback',
65
+ PENDING_UPGRADE: 'pending-upgrade',
66
+ ABORTED: 'aborted',
67
+ ACTIVATING: 'activating',
68
+ ACTIVE: 'active',
69
+ AVAILABLE: 'available',
70
+ BACKED_UP: 'backedup',
71
+ BOUND: 'bound',
72
+ BUILDING: 'building',
73
+ COMPLETED: 'completed',
74
+ CORDONED: 'cordoned',
75
+ COUNT: 'count',
76
+ CREATED: 'created',
77
+ CREATING: 'creating',
78
+ DEACTIVATING: 'deactivating',
79
+ DEGRADED: 'degraded',
80
+ DENIED: 'denied',
81
+ DEPLOYED: 'deployed',
82
+ DEPLOYING: 'deploying',
83
+ DISABLED: 'disabled',
84
+ DISCONNECTED: 'disconnected',
85
+ DRAINED: 'drained',
86
+ DRAINING: 'draining',
87
+ ENABLED: 'enabled',
88
+ ERR_APPLIED: 'errapplied',
89
+ ERROR: 'error',
90
+ ERRORING: 'erroring',
91
+ ERRORS: 'errors',
92
+ EXPIRED: 'expired',
93
+ EXPIRING: 'expiring',
94
+ FAIL: 'fail',
95
+ FAILED: 'failed',
96
+ HEALTHY: 'healthy',
97
+ INACTIVE: 'inactive',
98
+ INFO: 'info',
99
+ INITIALIZING: 'initializing',
100
+ INPROGRESS: 'inprogress',
101
+ LOCKED: 'locked',
102
+ MIGRATING: 'migrating',
103
+ MISSING: 'missing',
104
+ MODIFIED: 'modified',
105
+ NOT_APPLICABLE: 'notApplicable',
106
+ NOT_APLLIED: 'notapplied',
107
+ NOT_READY: 'notready',
108
+ OFF: 'off',
109
+ ORPHANED: 'orphaned',
110
+ OTHER: 'other',
111
+ OUT_OF_SYNC: 'outofsync',
112
+ ON_GOING: 'on-going',
113
+ PASS: 'pass',
114
+ PASSED: 'passed',
115
+ PAUSED: 'paused',
116
+ PENDING: 'pending',
117
+ PROVISIONING: 'provisioning',
118
+ PROVISIONED: 'provisioned',
119
+ PURGED: 'purged',
120
+ PURGING: 'purging',
121
+ READY: 'ready',
122
+ RECONNECTING: 'reconnecting',
123
+ REGISTERING: 'registering',
124
+ REINITIALIZING: 'reinitializing',
125
+ RELEASED: 'released',
126
+ REMOVED: 'removed',
127
+ REMOVING: 'removing',
128
+ REQUESTED: 'requested',
129
+ RESTARTING: 'restarting',
130
+ RESTORING: 'restoring',
131
+ RESIZING: 'resizing',
132
+ RUNNING: 'running',
133
+ SKIP: 'skip',
134
+ SKIPPED: 'skipped',
135
+ STARTING: 'starting',
136
+ STOPPED: 'stopped',
137
+ STOPPING: 'stopping',
138
+ SUCCEEDED: 'succeeded',
139
+ SUCCESS: 'success',
140
+ SUCCESSFUL: 'successful',
141
+ SUPERSEDED: 'superseded',
142
+ SUSPENDED: 'suspended',
143
+ UNAVAILABLE: 'unavailable',
144
+ UNHEALTHY: 'unhealthy',
145
+ UNINSTALLED: 'uninstalled',
146
+ UNINSTALLING: 'uninstalling',
147
+ UNKNOWN: 'unknown',
148
+ UNTRIGGERED: 'untriggered',
149
+ UPDATING: 'updating',
150
+ WAIT_APPLIED: 'waitapplied',
151
+ WAIT_CHECKIN: 'waitcheckin',
152
+ WAITING: 'waiting',
153
+ WARNING: 'warning',
154
+ };
155
+
156
+ export function mapStateToEnum(statusString) {
157
+ // e.g. in fleet Status is Capitalized. This function will map it to the enum
158
+ return Object.values(STATES_ENUM).find((val) => {
159
+ return val.toLowerCase() === statusString.toLocaleLowerCase();
160
+ });
161
+ }
162
+
163
+ export const STATES = {
164
+ [STATES_ENUM.IN_USE]: {
165
+ color: 'success', icon: 'dot-open', label: 'In Use', compoundIcon: 'checkmark'
166
+ },
167
+ [STATES_ENUM.IN_PROGRESS]: {
168
+ color: 'info', icon: 'tag', label: 'In Progress', compoundIcon: 'info'
169
+ },
170
+ [STATES_ENUM.PENDING_ROLLBACK]: {
171
+ color: 'info', icon: 'dot-half', label: 'Pending Rollback', compoundIcon: 'info'
172
+ },
173
+ [STATES_ENUM.PENDING_UPGRADE]: {
174
+ color: 'info', icon: 'dot-half', label: 'Pending Update', compoundIcon: 'info'
175
+ },
176
+ [STATES_ENUM.ABORTED]: {
177
+ color: 'warning', icon: 'error', label: 'Aborted', compoundIcon: 'warning'
178
+ },
179
+ [STATES_ENUM.ACTIVATING]: {
180
+ color: 'info', icon: 'tag', label: 'Activating', compoundIcon: 'info'
181
+ },
182
+ [STATES_ENUM.ACTIVE]: {
183
+ color: 'success', icon: 'dot-open', label: 'Active', compoundIcon: 'checkmark'
184
+ },
185
+ [STATES_ENUM.AVAILABLE]: {
186
+ color: 'success', icon: 'dot-open', label: 'Available', compoundIcon: 'checkmark'
187
+ },
188
+ [STATES_ENUM.BACKED_UP]: {
189
+ color: 'success', icon: 'backup', label: 'Backed Up', compoundIcon: 'checkmark'
190
+ },
191
+ [STATES_ENUM.BOUND]: {
192
+ color: 'success', icon: 'dot', label: 'Bound', compoundIcon: 'checkmark'
193
+ },
194
+ [STATES_ENUM.BUILDING]: {
195
+ color: 'success', icon: 'dot-open', label: 'Building', compoundIcon: 'checkmark'
196
+ },
197
+ [STATES_ENUM.COMPLETED]: {
198
+ color: 'success', icon: 'dot', label: 'Completed', compoundIcon: 'checkmark'
199
+ },
200
+ [STATES_ENUM.CORDONED]: {
201
+ color: 'info', icon: 'tag', label: 'Cordoned', compoundIcon: 'info'
202
+ },
203
+ [STATES_ENUM.COUNT]: {
204
+ color: 'success', icon: 'dot-open', label: 'Count', compoundIcon: 'checkmark'
205
+ },
206
+ [STATES_ENUM.CREATED]: {
207
+ color: 'info', icon: 'tag', label: 'Created', compoundIcon: 'info'
208
+ },
209
+ [STATES_ENUM.CREATING]: {
210
+ color: 'info', icon: 'tag', label: 'Creating', compoundIcon: 'info'
211
+ },
212
+ [STATES_ENUM.DEACTIVATING]: {
213
+ color: 'info', icon: 'adjust', label: 'Deactivating', compoundIcon: 'info'
214
+ },
215
+ [STATES_ENUM.DEGRADED]: {
216
+ color: 'warning', icon: 'error', label: 'Degraded', compoundIcon: 'warning'
217
+ },
218
+ [STATES_ENUM.DENIED]: {
219
+ color: 'error', icon: 'adjust', label: 'Denied', compoundIcon: 'error'
220
+ },
221
+ [STATES_ENUM.DEPLOYED]: {
222
+ color: 'success', icon: 'dot-open', label: 'Deployed', compoundIcon: 'checkmark'
223
+ },
224
+ [STATES_ENUM.DISABLED]: {
225
+ color: 'warning', icon: 'error', label: 'Disabled', compoundIcon: 'warning'
226
+ },
227
+ [STATES_ENUM.DISCONNECTED]: {
228
+ color: 'warning', icon: 'error', label: 'Disconnected', compoundIcon: 'warning'
229
+ },
230
+ [STATES_ENUM.DRAINED]: {
231
+ color: 'info', icon: 'tag', label: 'Drained', compoundIcon: 'info'
232
+ },
233
+ [STATES_ENUM.DRAINING]: {
234
+ color: 'warning', icon: 'tag', label: 'Draining', compoundIcon: 'warning'
235
+ },
236
+ [STATES_ENUM.ENABLED]: {
237
+ color: 'success', icon: 'dot-open', label: 'Enabled', compoundIcon: 'checkmark'
238
+ },
239
+ [STATES_ENUM.ERR_APPLIED]: {
240
+ color: 'error', icon: 'error', label: 'Error Applied', compoundIcon: 'error'
241
+ },
242
+ [STATES_ENUM.ERROR]: {
243
+ color: 'error', icon: 'error', label: 'Error', compoundIcon: 'error'
244
+ },
245
+ [STATES_ENUM.ERRORING]: {
246
+ color: 'error', icon: 'error', label: 'Erroring', compoundIcon: 'error'
247
+ },
248
+ [STATES_ENUM.ERRORS]: {
249
+ color: 'error', icon: 'error', label: 'Errors', compoundIcon: 'error'
250
+ },
251
+ [STATES_ENUM.EXPIRED]: {
252
+ color: 'error', icon: 'error', label: 'Expired', compoundIcon: 'warning'
253
+ },
254
+ [STATES_ENUM.EXPIRING]: {
255
+ color: 'warning', icon: 'error', label: 'Expiring', compoundIcon: 'error'
256
+ },
257
+ [STATES_ENUM.FAIL]: {
258
+ color: 'error', icon: 'error', label: 'Fail', compoundIcon: 'error'
259
+ },
260
+ [STATES_ENUM.FAILED]: {
261
+ color: 'error', icon: 'error', label: 'Failed', compoundIcon: 'error'
262
+ },
263
+ [STATES_ENUM.HEALTHY]: {
264
+ color: 'success', icon: 'dot-open', label: 'Healthy', compoundIcon: 'checkmark'
265
+ },
266
+ [STATES_ENUM.INACTIVE]: {
267
+ color: 'error', icon: 'dot', label: 'Inactive', compoundIcon: 'error'
268
+ },
269
+ [STATES_ENUM.INITIALIZING]: {
270
+ color: 'warning', icon: 'error', label: 'Initializing', compoundIcon: 'warning'
271
+ },
272
+ [STATES_ENUM.INPROGRESS]: {
273
+ color: 'info', icon: 'spinner', label: 'In Progress', compoundIcon: 'info'
274
+ },
275
+ [STATES_ENUM.INFO]: {
276
+ color: 'info', icon: 'info', label: 'Info', compoundIcon: 'info'
277
+ },
278
+ [STATES_ENUM.LOCKED]: {
279
+ color: 'warning', icon: 'adjust', label: 'Locked', compoundIcon: 'warning'
280
+ },
281
+ [STATES_ENUM.MIGRATING]: {
282
+ color: 'info', icon: 'info', label: 'Migrated', compoundIcon: 'info'
283
+ },
284
+ [STATES_ENUM.MISSING]: {
285
+ color: 'warning', icon: 'adjust', label: 'Missing', compoundIcon: 'warning'
286
+ },
287
+ [STATES_ENUM.MODIFIED]: {
288
+ color: 'warning', icon: 'edit', label: 'Modified', compoundIcon: 'warning'
289
+ },
290
+ [STATES_ENUM.NOT_APPLICABLE]: {
291
+ color: 'warning', icon: 'tag', label: 'Not Applicable', compoundIcon: 'warning'
292
+ },
293
+ [STATES_ENUM.NOT_APLLIED]: {
294
+ color: 'warning', icon: 'tag', label: 'Not Applied', compoundIcon: 'warning'
295
+ },
296
+ [STATES_ENUM.NOT_READY]: {
297
+ color: 'warning', icon: 'tag', label: 'Not Ready', compoundIcon: 'warning'
298
+ },
299
+ [STATES_ENUM.OFF]: {
300
+ color: 'darker', icon: 'error', label: 'Off'
301
+ },
302
+ [STATES_ENUM.ON_GOING]: {
303
+ color: 'info', icon: 'info', label: 'Info', compoundIcon: 'info'
304
+ },
305
+ [STATES_ENUM.ORPHANED]: {
306
+ color: 'warning', icon: 'tag', label: 'Orphaned', compoundIcon: 'warning'
307
+ },
308
+ [STATES_ENUM.OTHER]: {
309
+ color: 'info', icon: 'info', label: 'Other', compoundIcon: 'info'
310
+ },
311
+ [STATES_ENUM.OUT_OF_SYNC]: {
312
+ color: 'warning', icon: 'tag', label: 'Out Of Sync', compoundIcon: 'warning'
313
+ },
314
+ [STATES_ENUM.PASS]: {
315
+ color: 'success', icon: 'dot-dotfill', label: 'Pass', compoundIcon: 'checkmark'
316
+ },
317
+ [STATES_ENUM.PASSED]: {
318
+ color: 'success', icon: 'dot-dotfill', label: 'Passed', compoundIcon: 'checkmark'
319
+ },
320
+ [STATES_ENUM.PAUSED]: {
321
+ color: 'info', icon: 'info', label: 'Paused', compoundIcon: 'info'
322
+ },
323
+ [STATES_ENUM.PENDING]: {
324
+ color: 'info', icon: 'tag', label: 'Pending', compoundIcon: 'info'
325
+ },
326
+ [STATES_ENUM.PROVISIONING]: {
327
+ color: 'info', icon: 'dot', label: 'Provisioning', compoundIcon: 'info'
328
+ },
329
+ [STATES_ENUM.PROVISIONED]: {
330
+ color: 'success', icon: 'dot', label: 'Provisioned', compoundIcon: 'checkmark'
331
+ },
332
+ [STATES_ENUM.PURGED]: {
333
+ color: 'error', icon: 'purged', label: 'Purged', compoundIcon: 'error'
334
+ },
335
+ [STATES_ENUM.PURGING]: {
336
+ color: 'info', icon: 'purged', label: 'Purging', compoundIcon: 'info'
337
+ },
338
+ [STATES_ENUM.READY]: {
339
+ color: 'success', icon: 'dot-open', label: 'Ready', compoundIcon: 'checkmark'
340
+ },
341
+ [STATES_ENUM.RECONNECTING]: {
342
+ color: 'error', icon: 'error', label: 'Reconnecting', compoundIcon: 'error'
343
+ },
344
+ [STATES_ENUM.REGISTERING]: {
345
+ color: 'info', icon: 'tag', label: 'Registering', compoundIcon: 'info'
346
+ },
347
+ [STATES_ENUM.REINITIALIZING]: {
348
+ color: 'warning', icon: 'error', label: 'Reinitializing', compoundIcon: 'warning'
349
+ },
350
+ [STATES_ENUM.RELEASED]: {
351
+ color: 'warning', icon: 'error', label: 'Released', compoundIcon: 'warning'
352
+ },
353
+ [STATES_ENUM.REMOVED]: {
354
+ color: 'error', icon: 'trash', label: 'Removed', compoundIcon: 'error'
355
+ },
356
+ [STATES_ENUM.REMOVING]: {
357
+ color: 'info', icon: 'trash', label: 'Removing', compoundIcon: 'info'
358
+ },
359
+ [STATES_ENUM.REQUESTED]: {
360
+ color: 'info', icon: 'tag', label: 'Requested', compoundIcon: 'info'
361
+ },
362
+ [STATES_ENUM.RESTARTING]: {
363
+ color: 'info', icon: 'adjust', label: 'Restarting', compoundIcon: 'info'
364
+ },
365
+ [STATES_ENUM.RESTORING]: {
366
+ color: 'info', icon: 'medicalcross', label: 'Restoring', compoundIcon: 'info'
367
+ },
368
+ [STATES_ENUM.RESIZING]: {
369
+ color: 'warning', icon: 'dot', label: 'Resizing', compoundIcon: 'warning'
370
+ },
371
+ [STATES_ENUM.RUNNING]: {
372
+ color: 'success', icon: 'dot-open', label: 'Running', compoundIcon: 'checkmark'
373
+ },
374
+ [STATES_ENUM.SKIP]: {
375
+ color: 'info', icon: 'dot-open', label: 'Skip', compoundIcon: 'info'
376
+ },
377
+ [STATES_ENUM.SKIPPED]: {
378
+ color: 'info', icon: 'dot-open', label: 'Skipped', compoundIcon: 'info'
379
+ },
380
+ [STATES_ENUM.STARTING]: {
381
+ color: 'info', icon: 'adjust', label: 'Starting', compoundIcon: 'info'
382
+ },
383
+ [STATES_ENUM.STOPPED]: {
384
+ color: 'error', icon: 'dot', label: 'Stopped', compoundIcon: 'error'
385
+ },
386
+ [STATES_ENUM.STOPPING]: {
387
+ color: 'info', icon: 'adjust', label: 'Stopping', compoundIcon: 'info'
388
+ },
389
+ [STATES_ENUM.SUCCEEDED]: {
390
+ color: 'success', icon: 'dot-dotfill', label: 'Succeeded', compoundIcon: 'checkmark'
391
+ },
392
+ [STATES_ENUM.SUCCESS]: {
393
+ color: 'success', icon: 'dot-open', label: 'Success', compoundIcon: 'checkmark'
394
+ },
395
+ [STATES_ENUM.SUCCESSFUL]: {
396
+ color: 'success', icon: 'dot-open', label: 'Successful'
397
+ },
398
+ [STATES_ENUM.SUPERSEDED]: {
399
+ color: 'info', icon: 'dot-open', label: 'Superseded', compoundIcon: 'info'
400
+ },
401
+ [STATES_ENUM.SUSPENDED]: {
402
+ color: 'info', icon: 'pause', label: 'Suspended', compoundIcon: 'info'
403
+ },
404
+ [STATES_ENUM.UNAVAILABLE]: {
405
+ color: 'error', icon: 'error', label: 'Unavailable', compoundIcon: 'error'
406
+ },
407
+ [STATES_ENUM.UNHEALTHY]: {
408
+ color: 'error', icon: 'error', label: 'Unhealthy', compoundIcon: 'error'
409
+ },
410
+ [STATES_ENUM.UNINSTALLED]: {
411
+ color: 'info', icon: 'trash', label: 'Uninstalled', compoundIcon: 'info'
412
+ },
413
+ [STATES_ENUM.UNINSTALLING]: {
414
+ color: 'info', icon: 'trash', label: 'Uninstalling', compoundIcon: 'info'
415
+ },
416
+ [STATES_ENUM.UNKNOWN]: {
417
+ color: 'warning', icon: 'x', label: 'Unknown', compoundIcon: 'warning'
418
+ },
419
+ [STATES_ENUM.UNTRIGGERED]: {
420
+ color: 'success', icon: 'tag', label: 'Untriggered', compoundIcon: 'checkmark'
421
+ },
422
+ [STATES_ENUM.UPDATING]: {
423
+ color: 'warning', icon: 'tag', label: 'Updating', compoundIcon: 'warning'
424
+ },
425
+ [STATES_ENUM.WAIT_APPLIED]: {
426
+ color: 'info', icon: 'tag', label: 'Wait Applied', compoundIcon: 'info'
427
+ },
428
+ [STATES_ENUM.WAIT_CHECKIN]: {
429
+ color: 'warning', icon: 'tag', label: 'Wait Checkin', compoundIcon: 'warning'
430
+ },
431
+ [STATES_ENUM.WAITING]: {
432
+ color: 'info', icon: 'tag', label: 'Waiting', compoundIcon: 'info'
433
+ },
434
+ [STATES_ENUM.WARNING]: {
435
+ color: 'warning', icon: 'error', label: 'Warning', compoundIcon: 'warning'
436
+ },
437
+ [STATES_ENUM.DEPLOYING]: {
438
+ color: 'info', icon: 'info', label: 'Deploying', compoundIcon: 'info'
439
+ },
440
+ };
441
+
442
+ export function getStatesByType(type = 'info') {
443
+ const out = {
444
+ info: [],
445
+ error: [],
446
+ success: [],
447
+ warning: [],
448
+ unknown: [],
449
+ };
450
+
451
+ forIn(STATES, (state, stateKey) => {
452
+ if (state.color) {
453
+ if (out[state.color]) {
454
+ out[state.color].push(stateKey);
455
+ } else {
456
+ out.unknown.push(stateKey);
457
+ }
458
+ }
459
+ });
460
+
461
+ return out;
462
+ }
463
+
464
+ const SORT_ORDER = {
465
+ error: 1,
466
+ warning: 2,
467
+ info: 3,
468
+ success: 4,
469
+ ready: 5,
470
+ notready: 6,
471
+ other: 7,
472
+ };
473
+
474
+ export function getStateLabel(state) {
475
+ const lowercaseState = state.toLowerCase();
476
+
477
+ return STATES[lowercaseState] ? STATES[lowercaseState].label : STATES[STATES_ENUM.UNKNOWN].label;
478
+ }
479
+
480
+ export function colorForState(state, isError, isTransitioning) {
481
+ if ( isError ) {
482
+ return 'text-error';
483
+ }
484
+
485
+ if ( isTransitioning ) {
486
+ return 'text-info';
487
+ }
488
+
489
+ const key = (state || 'active').toLowerCase();
490
+ let color;
491
+
492
+ if ( STATES[key] && STATES[key].color ) {
493
+ color = maybeFn.call(this, STATES[key].color);
494
+ }
495
+
496
+ if ( !color ) {
497
+ color = DEFAULT_COLOR;
498
+ }
499
+
500
+ return `text-${ color }`;
501
+ }
502
+
503
+ export function stateDisplay(state) {
504
+ // @TODO use translations
505
+ const key = (state || 'active').toLowerCase();
506
+
507
+ if ( REMAP_STATE[key] ) {
508
+ return REMAP_STATE[key];
509
+ }
510
+
511
+ return key.split(/-/).map(ucFirst).join('-');
512
+ }
513
+
514
+ export function primaryDisplayStatusFromCount(status) {
515
+ const statusOrder = [
516
+ STATES_ENUM.ERROR,
517
+ STATES_ENUM.FAILED,
518
+ STATES_ENUM.WARNING,
519
+ STATES_ENUM.MODIFIED,
520
+ STATES_ENUM.WAIT_APPLIED,
521
+ STATES_ENUM.ORPHANED,
522
+ STATES_ENUM.MISSING,
523
+ STATES_ENUM.UNKNOWN,
524
+ STATES_ENUM.NOT_READY,
525
+ STATES_ENUM.READY,
526
+ ];
527
+
528
+ // sort status by order of statusOrder
529
+ const existingStatuses = Object.keys(status).filter((key) => {
530
+ return status[key] > 0 && statusOrder.includes(key.toLowerCase());
531
+ }).sort((a, b) => statusOrder.indexOf(a.toLowerCase()) - statusOrder.indexOf(b.toLowerCase()));
532
+
533
+ return existingStatuses[0] ? existingStatuses[0] : STATES_ENUM.UNKNOWN;
534
+ }
535
+
536
+ export function stateSort(color, display) {
537
+ color = color.replace(/^(text|bg)-/, '');
538
+
539
+ return `${ SORT_ORDER[color] || SORT_ORDER['other'] } ${ display }`;
540
+ }
541
+
542
+ export function isConditionReadyAndWaiting(condition) {
543
+ if (!condition) {
544
+ return false;
545
+ }
546
+
547
+ return condition?.type?.toLowerCase() === 'ready' && condition?.reason?.toLowerCase() === 'waiting';
548
+ }
549
+
550
+ function maybeFn(val) {
551
+ if ( isFunction(val) ) {
552
+ return val(this);
553
+ }
554
+
555
+ return val;
556
+ }
557
+
558
+ export default class Resource {
559
+ constructor(data, ctx = {}, rehydrateNamespace = null, setClone = false) {
560
+ for ( const k in data ) {
561
+ this[k] = data[k];
562
+ }
563
+
564
+ Object.defineProperty(this, '$ctx', {
565
+ value: markRaw(ctx),
566
+ enumerable: false,
567
+ });
568
+
569
+ if ( rehydrateNamespace ) {
570
+ Object.defineProperty(this, '__rehydrate', {
571
+ value: rehydrateNamespace,
572
+ enumerable: true,
573
+ configurable: true
574
+ });
575
+ }
576
+
577
+ if ( setClone ) {
578
+ Object.defineProperty(this, '__clone', {
579
+ value: true,
580
+ enumerable: true,
581
+ configurable: true,
582
+ writable: true
583
+ });
584
+ }
585
+ }
586
+
587
+ get '$getters'() {
588
+ return this.$ctx.getters;
589
+ }
590
+
591
+ get '$rootGetters'() {
592
+ return this.$ctx.rootGetters;
593
+ }
594
+
595
+ get '$dispatch'() {
596
+ return this.$ctx.dispatch;
597
+ }
598
+
599
+ get '$state'() {
600
+ return this.$ctx.state;
601
+ }
602
+
603
+ get '$rootState'() {
604
+ return this.$ctx.rootState;
605
+ }
606
+
607
+ get '$plugin'() {
608
+ return this.$ctx.rootState?.$plugin;
609
+ }
610
+
611
+ get customValidationRules() {
612
+ return [
613
+ /**
614
+ * Essentially a fake schema object with additional params to extend validation
615
+ *
616
+ * @param {nullable} Value is nullable
617
+ * @param {path} Path on the resource to the value to validate
618
+ * @param {required} Value required
619
+ * @param {requiredIf} Value required if value at path not empty
620
+ * @param {translationKey} Human readable display key for param in path e.g. metadata.name === Name
621
+ * @param {type} Type of field to validate
622
+ * @param {validators} array of strings where item is name of exported validator function in custom-validators, args can be passed by prepending args separated by colon. e.g maxLength:63
623
+ */
624
+ /* {
625
+ nullable: false,
626
+ path: 'spec.ports',
627
+ required: true,
628
+ type: 'array',
629
+ validators: ['servicePort'],
630
+ } */
631
+ ];
632
+ }
633
+
634
+ get _key() {
635
+ const m = this.metadata;
636
+
637
+ if ( m ) {
638
+ if ( m.uid ) {
639
+ return m.uid;
640
+ }
641
+
642
+ if ( m.namespace ) {
643
+ return `${ this.type }/${ m.namespace }/${ m.name }`;
644
+ }
645
+ }
646
+
647
+ if ( this.id ) {
648
+ return `${ this.type }/${ this.id }`;
649
+ }
650
+
651
+ return `${ this.type }/${ Math.random() }`;
652
+ }
653
+
654
+ get schema() {
655
+ return this.$getters['schemaFor'](this.type);
656
+ }
657
+
658
+ toString() {
659
+ return `[${ this.type }: ${ this.id }]`;
660
+ }
661
+
662
+ get typeDisplay() {
663
+ const schema = this.schema;
664
+
665
+ if ( schema ) {
666
+ return this.$rootGetters['type-map/labelFor'](schema);
667
+ }
668
+
669
+ return '?';
670
+ }
671
+
672
+ get nameDisplay() {
673
+ return this.displayName || this.spec?.displayName || this.metadata?.annotations?.[NORMAN_NAME] || this.name || this.metadata?.name || this.id;
674
+ }
675
+
676
+ get nameSort() {
677
+ return sortableNumericSuffix(this.nameDisplay).toLowerCase();
678
+ }
679
+
680
+ get namespacedName() {
681
+ const namespace = this.metadata?.namespace;
682
+ const name = this.nameDisplay;
683
+
684
+ if ( namespace ) {
685
+ return `${ namespace }:${ name }`;
686
+ }
687
+
688
+ return name;
689
+ }
690
+
691
+ get namespacedNameSort() {
692
+ return sortableNumericSuffix(this.namespacedName).toLowerCase();
693
+ }
694
+
695
+ get groupByLabel() {
696
+ const name = this.metadata?.namespace;
697
+ let out;
698
+
699
+ if ( name ) {
700
+ out = this.t('resourceTable.groupLabel.namespace', { name: escapeHtml(name) });
701
+ } else {
702
+ out = this.t('resourceTable.groupLabel.notInANamespace');
703
+ }
704
+
705
+ return out;
706
+ }
707
+
708
+ setLabels(/* val */) {
709
+ throw new Error('Implement setLabels in subclass');
710
+ }
711
+
712
+ setLabel(/* key, val */) {
713
+ throw new Error('Implement setLabel in subclass');
714
+ }
715
+
716
+ setAnnotations(val) {
717
+ throw new Error('Implement setAnnotations in subclass');
718
+ }
719
+
720
+ setAnnotation(key, val) {
721
+ throw new Error('Implement setAnnotation in subclass');
722
+ }
723
+
724
+ // You can override the displayed by providing your own stateDisplay (and possibly using the function exported above)
725
+ get stateDisplay() {
726
+ return stateDisplay(this.state);
727
+ }
728
+
729
+ get stateColor() {
730
+ return colorForState.call(
731
+ this,
732
+ this.state,
733
+ this.stateObj?.error,
734
+ this.stateObj?.transitioning
735
+ );
736
+ }
737
+
738
+ get stateBackground() {
739
+ return this.stateColor.replace('text-', 'bg-');
740
+ }
741
+
742
+ get stateIcon() {
743
+ let trans = false;
744
+ let error = false;
745
+
746
+ if ( this.metadata && this.metadata.state ) {
747
+ trans = this.metadata.state.transitioning;
748
+ error = this.metadata.state.error;
749
+ }
750
+
751
+ if ( trans ) {
752
+ return 'icon icon-spinner icon-spin';
753
+ }
754
+
755
+ if ( error ) {
756
+ return 'icon icon-error';
757
+ }
758
+
759
+ const key = (this.state || '').toLowerCase();
760
+ let icon;
761
+
762
+ if ( STATES[key] && STATES[key].icon ) {
763
+ icon = maybeFn.call(this, STATES[key].icon);
764
+ }
765
+
766
+ if ( !icon ) {
767
+ icon = DEFAULT_ICON;
768
+ }
769
+
770
+ return `icon icon-${ icon }`;
771
+ }
772
+
773
+ get stateSort() {
774
+ return stateSort(this.stateColor, this.stateDisplay);
775
+ }
776
+
777
+ get stateDescription() {
778
+ const trans = this.stateObj?.transitioning || false;
779
+ const error = this.stateObj?.error || false;
780
+ const message = this.stateObj?.message;
781
+
782
+ return trans || error ? ucFirst(message) : '';
783
+ }
784
+
785
+ get stateObj() {
786
+ return this.metadata?.state;
787
+ }
788
+
789
+ // ------------------------------------------------------------------
790
+
791
+ waitForTestFn(fn, msg, timeoutMs, intervalMs) {
792
+ return waitFor(() => fn.apply(this), msg, timeoutMs || DEFAULT_WAIT_TMIMEOUT, intervalMs || DEFAULT_WAIT_INTERVAL, true);
793
+ }
794
+
795
+ waitForState(state, timeout, interval) {
796
+ return this.waitForTestFn(() => {
797
+ return (this.state || '').toLowerCase() === state.toLowerCase();
798
+ }, `state=${ state }`, timeout, interval);
799
+ }
800
+
801
+ waitForTransition() {
802
+ return this.waitForTestFn(() => {
803
+ return !this.transitioning;
804
+ }, 'transition completion', undefined, undefined);
805
+ }
806
+
807
+ waitForAction(name) {
808
+ return this.waitForTestFn(() => {
809
+ return this.hasAction(name);
810
+ }, `action=${ name }`, undefined, undefined);
811
+ }
812
+
813
+ waitForLink(name) {
814
+ return this.waitForTestFn(() => {
815
+ return this.hasLink(name);
816
+ }, `link=${ name }`, undefined, undefined);
817
+ }
818
+
819
+ hasCondition(condition) {
820
+ return this.isCondition(condition, null);
821
+ }
822
+
823
+ isCondition(condition, withStatus = 'True') {
824
+ if ( !this.status || !this.status.conditions ) {
825
+ return false;
826
+ }
827
+
828
+ const entry = findBy((this.status.conditions || []), 'type', condition);
829
+
830
+ if ( !entry ) {
831
+ return false;
832
+ }
833
+
834
+ if ( !withStatus ) {
835
+ return true;
836
+ }
837
+
838
+ return (entry.status || '').toLowerCase() === `${ withStatus }`.toLowerCase();
839
+ }
840
+
841
+ waitForCondition(name, withStatus = 'True', timeoutMs = DEFAULT_WAIT_TMIMEOUT, intervalMs = DEFAULT_WAIT_INTERVAL) {
842
+ return this.waitForTestFn(() => {
843
+ return this.isCondition(name, withStatus);
844
+ }, `condition ${ name }=${ withStatus }`, timeoutMs, intervalMs);
845
+ }
846
+
847
+ // ------------------------------------------------------------------
848
+
849
+ get availableActions() {
850
+ const all = this._availableActions;
851
+
852
+ // Remove disabled items and consecutive dividers
853
+ let last = null;
854
+ const out = all.filter((item) => {
855
+ if ( item.enabled === false ) {
856
+ return false;
857
+ }
858
+
859
+ const cur = item.divider;
860
+ const ok = !cur || (cur && !last);
861
+
862
+ last = cur;
863
+
864
+ return ok;
865
+ });
866
+
867
+ // Remove dividers at the beginning
868
+ while ( out.length && out[0].divider ) {
869
+ out.shift();
870
+ }
871
+
872
+ // Remove dividers at the end
873
+ while ( out.length && out[out.length - 1].divider ) {
874
+ out.pop();
875
+ }
876
+
877
+ // Remove consecutive dividers in the middle
878
+ for ( let i = 1 ; i < out.length ; i++ ) {
879
+ if ( out[i].divider && out[i - 1].divider ) {
880
+ removeAt(out, i, 1);
881
+ i--;
882
+ }
883
+ }
884
+
885
+ return out;
886
+ }
887
+
888
+ // You can add custom actions by overriding your own availableActions (and probably reading super._availableActions)
889
+ get _availableActions() {
890
+ // get menu actions available by plugins configuration
891
+ const currentRoute = this.currentRouter().currentRoute.value;
892
+ const extensionMenuActions = getApplicableExtensionEnhancements(this.$rootState, ExtensionPoint.ACTION, ActionLocation.TABLE, currentRoute, this);
893
+
894
+ const all = [
895
+ { divider: true },
896
+ {
897
+ action: this.canUpdate ? 'goToEdit' : 'goToViewConfig',
898
+ label: this.t(this.canUpdate ? 'action.edit' : 'action.view'),
899
+ icon: 'icon icon-edit',
900
+ enabled: this.canCustomEdit,
901
+ },
902
+ {
903
+ action: this.canEditYaml ? 'goToEditYaml' : 'goToViewYaml',
904
+ label: this.t(this.canEditYaml ? 'action.editYaml' : 'action.viewYaml'),
905
+ icon: 'icon icon-file',
906
+ enabled: this.canYaml,
907
+ },
908
+ {
909
+ action: (this.canCustomEdit ? 'goToClone' : 'cloneYaml'),
910
+ label: this.t('action.clone'),
911
+ icon: 'icon icon-copy',
912
+ enabled: this.canClone && this.canCreate && (this.canCustomEdit || this.canYaml),
913
+ },
914
+ { divider: true },
915
+ {
916
+ action: 'download',
917
+ label: this.t('action.download'),
918
+ icon: 'icon icon-download',
919
+ bulkable: true,
920
+ bulkAction: 'downloadBulk',
921
+ enabled: this.canYaml,
922
+ weight: -9,
923
+ },
924
+ {
925
+ action: 'viewInApi',
926
+ label: this.t('action.viewInApi'),
927
+ icon: 'icon icon-external-link',
928
+ enabled: this.canViewInApi,
929
+ },
930
+ {
931
+ action: 'promptRemove',
932
+ altAction: 'remove',
933
+ label: this.t('action.remove'),
934
+ icon: 'icon icon-trash',
935
+ bulkable: true,
936
+ enabled: this.canDelete,
937
+ bulkAction: 'promptRemove',
938
+ weight: -10, // Delete always goes last
939
+ },
940
+ ];
941
+
942
+ // Extension actions get added to the end, so add a divider if there are any
943
+ if (extensionMenuActions.length) {
944
+ // Add a divider first
945
+ all.push({ divider: true });
946
+
947
+ extensionMenuActions.forEach((action) => {
948
+ const newActionInstance = { ...action };
949
+
950
+ const enabledFn = newActionInstance.enabled;
951
+ const typeofEnabled = typeof enabledFn;
952
+
953
+ switch (typeofEnabled) {
954
+ case 'undefined':
955
+ newActionInstance.enabled = true;
956
+ break;
957
+ case 'function':
958
+ Object.defineProperty(newActionInstance, 'enabled', { get: () => enabledFn(this) });
959
+ break;
960
+ case 'boolean':
961
+ // no op, just use it directly
962
+ break;
963
+ default:
964
+ // unsupported value
965
+ console.warn(`Unsupported 'enabled' property type for action: ${ action.label || action.labelKey }` ); // eslint-disable-line no-console
966
+ delete newActionInstance.enabled;
967
+ break;
968
+ }
969
+
970
+ all.push(newActionInstance);
971
+ });
972
+ }
973
+
974
+ return all;
975
+ }
976
+
977
+ // ------------------------------------------------------------------
978
+
979
+ get canDelete() {
980
+ return this._canDelete;
981
+ }
982
+
983
+ get _canDelete() {
984
+ return this.hasLink('remove') && this.$rootGetters['type-map/optionsFor'](this.type).isRemovable;
985
+ }
986
+
987
+ get canClone() {
988
+ return true;
989
+ }
990
+
991
+ get canUpdate() {
992
+ return this.hasLink('update') && this.$rootGetters['type-map/optionsFor'](this.type).isEditable;
993
+ }
994
+
995
+ get canCustomEdit() {
996
+ return this.$rootGetters['type-map/hasCustomEdit'](this.type, this.id);
997
+ }
998
+
999
+ get canCreate() {
1000
+ if ( this.schema && !this.schema?.collectionMethods.find((x) => x.toLowerCase() === 'post') ) {
1001
+ return false;
1002
+ }
1003
+
1004
+ return this.$rootGetters['type-map/optionsFor'](this.type).isCreatable;
1005
+ }
1006
+
1007
+ get canViewInApi() {
1008
+ try {
1009
+ return this.hasLink('self') && this.$rootGetters['prefs/get'](VIEW_IN_API);
1010
+ } catch {
1011
+ return this.hasLink('self') && this.$rootGetters['prefs/get'](DEV);
1012
+ }
1013
+ }
1014
+
1015
+ get canYaml() {
1016
+ return this.hasLink('view');
1017
+ }
1018
+
1019
+ get canEditYaml() {
1020
+ return this.schema?.resourceMethods?.find((x) => x === 'blocked-PUT') ? false : this.canUpdate;
1021
+ }
1022
+
1023
+ // ------------------------------------------------------------------
1024
+
1025
+ hasLink(linkName) {
1026
+ return !!this.linkFor(linkName);
1027
+ }
1028
+
1029
+ linkFor(linkName) {
1030
+ return (this.links || {})[linkName];
1031
+ }
1032
+
1033
+ followLink(linkName, opt = {}) {
1034
+ if ( !opt.url ) {
1035
+ opt.url = (this.links || {})[linkName];
1036
+ }
1037
+
1038
+ if ( opt.urlSuffix ) {
1039
+ opt.url += opt.urlSuffix;
1040
+ }
1041
+
1042
+ if ( !opt.url ) {
1043
+ throw new Error(`Unknown link ${ linkName } on ${ this.type } ${ this.id }`);
1044
+ }
1045
+
1046
+ return this.$dispatch('request', { opt, type: this.type } );
1047
+ }
1048
+
1049
+ // ------------------------------------------------------------------
1050
+
1051
+ hasAction(actionName) {
1052
+ return !!this.actionLinkFor(actionName);
1053
+ }
1054
+
1055
+ actionLinkFor(actionName) {
1056
+ return (this.actions || this.actionLinks || {})[actionName];
1057
+ }
1058
+
1059
+ doAction(actionName, body, opt = {}) {
1060
+ return this.$dispatch('resourceAction', {
1061
+ resource: this,
1062
+ actionName,
1063
+ body,
1064
+ opt,
1065
+ });
1066
+ }
1067
+
1068
+ async doActionGrowl(actionName, body, opt = {}) {
1069
+ try {
1070
+ return await this.$dispatch('resourceAction', {
1071
+ resource: this,
1072
+ actionName,
1073
+ body,
1074
+ opt,
1075
+ });
1076
+ } catch (err) {
1077
+ this.$dispatch('growl/fromError', {
1078
+ title: this.$rootGetters['i18n/t']('generic.notification.title.error'),
1079
+ err: err.data || err,
1080
+ }, { root: true });
1081
+ }
1082
+ }
1083
+
1084
+ // ------------------------------------------------------------------
1085
+
1086
+ patch(data, opt = {}, merge = false, alertOnError = false) {
1087
+ if ( !opt.url ) {
1088
+ // Workaround for the links not being correct - view link is the only one that seems correct
1089
+ opt.url = this.linkFor('view') || this.linkFor('self');
1090
+ }
1091
+
1092
+ opt.method = 'patch';
1093
+ opt.headers = opt.headers || {};
1094
+
1095
+ if (!opt.headers['content-type']) {
1096
+ const contentType = merge ? 'application/strategic-merge-patch+json' : 'application/json-patch+json';
1097
+
1098
+ opt.headers['content-type'] = contentType;
1099
+ }
1100
+ opt.data = data;
1101
+
1102
+ const dispatch = this.$dispatch('request', { opt, type: this.type } );
1103
+
1104
+ return !alertOnError ? dispatch : dispatch.catch((e) => {
1105
+ const title = this.t('resource.errors.update', { name: this.name });
1106
+
1107
+ console.error(title, e); // eslint-disable-line no-console
1108
+
1109
+ this.$dispatch('growl/error', {
1110
+ title,
1111
+ message: e?.message,
1112
+ timeout: 5000
1113
+ }, { root: true });
1114
+ });
1115
+ }
1116
+
1117
+ save() {
1118
+ return this._save(...arguments);
1119
+ }
1120
+
1121
+ /**
1122
+ * Remove any unwanted properties from the object that will be saved
1123
+ */
1124
+ cleanForSave(data, forNew) {
1125
+ delete data.__rehydrate;
1126
+ delete data.__clone;
1127
+
1128
+ return data;
1129
+ }
1130
+
1131
+ /**
1132
+ * Allow to handle the response of the save request
1133
+ * @param {*} res Full request response
1134
+ */
1135
+ processSaveResponse(res) { }
1136
+
1137
+ async _save(opt = { }) {
1138
+ const forNew = !this.id;
1139
+
1140
+ const errors = this.validationErrors(this, opt);
1141
+
1142
+ if (!isEmpty(errors)) {
1143
+ return Promise.reject(errors);
1144
+ }
1145
+
1146
+ if ( this.metadata?.resourceVersion ) {
1147
+ this.metadata.resourceVersion = `${ this.metadata.resourceVersion }`;
1148
+ }
1149
+
1150
+ if ( !opt.url ) {
1151
+ if ( forNew ) {
1152
+ const schema = this.$getters['schemaFor'](this.type);
1153
+ let url = schema.linkFor('collection');
1154
+
1155
+ if ( schema.attributes && schema.attributes.namespaced && this.metadata && this.metadata.namespace ) {
1156
+ url += `/${ this.metadata.namespace }`;
1157
+ }
1158
+
1159
+ opt.url = url;
1160
+ } else {
1161
+ opt.url = this.linkFor('update') || this.linkFor('self');
1162
+ }
1163
+ }
1164
+
1165
+ if ( !opt.method ) {
1166
+ opt.method = ( forNew ? 'post' : 'put' );
1167
+ }
1168
+
1169
+ if ( !opt.headers ) {
1170
+ opt.headers = {};
1171
+ }
1172
+
1173
+ if ( !opt.headers['content-type'] ) {
1174
+ opt.headers['content-type'] = 'application/json';
1175
+ }
1176
+
1177
+ if ( !opt.headers['accept'] ) {
1178
+ opt.headers['accept'] = 'application/json';
1179
+ }
1180
+
1181
+ // @TODO remove this once the API maps steve _type <-> k8s type in both directions
1182
+ opt.data = this.toSave() || { ...this };
1183
+
1184
+ if (opt.data._type) {
1185
+ opt.data.type = opt.data._type;
1186
+ }
1187
+
1188
+ if (opt.data._name) {
1189
+ opt.data.name = opt.data._name;
1190
+ }
1191
+
1192
+ if (opt.data._labels) {
1193
+ opt.data.labels = opt.data._labels;
1194
+ }
1195
+
1196
+ if (opt.data._annotations) {
1197
+ opt.data.annotations = opt.data._annotations;
1198
+ }
1199
+
1200
+ opt.data = this.cleanForSave(opt.data, forNew);
1201
+
1202
+ // handle "replace" opt as a query param _replace=true for norman PUT requests
1203
+ if (opt?.replace && opt.method === 'put') {
1204
+ const argParam = opt.url.includes('?') ? '&' : '?';
1205
+
1206
+ opt.url = `${ opt.url }${ argParam }_replace=true`;
1207
+ delete opt.replace;
1208
+ }
1209
+
1210
+ try {
1211
+ const res = await this.$dispatch('request', { opt, type: this.type } );
1212
+
1213
+ // Allow to process response independently from the related models
1214
+ this.processSaveResponse(res);
1215
+
1216
+ // Steve sometimes returns Table responses instead of the resource you just saved.. ignore
1217
+ if ( res && res.kind !== 'Table') {
1218
+ await this.$dispatch('load', { data: res, existing: (forNew ? this : undefined ) });
1219
+ }
1220
+ } catch (e) {
1221
+ if ( this.type && this.id && e?._status === 409) {
1222
+ // If there's a conflict, try to load the new version
1223
+ await this.$dispatch('find', {
1224
+ type: this.type,
1225
+ id: this.id,
1226
+ opt: { force: true }
1227
+ });
1228
+ }
1229
+
1230
+ return Promise.reject(e);
1231
+ }
1232
+
1233
+ return this;
1234
+ }
1235
+
1236
+ remove() {
1237
+ return this._remove(...arguments);
1238
+ }
1239
+
1240
+ async _remove(opt = {}) {
1241
+ if ( !opt.url ) {
1242
+ opt.url = this.linkFor('self');
1243
+ }
1244
+
1245
+ opt.method = 'delete';
1246
+
1247
+ const res = await this.$dispatch('request', { opt, type: this.type } );
1248
+
1249
+ if ( res?._status === 204 ) {
1250
+ // If there's no body, assume the resource was immediately deleted
1251
+ // and drop it from the store as if a remove event happened.
1252
+ await this.$dispatch('ws.resource.remove', { data: this });
1253
+ }
1254
+ }
1255
+
1256
+ // ------------------------------------------------------------------
1257
+
1258
+ currentRoute() {
1259
+ return window.$globalApp.$route;
1260
+ }
1261
+
1262
+ currentRouter() {
1263
+ return window.$globalApp.$router;
1264
+ }
1265
+
1266
+ get listLocation() {
1267
+ return {
1268
+ name: `c-cluster-product-resource`,
1269
+ params: {
1270
+ product: this.$rootGetters['productId'],
1271
+ cluster: this.$rootGetters['clusterId'],
1272
+ resource: this.type,
1273
+ }
1274
+ };
1275
+ }
1276
+
1277
+ get _detailLocation() {
1278
+ const schema = this.$getters['schemaFor'](this.type);
1279
+
1280
+ const id = this.id?.replace(/.*\//, '');
1281
+
1282
+ return {
1283
+ name: `c-cluster-product-resource${ schema?.attributes?.namespaced ? '-namespace' : '' }-id`,
1284
+ params: {
1285
+ product: this.$rootGetters['productId'],
1286
+ cluster: this.$rootGetters['clusterId'],
1287
+ resource: this.type,
1288
+ namespace: this.metadata?.namespace,
1289
+ id,
1290
+ }
1291
+ };
1292
+ }
1293
+
1294
+ get detailLocation() {
1295
+ return this._detailLocation;
1296
+ }
1297
+
1298
+ goToDetail() {
1299
+ this.currentRouter().push(this.detailLocation);
1300
+ }
1301
+
1302
+ /**
1303
+ * Resource action redirects to the detail page with a query parameter 'clone'
1304
+ * When the query parameter is present, the view will fetch the resource to clone define in the parameter
1305
+ * E.g.: /my-id?mode=clone
1306
+ * @param {*} moreQuery
1307
+ */
1308
+ goToClone(moreQuery = {}) {
1309
+ const location = this.detailLocation;
1310
+
1311
+ location.query = {
1312
+ ...location.query,
1313
+ [MODE]: _CLONE,
1314
+ [AS]: _UNFLAG,
1315
+ ...moreQuery
1316
+ };
1317
+
1318
+ this.currentRouter().push(location);
1319
+ }
1320
+
1321
+ goToEdit(moreQuery = {}) {
1322
+ const location = this.detailLocation;
1323
+
1324
+ location.query = {
1325
+ ...location.query,
1326
+ [MODE]: _EDIT,
1327
+ [AS]: _UNFLAG,
1328
+ ...moreQuery
1329
+ };
1330
+
1331
+ this.currentRouter().push(location);
1332
+ }
1333
+
1334
+ goToViewConfig(moreQuery = {}) {
1335
+ const location = this.detailLocation;
1336
+
1337
+ location.query = {
1338
+ ...location.query,
1339
+ [MODE]: _VIEW,
1340
+ [AS]: _CONFIG,
1341
+ ...moreQuery
1342
+ };
1343
+
1344
+ this.currentRouter().push(location);
1345
+ }
1346
+
1347
+ goToEditYaml() {
1348
+ const location = this.detailLocation;
1349
+
1350
+ location.query = {
1351
+ ...location.query,
1352
+ [MODE]: _EDIT,
1353
+ [AS]: _YAML
1354
+ };
1355
+
1356
+ this.currentRouter().push(location);
1357
+ }
1358
+
1359
+ goToViewYaml() {
1360
+ const location = this.detailLocation;
1361
+
1362
+ location.query = {
1363
+ ...location.query,
1364
+ [MODE]: _VIEW,
1365
+ [AS]: _YAML
1366
+ };
1367
+
1368
+ this.currentRouter().push(location);
1369
+ }
1370
+
1371
+ cloneYaml(moreQuery = {}) {
1372
+ const location = this.detailLocation;
1373
+
1374
+ location.query = {
1375
+ ...location.query,
1376
+ [MODE]: _CLONE,
1377
+ [AS]: _YAML,
1378
+ ...moreQuery
1379
+ };
1380
+
1381
+ this.currentRouter().push(location);
1382
+ }
1383
+
1384
+ async download() {
1385
+ const value = await this.followLink('view', { headers: { accept: 'application/yaml' } });
1386
+ const data = await this.cleanForDownload(value.data);
1387
+
1388
+ downloadFile(`${ this.nameDisplay }.yaml`, data, 'application/yaml');
1389
+ }
1390
+
1391
+ async downloadBulk(items) {
1392
+ const files = {};
1393
+ const names = [];
1394
+
1395
+ for ( const item of items ) {
1396
+ let name = `${ item.nameDisplay }.yaml`;
1397
+ let i = 2;
1398
+
1399
+ while ( names.includes(name) ) {
1400
+ name = `${ item.nameDisplay }_${ i++ }.yaml`;
1401
+ }
1402
+
1403
+ names.push(name);
1404
+ }
1405
+
1406
+ await eachLimit(items, 10, (item, idx) => {
1407
+ return item.followLink('view', { headers: { accept: 'application/yaml' } } ).then(async(data) => {
1408
+ const yaml = data.data || data;
1409
+ const cleanedYaml = await this.cleanForDownload(yaml);
1410
+
1411
+ files[`resources/${ names[idx] }`] = cleanedYaml;
1412
+ });
1413
+ });
1414
+
1415
+ const zip = await generateZip(files);
1416
+
1417
+ downloadFile('resources.zip', zip, 'application/zip');
1418
+ }
1419
+
1420
+ viewInApi() {
1421
+ window.open(this.links.self, '_blank');
1422
+ }
1423
+
1424
+ promptRemove(resources) {
1425
+ if ( !resources ) {
1426
+ resources = this;
1427
+ }
1428
+
1429
+ this.$dispatch('promptRemove', resources);
1430
+ }
1431
+
1432
+ get confirmRemove() {
1433
+ return false;
1434
+ }
1435
+
1436
+ applyDefaults() {
1437
+ }
1438
+
1439
+ get urlFromAttrs() {
1440
+ const schema = this.$getters['schemaFor'](this.type);
1441
+ const { metadata:{ namespace = 'default' } } = this;
1442
+ let url = schema.links.collection;
1443
+
1444
+ const attributes = schema?.attributes;
1445
+
1446
+ if (!attributes) {
1447
+ throw new Error('Attributes must be present on the schema');
1448
+ }
1449
+ const { group, resource } = attributes;
1450
+
1451
+ url = `${ url.slice(0, url.indexOf('/v1')) }/apis/${ group }/namespaces/${ namespace }/${ resource }`;
1452
+
1453
+ return url;
1454
+ }
1455
+
1456
+ // convert yaml to object, clean for new if creating/cloning
1457
+ // map _type to type
1458
+ cleanYaml(yaml, mode = 'edit') {
1459
+ try {
1460
+ const obj = jsyaml.load(yaml);
1461
+
1462
+ if (mode !== 'edit') {
1463
+ this.$dispatch(`cleanForNew`, obj);
1464
+ }
1465
+
1466
+ if (obj._type) {
1467
+ obj.type = obj._type;
1468
+ delete obj._type;
1469
+ }
1470
+ const out = jsyaml.dump(obj, { skipInvalid: true });
1471
+
1472
+ return out;
1473
+ } catch (e) {
1474
+ return null;
1475
+ }
1476
+ }
1477
+
1478
+ cleanForNew() {
1479
+ this.$dispatch(`cleanForNew`, this);
1480
+ }
1481
+
1482
+ cleanForDiff() {
1483
+ this.$dispatch(`cleanForDiff`, this.toJSON());
1484
+ }
1485
+
1486
+ async cleanForDownload(yaml) {
1487
+ return this.$dispatch(`cleanForDownload`, yaml);
1488
+ }
1489
+
1490
+ yamlForSave(yaml) {
1491
+ try {
1492
+ const obj = jsyaml.load(yaml);
1493
+
1494
+ if (obj) {
1495
+ if (this._type) {
1496
+ obj._type = obj.type;
1497
+ }
1498
+
1499
+ return jsyaml.dump(obj);
1500
+ }
1501
+ } catch (e) {
1502
+ return null;
1503
+ }
1504
+ }
1505
+
1506
+ async saveYaml(yaml) {
1507
+ await this._saveYaml(yaml);
1508
+ }
1509
+
1510
+ async _saveYaml(yaml) {
1511
+ /* Multipart support, but need to know the right cluster and work for management store
1512
+ and "apply" seems to only work for create, not update.
1513
+
1514
+ const ary = jsyaml.loadAll(yaml); // will throw on invalid yaml, and return one or more documents (usually one)
1515
+
1516
+ if ( ary.length > 1 ) {
1517
+ await this.$rootGetters['currentCluster'].doAction('apply', {
1518
+ yaml,
1519
+ defaultNamespace: this.metadata.namespace,
1520
+ });
1521
+ }
1522
+
1523
+ const parsed = ary[0];
1524
+ */
1525
+
1526
+ const parsed = jsyaml.load(yaml); // will throw on invalid yaml, and return one or more documents (usually one)
1527
+
1528
+ if ( this.schema?.attributes?.namespaced && !parsed.metadata.namespace ) {
1529
+ const err = this.$rootGetters['i18n/t']('resourceYaml.errors.namespaceRequired');
1530
+
1531
+ throw err;
1532
+ }
1533
+
1534
+ let res;
1535
+ const isCreate = !this.id;
1536
+ const headers = {
1537
+ 'content-type': 'application/yaml',
1538
+ accept: 'application/json',
1539
+ };
1540
+
1541
+ if ( isCreate ) {
1542
+ res = await this.schema.followLink('collection', {
1543
+ method: 'POST',
1544
+ headers,
1545
+ data: yaml
1546
+ });
1547
+ } else {
1548
+ res = await this.followLink('update', {
1549
+ method: 'PUT',
1550
+ headers,
1551
+ data: yaml
1552
+ });
1553
+ }
1554
+
1555
+ await this.$dispatch(`load`, {
1556
+ data: res,
1557
+ existing: (isCreate ? this : undefined)
1558
+ });
1559
+
1560
+ if (this.isSpoofed) {
1561
+ await this.$dispatch('cluster/findAll', { type: this.type, opt: { force: true } }, { root: true });
1562
+ }
1563
+ }
1564
+
1565
+ get modelValidationRules() {
1566
+ const rules = [];
1567
+
1568
+ const customValidationRulesets = this?.customValidationRules
1569
+ .filter((rule) => !!rule.validators || !!rule.required)
1570
+ .map((rule) => {
1571
+ const formRules = formRulesGenerator(this.t, { displayKey: rule?.translationKey ? this.t(rule.translationKey) : 'Value' });
1572
+
1573
+ return {
1574
+ path: rule.path,
1575
+ rules: [
1576
+ ...(rule.validators || []),
1577
+ ...rule.required ? ['required'] : [],
1578
+ ...['dnsLabel', 'dnsLabelRestricted', 'hostname'].includes(rule.type) ? [rule.type] : []
1579
+ ]
1580
+ .map((rule) => {
1581
+ if (rule.includes(':')) {
1582
+ const [ruleKey, ruleArg] = rule.split(':');
1583
+
1584
+ return formRules[ruleKey](ruleArg);
1585
+ }
1586
+
1587
+ return formRules[rule];
1588
+ }
1589
+ )
1590
+ .filter((rule) => !!rule)
1591
+ };
1592
+ })
1593
+ .filter((ruleset) => ruleset.rules.length > 0);
1594
+
1595
+ rules.push(...customValidationRulesets);
1596
+
1597
+ return rules;
1598
+ }
1599
+
1600
+ customValidationErrors(data, ignorePaths = []) {
1601
+ const errors = [];
1602
+
1603
+ let { customValidationRules } = this;
1604
+
1605
+ if (!isEmpty(customValidationRules)) {
1606
+ if (isFunction(customValidationRules)) {
1607
+ customValidationRules = customValidationRules();
1608
+ }
1609
+
1610
+ customValidationRules.filter((rule) => !ignorePaths.includes(rule.path)).forEach((rule) => {
1611
+ const {
1612
+ path,
1613
+ requiredIf: requiredIfPath,
1614
+ validators = [],
1615
+ type: fieldType,
1616
+ } = rule;
1617
+ let pathValue = get(data, path);
1618
+
1619
+ const parsedRules = compact((validators || []));
1620
+ let displayKey = path;
1621
+
1622
+ if (rule.translationKey && this.$rootGetters['i18n/exists'](rule.translationKey)) {
1623
+ displayKey = this.t(rule.translationKey);
1624
+ }
1625
+
1626
+ if (isString(pathValue)) {
1627
+ pathValue = pathValue.trim();
1628
+ }
1629
+ if (requiredIfPath) {
1630
+ const reqIfVal = get(data, requiredIfPath);
1631
+
1632
+ if (!isEmpty(reqIfVal) && (isEmpty(pathValue) && pathValue !== 0)) {
1633
+ errors.push(this.t('validation.required', { key: displayKey }));
1634
+ }
1635
+ }
1636
+
1637
+ validateLength(pathValue, rule, displayKey, this.$rootGetters, errors);
1638
+ validateChars(pathValue, rule, displayKey, this.$rootGetters, errors);
1639
+
1640
+ if ( !isEmpty(pathValue) && DNS_LIKE_TYPES.includes(fieldType) ) {
1641
+ // DNS types should be lowercase
1642
+ const tolower = (pathValue || '').toLowerCase();
1643
+
1644
+ if ( tolower !== pathValue ) {
1645
+ pathValue = tolower;
1646
+
1647
+ data[path] = pathValue;
1648
+ }
1649
+
1650
+ errors.push(...validateDnsLikeTypes(pathValue, fieldType, displayKey, this.$rootGetters, errors));
1651
+ }
1652
+
1653
+ parsedRules.forEach((validator) => {
1654
+ const validatorAndArgs = validator.split(':');
1655
+ const validatorName = validatorAndArgs.slice(0, 1);
1656
+ const validatorArgs = validatorAndArgs.slice(1) || null;
1657
+ const validatorExists = Object.prototype.hasOwnProperty.call(CustomValidators, validatorName);
1658
+
1659
+ if (!isEmpty(validatorName) && validatorExists) {
1660
+ CustomValidators[validatorName](pathValue, this.$rootGetters, errors, validatorArgs, displayKey, data);
1661
+ } else if (!isEmpty(validatorName) && !validatorExists) {
1662
+ // Check if validator is imported from plugin
1663
+ const pluginValidator = this.$rootState.$plugin?.getValidator(validatorName);
1664
+
1665
+ if (pluginValidator) {
1666
+ pluginValidator(pathValue, this.$rootGetters, errors, validatorArgs, displayKey, data);
1667
+ } else {
1668
+ // eslint-disable-next-line
1669
+ console.warn(this.t('validation.custom.missing', { validatorName }));
1670
+ }
1671
+ }
1672
+ });
1673
+ });
1674
+ }
1675
+
1676
+ return errors;
1677
+ }
1678
+
1679
+ /**
1680
+ * Check this instance is valid against
1681
+ * - any custom dashboard validation
1682
+ *
1683
+ * Models can override this and call super.validationErrors
1684
+ */
1685
+ validationErrors(data = this, opts = { }) {
1686
+ return this.customValidationErrors(data);
1687
+ }
1688
+
1689
+ get ownersByType() {
1690
+ const ownerReferences = this.metadata?.ownerReferences || [];
1691
+ const ownersByType = {};
1692
+
1693
+ ownerReferences.forEach((owner) => {
1694
+ if (!ownersByType[owner.kind]) {
1695
+ ownersByType[owner.kind] = [owner];
1696
+ } else {
1697
+ ownersByType[owner.kind].push(owner);
1698
+ }
1699
+ });
1700
+
1701
+ return ownersByType;
1702
+ }
1703
+
1704
+ get owners() {
1705
+ const owners = [];
1706
+
1707
+ for ( const kind in this.ownersByType) {
1708
+ const schema = this.$rootGetters['cluster/schema'](kind);
1709
+
1710
+ if (schema) {
1711
+ const type = schema.id;
1712
+ const allOfResourceType = this.$rootGetters['cluster/all']( type );
1713
+
1714
+ this.ownersByType[kind].forEach((resource, idx) => {
1715
+ const resourceInstance = allOfResourceType.find((resourceByType) => resourceByType?.metadata?.uid === resource.uid);
1716
+
1717
+ if (resourceInstance) {
1718
+ owners.push(resourceInstance);
1719
+ }
1720
+ });
1721
+ }
1722
+ }
1723
+
1724
+ return owners;
1725
+ }
1726
+
1727
+ get details() {
1728
+ return this._details;
1729
+ }
1730
+
1731
+ get _details() {
1732
+ const details = [];
1733
+
1734
+ if (this.owners?.length > 0) {
1735
+ details.push({
1736
+ label: this.t('resourceDetail.detailTop.ownerReferences', { count: this.owners.length }),
1737
+ formatter: 'ListLinkDetail',
1738
+ content: this.owners.map((owner) => ({
1739
+ key: owner.id,
1740
+ row: owner,
1741
+ col: {},
1742
+ value: owner.metadata.name
1743
+ }))
1744
+ });
1745
+ }
1746
+
1747
+ if (get(this, 'metadata.deletionTimestamp')) {
1748
+ details.push({
1749
+ label: this.t('resourceDetail.detailTop.deleted'),
1750
+ formatter: 'LiveDate',
1751
+ formatterOpts: { addSuffix: true },
1752
+ content: get(this, 'metadata.deletionTimestamp')
1753
+ });
1754
+ }
1755
+
1756
+ return details;
1757
+ }
1758
+
1759
+ get t() {
1760
+ return this.$rootGetters['i18n/t'];
1761
+ }
1762
+
1763
+ // Returns array of MODELS that own this resource (async, network call)
1764
+ findOwners() {
1765
+ return this._getRelationship('owner', 'from');
1766
+ }
1767
+
1768
+ // Returns array of {type, namespace, id} objects that own this resource (sync)
1769
+ getOwners() {
1770
+ return this._getRelationship('owner', 'from');
1771
+ }
1772
+
1773
+ findOwned() {
1774
+ return this._findRelationship('owner', 'to');
1775
+ }
1776
+
1777
+ _relationshipsFor(rel, direction) {
1778
+ const out = { selectors: [], ids: [] };
1779
+
1780
+ if ( !this.metadata?.relationships?.length ) {
1781
+ return out;
1782
+ }
1783
+
1784
+ for ( const r of this.metadata.relationships ) {
1785
+ if ( rel !== 'any' && r.rel !== rel ) {
1786
+ continue;
1787
+ }
1788
+
1789
+ if ( !r[`${ direction }Type`] ) {
1790
+ continue;
1791
+ }
1792
+
1793
+ if ( r.selector ) {
1794
+ addObjects(out.selectors, {
1795
+ type: r.toType,
1796
+ namespace: r.toNamespace,
1797
+ selector: r.selector
1798
+ });
1799
+ } else {
1800
+ const type = r[`${ direction }Type`];
1801
+ let namespace = r[`${ direction }Namespace`];
1802
+ let name = r[`${ direction }Id`];
1803
+
1804
+ if ( !namespace && name.includes('/') ) {
1805
+ const idx = name.indexOf('/');
1806
+
1807
+ namespace = name.substr(0, idx);
1808
+ name = name.substr(idx + 1);
1809
+ }
1810
+
1811
+ const id = (namespace ? `${ namespace }/` : '') + name;
1812
+
1813
+ addObject(out.ids, {
1814
+ type,
1815
+ namespace,
1816
+ name,
1817
+ id,
1818
+ });
1819
+ }
1820
+ }
1821
+
1822
+ return out;
1823
+ }
1824
+
1825
+ _getRelationship(rel, direction) {
1826
+ const res = this._relationshipsFor(rel, direction);
1827
+
1828
+ if ( res.selectors?.length ) {
1829
+ // eslint-disable-next-line no-console
1830
+ console.warn('Sync request for a relationship that is a selector');
1831
+ }
1832
+
1833
+ return res.ids || [];
1834
+ }
1835
+
1836
+ async _findRelationship(rel, direction) {
1837
+ const { selectors, ids } = this._relationshipsFor(rel, direction);
1838
+ const out = [];
1839
+
1840
+ for ( const sel of selectors ) {
1841
+ const matching = await this.$dispatch('findMatching', sel);
1842
+
1843
+ addObjects(out, matching.data);
1844
+ }
1845
+
1846
+ for ( const obj of ids ) {
1847
+ const { type, id } = obj;
1848
+ let matching = this.$getters['byId'](type, id);
1849
+
1850
+ if ( !matching ) {
1851
+ try {
1852
+ matching = await this.$dispatch('find', { type, id });
1853
+ } catch {
1854
+ }
1855
+ }
1856
+ if (matching) {
1857
+ addObject(out, matching);
1858
+ }
1859
+ }
1860
+
1861
+ return out;
1862
+ }
1863
+
1864
+ get shortId() {
1865
+ const splitId = this.id.split('/');
1866
+
1867
+ return splitId.length > 1 ? splitId[1] : splitId[0];
1868
+ }
1869
+
1870
+ toJSON() {
1871
+ const out = {};
1872
+ const keys = Object.keys(this);
1873
+
1874
+ for ( const k of keys ) {
1875
+ if ( this[k]?.toJSON ) {
1876
+ out[k] = this[k].toJSON();
1877
+ } else {
1878
+ out[k] = clone(this[k]);
1879
+ }
1880
+ }
1881
+
1882
+ return out;
1883
+ }
1884
+
1885
+ /**
1886
+ * Allow models to override the object that is sent when saving this resource
1887
+ */
1888
+ toSave() {
1889
+ return undefined;
1890
+ }
1891
+
1892
+ get creationTimestamp() {
1893
+ return this.metadata?.creationTimestamp;
1894
+ }
1895
+
1896
+ /**
1897
+ * Allows model to specify JSON Paths that should be folded in the YAML editor by default
1898
+ */
1899
+ get yamlFolding() {
1900
+ return [];
1901
+ }
1902
+ }