@rancher/shell 0.1.0 → 0.1.1

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 (595) hide show
  1. package/assets/styles/base/_basic.scss +0 -1
  2. package/assets/styles/base/_variables.scss +2 -0
  3. package/assets/styles/global/_labeled-input.scss +6 -1
  4. package/assets/styles/global/_select.scss +9 -0
  5. package/assets/styles/vendor/vue-js-modal.scss +4 -0
  6. package/assets/translations/en-us.yaml +240 -16
  7. package/assets/translations/zh-hans.yaml +335 -111
  8. package/chart/example.vue +1 -1
  9. package/chart/istio.vue +2 -2
  10. package/chart/logging/index.vue +2 -2
  11. package/chart/monitoring/alerting/index.vue +2 -2
  12. package/chart/monitoring/grafana/index.vue +2 -2
  13. package/chart/monitoring/index.vue +2 -2
  14. package/chart/monitoring/prometheus/index.vue +4 -4
  15. package/chart/rancher-alerting-drivers.vue +17 -3
  16. package/chart/rancher-backup/S3.vue +37 -4
  17. package/chart/rancher-backup/index.vue +3 -3
  18. package/cloud-credential/aws.vue +1 -1
  19. package/cloud-credential/azure.vue +1 -1
  20. package/cloud-credential/digitalocean.vue +1 -1
  21. package/cloud-credential/gcp.vue +1 -1
  22. package/cloud-credential/generic.vue +1 -1
  23. package/cloud-credential/harvester.vue +2 -2
  24. package/cloud-credential/linode.vue +1 -1
  25. package/cloud-credential/s3.vue +2 -2
  26. package/cloud-credential/vmwarevsphere.vue +1 -1
  27. package/components/ActionMenu.vue +11 -1
  28. package/components/Alert.vue +1 -1
  29. package/components/AssignTo.vue +2 -2
  30. package/components/AsyncButton.vue +25 -12
  31. package/components/AwsComplianceBanner.vue +44 -0
  32. package/components/BannerGraphic.vue +11 -2
  33. package/components/ChartReadme.vue +10 -2
  34. package/components/CompoundStatusBadge.vue +50 -0
  35. package/components/CopyToClipboardText.vue +25 -4
  36. package/components/CruResource.vue +185 -16
  37. package/components/CruResourceFooter.vue +17 -1
  38. package/components/EtcdInfoBanner.vue +1 -1
  39. package/components/FilterLabel.vue +254 -0
  40. package/components/GlobalRoleBindings.vue +2 -2
  41. package/components/GrafanaDashboard.vue +1 -1
  42. package/components/GrowlManager.vue +20 -9
  43. package/components/HarvesterServiceAddOnConfig.vue +2 -2
  44. package/components/Import.vue +2 -2
  45. package/components/LandingPagePreference.vue +2 -2
  46. package/components/Markdown.vue +44 -12
  47. package/components/ModalWithCard.vue +2 -2
  48. package/components/MoveModal.vue +1 -1
  49. package/components/PercentageBar.vue +1 -1
  50. package/components/PromptChangePassword.vue +1 -1
  51. package/components/PromptModal.vue +13 -2
  52. package/components/PromptRemove.vue +64 -33
  53. package/components/PromptRestore.vue +3 -3
  54. package/components/Questions/Boolean.vue +1 -1
  55. package/components/Questions/Float.vue +1 -1
  56. package/components/Questions/Int.vue +1 -1
  57. package/components/Questions/Reference.vue +1 -1
  58. package/components/Questions/String.vue +1 -1
  59. package/components/RelatedResources.vue +1 -1
  60. package/components/RelatedWorkloadsTable.vue +3 -1
  61. package/components/ResourceDetail/Masthead.vue +27 -9
  62. package/components/ResourceDetail/index.vue +72 -7
  63. package/components/ResourceList/Masthead.vue +22 -0
  64. package/components/ResourceList/ResourceLoadingIndicator.vue +137 -0
  65. package/components/ResourceList/index.vue +42 -7
  66. package/components/ResourceTable.vue +11 -2
  67. package/components/ResourceYaml.vue +7 -1
  68. package/components/SelectIconGrid.vue +14 -1
  69. package/components/SortableTable/THead.vue +1 -1
  70. package/components/SortableTable/debug.js +117 -0
  71. package/components/SortableTable/index.vue +200 -43
  72. package/components/SortableTable/paging.js +2 -12
  73. package/components/SortableTable/selection.js +3 -0
  74. package/components/SortableTable/sorting.js +3 -1
  75. package/components/Tabbed/Tab.vue +25 -4
  76. package/components/Tabbed/index.vue +133 -119
  77. package/components/TypeDescription.vue +1 -1
  78. package/components/VMConsoleBar.vue +1 -1
  79. package/components/Wizard.vue +53 -14
  80. package/components/YamlEditor.vue +10 -0
  81. package/components/__tests__/CopyCode.test.ts +1 -7
  82. package/components/__tests__/CruResource.test.ts +1 -8
  83. package/components/auth/AllowedPrincipals.vue +1 -1
  84. package/components/auth/AuthBanner.vue +2 -1
  85. package/components/auth/AzureWarning.vue +69 -0
  86. package/components/auth/RoleDetailEdit.vue +4 -4
  87. package/components/auth/login/ldap.vue +1 -1
  88. package/components/cards/ApplicationCard.vue +140 -0
  89. package/components/dialog/AddClusterMemberDialog.vue +1 -1
  90. package/components/dialog/AddCustomBadgeDialog.vue +4 -4
  91. package/components/dialog/AddProjectMemberDialog.vue +2 -2
  92. package/components/dialog/AddonConfigConfirmationDialog.vue +1 -1
  93. package/components/dialog/DrainNode.vue +3 -3
  94. package/components/dialog/ForceMachineRemoveDialog.vue +2 -2
  95. package/components/dialog/GenericPrompt.vue +2 -2
  96. package/components/dialog/RollbackWorkloadDialog.vue +2 -2
  97. package/components/dialog/RotateCertificatesDialog.vue +3 -3
  98. package/components/dialog/RotateEncryptionKeyDialog.vue +11 -6
  99. package/components/dialog/SaveAsRKETemplateDialog.vue +3 -3
  100. package/components/dialog/harvester/AddHotplugModal.vue +3 -3
  101. package/components/dialog/harvester/BackupModal.vue +3 -3
  102. package/components/dialog/harvester/CloneTemplate.vue +3 -3
  103. package/components/dialog/harvester/EjectCDROMDialog.vue +3 -3
  104. package/components/dialog/harvester/ExportImageDialog.vue +3 -3
  105. package/components/dialog/harvester/MaintenanceDialog.vue +2 -2
  106. package/components/dialog/harvester/MigrationDialog.vue +2 -2
  107. package/components/dialog/harvester/RestoreDialog.vue +2 -2
  108. package/components/dialog/harvester/SupportBundle.vue +2 -2
  109. package/components/dialog/harvester/UnplugVolume.vue +2 -2
  110. package/components/fleet/FleetBundleResources.vue +1 -1
  111. package/components/fleet/FleetBundles.vue +1 -1
  112. package/components/fleet/FleetResources.vue +5 -3
  113. package/components/fleet/ForceDirectedTreeChart/chartIcons.js +17 -0
  114. package/components/fleet/ForceDirectedTreeChart/index.vue +553 -0
  115. package/components/form/ArrayList.vue +22 -3
  116. package/components/form/BannerSettings.vue +3 -3
  117. package/components/form/ChangePassword.vue +2 -2
  118. package/components/form/Command.vue +28 -9
  119. package/components/form/Error.vue +50 -0
  120. package/components/form/Footer.vue +2 -5
  121. package/components/form/HealthCheck.vue +2 -2
  122. package/components/form/HookOption.vue +2 -2
  123. package/components/form/InputWithSelect.vue +12 -2
  124. package/components/form/KeyValue.vue +5 -2
  125. package/components/form/LabeledSelect.vue +27 -14
  126. package/components/form/Labels.vue +12 -0
  127. package/components/form/MatchExpressions.vue +44 -10
  128. package/components/form/Members/ClusterPermissionsEditor.vue +3 -3
  129. package/components/form/Members/MembershipEditor.vue +10 -1
  130. package/components/form/Members/ProjectMembershipEditor.vue +1 -0
  131. package/components/form/NameNsDescription.vue +202 -79
  132. package/components/form/Networking.vue +1 -1
  133. package/components/form/NodeAffinity.vue +41 -26
  134. package/components/form/NodeScheduling.vue +29 -3
  135. package/components/form/NotificationSettings.vue +2 -2
  136. package/components/form/Password.vue +1 -1
  137. package/components/form/PodAffinity.vue +64 -6
  138. package/components/form/PodSecurity.vue +2 -2
  139. package/components/form/Ports.vue +1 -1
  140. package/components/form/Probe.vue +60 -17
  141. package/components/form/ProjectMemberEditor.vue +3 -3
  142. package/components/form/ResourceQuota/NamespaceRow.vue +46 -2
  143. package/components/form/ResourceQuota/Project.vue +4 -0
  144. package/components/form/ResourceTabs/index.vue +19 -7
  145. package/components/form/RuleSelector.vue +1 -1
  146. package/components/form/Security.vue +56 -14
  147. package/components/form/Select.vue +52 -10
  148. package/components/form/SelectOrCreateAuthSecret.vue +70 -31
  149. package/components/form/ServiceNameSelect.vue +1 -1
  150. package/components/form/ServicePorts.vue +10 -2
  151. package/components/form/ShellInput.vue +1 -1
  152. package/components/form/SimpleSecretSelector.vue +2 -2
  153. package/components/form/Tolerations.vue +1 -1
  154. package/components/form/UnitInput.vue +12 -3
  155. package/components/form/ValueFromResource.vue +1 -1
  156. package/components/form/WorkloadPorts.vue +1 -1
  157. package/components/form/__tests__/Command.test.ts +63 -0
  158. package/components/form/__tests__/Error.test.ts +56 -0
  159. package/components/form/__tests__/MatchExpressions.test.ts +79 -0
  160. package/components/form/__tests__/Probe.test.ts +62 -0
  161. package/components/form/__tests__/Security.test.ts +55 -0
  162. package/components/form/__tests__/UnitInput.test.ts +31 -23
  163. package/components/formatter/BadgeStateFormatter.vue +1 -1
  164. package/components/formatter/Capitalize.vue +7 -0
  165. package/components/formatter/ClusterLink.vue +6 -2
  166. package/components/formatter/ClusterProvider.vue +36 -0
  167. package/components/formatter/DelayedValue.vue +43 -0
  168. package/components/formatter/Endpoints.vue +2 -2
  169. package/components/formatter/HarvesterDiskState.vue +1 -1
  170. package/components/formatter/HarvesterIpAddress.vue +37 -18
  171. package/components/formatter/HarvesterMigrationState.vue +1 -1
  172. package/components/formatter/HarvesterVmState.vue +1 -1
  173. package/components/formatter/LinkDetail.vue +11 -2
  174. package/components/formatter/LinkName.vue +2 -2
  175. package/components/formatter/LiveExpiryBadgeState.vue +1 -1
  176. package/components/formatter/LivePodRestarts.vue +47 -0
  177. package/components/formatter/MachineSummaryGraph.vue +51 -5
  178. package/components/formatter/PodsUsage.vue +5 -3
  179. package/components/formatter/Weight.vue +1 -1
  180. package/components/formatter/WorkloadHealthScale.vue +17 -6
  181. package/components/nav/HarvesterUpgrade.vue +15 -5
  182. package/components/nav/Header.vue +15 -6
  183. package/components/nav/Jump.vue +1 -1
  184. package/components/nav/NamespaceFilter.vue +30 -10
  185. package/components/nav/TopLevelMenu.vue +52 -14
  186. package/components/nav/WindowManager/ContainerLogs.vue +14 -2
  187. package/components/nav/WorkspaceSwitcher.vue +1 -1
  188. package/components/{NovncConsole.vue → novnc/NovncConsole.vue} +0 -0
  189. package/components/novnc/NovncConsoleItem.vue +89 -0
  190. package/components/novnc/NovncConsoleWrapper.vue +243 -0
  191. package/config/labels-annotations.js +6 -2
  192. package/config/product/explorer.js +7 -3
  193. package/config/product/fleet.js +4 -1
  194. package/config/product/manager.js +5 -6
  195. package/config/product/settings.js +12 -1
  196. package/config/query-params.js +2 -0
  197. package/config/roles.ts +5 -0
  198. package/config/settings.js +60 -63
  199. package/config/table-headers.js +47 -18
  200. package/config/types.js +24 -8
  201. package/content/docs/en-us/whats-new.md +25 -0
  202. package/core/plugin.ts +12 -2
  203. package/creators/app/init +7 -1
  204. package/creators/pkg/tsconfig.json +2 -3
  205. package/detail/catalog.cattle.io.app.vue +1 -1
  206. package/detail/cis.cattle.io.clusterscan.vue +1 -1
  207. package/detail/fleet.cattle.io.bundle.vue +73 -21
  208. package/detail/fleet.cattle.io.gitrepo.vue +5 -4
  209. package/detail/harvesterhci.io.host/HarvesterHostBasic.vue +25 -4
  210. package/detail/harvesterhci.io.host/HarvesterHostDisk.vue +2 -2
  211. package/detail/harvesterhci.io.virtualmachinebackup/index.vue +1 -1
  212. package/detail/helm.cattle.io.projecthelmchart.vue +1 -1
  213. package/detail/networking.k8s.io.ingress.vue +10 -2
  214. package/detail/pod.vue +37 -1
  215. package/detail/provisioning.cattle.io.cluster.vue +102 -15
  216. package/detail/workload/index.vue +163 -15
  217. package/edit/auth/azuread.vue +146 -34
  218. package/edit/auth/github.vue +3 -3
  219. package/edit/auth/googleoauth.vue +3 -3
  220. package/edit/auth/ldap/config.vue +15 -7
  221. package/edit/auth/ldap/index.vue +2 -2
  222. package/edit/auth/oidc.vue +3 -3
  223. package/edit/auth/saml.vue +3 -3
  224. package/edit/autoscaling.horizontalpodautoscaler/index.vue +1 -1
  225. package/edit/autoscaling.horizontalpodautoscaler/metric-identifier.vue +1 -1
  226. package/edit/autoscaling.horizontalpodautoscaler/metric-object-reference.vue +1 -1
  227. package/edit/autoscaling.horizontalpodautoscaler/metric-target.vue +1 -1
  228. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +1 -1
  229. package/edit/catalog.cattle.io.clusterrepo.vue +2 -2
  230. package/edit/cis.cattle.io.clusterscan.vue +4 -4
  231. package/edit/cis.cattle.io.clusterscanbenchmark.vue +1 -1
  232. package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -1
  233. package/edit/fleet.cattle.io.cluster.vue +1 -0
  234. package/edit/fleet.cattle.io.clustergroup.vue +1 -1
  235. package/edit/fleet.cattle.io.gitrepo.vue +290 -157
  236. package/edit/harvesterhci.io.host/HarvesterDisk.vue +4 -5
  237. package/edit/harvesterhci.io.host/index.vue +28 -19
  238. package/edit/harvesterhci.io.keypair.vue +1 -1
  239. package/edit/harvesterhci.io.managedchart/rancher-monitoring.vue +1 -1
  240. package/edit/harvesterhci.io.management.cluster.vue +1 -1
  241. package/edit/harvesterhci.io.networkattachmentdefinition.vue +2 -2
  242. package/edit/harvesterhci.io.setting/additional-ca.vue +1 -1
  243. package/edit/harvesterhci.io.setting/backup-target.vue +1 -1
  244. package/edit/harvesterhci.io.setting/http-proxy.vue +1 -1
  245. package/edit/harvesterhci.io.setting/index.vue +3 -3
  246. package/edit/harvesterhci.io.setting/overcommit-config.vue +4 -1
  247. package/edit/harvesterhci.io.setting/ssl-parameters.vue +1 -1
  248. package/edit/harvesterhci.io.setting/support-bundle-image.vue +1 -1
  249. package/edit/harvesterhci.io.setting/vip-pools.vue +1 -1
  250. package/edit/harvesterhci.io.setting/vm-force-reset-policy.vue +2 -2
  251. package/edit/harvesterhci.io.virtualmachinebackup.vue +2 -2
  252. package/edit/harvesterhci.io.virtualmachineimage.vue +2 -2
  253. package/edit/harvesterhci.io.virtualmachinetemplateversion.vue +26 -18
  254. package/edit/helm.cattle.io.projecthelmchart.vue +3 -3
  255. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +2 -2
  256. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue +1 -1
  257. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue +1 -1
  258. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue +1 -0
  259. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue +2 -1
  260. package/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue +3 -1
  261. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/__tests__/HarvesterEditNetwork.test.ts +41 -0
  262. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue +79 -36
  263. package/edit/kubevirt.io.virtualmachine/VirtualMachineReserved.vue +54 -0
  264. package/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue +1 -1
  265. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue +2 -3
  266. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditContainer.test.ts +40 -0
  267. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditExisting.test.ts +102 -0
  268. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVMImage.test.ts +117 -0
  269. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVolume.test.ts +74 -0
  270. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue +59 -13
  271. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue +72 -16
  272. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue +74 -14
  273. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue +35 -9
  274. package/edit/kubevirt.io.virtualmachine/index.vue +33 -24
  275. package/edit/logging-flow/index.vue +1 -1
  276. package/edit/logging.banzaicloud.io.output/index.vue +1 -1
  277. package/edit/logging.banzaicloud.io.output/providers/awsElasticsearch.vue +1 -1
  278. package/edit/logging.banzaicloud.io.output/providers/azurestorage.vue +1 -1
  279. package/edit/logging.banzaicloud.io.output/providers/cloudwatch.vue +1 -1
  280. package/edit/logging.banzaicloud.io.output/providers/datadog.vue +2 -2
  281. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +2 -2
  282. package/edit/logging.banzaicloud.io.output/providers/file.vue +1 -1
  283. package/edit/logging.banzaicloud.io.output/providers/forward.vue +1 -1
  284. package/edit/logging.banzaicloud.io.output/providers/gcs.vue +2 -2
  285. package/edit/logging.banzaicloud.io.output/providers/gelf.vue +2 -2
  286. package/edit/logging.banzaicloud.io.output/providers/kafka.vue +2 -2
  287. package/edit/logging.banzaicloud.io.output/providers/kinesisStream.vue +1 -1
  288. package/edit/logging.banzaicloud.io.output/providers/logdna.vue +1 -1
  289. package/edit/logging.banzaicloud.io.output/providers/logz.vue +2 -2
  290. package/edit/logging.banzaicloud.io.output/providers/loki.vue +2 -2
  291. package/edit/logging.banzaicloud.io.output/providers/newrelic.vue +1 -1
  292. package/edit/logging.banzaicloud.io.output/providers/s3.vue +2 -2
  293. package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +2 -2
  294. package/edit/logging.banzaicloud.io.output/providers/sumologic.vue +1 -1
  295. package/edit/logging.banzaicloud.io.output/providers/syslog.vue +2 -2
  296. package/edit/management.cattle.io.clusterroletemplatebinding.vue +2 -0
  297. package/edit/management.cattle.io.node.vue +71 -0
  298. package/edit/management.cattle.io.project.vue +28 -23
  299. package/edit/management.cattle.io.setting.vue +14 -3
  300. package/edit/management.cattle.io.user.vue +1 -1
  301. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +4 -4
  302. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +13 -13
  303. package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +18 -10
  304. package/edit/monitoring.coreos.com.alertmanagerconfig/tls.vue +2 -2
  305. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +12 -7
  306. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +12 -7
  307. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +20 -11
  308. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +13 -8
  309. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +25 -7
  310. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +2 -2
  311. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +20 -7
  312. package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +1 -1
  313. package/edit/monitoring.coreos.com.prometheusrule/index.vue +19 -8
  314. package/edit/monitoring.coreos.com.receiver/auth.vue +1 -1
  315. package/edit/monitoring.coreos.com.receiver/index.vue +2 -2
  316. package/edit/monitoring.coreos.com.receiver/tls.vue +2 -2
  317. package/edit/monitoring.coreos.com.receiver/types/email.vue +2 -2
  318. package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +2 -2
  319. package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +2 -2
  320. package/edit/monitoring.coreos.com.receiver/types/slack.vue +2 -2
  321. package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +1 -1
  322. package/edit/monitoring.coreos.com.receiver/types/webhook.vue +3 -3
  323. package/edit/monitoring.coreos.com.route.vue +2 -2
  324. package/edit/namespace.vue +0 -8
  325. package/edit/network.harvesterhci.io.clusternetwork/vlan.vue +1 -1
  326. package/edit/networking.istio.io.destinationrule/LoadBalancer.vue +2 -2
  327. package/edit/networking.istio.io.destinationrule/index.vue +1 -1
  328. package/edit/networking.k8s.io.ingress/Certificate.vue +5 -1
  329. package/edit/networking.k8s.io.ingress/Certificates.vue +5 -0
  330. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +17 -2
  331. package/edit/networking.k8s.io.ingress/IngressClass.vue +63 -0
  332. package/edit/networking.k8s.io.ingress/Rule.vue +42 -6
  333. package/edit/networking.k8s.io.ingress/RulePath.vue +29 -5
  334. package/edit/networking.k8s.io.ingress/Rules.vue +11 -0
  335. package/edit/networking.k8s.io.ingress/index.vue +104 -15
  336. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +1 -1
  337. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +2 -2
  338. package/edit/networking.k8s.io.networkpolicy/index.vue +2 -2
  339. package/edit/persistentvolume/index.vue +1 -1
  340. package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +2 -2
  341. package/edit/persistentvolume/plugins/azureDisk.vue +2 -2
  342. package/edit/persistentvolume/plugins/azureFile.vue +2 -2
  343. package/edit/persistentvolume/plugins/cephfs.vue +4 -4
  344. package/edit/persistentvolume/plugins/cinder.vue +2 -2
  345. package/edit/persistentvolume/plugins/csi.vue +2 -2
  346. package/edit/persistentvolume/plugins/fc.vue +4 -4
  347. package/edit/persistentvolume/plugins/flexVolume.vue +2 -2
  348. package/edit/persistentvolume/plugins/flocker.vue +1 -1
  349. package/edit/persistentvolume/plugins/gcePersistentDisk.vue +2 -2
  350. package/edit/persistentvolume/plugins/glusterfs.vue +2 -2
  351. package/edit/persistentvolume/plugins/hostPath.vue +1 -1
  352. package/edit/persistentvolume/plugins/iscsi.vue +4 -4
  353. package/edit/persistentvolume/plugins/local.vue +1 -1
  354. package/edit/persistentvolume/plugins/longhorn.vue +2 -2
  355. package/edit/persistentvolume/plugins/nfs.vue +2 -2
  356. package/edit/persistentvolume/plugins/photonPersistentDisk.vue +1 -1
  357. package/edit/persistentvolume/plugins/portworxVolume.vue +2 -2
  358. package/edit/persistentvolume/plugins/quobyte.vue +2 -2
  359. package/edit/persistentvolume/plugins/rbd.vue +4 -4
  360. package/edit/persistentvolume/plugins/scaleIO.vue +2 -2
  361. package/edit/persistentvolume/plugins/storageos.vue +2 -2
  362. package/edit/persistentvolume/plugins/vsphereVolume.vue +1 -1
  363. package/edit/persistentvolumeclaim.vue +24 -8
  364. package/edit/provisioning.cattle.io.cluster/ACE.vue +2 -2
  365. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +8 -3
  366. package/edit/provisioning.cattle.io.cluster/DrainOptions.vue +2 -2
  367. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +15 -3
  368. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +16 -3
  369. package/edit/provisioning.cattle.io.cluster/S3Config.vue +2 -2
  370. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +1 -1
  371. package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +1 -7
  372. package/edit/provisioning.cattle.io.cluster/import.vue +2 -1
  373. package/edit/provisioning.cattle.io.cluster/index.vue +26 -7
  374. package/edit/provisioning.cattle.io.cluster/rke2.vue +136 -48
  375. package/edit/resources.cattle.io.backup.vue +26 -8
  376. package/edit/resources.cattle.io.restore.vue +3 -3
  377. package/edit/secret/basic.vue +1 -1
  378. package/edit/secret/index.vue +80 -2
  379. package/edit/secret/registry.vue +2 -2
  380. package/edit/secret/ssh.vue +1 -1
  381. package/edit/secret/tls.vue +1 -1
  382. package/edit/service.vue +47 -11
  383. package/edit/serviceaccount.vue +1 -1
  384. package/edit/storage.k8s.io.storageclass/index.vue +1 -1
  385. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/aws-ebs.vue +7 -3
  386. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-disk.vue +1 -1
  387. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/azure-file.vue +1 -1
  388. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/cinder.vue +2 -2
  389. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/gce-pd.vue +2 -2
  390. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/glusterfs.vue +1 -1
  391. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/portworx-volume.vue +1 -1
  392. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/quobyte.vue +1 -1
  393. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/rbd.vue +1 -1
  394. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/scaleio.vue +1 -1
  395. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/storageos.vue +1 -1
  396. package/edit/storage.k8s.io.storageclass/provisioners/kubernetes.io/vsphere-volume.vue +1 -1
  397. package/edit/token.vue +3 -3
  398. package/edit/ui.cattle.io.navlink.vue +2 -2
  399. package/edit/workload/Job.vue +111 -23
  400. package/edit/workload/Upgrading.vue +77 -22
  401. package/edit/workload/__tests__/Job.test.ts +72 -0
  402. package/edit/workload/__tests__/Upgrading.test.ts +60 -0
  403. package/edit/workload/index.vue +13 -1085
  404. package/edit/workload/mixins/workload.js +900 -0
  405. package/edit/workload/storage/Mount.vue +2 -2
  406. package/edit/workload/storage/awsElasticBlockStore.vue +1 -1
  407. package/edit/workload/storage/azureDisk.vue +2 -2
  408. package/edit/workload/storage/azureFile.vue +1 -1
  409. package/edit/workload/storage/ephemeralVolume/index.vue +2 -2
  410. package/edit/workload/storage/gcePersistentDisk.vue +1 -1
  411. package/edit/workload/storage/hostPath.vue +1 -1
  412. package/edit/workload/storage/nfs.vue +2 -2
  413. package/edit/workload/storage/persistentVolumeClaim/index.vue +2 -2
  414. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +3 -3
  415. package/edit/workload/storage/secret.vue +2 -2
  416. package/edit/workload/storage/vsphereVolume.vue +1 -1
  417. package/edit/workload/types/Deployment.vue +377 -0
  418. package/edit/workload/types/Generic.vue +295 -0
  419. package/layouts/default.vue +26 -7
  420. package/layouts/error.vue +3 -2
  421. package/layouts/home.vue +12 -2
  422. package/layouts/plain.vue +18 -2
  423. package/layouts/unauthenticated.vue +2 -1
  424. package/list/catalog.cattle.io.clusterrepo.vue +1 -1
  425. package/list/fleet.cattle.io.bundle.vue +1 -1
  426. package/list/fleet.cattle.io.cluster.vue +1 -1
  427. package/list/fleet.cattle.io.clusterregistrationtoken.vue +1 -1
  428. package/list/harvesterhci.io.dashboard/HarvesterUpgrade.vue +9 -8
  429. package/list/harvesterhci.io.dashboard/UpgradeInfo.vue +40 -0
  430. package/list/harvesterhci.io.dashboard/index.vue +14 -36
  431. package/list/harvesterhci.io.host/index.vue +24 -12
  432. package/list/harvesterhci.io.networkattachmentdefinition.vue +1 -1
  433. package/list/harvesterhci.io.setting.vue +1 -1
  434. package/list/harvesterhci.io.virtualmachinebackup.vue +1 -1
  435. package/list/harvesterhci.io.virtualmachineimage.vue +36 -3
  436. package/list/harvesterhci.io.virtualmachinetemplateversion.vue +1 -5
  437. package/list/helm.cattle.io.projecthelmchart.vue +1 -1
  438. package/list/kubevirt.io.virtualmachine.vue +4 -2
  439. package/list/management.cattle.io.feature.vue +3 -3
  440. package/list/management.cattle.io.setting.vue +2 -2
  441. package/list/monitoring.coreos.com.alertmanagerconfig.vue +1 -1
  442. package/list/namespace.vue +3 -1
  443. package/list/node.vue +10 -3
  444. package/list/persistentvolumeclaim.vue +42 -0
  445. package/list/provisioning.cattle.io.cluster.vue +22 -20
  446. package/list/workload.vue +31 -6
  447. package/machine-config/amazonec2.vue +37 -12
  448. package/machine-config/azure.vue +3 -3
  449. package/machine-config/digitalocean.vue +2 -2
  450. package/machine-config/generic.vue +1 -1
  451. package/machine-config/harvester.vue +124 -25
  452. package/machine-config/linode.vue +2 -2
  453. package/machine-config/vmwarevsphere.vue +5 -5
  454. package/middleware/authenticated.js +36 -6
  455. package/middleware/unauthenticated.js +22 -0
  456. package/mixins/brand.js +50 -3
  457. package/mixins/browser-tab-visibility.js +37 -0
  458. package/mixins/chart.js +36 -4
  459. package/mixins/{compact-input.js → compact-input.ts} +5 -3
  460. package/mixins/form-validation.js +122 -0
  461. package/mixins/harvester-vm/index.js +134 -90
  462. package/mixins/labeled-form-element.ts +193 -0
  463. package/mixins/resource-fetch.js +173 -0
  464. package/models/cluster.x-k8s.io.machine.js +6 -2
  465. package/models/etcdbackup.js +4 -0
  466. package/models/event.js +4 -0
  467. package/models/fleet.cattle.io.bundle.js +1 -1
  468. package/models/fleet.cattle.io.gitrepo.js +10 -0
  469. package/models/harvester/harvesterhci.io.virtualmachinebackup.js +5 -2
  470. package/models/harvester/harvesterhci.io.virtualmachineimage.js +11 -8
  471. package/models/harvester/harvesterhci.io.virtualmachinetemplateversion.js +11 -2
  472. package/models/harvester/kubevirt.io.virtualmachine.js +2 -2
  473. package/models/harvester/kubevirt.io.virtualmachineinstance.js +1 -1
  474. package/models/harvester/node.js +27 -32
  475. package/models/harvester/persistentvolumeclaim.js +1 -1
  476. package/models/management.cattle.io.cluster.js +17 -11
  477. package/models/management.cattle.io.clusterroletemplatebinding.js +2 -2
  478. package/models/management.cattle.io.globalrole.js +19 -0
  479. package/models/management.cattle.io.node.js +10 -11
  480. package/models/management.cattle.io.project.js +60 -26
  481. package/models/management.cattle.io.roletemplate.js +19 -0
  482. package/models/monitoring.coreos.com.alertmanagerconfig.js +3 -2
  483. package/models/monitoring.coreos.com.prometheusrule.js +9 -0
  484. package/models/namespace.js +9 -1
  485. package/models/networking.k8s.io.ingress.js +17 -5
  486. package/models/persistentvolumeclaim.js +47 -1
  487. package/models/projectroletemplatebinding.js +2 -2
  488. package/models/provisioning.cattle.io.cluster.js +92 -13
  489. package/models/rke.cattle.io.etcdsnapshot.js +4 -0
  490. package/models/service.js +11 -5
  491. package/models/storage.k8s.io.storageclass.js +14 -1
  492. package/models/workload.js +7 -2
  493. package/nuxt.config.js +27 -7
  494. package/package.json +10 -14
  495. package/pages/about.vue +15 -1
  496. package/pages/account/index.vue +1 -1
  497. package/pages/auth/login.vue +17 -5
  498. package/pages/auth/setup.vue +47 -9
  499. package/pages/c/_cluster/_product/_resource/create.vue +1 -1
  500. package/pages/c/_cluster/_product/members/index.vue +6 -1
  501. package/pages/c/_cluster/_product/projectsnamespaces.vue +113 -11
  502. package/pages/c/_cluster/apps/charts/chart.vue +1 -1
  503. package/pages/c/_cluster/apps/charts/index.vue +2 -2
  504. package/pages/c/_cluster/apps/charts/install.vue +197 -19
  505. package/pages/c/_cluster/auth/config/index.vue +1 -1
  506. package/pages/c/_cluster/explorer/EventsTable.vue +1 -15
  507. package/pages/c/_cluster/explorer/index.vue +64 -35
  508. package/pages/c/_cluster/explorer/tools/index.vue +1 -1
  509. package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +249 -0
  510. package/pages/c/_cluster/fleet/index.vue +47 -65
  511. package/pages/c/_cluster/harvester/airgapupgrade/index.vue +7 -4
  512. package/pages/c/_cluster/harvester/console/_uid/vnc.vue +7 -1
  513. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +8 -14
  514. package/pages/c/_cluster/monitoring/index.vue +1 -1
  515. package/pages/c/_cluster/monitoring/route-receiver/index.vue +1 -1
  516. package/pages/c/_cluster/settings/banners.vue +2 -2
  517. package/pages/c/_cluster/settings/brand.vue +62 -7
  518. package/pages/c/_cluster/settings/performance.vue +167 -0
  519. package/pages/diagnostic.vue +468 -0
  520. package/pages/fail-whale.vue +17 -5
  521. package/pages/home.vue +36 -22
  522. package/pages/plugins.vue +1 -1
  523. package/pages/prefs.vue +20 -7
  524. package/pages/support/index.vue +51 -9
  525. package/pkg/auto-import.js +1 -1
  526. package/pkg/dynamic-importer.lib.js +8 -0
  527. package/pkg/tsconfig.json +26 -9
  528. package/pkg/vue.config.js +8 -0
  529. package/plugins/console.js +29 -0
  530. package/plugins/dashboard-store/actions.js +171 -28
  531. package/plugins/dashboard-store/getters.js +13 -1
  532. package/plugins/dashboard-store/index.js +5 -1
  533. package/plugins/dashboard-store/mutations.js +72 -22
  534. package/plugins/dashboard-store/resource-class.js +259 -184
  535. package/plugins/i18n.js +9 -3
  536. package/plugins/steve/actions.js +16 -1
  537. package/plugins/steve/getters.js +9 -1
  538. package/plugins/steve/index.js +6 -2
  539. package/plugins/steve/mutations.js +100 -5
  540. package/plugins/steve/norman-class.js +8 -0
  541. package/plugins/steve/performanceTesting.js +5 -0
  542. package/plugins/steve/subscribe.js +144 -12
  543. package/plugins/steve/web-worker.steve-sub-worker.js +129 -0
  544. package/promptRemove/kubevirt.io.virtualmachine.vue +3 -17
  545. package/promptRemove/management.cattle.io.project.vue +128 -0
  546. package/promptRemove/pod.vue +131 -0
  547. package/rancher-components/BadgeState/BadgeState.spec.ts +12 -0
  548. package/{components → rancher-components/BadgeState}/BadgeState.vue +18 -10
  549. package/rancher-components/BadgeState/index.ts +1 -0
  550. package/{components/__tests__ → rancher-components/Banner}/Banner.test.ts +1 -1
  551. package/{components → rancher-components/Banner}/Banner.vue +22 -7
  552. package/rancher-components/Banner/index.ts +1 -0
  553. package/{components → rancher-components/Card}/Card.vue +58 -12
  554. package/rancher-components/Card/index.ts +1 -0
  555. package/{components/form → rancher-components/Form/Checkbox}/Checkbox.vue +118 -25
  556. package/rancher-components/Form/Checkbox/index.ts +1 -0
  557. package/{components/form/__tests__ → rancher-components/Form/LabeledInput}/LabeledInput.test.ts +13 -2
  558. package/rancher-components/Form/LabeledInput/LabeledInput.vue +341 -0
  559. package/rancher-components/Form/LabeledInput/index.ts +1 -0
  560. package/{components/form → rancher-components/Form/Radio}/RadioButton.vue +50 -22
  561. package/{components/form → rancher-components/Form/Radio}/RadioGroup.vue +76 -28
  562. package/rancher-components/Form/Radio/index.ts +2 -0
  563. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +169 -0
  564. package/rancher-components/Form/TextArea/index.ts +1 -0
  565. package/rancher-components/Form/index.ts +4 -0
  566. package/{components/form → rancher-components/LabeledTooltip}/LabeledTooltip.vue +32 -11
  567. package/rancher-components/LabeledTooltip/index.ts +1 -0
  568. package/scripts/build-pkg.sh +4 -0
  569. package/scripts/publish-shell.sh +37 -18
  570. package/scripts/test-plugins-build.sh +115 -0
  571. package/store/catalog.js +4 -0
  572. package/store/growl.js +6 -0
  573. package/store/i18n.js +18 -9
  574. package/store/index.js +190 -107
  575. package/store/prefs.js +8 -2
  576. package/store/resource-fetch.js +44 -0
  577. package/store/type-map.js +43 -7
  578. package/store/uiplugins.ts +1 -1
  579. package/utils/favicon.js +40 -0
  580. package/utils/object.js +26 -9
  581. package/utils/promise.js +20 -0
  582. package/utils/socket.js +10 -1
  583. package/utils/string.js +16 -0
  584. package/utils/validators/formRules/__tests__/index.test.ts +928 -0
  585. package/utils/validators/formRules/index.ts +447 -0
  586. package/utils/validators/prometheusrule.js +1 -1
  587. package/utils/validators/vm.js +12 -5
  588. package/utils/width.js +39 -0
  589. package/yarn-error.log +196 -0
  590. package/components/NovncConsoleWrapper.vue +0 -150
  591. package/components/form/Container.vue +0 -143
  592. package/components/form/LabeledInput.vue +0 -245
  593. package/components/form/Scheduling.vue +0 -115
  594. package/components/form/TextAreaAutoGrow.vue +0 -127
  595. package/mixins/labeled-form-element.js +0 -137
@@ -1,1106 +1,34 @@
1
1
  <script>
2
- import omitBy from 'lodash/omitBy';
3
- import { cleanUp } from '@shell/utils/object';
4
- import {
5
- CONFIG_MAP, SECRET, WORKLOAD_TYPES, NODE, SERVICE, PVC, SERVICE_ACCOUNT, CAPI
6
- } from '@shell/config/types';
7
- import Tab from '@shell/components/Tabbed/Tab';
8
- import CreateEditView from '@shell/mixins/create-edit-view';
9
- import { allHash } from '@shell/utils/promise';
10
- import NameNsDescription from '@shell/components/form/NameNsDescription';
11
- import LabeledSelect from '@shell/components/form/LabeledSelect';
12
- import LabeledInput from '@shell/components/form/LabeledInput';
13
- import ServiceNameSelect from '@shell/components/form/ServiceNameSelect';
14
- import HealthCheck from '@shell/components/form/HealthCheck';
15
- import Security from '@shell/components/form/Security';
16
- import Upgrading from '@shell/edit/workload/Upgrading';
17
- import Loading from '@shell/components/Loading';
18
- import Networking from '@shell/components/form/Networking';
19
- import VolumeClaimTemplate from '@shell/edit/workload/VolumeClaimTemplate';
20
- import Job from '@shell/edit/workload/Job';
21
- import { _EDIT, _CREATE, _VIEW } from '@shell/config/query-params';
22
- import WorkloadPorts from '@shell/components/form/WorkloadPorts';
23
- import ContainerResourceLimit from '@shell/components/ContainerResourceLimit';
24
- import KeyValue from '@shell/components/form/KeyValue';
25
- import Tabbed from '@shell/components/Tabbed';
26
- import { mapGetters } from 'vuex';
27
- import NodeScheduling from '@shell/components/form/NodeScheduling';
28
- import PodAffinity from '@shell/components/form/PodAffinity';
29
- import Tolerations from '@shell/components/form/Tolerations';
30
- import CruResource from '@shell/components/CruResource';
31
- import Command from '@shell/components/form/Command';
32
- import LifecycleHooks from '@shell/components/form/LifecycleHooks';
33
- import Storage from '@shell/edit/workload/storage';
34
- import Labels from '@shell/components/form/Labels';
35
- import RadioGroup from '@shell/components/form/RadioGroup';
36
- import { UI_MANAGED } from '@shell/config/labels-annotations';
37
- import { removeObject } from '@shell/utils/array';
38
- import { BEFORE_SAVE_HOOKS } from '@shell/mixins/child-hook';
2
+ import WorkloadGeneric from './types/Generic';
3
+ import WorkloadDeployment from './types/Deployment';
39
4
 
40
- const TAB_WEIGHT_MAP = {
41
- general: 99,
42
- healthCheck: 98,
43
- labels: 97,
44
- networking: 96,
45
- nodeScheduling: 95,
46
- podScheduling: 94,
47
- resources: 93,
48
- upgrading: 92,
49
- securityContext: 91,
50
- storage: 90,
51
- volumeClaimTemplates: 89,
52
- };
53
-
54
- const GPU_KEY = 'nvidia.com/gpu';
5
+ import WorkLoadMixin from '@shell/edit/workload/mixins/workload';
55
6
 
56
7
  export default {
57
8
  name: 'CruWorkload',
58
9
  components: {
59
- Loading,
60
- NameNsDescription,
61
- LabeledSelect,
62
- LabeledInput,
63
- ServiceNameSelect,
64
- KeyValue,
65
- Tabbed,
66
- Tab,
67
- Upgrading,
68
- Networking,
69
- Job,
70
- HealthCheck,
71
- Security,
72
- WorkloadPorts,
73
- ContainerResourceLimit,
74
- PodAffinity,
75
- NodeScheduling,
76
- Tolerations,
77
- CruResource,
78
- Command,
79
- LifecycleHooks,
80
- Storage,
81
- VolumeClaimTemplate,
82
- Labels,
83
- RadioGroup,
10
+ WorkloadGeneric,
11
+ WorkloadDeployment
84
12
  },
85
-
86
- mixins: [CreateEditView],
87
-
88
13
  props: {
89
14
  value: {
90
15
  type: Object,
91
- required: true
16
+ required: true,
92
17
  },
93
18
 
94
19
  mode: {
95
20
  type: String,
96
- default: 'create'
97
- }
98
- },
99
-
100
- async fetch() {
101
- const requests = { rancherClusters: this.$store.dispatch('management/findAll', { type: CAPI.RANCHER_CLUSTER }) };
102
- const needed = {
103
- configMaps: CONFIG_MAP,
104
- nodes: NODE,
105
- services: SERVICE,
106
- pvcs: PVC,
107
- sas: SERVICE_ACCOUNT,
108
- secrets: SECRET,
109
- };
110
-
111
- // Only fetch types if the user can see them
112
- Object.keys(needed).forEach((key) => {
113
- const type = needed[key];
114
-
115
- if (this.$store.getters['cluster/schemaFor'](type)) {
116
- requests[key] = this.$store.dispatch('cluster/findAll', { type });
117
- }
118
- });
119
-
120
- const hash = await allHash(requests);
121
-
122
- this.servicesOwned = hash.services ? await this.value.getServicesOwned() : [];
123
-
124
- this.allSecrets = hash.secrets || [];
125
- this.allConfigMaps = hash.configMaps || [];
126
- this.allNodeObjects = hash.nodes || [];
127
- this.allNodes = this.allNodeObjects.map(node => node.id);
128
- this.allServices = hash.services || [];
129
- this.pvcs = hash.pvcs || [];
130
- this.sas = hash.sas || [];
131
- },
132
-
133
- data() {
134
- let type = this.$route.params.resource;
135
- const createSidecar = !!this.$route.query.sidecar;
136
- const isInitContainer = !!this.$route.query.init;
137
-
138
- if (type === 'workload') {
139
- type = null;
140
- }
141
-
142
- if (!this.value.spec) {
143
- this.value.spec = {};
144
- }
145
-
146
- const spec = this.value.spec;
147
- let container;
148
- const podTemplateSpec = type === WORKLOAD_TYPES.CRON_JOB ? spec.jobTemplate.spec.template.spec : spec?.template?.spec;
149
- let containers = podTemplateSpec.containers;
150
-
151
- if (this.mode === _CREATE || this.mode === _VIEW || (!createSidecar && !this.value.hasSidecars)) {
152
- container = containers[0];
153
- } else {
154
- if (!podTemplateSpec.initContainers) {
155
- podTemplateSpec.initContainers = [];
156
- }
157
- const allContainers = [...podTemplateSpec.initContainers, ...podTemplateSpec.containers];
158
-
159
- if (this.$route.query.init) {
160
- podTemplateSpec.initContainers.push({ imagePullPolicy: 'Always', name: `container-${ allContainers.length }` });
161
- containers = podTemplateSpec.initContainers;
162
- }
163
- if (createSidecar) {
164
- container = { imagePullPolicy: 'Always', name: `container-${ allContainers.length }` };
165
- containers.push(container);
166
- } else {
167
- container = containers[0];
168
- }
169
- }
170
-
171
- this.selectContainer(container);
172
-
173
- return {
174
- allConfigMaps: [],
175
- allNodes: null,
176
- allNodeObjects: [],
177
- allSecrets: [],
178
- allServices: [],
179
- name: this.value?.metadata?.name || null,
180
- pvcs: [],
181
- sas: [],
182
- showTabs: false,
183
- pullPolicyOptions: ['Always', 'IfNotPresent', 'Never'],
184
- spec,
185
- type,
186
- servicesOwned: [],
187
- servicesToRemove: [],
188
- portsForServices: [],
189
- isInitContainer,
190
- container,
191
- containerChange: 0,
192
- podFsGroup: podTemplateSpec.securityContext?.fsGroup,
193
- savePvcHookName: 'savePvcHook',
194
- tabWeightMap: TAB_WEIGHT_MAP,
195
- };
196
- },
197
-
198
- computed: {
199
-
200
- isEdit() {
201
- return this.mode === _EDIT;
202
- },
203
-
204
- isJob() {
205
- return this.type === WORKLOAD_TYPES.JOB || this.isCronJob;
206
- },
207
-
208
- isCronJob() {
209
- return this.type === WORKLOAD_TYPES.CRON_JOB;
210
- },
211
-
212
- isReplicable() {
213
- return (
214
- this.type === WORKLOAD_TYPES.DEPLOYMENT ||
215
- this.type === WORKLOAD_TYPES.REPLICA_SET ||
216
- this.type === WORKLOAD_TYPES.REPLICATION_CONTROLLER ||
217
- this.type === WORKLOAD_TYPES.STATEFUL_SET
218
- );
219
- },
220
-
221
- isStatefulSet() {
222
- return this.type === WORKLOAD_TYPES.STATEFUL_SET;
223
- },
224
-
225
- // if this is a cronjob, grab pod spec from within job template spec
226
- podTemplateSpec: {
227
- get() {
228
- return this.isCronJob ? this.spec.jobTemplate.spec.template.spec : this.spec?.template?.spec;
229
- },
230
- set(neu) {
231
- if (this.isCronJob) {
232
- this.$set(this.spec.jobTemplate.spec.template, 'spec', neu);
233
- } else {
234
- this.$set(this.spec.template, 'spec', neu);
235
- }
236
- }
237
- },
238
-
239
- podLabels: {
240
- get() {
241
- if (this.isCronJob) {
242
- if (!this.spec.jobTemplate.metadata) {
243
- this.$set( this.spec.jobTemplate, 'metadata', { labels: {} });
244
- }
245
-
246
- return this.spec.jobTemplate.metadata.labels;
247
- } else {
248
- if (!this.spec.template.metadata) {
249
- this.$set(this.spec.template, 'metadata', { labels: {} });
250
- }
251
-
252
- return this.spec.template.metadata.labels;
253
- }
254
- },
255
- set(neu) {
256
- if (this.isCronJob) {
257
- this.$set( this.spec.jobTemplate.metadata, 'labels', neu);
258
- } else {
259
- this.$set(this.spec.template.metadata, 'labels', neu);
260
- }
261
- }
262
- },
263
-
264
- podAnnotations: {
265
- get() {
266
- if (this.isCronJob) {
267
- if (!this.spec.jobTemplate.metadata) {
268
- this.$set( this.spec.jobTemplate, 'metadata', { annotations: {} });
269
- }
270
-
271
- return this.spec.jobTemplate.metadata.annotations;
272
- } else {
273
- if (!this.spec.template.metadata) {
274
- this.$set(this.spec.template, 'metadata', { annotations: {} });
275
- }
276
-
277
- return this.spec.template.metadata.annotations;
278
- }
279
- },
280
- set(neu) {
281
- if (this.isCronJob) {
282
- this.$set( this.spec.jobTemplate.metadata, 'annotations', neu);
283
- } else {
284
- this.$set(this.spec.template.metadata, 'annotations', neu);
285
- }
286
- }
287
- },
288
-
289
- allContainers() {
290
- const containers = this.podTemplateSpec?.containers || [];
291
- const initContainers = this.podTemplateSpec?.initContainers || [];
292
-
293
- return [...containers, ...initContainers.map((each) => {
294
- each._init = true;
295
-
296
- return each;
297
- })];
298
- },
299
-
300
- flatResources: {
301
- get() {
302
- const { limits = {}, requests = {} } = this.container.resources || {};
303
- const { cpu: limitsCpu, memory: limitsMemory, [GPU_KEY]: limitsGpu } = limits;
304
- const { cpu: requestsCpu, memory: requestsMemory } = requests;
305
-
306
- return {
307
- limitsCpu, limitsMemory, requestsCpu, requestsMemory, limitsGpu
308
- };
309
- },
310
- set(neu) {
311
- const {
312
- limitsCpu, limitsMemory, requestsCpu, requestsMemory, limitsGpu
313
- } = neu;
314
-
315
- const out = {
316
- requests: {
317
- cpu: requestsCpu,
318
- memory: requestsMemory
319
- },
320
- limits: {
321
- cpu: limitsCpu,
322
- memory: limitsMemory,
323
- [GPU_KEY]: limitsGpu
324
- }
325
- };
326
-
327
- this.$set(this.container, 'resources', cleanUp(out));
328
- }
329
- },
330
-
331
- healthCheck: {
332
- get() {
333
- const { readinessProbe, livenessProbe, startupProbe } = this.container;
334
-
335
- return {
336
- readinessProbe, livenessProbe, startupProbe
337
- };
338
- },
339
- set(neu) {
340
- Object.assign(this.container, neu);
341
- }
342
- },
343
-
344
- imagePullSecrets: {
345
- get() {
346
- if (!this.podTemplateSpec.imagePullSecrets) {
347
- this.$set(this.podTemplateSpec, 'imagePullSecrets', []);
348
- }
349
-
350
- const { imagePullSecrets } = this.podTemplateSpec;
351
-
352
- return imagePullSecrets.map(each => each.name);
353
- },
354
- set(neu) {
355
- this.podTemplateSpec.imagePullSecrets = neu.map((secret) => {
356
- return { name: secret };
357
- });
358
- }
359
-
360
- },
361
-
362
- schema() {
363
- return this.$store.getters['cluster/schemaFor'](this.type);
364
- },
365
-
366
- namespacedSecrets() {
367
- const namespace = this.value?.metadata?.namespace;
368
-
369
- if (namespace) {
370
- return this.allSecrets.filter(
371
- secret => secret.metadata.namespace === namespace
372
- );
373
- } else {
374
- return this.allSecrets;
375
- }
376
- },
377
-
378
- namespacedConfigMaps() {
379
- const namespace = this.value?.metadata?.namespace;
380
-
381
- if (namespace) {
382
- return this.allConfigMaps.filter(
383
- configMap => configMap.metadata.namespace === namespace
384
- );
385
- } else {
386
- return this.allConfigMaps;
387
- }
388
- },
389
-
390
- namespacedServiceNames() {
391
- const { namespace } = this.value?.metadata;
392
-
393
- if (namespace) {
394
- return this.sas.filter(
395
- serviceName => serviceName.metadata.namespace === namespace
396
- );
397
- } else {
398
- return this.sas;
399
- }
21
+ default: 'create',
400
22
  },
401
-
402
- headlessServices() {
403
- return this.allServices.filter(service => service.spec.clusterIP === 'None' && service.metadata.namespace === this.value.metadata.namespace);
404
- },
405
-
406
- workloadTypes() {
407
- return omitBy(WORKLOAD_TYPES, (type) => {
408
- return type === WORKLOAD_TYPES.REPLICA_SET || type === WORKLOAD_TYPES.REPLICATION_CONTROLLER;
409
- } );
410
- },
411
-
412
- // array of id, label, description, initials for type selection step
413
- workloadSubTypes() {
414
- const out = [];
415
-
416
- for (const prop in this.workloadTypes) {
417
- const type = this.workloadTypes[prop];
418
- const subtype = {
419
- id: type,
420
- description: `workload.typeDescriptions.'${ type }'`,
421
- label: this.nameDisplayFor(type),
422
- bannerAbbrv: this.initialDisplayFor(type)
423
- };
424
-
425
- out.push(subtype);
426
- }
427
-
428
- return out;
429
- },
430
-
431
- nameNsColumns() {
432
- const out = [];
433
-
434
- if (this.isCronJob) {
435
- out.push('schedule');
436
- } else if (this.isReplicable) {
437
- out.push('replicas');
438
-
439
- if (this.isStatefulSet) {
440
- out.push('service');
441
- }
442
- }
443
-
444
- return out;
445
- },
446
-
447
- containerOptions() {
448
- const out = [...this.allContainers];
449
-
450
- if (!this.isView) {
451
- out.push({ name: 'Add Container', __add: true });
452
- }
453
-
454
- return out;
455
- },
456
-
457
- ...mapGetters({ t: 'i18n/t' })
458
23
  },
459
-
460
- watch: {
461
- type(neu, old) {
462
- const template =
463
- old === WORKLOAD_TYPES.CRON_JOB ? this.spec?.jobTemplate?.spec?.template : this.spec?.template;
464
-
465
- if (!template.spec) {
466
- template.spec = {};
467
- }
468
-
469
- let restartPolicy;
470
-
471
- if (this.isJob || this.isCronJob) {
472
- restartPolicy = 'Never';
473
- } else {
474
- restartPolicy = 'Always';
475
- }
476
-
477
- this.$set(template.spec, 'restartPolicy', restartPolicy);
478
-
479
- if (!this.isReplicable) {
480
- delete this.spec.replicas;
481
- }
482
-
483
- if (old === WORKLOAD_TYPES.CRON_JOB) {
484
- this.$set(this.spec, 'template', { ...template });
485
- delete this.spec.jobTemplate;
486
- delete this.spec.schedule;
487
- } else if (neu === WORKLOAD_TYPES.CRON_JOB) {
488
- this.$set(this.spec, 'jobTemplate', { spec: { template } });
489
- this.$set(this.spec, 'schedule', '0 * * * *');
490
- delete this.spec.template;
491
- }
492
-
493
- this.$set(this.value, 'type', neu);
494
- delete this.value.apiVersion;
495
- },
496
-
497
- container(neu) {
498
- const containers = this.isInitContainer ? this.podTemplateSpec.initContainers : this.podTemplateSpec.containers;
499
- const existing = containers.filter(container => container.__active)[0];
500
-
501
- Object.assign(existing, neu);
502
- }
503
- },
504
-
505
- created() {
506
- this.registerBeforeHook(this.saveWorkload, 'willSaveWorkload');
507
- this.registerBeforeHook(this.getPorts, 'getPorts');
508
-
509
- this.registerAfterHook(this.saveService, 'saveService');
510
- },
511
-
512
- methods: {
513
- nameDisplayFor(type) {
514
- const schema = this.$store.getters['cluster/schemaFor'](type);
515
-
516
- return this.$store.getters['type-map/labelFor'](schema) || '';
517
- },
518
-
519
- // TODO better images for workload types?
520
- // show initials of workload type in blue circles for now
521
- initialDisplayFor(type) {
522
- const typeDisplay = this.nameDisplayFor(type);
523
-
524
- return typeDisplay.split('').filter(letter => letter.match(/[A-Z]/)).join('');
525
- },
526
-
527
- cancel() {
528
- this.done();
529
- },
530
-
531
- async getPorts() {
532
- const ports = await this.value.getPortsWithServiceType() || [];
533
-
534
- this.portsForServices = ports;
535
- },
536
-
537
- async saveService() {
538
- // If we can't access services then just return - the UI should only allow ports without service creation
539
- if (!this.$store.getters['cluster/schemaFor'](SERVICE)) {
540
- return;
541
- }
542
-
543
- const { toSave = [], toRemove = [] } = await this.value.servicesFromContainerPorts(this.mode, this.portsForServices) || {};
544
-
545
- this.servicesOwned = toSave;
546
- this.servicesToRemove = toRemove;
547
-
548
- if (!toSave.length && !toRemove.length) {
549
- return;
550
- }
551
-
552
- return Promise.all([...toSave.map(svc => svc.save()), ...toRemove.map((svc) => {
553
- const ui = svc?.metadata?.annotations[UI_MANAGED];
554
-
555
- if (ui) {
556
- svc.remove();
557
- }
558
- })]);
559
- },
560
-
561
- saveWorkload() {
562
- if (this.type !== WORKLOAD_TYPES.JOB && this.type !== WORKLOAD_TYPES.CRON_JOB && this.mode === _CREATE) {
563
- this.spec.selector = { matchLabels: this.value.workloadSelector };
564
- Object.assign(this.value.metadata.labels, this.value.workloadSelector);
565
- }
566
-
567
- let template;
568
-
569
- if (this.type === WORKLOAD_TYPES.CRON_JOB) {
570
- template = this.spec.jobTemplate;
571
- } else {
572
- template = this.spec.template;
573
- }
574
-
575
- if (this.type !== WORKLOAD_TYPES.JOB && this.type !== WORKLOAD_TYPES.CRON_JOB && this.mode === _CREATE) {
576
- if (!template.metadata) {
577
- template.metadata = { labels: this.value.workloadSelector };
578
- } else {
579
- Object.assign(template.metadata.labels, this.value.workloadSelector);
580
- }
581
- }
582
-
583
- if (template.spec.containers && template.spec.containers[0]) {
584
- const containerResources = template.spec.containers[0].resources;
585
- const nvidiaGpuLimit = template.spec.containers[0].resources?.limits?.[GPU_KEY];
586
-
587
- // Though not required, requests are also set to mirror the ember ui
588
- if (nvidiaGpuLimit > 0) {
589
- containerResources.requests = containerResources.requests || {};
590
- containerResources.requests[GPU_KEY] = nvidiaGpuLimit;
591
- }
592
-
593
- if (!this.nvidiaIsValid(nvidiaGpuLimit) ) {
594
- try {
595
- delete containerResources.requests[GPU_KEY];
596
- delete containerResources.limits[GPU_KEY];
597
-
598
- if (Object.keys(containerResources.limits).length === 0) {
599
- delete containerResources.limits;
600
- }
601
- if (Object.keys(containerResources.requests).length === 0) {
602
- delete containerResources.requests;
603
- }
604
- if (Object.keys(containerResources).length === 0) {
605
- delete template.spec.containers[0].resources;
606
- }
607
- } catch {}
608
- }
609
- }
610
-
611
- const nodeAffinity = template?.spec?.affinity?.nodeAffinity || {};
612
- const podAffinity = template?.spec?.affinity?.podAffinity || {};
613
- const podAntiAffinity = template?.spec?.affinity?.podAntiAffinity || {};
614
-
615
- this.fixNodeAffinity(nodeAffinity);
616
- this.fixPodAffinity(podAffinity);
617
- this.fixPodAffinity(podAntiAffinity);
618
- this.fixPodSecurityContext(this.podTemplateSpec);
619
-
620
- // delete this.value.kind;
621
- if (this.container && !this.container.name) {
622
- this.$set(this.container, 'name', this.value.metadata.name);
623
- }
624
-
625
- const ports = this.value.containers.reduce((total, each) => {
626
- const containerPorts = each.ports || [];
627
-
628
- total.push(...containerPorts.filter(port => port._serviceType && port._serviceType !== ''));
629
-
630
- return total;
631
- }, []);
632
-
633
- // ports contain info used to create services after saving
634
- this.portsForServices = ports;
635
- Object.assign(this.value, { spec: this.spec });
636
- },
637
-
638
- // node and pod affinity are formatted incorrectly from API; fix before saving
639
- fixNodeAffinity(nodeAffinity) {
640
- const preferredDuringSchedulingIgnoredDuringExecution =
641
- nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution || [];
642
- const requiredDuringSchedulingIgnoredDuringExecution =
643
- nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution || {};
644
-
645
- preferredDuringSchedulingIgnoredDuringExecution.forEach((term) => {
646
- const matchExpressions = term?.preference?.matchExpressions || [];
647
-
648
- matchExpressions.forEach((expression) => {
649
- if (expression.values) {
650
- expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
651
- }
652
- });
653
- });
654
-
655
- (
656
- requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms || []
657
- ).forEach((term) => {
658
- const matchExpressions = term.matchExpressions || [];
659
-
660
- matchExpressions.forEach((expression) => {
661
- if (expression.values) {
662
- expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
663
- }
664
- });
665
- });
666
- },
667
-
668
- fixPodAffinity(podAffinity) {
669
- const preferredDuringSchedulingIgnoredDuringExecution =
670
- podAffinity.preferredDuringSchedulingIgnoredDuringExecution || [];
671
- const requiredDuringSchedulingIgnoredDuringExecution =
672
- podAffinity.requiredDuringSchedulingIgnoredDuringExecution || [];
673
-
674
- preferredDuringSchedulingIgnoredDuringExecution.forEach((term) => {
675
- const matchExpressions = term?.podAffinityTerm?.labelSelector?.matchExpressions || [];
676
-
677
- matchExpressions.forEach((expression) => {
678
- if (expression.values) {
679
- expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
680
- }
681
- });
682
- });
683
-
684
- requiredDuringSchedulingIgnoredDuringExecution.forEach((term) => {
685
- const matchExpressions = term?.labelSelector?.matchExpressions || [];
686
-
687
- matchExpressions.forEach((expression) => {
688
- if (expression.values) {
689
- expression.values = typeof expression.values === 'string' ? [expression.values] : [...expression.values];
690
- }
691
- });
692
- });
693
-
694
- return podAffinity;
695
- },
696
-
697
- fixPodSecurityContext(podTempSpec) {
698
- if (this.podFsGroup) {
699
- podTempSpec.securityContext = podTempSpec.securityContext || {};
700
- podTempSpec.securityContext.fsGroup = this.podFsGroup;
701
- } else {
702
- if (podTempSpec.securityContext?.fsGroup) {
703
- delete podTempSpec.securityContext.fsGroup;
704
- }
705
- if (Object.keys(podTempSpec.securityContext || {}).length === 0) {
706
- delete podTempSpec.securityContext;
707
- }
708
- }
709
- },
710
-
711
- selectType(type) {
712
- if (!this.type && type) {
713
- this.$router.replace({ params: { resource: type } });
714
- } else {
715
- this.type = type;
716
- }
717
- },
718
-
719
- selectContainer(container) {
720
- if (container.__add) {
721
- this.addContainer();
722
-
723
- return;
724
- }
725
- (this.allContainers || []).forEach((container) => {
726
- if (container.__active) {
727
- delete container.__active;
728
- }
729
- });
730
- container.__active = true;
731
- this.container = container;
732
- this.isInitContainer = !!container._init;
733
- this.containerChange++;
734
- },
735
-
736
- addContainer() {
737
- let nameNumber = this.allContainers.length;
738
- const allNames = this.allContainers.reduce((names, each) => {
739
- names.push(each.name);
740
-
741
- return names;
742
- }, []);
743
-
744
- while (allNames.includes(`container-${ nameNumber }`)) {
745
- nameNumber++;
746
- }
747
- const container = { imagePullPolicy: 'Always', name: `container-${ nameNumber }` };
748
-
749
- this.podTemplateSpec.containers.push(container);
750
- this.selectContainer(container);
751
- },
752
-
753
- removeContainer(container) {
754
- if (container._init) {
755
- removeObject(this.podTemplateSpec.initContainers, container);
756
- } else {
757
- removeObject(this.podTemplateSpec.containers, container);
758
- }
759
- this.selectContainer(this.allContainers[0]);
760
- },
761
-
762
- updateInitContainer(neu) {
763
- if (!this.container) {
764
- return;
765
- }
766
- const containers = this.podTemplateSpec.containers;
767
-
768
- if (neu) {
769
- if (!this.podTemplateSpec.initContainers) {
770
- this.podTemplateSpec.initContainers = [];
771
- }
772
- this.podTemplateSpec.initContainers.push(this.container);
773
-
774
- removeObject(containers, this.container);
775
- } else {
776
- delete this.container._init;
777
- const initContainers = this.podTemplateSpec.initContainers;
778
-
779
- removeObject(initContainers, this.container);
780
- containers.push(this.container);
781
- }
782
- this.isInitContainer = neu;
783
- },
784
- clearPvcFormState(hookName) {
785
- // On the `closePvcForm` event, remove the
786
- // before save hook to prevent the PVC from
787
- // being created. Use the PVC's unique ID to distinguish
788
- // between hooks for different PVCs.
789
- if (this[BEFORE_SAVE_HOOKS]) {
790
- this.unregisterBeforeSaveHook(hookName);
791
- }
792
- },
793
-
794
- updateServiceAccount(neu) {
795
- if (neu) {
796
- this.podTemplateSpec.serviceAccount = neu;
797
- this.podTemplateSpec.serviceAccountName = neu;
798
- } else {
799
- // Note - both have to be removed in order for removal to work
800
- delete this.podTemplateSpec.serviceAccount;
801
- delete this.podTemplateSpec.serviceAccountName;
802
- }
803
- },
804
- nvidiaIsValid(nvidiaGpuLimit) {
805
- if (!Number.isInteger(nvidiaGpuLimit)) {
806
- return false;
807
- }
808
- if (nvidiaGpuLimit === undefined) {
809
- return false;
810
- }
811
- if (nvidiaGpuLimit < 1) {
812
- return false;
813
- } else {
814
- return true;
815
- }
816
-
817
- //
818
- }
819
- }
24
+ mixins: [WorkLoadMixin],
820
25
  };
821
26
  </script>
822
27
 
823
28
  <template>
824
- <Loading v-if="$fetchState.pending" />
825
-
826
- <form v-else class="filled-height">
827
- <CruResource
828
- :validation-passed="true"
829
- :selected-subtype="type"
830
- :resource="value"
831
- :mode="mode"
832
- :errors="errors"
833
- :done-route="doneRoute"
834
- :subtypes="workloadSubTypes"
835
- :apply-hooks="applyHooks"
836
- @finish="save"
837
- @select-type="selectType"
838
- @error="e=>errors = e"
839
- >
840
- <div class="row">
841
- <div class="col span-12">
842
- <NameNsDescription :value="value" :extra-columns="nameNsColumns" :mode="mode" @change="name=value.metadata.name">
843
- <template #schedule>
844
- <LabeledInput
845
- v-model="spec.schedule"
846
- type="cron"
847
- required
848
- :mode="mode"
849
- :label="t('workload.cronSchedule')"
850
- placeholder="0 * * * *"
851
- />
852
- </template>
853
- <template #replicas>
854
- <LabeledInput
855
- v-model.number="spec.replicas"
856
- type="number"
857
- min="0"
858
- required
859
- :mode="mode"
860
- :label="t('workload.replicas')"
861
- />
862
- </template>
863
- <template #service>
864
- <LabeledSelect
865
- v-model="spec.serviceName"
866
- option-label="metadata.name"
867
- :reduce="service=>service.metadata.name"
868
- :mode="mode"
869
- :label="t('workload.serviceName')"
870
- :options="headlessServices"
871
- required
872
- />
873
- </template>
874
- </NameNsDescription>
875
- </div>
876
- </div>
877
- <div v-if="containerOptions.length > 1" class="container-row">
878
- <div class="col span-4">
879
- <LabeledSelect :value="container" option-label="name" :label="t('workload.container.titles.container')" :options="containerOptions" @input="selectContainer" />
880
- </div>
881
- <div v-if="allContainers.length > 1 && !isView" class="col">
882
- <button type="button" class="btn-sm role-link" @click="removeContainer(container)">
883
- {{ t('workload.container.removeContainer') }}
884
- </button>
885
- </div>
886
- </div>
887
- <Tabbed :key="containerChange" :side-tabs="true">
888
- <Tab :label="t('workload.container.titles.general')" name="general" :weight="tabWeightMap['general']">
889
- <div>
890
- <div :style="{'align-items':'center'}" class="row mb-20">
891
- <div class="col span-6">
892
- <LabeledInput v-model="container.name" :mode="mode" :label="t('workload.container.containerName')" />
893
- </div>
894
- <div class="col span-6">
895
- <RadioGroup
896
- :mode="mode"
897
- :value="isInitContainer"
898
- name="initContainer"
899
- :options="[true, false]"
900
- :labels="[t('workload.container.init'), t('workload.container.standard')]"
901
- @input="updateInitContainer"
902
- />
903
- </div>
904
- </div>
905
- <h3>{{ t('workload.container.titles.image') }}</h3>
906
- <div class="row mb-20">
907
- <div class="col span-6">
908
- <LabeledInput
909
- v-model.trim="container.image"
910
- :mode="mode"
911
- :label="t('workload.container.image')"
912
- :placeholder="t('generic.placeholder', {text: 'nginx:latest'}, true)"
913
- required
914
- />
915
- </div>
916
- <div class="col span-6">
917
- <LabeledSelect
918
- v-model="container.imagePullPolicy"
919
- :label="t('workload.container.imagePullPolicy')"
920
- :options="pullPolicyOptions"
921
- :mode="mode"
922
- />
923
- </div>
924
- </div>
925
- <div class="row">
926
- <div class="col span-6">
927
- <LabeledSelect
928
- v-model="imagePullSecrets"
929
- :label="t('workload.container.imagePullSecrets')"
930
- :multiple="true"
931
- :taggable="true"
932
- :options="namespacedSecrets"
933
- :mode="mode"
934
- option-label="metadata.name"
935
- :reduce="service=>service.metadata.name"
936
- />
937
- </div>
938
- </div>
939
- </div>
940
-
941
- <div class="spacer"></div>
942
- <div>
943
- <h3>{{ t('workload.container.titles.ports') }}</h3>
944
- <div class="row">
945
- <WorkloadPorts v-model="container.ports" :name="value.metadata.name" :services="servicesOwned" :mode="mode" />
946
- </div>
947
- </div>
948
-
949
- <div class="spacer"></div>
950
- <div>
951
- <h3>{{ t('workload.container.titles.command') }}</h3>
952
- <Command v-model="container" :secrets="namespacedSecrets" :config-maps="namespacedConfigMaps" :mode="mode" />
953
- </div>
954
- <ServiceNameSelect
955
- :value="podTemplateSpec.serviceAccountName"
956
- :mode="mode"
957
- :select-label="t('workload.serviceAccountName.label')"
958
- :select-placeholder="t('workload.serviceAccountName.label')"
959
- :options="namespacedServiceNames"
960
- option-label="metadata.name"
961
- @input="updateServiceAccount"
962
- />
963
-
964
- <div class="spacer"></div>
965
- <div>
966
- <h3>{{ t('workload.container.titles.lifecycle') }}</h3>
967
- <LifecycleHooks v-model="container.lifecycle" :mode="mode" />
968
- </div>
969
- </Tab>
970
- <Tab :label="t('workload.storage.title')" name="storage" :weight="tabWeightMap['storage']">
971
- <Storage
972
- v-model="podTemplateSpec"
973
- :namespace="value.metadata.namespace"
974
- :register-before-hook="registerBeforeHook"
975
- :mode="mode"
976
- :secrets="namespacedSecrets"
977
- :config-maps="namespacedConfigMaps"
978
- :container="container"
979
- :save-pvc-hook-name="savePvcHookName"
980
- @removePvcForm="clearPvcFormState"
981
- />
982
- </Tab>
983
- <Tab :label="t('workload.container.titles.resources')" name="resources" :weight="tabWeightMap['resources']">
984
- <h3 class="mb-10">
985
- <t k="workload.scheduling.titles.limits" />
986
- </h3>
987
- <ContainerResourceLimit v-model="flatResources" :mode="mode" :show-tip="false" />
988
- <template>
989
- <div class="spacer"></div>
990
- <div>
991
- <h3 class="mb-10">
992
- <t k="workload.scheduling.titles.tolerations" />
993
- </h3>
994
- <div class="row">
995
- <Tolerations v-model="podTemplateSpec.tolerations" :mode="mode" />
996
- </div>
997
- </div>
998
-
999
- <div>
1000
- <div class="spacer"></div>
1001
- <h3 class="mb-10">
1002
- <t k="workload.scheduling.titles.priority" />
1003
- </h3>
1004
- <div class="row">
1005
- <div class="col span-6">
1006
- <LabeledInput v-model.number="podTemplateSpec.priority" :mode="mode" :label="t('workload.scheduling.priority.priority')" />
1007
- </div>
1008
- <div class="col span-6">
1009
- <LabeledInput v-model="podTemplateSpec.priorityClassname" :mode="mode" :label="t('workload.scheduling.priority.className')" />
1010
- </div>
1011
- </div>
1012
- </div>
1013
- </template>
1014
- </Tab>
1015
- <Tab :label="t('workload.container.titles.podScheduling')" name="podScheduling" :weight="tabWeightMap['podScheduling']">
1016
- <PodAffinity :mode="mode" :value="podTemplateSpec" :nodes="allNodeObjects" />
1017
- </Tab>
1018
- <Tab :label="t('workload.container.titles.nodeScheduling')" name="nodeScheduling" :weight="tabWeightMap['nodeScheduling']">
1019
- <NodeScheduling :mode="mode" :value="podTemplateSpec" :nodes="allNodes" />
1020
- </Tab>
1021
- <Tab :label="t('workload.container.titles.upgrading')" name="upgrading" :weight="tabWeightMap['upgrading']">
1022
- <Job v-if="isJob || isCronJob" v-model="spec" :mode="mode" :type="type" />
1023
- <Upgrading v-else v-model="spec" :mode="mode" :type="type" />
1024
- </Tab>
1025
- <Tab v-if="!isInitContainer" :label="t('workload.container.titles.healthCheck')" name="healthCheck" :weight="tabWeightMap['healthCheck']">
1026
- <HealthCheck v-model="healthCheck" :mode="mode" />
1027
- </Tab>
1028
- <Tab :label="t('workload.container.titles.securityContext')" name="securityContext" :weight="tabWeightMap['securityContext']">
1029
- <Security v-model="container.securityContext" :mode="mode" />
1030
- <div class="spacer"></div>
1031
- <div>
1032
- <h3>{{ t('workload.container.security.podFsGroup') }}</h3>
1033
- <div class="row">
1034
- <div class="col span-6">
1035
- <LabeledInput v-model.number="podFsGroup" type="number" :mode="mode" :label="t('workload.container.security.fsGroup')" />
1036
- </div>
1037
- </div>
1038
- </div>
1039
- </Tab>
1040
- <Tab :label="t('workload.container.titles.networking')" name="networking" :weight="tabWeightMap['networking']">
1041
- <Networking v-model="podTemplateSpec" :mode="mode" />
1042
- </Tab>
1043
- <Tab v-if="isStatefulSet" :label="t('workload.container.titles.volumeClaimTemplates')" name="volumeClaimTemplates" :weight="tabWeightMap['volumeClaimTemplates']">
1044
- <VolumeClaimTemplate v-model="spec" :mode="mode" />
1045
- </Tab>
1046
- <Tab name="labels" label-key="generic.labelsAndAnnotations" :weight="tabWeightMap['labels']">
1047
- <Labels v-model="value" :mode="mode" />
1048
- <div class="spacer"></div>
1049
-
1050
- <div>
1051
- <h3>{{ t('workload.container.titles.podLabels') }}</h3>
1052
- <div class="row mb-20">
1053
- <KeyValue
1054
- key="labels"
1055
- v-model="podLabels"
1056
- :add-label="t('labels.addLabel')"
1057
- :mode="mode"
1058
- :read-allowed="false"
1059
- :protip="false"
1060
- />
1061
- </div>
1062
- <div class="spacer"></div>
1063
- <h3>{{ t('workload.container.titles.podAnnotations') }}</h3>
1064
- <div class="row">
1065
- <KeyValue
1066
- key="annotations"
1067
- v-model="podAnnotations"
1068
- :add-label="t('labels.addAnnotation')"
1069
- :mode="mode"
1070
- :read-allowed="false"
1071
- :protip="false"
1072
- />
1073
- </div>
1074
- </div>
1075
- </Tab>
1076
- </Tabbed>
1077
- </CruResource>
1078
- </form>
29
+ <div>
30
+ <Loading v-if="$fetchState.pending" />
31
+ <WorkloadDeployment v-else-if="isDeployment" :mode="mode" :value="value" />
32
+ <WorkloadGeneric v-else :mode="mode" :value="value" />
33
+ </div>
1079
34
  </template>
1080
-
1081
- <style lang='scss'>
1082
- .container-row{
1083
- display: flex;
1084
- align-items: center;
1085
- margin-bottom: 20px;
1086
- }
1087
-
1088
- .type-placeholder{
1089
- color: white;
1090
- font-size: 2.5em;
1091
- height: 100%;
1092
- width: 100%;
1093
- background-color: var(--primary);
1094
- display: flex;
1095
- justify-content: center;
1096
- align-items: center;
1097
- }
1098
-
1099
- .type-description{
1100
- color: var(--input-label)
1101
- }
1102
-
1103
- .next-dropdown{
1104
- display: inline-block;
1105
- }
1106
- </style>