@spinnaker/cloudfoundry 0.0.0-main-2

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 (286) hide show
  1. package/CHANGELOG.md +1085 -0
  2. package/LICENSE.txt +203 -0
  3. package/dist/cf.module.d.ts +24 -0
  4. package/dist/cf.settings.d.ts +7 -0
  5. package/dist/common/applicationName.validator.d.ts +1 -0
  6. package/dist/deploymentStrategy/CloudFoundryDeploymentStrategySelector.d.ts +21 -0
  7. package/dist/deploymentStrategy/strategies/redblack/redblack.strategy.d.ts +10 -0
  8. package/dist/deploymentStrategy/strategies/rollingredblack/AdditionalFields.d.ts +22 -0
  9. package/dist/domain/ICloudFoundryAccount.d.ts +7 -0
  10. package/dist/domain/ICloudFoundryApplication.d.ts +4 -0
  11. package/dist/domain/ICloudFoundryCluster.d.ts +5 -0
  12. package/dist/domain/ICloudFoundryDroplet.d.ts +19 -0
  13. package/dist/domain/ICloudFoundryInstance.d.ts +4 -0
  14. package/dist/domain/ICloudFoundryLoadBalancer.d.ts +25 -0
  15. package/dist/domain/ICloudFoundryServerGroup.d.ts +41 -0
  16. package/dist/domain/ICloudFoundrySpace.d.ts +9 -0
  17. package/dist/domain/index.d.ts +8 -0
  18. package/dist/help/cloudfoundry.help.d.ts +1 -0
  19. package/dist/image/image.reader.cf.d.ts +4 -0
  20. package/dist/index.d.ts +6 -0
  21. package/dist/index.js +5929 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/instance/details/CloudFoundryInstanceActions.d.ts +11 -0
  24. package/dist/instance/details/CloudFoundryInstanceDetails.d.ts +23 -0
  25. package/dist/instance/details/index.d.ts +1 -0
  26. package/dist/instance/details/sections/CloudFoundryInstanceDetailsSection.d.ts +9 -0
  27. package/dist/instance/details/sections/index.d.ts +1 -0
  28. package/dist/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.d.ts +33 -0
  29. package/dist/loadBalancer/configure/loadBalancerDetails.d.ts +32 -0
  30. package/dist/loadBalancer/details/CloudFoundryLoadBalancerActions.d.ts +10 -0
  31. package/dist/loadBalancer/details/CloudFoundryLoadBalancerDetails.d.ts +26 -0
  32. package/dist/loadBalancer/details/index.d.ts +1 -0
  33. package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.d.ts +9 -0
  34. package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.d.ts +9 -0
  35. package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.d.ts +9 -0
  36. package/dist/loadBalancer/details/sections/index.d.ts +3 -0
  37. package/dist/loadBalancer/index.d.ts +3 -0
  38. package/dist/loadBalancer/loadBalancer.transformer.d.ts +25 -0
  39. package/dist/pipeline/config/validation/cfTargetImpedance.validator.d.ts +9 -0
  40. package/dist/pipeline/config/validation/instanceSize.validator.d.ts +15 -0
  41. package/dist/pipeline/config/validation/requiredRoutes.validator.d.ts +4 -0
  42. package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.d.ts +7 -0
  43. package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.d.ts +13 -0
  44. package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.d.ts +6 -0
  45. package/dist/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.d.ts +1 -0
  46. package/dist/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.d.ts +11 -0
  47. package/dist/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.d.ts +1 -0
  48. package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.d.ts +9 -0
  49. package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.d.ts +26 -0
  50. package/dist/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.d.ts +1 -0
  51. package/dist/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.d.ts +19 -0
  52. package/dist/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.d.ts +1 -0
  53. package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.d.ts +10 -0
  54. package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.d.ts +20 -0
  55. package/dist/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.d.ts +1 -0
  56. package/dist/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.d.ts +19 -0
  57. package/dist/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.d.ts +1 -0
  58. package/dist/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.d.ts +24 -0
  59. package/dist/pipeline/stages/deployService/CreateServiceInstanceDirectInput.d.ts +29 -0
  60. package/dist/pipeline/stages/deployService/CreateUserProvidedInput.d.ts +19 -0
  61. package/dist/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.d.ts +24 -0
  62. package/dist/pipeline/stages/deployService/ServiceTagsInput.d.ts +17 -0
  63. package/dist/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.d.ts +1 -0
  64. package/dist/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.d.ts +1 -0
  65. package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.d.ts +5 -0
  66. package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.d.ts +19 -0
  67. package/dist/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.d.ts +1 -0
  68. package/dist/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.d.ts +1 -0
  69. package/dist/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.d.ts +1 -0
  70. package/dist/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.d.ts +1 -0
  71. package/dist/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.d.ts +17 -0
  72. package/dist/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.d.ts +1 -0
  73. package/dist/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.d.ts +17 -0
  74. package/dist/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.d.ts +1 -0
  75. package/dist/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.d.ts +14 -0
  76. package/dist/pipeline/stages/runJob/RunJobExecutionDetails.d.ts +6 -0
  77. package/dist/pipeline/stages/runJob/cloudFoundryRunJob.module.d.ts +1 -0
  78. package/dist/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.d.ts +6 -0
  79. package/dist/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.d.ts +21 -0
  80. package/dist/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.d.ts +1 -0
  81. package/dist/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.d.ts +1 -0
  82. package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.d.ts +6 -0
  83. package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.d.ts +18 -0
  84. package/dist/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.d.ts +1 -0
  85. package/dist/presentation/forms/index.d.ts +2 -0
  86. package/dist/presentation/forms/inputs/FormikConfigField.d.ts +10 -0
  87. package/dist/presentation/forms/inputs/index.d.ts +1 -0
  88. package/dist/presentation/forms/serverGroup/Buildpacks.d.ts +8 -0
  89. package/dist/presentation/forms/serverGroup/EnvironmentVariables.d.ts +8 -0
  90. package/dist/presentation/forms/serverGroup/HealthCheck.d.ts +12 -0
  91. package/dist/presentation/forms/serverGroup/InstanceParameters.d.ts +12 -0
  92. package/dist/presentation/forms/serverGroup/Routes.d.ts +10 -0
  93. package/dist/presentation/forms/serverGroup/Services.d.ts +5 -0
  94. package/dist/presentation/forms/serverGroup/index.d.ts +6 -0
  95. package/dist/presentation/index.d.ts +3 -0
  96. package/dist/presentation/pipeline/index.d.ts +1 -0
  97. package/dist/presentation/pipeline/stages/CloudFoundryAsgStageConfig.d.ts +14 -0
  98. package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.d.ts +6 -0
  99. package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.d.ts +25 -0
  100. package/dist/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.d.ts +6 -0
  101. package/dist/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.d.ts +6 -0
  102. package/dist/presentation/pipeline/stages/index.d.ts +5 -0
  103. package/dist/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.d.ts +33 -0
  104. package/dist/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.d.ts +32 -0
  105. package/dist/presentation/widgets/accountRegionClusterSelector/index.d.ts +2 -0
  106. package/dist/presentation/widgets/index.d.ts +1 -0
  107. package/dist/presentation/widgets/recentLogs/CloudFoundryRecentLogs.d.ts +27 -0
  108. package/dist/routeDomains/index.d.ts +1 -0
  109. package/dist/routeDomains/routeDomainSelectField.d.ts +15 -0
  110. package/dist/serverGroup/configure/index.d.ts +4 -0
  111. package/dist/serverGroup/configure/serverGroupCommandBuilder.service.cf.d.ts +12 -0
  112. package/dist/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.d.ts +14 -0
  113. package/dist/serverGroup/configure/serverGroupConfigurationModel.cf.d.ts +65 -0
  114. package/dist/serverGroup/configure/wizard/CreateServerGroupModal.d.ts +31 -0
  115. package/dist/serverGroup/configure/wizard/ServerGroupTemplateSelection.d.ts +16 -0
  116. package/dist/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.d.ts +17 -0
  117. package/dist/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.d.ts +11 -0
  118. package/dist/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.d.ts +24 -0
  119. package/dist/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.d.ts +21 -0
  120. package/dist/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.d.ts +22 -0
  121. package/dist/serverGroup/details/cfServerGroupDetailsGetter.d.ts +4 -0
  122. package/dist/serverGroup/details/cloudFoundryServerGroupActions.d.ts +24 -0
  123. package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.d.ts +28 -0
  124. package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.d.ts +28 -0
  125. package/dist/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.d.ts +37 -0
  126. package/dist/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.d.ts +36 -0
  127. package/dist/serverGroup/details/sections/ApplicationManagerSection.d.ts +6 -0
  128. package/dist/serverGroup/details/sections/BoundServicesSection.d.ts +6 -0
  129. package/dist/serverGroup/details/sections/BuildSection.d.ts +6 -0
  130. package/dist/serverGroup/details/sections/EnvironmentVariablesSection.d.ts +6 -0
  131. package/dist/serverGroup/details/sections/HealthCheckSection.d.ts +6 -0
  132. package/dist/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.d.ts +5 -0
  133. package/dist/serverGroup/details/sections/MetricsSection.d.ts +6 -0
  134. package/dist/serverGroup/details/sections/PackageSection.d.ts +6 -0
  135. package/dist/serverGroup/details/sections/ServerGroupInformationSection.d.ts +6 -0
  136. package/dist/serverGroup/details/sections/ServerGroupSizingSection.d.ts +6 -0
  137. package/dist/serverGroup/details/sections/index.d.ts +9 -0
  138. package/dist/serverGroup/index.d.ts +5 -0
  139. package/dist/serverGroup/serverGroup.transformer.d.ts +10 -0
  140. package/package.json +52 -0
  141. package/src/cf.module.ts +85 -0
  142. package/src/cf.settings.ts +14 -0
  143. package/src/common/applicationName.validator.ts +43 -0
  144. package/src/common/cloudFoundry.less +16 -0
  145. package/src/deploymentStrategy/CloudFoundryDeploymentStrategySelector.tsx +175 -0
  146. package/src/deploymentStrategy/strategies/redblack/redblack.strategy.ts +11 -0
  147. package/src/deploymentStrategy/strategies/rollingredblack/AdditionalFields.tsx +161 -0
  148. package/src/domain/ICloudFoundryAccount.ts +9 -0
  149. package/src/domain/ICloudFoundryApplication.ts +5 -0
  150. package/src/domain/ICloudFoundryCluster.ts +6 -0
  151. package/src/domain/ICloudFoundryDroplet.ts +22 -0
  152. package/src/domain/ICloudFoundryInstance.ts +5 -0
  153. package/src/domain/ICloudFoundryLoadBalancer.ts +29 -0
  154. package/src/domain/ICloudFoundryServerGroup.ts +47 -0
  155. package/src/domain/ICloudFoundrySpace.ts +10 -0
  156. package/src/domain/index.ts +8 -0
  157. package/src/help/cloudfoundry.help.ts +31 -0
  158. package/src/image/image.reader.cf.ts +17 -0
  159. package/src/index.ts +7 -0
  160. package/src/instance/details/CloudFoundryInstanceActions.tsx +59 -0
  161. package/src/instance/details/CloudFoundryInstanceDetails.tsx +154 -0
  162. package/src/instance/details/index.ts +1 -0
  163. package/src/instance/details/sections/CloudFoundryInstanceDetailsSection.tsx +49 -0
  164. package/src/instance/details/sections/index.ts +1 -0
  165. package/src/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.tsx +210 -0
  166. package/src/loadBalancer/configure/loadBalancerDetails.tsx +228 -0
  167. package/src/loadBalancer/details/CloudFoundryLoadBalancerActions.tsx +61 -0
  168. package/src/loadBalancer/details/CloudFoundryLoadBalancerDetails.tsx +148 -0
  169. package/src/loadBalancer/details/index.ts +1 -0
  170. package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.tsx +63 -0
  171. package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.tsx +34 -0
  172. package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.tsx +27 -0
  173. package/src/loadBalancer/details/sections/index.ts +3 -0
  174. package/src/loadBalancer/index.ts +3 -0
  175. package/src/loadBalancer/loadBalancer.transformer.ts +144 -0
  176. package/src/logo/cf.icon.svg +12 -0
  177. package/src/logo/cf.logo.less +5 -0
  178. package/src/logo/cf.logo.svg +12 -0
  179. package/src/pipeline/config/validation/cfTargetImpedance.validator.ts +60 -0
  180. package/src/pipeline/config/validation/instanceSize.validator.ts +66 -0
  181. package/src/pipeline/config/validation/requiredRoutes.validator.ts +26 -0
  182. package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.tsx +62 -0
  183. package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.tsx +174 -0
  184. package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.tsx +35 -0
  185. package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestConfig.spec.tsx +80 -0
  186. package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.ts +35 -0
  187. package/src/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.tsx +113 -0
  188. package/src/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.ts +14 -0
  189. package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.spec.tsx +35 -0
  190. package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.tsx +69 -0
  191. package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.tsx +230 -0
  192. package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.ts +19 -0
  193. package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStageForm.spec.tsx +50 -0
  194. package/src/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.tsx +116 -0
  195. package/src/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.ts +21 -0
  196. package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.tsx +69 -0
  197. package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.tsx +158 -0
  198. package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.ts +19 -0
  199. package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStageForm.spec.tsx +49 -0
  200. package/src/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.tsx +116 -0
  201. package/src/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.ts +22 -0
  202. package/src/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.tsx +198 -0
  203. package/src/pipeline/stages/deployService/CreateServiceInstanceDirectInput.tsx +164 -0
  204. package/src/pipeline/stages/deployService/CreateUserProvidedInput.tsx +116 -0
  205. package/src/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.ts +27 -0
  206. package/src/pipeline/stages/deployService/ServiceTagsInput.tsx +89 -0
  207. package/src/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.ts +153 -0
  208. package/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.less +12 -0
  209. package/src/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.ts +23 -0
  210. package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.tsx +46 -0
  211. package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.tsx +134 -0
  212. package/src/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.ts +20 -0
  213. package/src/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.ts +18 -0
  214. package/src/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.ts +18 -0
  215. package/src/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.ts +21 -0
  216. package/src/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.tsx +148 -0
  217. package/src/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.ts +52 -0
  218. package/src/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.tsx +90 -0
  219. package/src/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.ts +19 -0
  220. package/src/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.tsx +100 -0
  221. package/src/pipeline/stages/runJob/RunJobExecutionDetails.tsx +62 -0
  222. package/src/pipeline/stages/runJob/cloudFoundryRunJob.module.ts +24 -0
  223. package/src/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.tsx +52 -0
  224. package/src/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.tsx +141 -0
  225. package/src/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.ts +21 -0
  226. package/src/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.ts +21 -0
  227. package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.tsx +46 -0
  228. package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.tsx +114 -0
  229. package/src/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.ts +21 -0
  230. package/src/presentation/forms/index.ts +2 -0
  231. package/src/presentation/forms/inputs/FormikConfigField.tsx +28 -0
  232. package/src/presentation/forms/inputs/index.ts +1 -0
  233. package/src/presentation/forms/serverGroup/Buildpacks.tsx +69 -0
  234. package/src/presentation/forms/serverGroup/EnvironmentVariables.tsx +94 -0
  235. package/src/presentation/forms/serverGroup/HealthCheck.tsx +57 -0
  236. package/src/presentation/forms/serverGroup/InstanceParameters.tsx +63 -0
  237. package/src/presentation/forms/serverGroup/Routes.tsx +74 -0
  238. package/src/presentation/forms/serverGroup/Services.tsx +62 -0
  239. package/src/presentation/forms/serverGroup/index.ts +6 -0
  240. package/src/presentation/index.ts +3 -0
  241. package/src/presentation/pipeline/index.ts +1 -0
  242. package/src/presentation/pipeline/stages/CloudFoundryAsgStageConfig.tsx +67 -0
  243. package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.tsx +53 -0
  244. package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.tsx +116 -0
  245. package/src/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.tsx +46 -0
  246. package/src/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.tsx +52 -0
  247. package/src/presentation/pipeline/stages/index.ts +5 -0
  248. package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.spec.tsx +385 -0
  249. package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.tsx +231 -0
  250. package/src/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.tsx +164 -0
  251. package/src/presentation/widgets/accountRegionClusterSelector/index.ts +2 -0
  252. package/src/presentation/widgets/index.ts +1 -0
  253. package/src/presentation/widgets/recentLogs/CloudFoundryRecentLogs.tsx +112 -0
  254. package/src/routeDomains/index.ts +1 -0
  255. package/src/routeDomains/routeDomainSelectField.tsx +48 -0
  256. package/src/serverGroup/configure/index.ts +4 -0
  257. package/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts +168 -0
  258. package/src/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.ts +64 -0
  259. package/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts +77 -0
  260. package/src/serverGroup/configure/wizard/CreateServerGroupModal.tsx +194 -0
  261. package/src/serverGroup/configure/wizard/ServerGroupTemplateSelection.tsx +55 -0
  262. package/src/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.tsx +78 -0
  263. package/src/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.tsx +49 -0
  264. package/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx +163 -0
  265. package/src/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.tsx +101 -0
  266. package/src/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.tsx +230 -0
  267. package/src/serverGroup/configure/wizard/serverGroup.less +3 -0
  268. package/src/serverGroup/details/cfServerGroupDetailsGetter.ts +60 -0
  269. package/src/serverGroup/details/cloudFoundryServerGroupActions.tsx +365 -0
  270. package/src/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.tsx +137 -0
  271. package/src/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.tsx +137 -0
  272. package/src/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.tsx +232 -0
  273. package/src/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.tsx +179 -0
  274. package/src/serverGroup/details/sections/ApplicationManagerSection.tsx +28 -0
  275. package/src/serverGroup/details/sections/BoundServicesSection.tsx +39 -0
  276. package/src/serverGroup/details/sections/BuildSection.tsx +61 -0
  277. package/src/serverGroup/details/sections/EnvironmentVariablesSection.tsx +34 -0
  278. package/src/serverGroup/details/sections/HealthCheckSection.tsx +28 -0
  279. package/src/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.ts +6 -0
  280. package/src/serverGroup/details/sections/MetricsSection.tsx +28 -0
  281. package/src/serverGroup/details/sections/PackageSection.tsx +27 -0
  282. package/src/serverGroup/details/sections/ServerGroupInformationSection.tsx +58 -0
  283. package/src/serverGroup/details/sections/ServerGroupSizingSection.tsx +27 -0
  284. package/src/serverGroup/details/sections/index.ts +9 -0
  285. package/src/serverGroup/index.ts +5 -0
  286. package/src/serverGroup/serverGroup.transformer.ts +42 -0
@@ -0,0 +1,154 @@
1
+ import { UISref } from '@uirouter/react';
2
+ import { UIRouterContext } from '@uirouter/react-hybrid';
3
+ import { flattenDeep } from 'lodash';
4
+ import React from 'react';
5
+
6
+ import type { Application, ILoadBalancer } from '@spinnaker/core';
7
+ import { InstanceReader, RecentHistoryService, Spinner } from '@spinnaker/core';
8
+
9
+ import { CloudFoundryInstanceActions } from './CloudFoundryInstanceActions';
10
+ import type { ICloudFoundryInstance } from '../../domain';
11
+ import { CloudFoundryInstanceDetailsSection } from './sections';
12
+
13
+ interface InstanceFromStateParams {
14
+ instanceId: string;
15
+ }
16
+
17
+ interface InstanceManager {
18
+ account: string;
19
+ region: string;
20
+ category: string; // e.g., serverGroup, loadBalancer.
21
+ name: string; // Parent resource name, not instance name.
22
+ instances: ICloudFoundryInstance[];
23
+ }
24
+
25
+ interface ICloudFoundryInstanceDetailsState {
26
+ instance?: ICloudFoundryInstance;
27
+ instanceIdNotFound: string;
28
+ loading: boolean;
29
+ }
30
+
31
+ interface ICloudFoundryInstanceDetailsProps {
32
+ app: Application;
33
+ instance: InstanceFromStateParams;
34
+ loading: boolean;
35
+ }
36
+
37
+ @UIRouterContext
38
+ export class CloudFoundryInstanceDetails extends React.Component<
39
+ ICloudFoundryInstanceDetailsProps,
40
+ ICloudFoundryInstanceDetailsState
41
+ > {
42
+ constructor(props: ICloudFoundryInstanceDetailsProps) {
43
+ super(props);
44
+
45
+ this.state = {
46
+ loading: true,
47
+ instanceIdNotFound: props.instance.instanceId,
48
+ };
49
+ }
50
+
51
+ public componentDidMount(): void {
52
+ this.props.app.ready().then(() => this.retrieveInstance(this.props.instance));
53
+ }
54
+
55
+ private retrieveInstance(instanceFromParams: InstanceFromStateParams): void {
56
+ const instanceLocatorPredicate = (dataSource: InstanceManager) => {
57
+ return dataSource.instances.some((possibleMatch) => possibleMatch.id === instanceFromParams.instanceId);
58
+ };
59
+
60
+ const dataSources: InstanceManager[] = flattenDeep([
61
+ this.props.app.getDataSource('serverGroups').data,
62
+ this.props.app.getDataSource('loadBalancers').data,
63
+ this.props.app
64
+ .getDataSource('loadBalancers')
65
+ .data.map((loadBalancer: ILoadBalancer) => loadBalancer.serverGroups),
66
+ ]);
67
+
68
+ const instanceManager = dataSources.find(instanceLocatorPredicate);
69
+
70
+ if (instanceManager) {
71
+ const recentHistoryExtraData: { [key: string]: string } = {
72
+ region: instanceManager.region,
73
+ account: instanceManager.account,
74
+ };
75
+ if (instanceManager.category === 'serverGroup') {
76
+ recentHistoryExtraData.serverGroup = instanceManager.name;
77
+ }
78
+ RecentHistoryService.addExtraDataToLatest('instances', recentHistoryExtraData);
79
+ InstanceReader.getInstanceDetails(instanceManager.account, instanceManager.region, instanceFromParams.instanceId)
80
+ .then((instanceDetails: ICloudFoundryInstance) => {
81
+ instanceDetails.account = instanceManager.account;
82
+ instanceDetails.region = instanceManager.region;
83
+ return instanceDetails;
84
+ })
85
+ .then((instance) => {
86
+ this.setState({
87
+ instance,
88
+ loading: false,
89
+ });
90
+ });
91
+ }
92
+ }
93
+
94
+ public render(): JSX.Element {
95
+ const { app } = this.props;
96
+ const { instance, instanceIdNotFound, loading } = this.state;
97
+ const CloseButton = (
98
+ <div className="close-button">
99
+ <UISref to="^">
100
+ <span className="glyphicon glyphicon-remove" />
101
+ </UISref>
102
+ </div>
103
+ );
104
+ const loadingHeader = () => (
105
+ <div className="header">
106
+ {CloseButton}
107
+ <div className="horizontal center middle">
108
+ <Spinner size="small" />
109
+ </div>
110
+ </div>
111
+ );
112
+ const notFoundHeader = () => (
113
+ <div className="header">
114
+ {CloseButton}
115
+ <div className="header-text horizontal middle">
116
+ <h3 className="horizontal middle space-between flex-1">{instanceIdNotFound}</h3>
117
+ </div>
118
+ </div>
119
+ );
120
+ const instanceHeader = () => (
121
+ <div className="header">
122
+ {CloseButton}
123
+ <div className="header-text horizontal middle">
124
+ <span className={'glyphicon glyphicon-hdd ' + instance.healthState} />
125
+ <h3 className="horizontal middle space-between flex-1">{instance.name}</h3>
126
+ </div>
127
+ <CloudFoundryInstanceActions application={app} instance={instance} />
128
+ </div>
129
+ );
130
+ const notFoundContent = () => (
131
+ <div className="content">
132
+ <div className="content-section">
133
+ <div className="content-body text-center">
134
+ <h3>Instance not found.</h3>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ );
139
+ const instanceContent = () => (
140
+ <div className="content">
141
+ <CloudFoundryInstanceDetailsSection instance={instance} />
142
+ </div>
143
+ );
144
+ return (
145
+ <div className="details-panel">
146
+ {loading && loadingHeader()}
147
+ {!loading && instance && instanceHeader()}
148
+ {!loading && instance && instanceContent()}
149
+ {!loading && !instance && notFoundHeader()}
150
+ {!loading && !instance && notFoundContent()}
151
+ </div>
152
+ );
153
+ }
154
+ }
@@ -0,0 +1 @@
1
+ export * from './CloudFoundryInstanceDetails';
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+
3
+ import { AccountTag, CollapsibleSection, timestamp } from '@spinnaker/core';
4
+ import type { ICloudFoundryInstance } from '../../../domain';
5
+
6
+ export interface ICloudFoundryInstanceDetailsSectionProps {
7
+ instance: ICloudFoundryInstance;
8
+ }
9
+
10
+ export class CloudFoundryInstanceDetailsSection extends React.Component<ICloudFoundryInstanceDetailsSectionProps> {
11
+ constructor(props: ICloudFoundryInstanceDetailsSectionProps) {
12
+ super(props);
13
+ }
14
+
15
+ public render(): JSX.Element {
16
+ const { instance } = this.props;
17
+ return (
18
+ <div>
19
+ <CollapsibleSection heading="Instance Information" defaultExpanded={true}>
20
+ <dl className="dl-horizontal dl-narrow">
21
+ <dt>Launched</dt>
22
+ <dd>{timestamp(instance.launchTime)}</dd>
23
+ <dt>In</dt>
24
+ <dd>
25
+ <AccountTag account={instance.account} />
26
+ </dd>
27
+ <dt>Region</dt>
28
+ <dd>{instance.region}</dd>
29
+ </dl>
30
+ </CollapsibleSection>
31
+ <CollapsibleSection heading="Status" defaultExpanded={true}>
32
+ <dl className="dl-horizontal dl-narrow">
33
+ <dt>
34
+ <span className={'glyphicon glyphicon-' + instance.healthState + '-triangle'} />
35
+ </dt>
36
+ <dd>{instance.healthState}</dd>
37
+
38
+ {instance.details && (
39
+ <div>
40
+ <dt>Details</dt>
41
+ <dd>{instance.details}</dd>
42
+ </div>
43
+ )}
44
+ </dl>
45
+ </CollapsibleSection>
46
+ </div>
47
+ );
48
+ }
49
+ }
@@ -0,0 +1 @@
1
+ export * from './CloudFoundryInstanceDetailsSection';
@@ -0,0 +1,210 @@
1
+ import type { IDeferred } from 'angular';
2
+ import type { IModalServiceInstance } from 'angular-ui-bootstrap';
3
+ import type { Formik } from 'formik';
4
+ import { Form } from 'formik';
5
+ import { $q } from 'ngimport';
6
+ import React from 'react';
7
+ import { Modal, ModalFooter } from 'react-bootstrap';
8
+ import { from as observableFrom, Subject } from 'rxjs';
9
+ import { takeUntil } from 'rxjs/operators';
10
+
11
+ import type {
12
+ Application,
13
+ IAccount,
14
+ ILoadBalancerModalProps,
15
+ IModalComponentProps,
16
+ IServerGroup,
17
+ } from '@spinnaker/core';
18
+ import {
19
+ AccountService,
20
+ ModalClose,
21
+ noop,
22
+ ReactInjector,
23
+ ReactModal,
24
+ SpinFormik,
25
+ TaskMonitor,
26
+ TaskMonitorWrapper,
27
+ } from '@spinnaker/core';
28
+ import type { ICloudFoundryServerGroup } from '../../domain';
29
+ import { AccountRegionClusterSelector, Routes } from '../../presentation';
30
+
31
+ export interface ICreateCloudFoundryMapLoadBalancerState {
32
+ accounts: IAccount[];
33
+ regions: string[];
34
+ application: Application;
35
+ selectedValues: ICloudFoundryLoadBalancerModalValues;
36
+ taskMonitor: TaskMonitor;
37
+ }
38
+
39
+ export interface ICloudFoundryLoadBalancerModalProps extends IModalComponentProps {
40
+ application: Application;
41
+ }
42
+
43
+ export interface ICloudFoundryLoadBalancerModalValues {
44
+ credentials: string;
45
+ region: string;
46
+ cluster: string;
47
+ routes: string[];
48
+ }
49
+
50
+ export class CloudFoundryMapLoadBalancerModal extends React.Component<
51
+ ICloudFoundryLoadBalancerModalProps,
52
+ ICreateCloudFoundryMapLoadBalancerState
53
+ > {
54
+ public static defaultProps: Partial<ICloudFoundryLoadBalancerModalProps> = {
55
+ closeModal: noop,
56
+ dismissModal: noop,
57
+ };
58
+
59
+ private destroy$ = new Subject();
60
+ private formikRef = React.createRef<Formik<ICloudFoundryLoadBalancerModalValues>>();
61
+ private $uibModalInstanceEmulation: IModalServiceInstance & { deferred?: IDeferred<any> };
62
+
63
+ constructor(props: ICloudFoundryLoadBalancerModalProps) {
64
+ super(props);
65
+
66
+ const deferred = $q.defer();
67
+ const promise = deferred.promise;
68
+ this.$uibModalInstanceEmulation = {
69
+ result: promise,
70
+ close: () => this.props.dismissModal(),
71
+ dismiss: () => this.props.dismissModal(),
72
+ } as IModalServiceInstance;
73
+ Object.assign(this.$uibModalInstanceEmulation, { deferred });
74
+ this.state = {
75
+ accounts: [],
76
+ regions: [],
77
+ application: props.application,
78
+ selectedValues: {
79
+ credentials: '',
80
+ region: '',
81
+ cluster: '',
82
+ routes: [''],
83
+ },
84
+ taskMonitor: new TaskMonitor({
85
+ application: props.application,
86
+ title: 'Mapping a route to your server group',
87
+ modalInstance: TaskMonitor.modalInstanceEmulation(() => this.props.dismissModal()),
88
+ onTaskComplete: () => this.props.application.serverGroups.refresh(),
89
+ }),
90
+ };
91
+ observableFrom(AccountService.listAccounts('cloudfoundry'))
92
+ .pipe(takeUntil(this.destroy$))
93
+ .subscribe((rawAccounts: IAccount[]) => this.setState({ accounts: rawAccounts }));
94
+ }
95
+
96
+ public static show(props: ILoadBalancerModalProps): Promise<void> {
97
+ const modalProps = { dialogClassName: 'wizard-modal modal-lg' };
98
+ return ReactModal.show(
99
+ CloudFoundryMapLoadBalancerModal,
100
+ {
101
+ application: props.app,
102
+ // className: 'create-pipeline-modal-overflow-visible',
103
+ },
104
+ modalProps,
105
+ );
106
+ }
107
+
108
+ public componentDidMount(): void {
109
+ observableFrom(AccountService.listAccounts('cloudfoundry'))
110
+ .pipe(takeUntil(this.destroy$))
111
+ .subscribe((accounts) => this.setState({ accounts }));
112
+ }
113
+
114
+ public componentWillUnmount(): void {
115
+ this.destroy$.next();
116
+ }
117
+
118
+ private submit = (values: ICloudFoundryLoadBalancerModalValues): void => {
119
+ const { routes } = values;
120
+ const serverGroup: ICloudFoundryServerGroup = this.props.application.serverGroups?.data?.find(
121
+ (sg: ICloudFoundryServerGroup) =>
122
+ sg.cluster === this.state.selectedValues.cluster &&
123
+ sg.account === this.state.selectedValues.credentials &&
124
+ sg.region === this.state.selectedValues.region,
125
+ );
126
+
127
+ const coreServerGroup: IServerGroup = {
128
+ account: serverGroup.account,
129
+ cloudProvider: serverGroup.cloudProvider,
130
+ cluster: serverGroup.cluster,
131
+ instanceCounts: serverGroup.instanceCounts,
132
+ instances: serverGroup.instances,
133
+ loadBalancers: routes,
134
+ name: serverGroup.name,
135
+ region: serverGroup.region,
136
+ type: serverGroup.type,
137
+ };
138
+
139
+ this.state.taskMonitor.submit(() => {
140
+ return ReactInjector.serverGroupWriter.mapLoadBalancers(coreServerGroup, this.props.application, {
141
+ serverGroupName: serverGroup.name,
142
+ });
143
+ });
144
+ };
145
+
146
+ private close = (args?: any): void => {
147
+ this.props.dismissModal.apply(null, args);
148
+ };
149
+
150
+ private accountRegionClusterUpdated = (values: any) => {
151
+ this.setState({
152
+ selectedValues: {
153
+ cluster: values.cluster,
154
+ credentials: values.credentials,
155
+ region: values.region,
156
+ routes: [''],
157
+ },
158
+ });
159
+ };
160
+
161
+ public render() {
162
+ const { accounts, application, selectedValues } = this.state;
163
+ return (
164
+ <>
165
+ <TaskMonitorWrapper monitor={this.state.taskMonitor} />
166
+ <SpinFormik<ICloudFoundryLoadBalancerModalValues>
167
+ ref={this.formikRef}
168
+ initialValues={selectedValues}
169
+ onSubmit={this.submit}
170
+ render={(formik) => {
171
+ return (
172
+ <>
173
+ <ModalClose dismiss={this.close} />
174
+ <Modal.Header>
175
+ <Modal.Title>Map route</Modal.Title>
176
+ </Modal.Header>
177
+ <Modal.Body>
178
+ <Form className="form-horizontal">
179
+ <AccountRegionClusterSelector
180
+ accounts={accounts}
181
+ application={application}
182
+ cloudProvider={'cloudfoundry'}
183
+ isSingleRegion={true}
184
+ onComponentUpdate={this.accountRegionClusterUpdated}
185
+ component={selectedValues}
186
+ />
187
+ <Routes fieldName="routes" isRequired={true} singleRouteOnly={true} />
188
+ </Form>
189
+ </Modal.Body>
190
+ <ModalFooter>
191
+ <button className="btn btn-default" onClick={this.close}>
192
+ Cancel
193
+ </button>
194
+ <button
195
+ type="submit"
196
+ className="btn btn-primary"
197
+ onClick={() => this.submit(formik.values)}
198
+ disabled={!formik.isValid}
199
+ >
200
+ Submit
201
+ </button>
202
+ </ModalFooter>
203
+ </>
204
+ );
205
+ }}
206
+ />
207
+ </>
208
+ );
209
+ }
210
+ }
@@ -0,0 +1,228 @@
1
+ import type { FormikErrors, FormikProps } from 'formik';
2
+ import React from 'react';
3
+ import type { Option } from 'react-select';
4
+ import Select from 'react-select';
5
+ import { from as observableFrom, Subject } from 'rxjs';
6
+ import { takeUntil } from 'rxjs/operators';
7
+
8
+ import type { Application, IAccount, IRegion, IWizardPageComponent } from '@spinnaker/core';
9
+ import { AccountService } from '@spinnaker/core';
10
+ import type { ICloudFoundryAccount, ICloudFoundryDomain, ICloudFoundryLoadBalancerUpsertCommand } from '../../domain';
11
+ import { RouteDomainSelectField } from '../../routeDomains';
12
+
13
+ export interface ILoadBalancerDetailsProps {
14
+ app: Application;
15
+ formik: FormikProps<ICloudFoundryLoadBalancerUpsertCommand>;
16
+ isNew?: boolean;
17
+ }
18
+
19
+ export interface ILoadBalancerDetailsState {
20
+ accounts: IAccount[];
21
+ availabilityZones: string[];
22
+ existingLoadBalancerNames: string[];
23
+ domains: ICloudFoundryDomain[];
24
+ regions: IRegion[];
25
+ }
26
+
27
+ export class LoadBalancerDetails
28
+ extends React.Component<ILoadBalancerDetailsProps, ILoadBalancerDetailsState>
29
+ implements IWizardPageComponent<ICloudFoundryLoadBalancerUpsertCommand> {
30
+ private destroy$ = new Subject();
31
+ public state: ILoadBalancerDetailsState = {
32
+ accounts: undefined,
33
+ availabilityZones: [],
34
+ existingLoadBalancerNames: [],
35
+ domains: [],
36
+ regions: [],
37
+ };
38
+
39
+ public validate(values: ICloudFoundryLoadBalancerUpsertCommand) {
40
+ const errors = {} as FormikErrors<ICloudFoundryLoadBalancerUpsertCommand>;
41
+ if (!values.host || !values.host.match(/^[a-zA-Z0-9-]*$/)) {
42
+ errors.host = 'Host name can only contain letters, numbers, and dashes';
43
+ }
44
+ if (!values.credentials) {
45
+ errors.credentials = 'Account must be selected';
46
+ }
47
+ if (!values.region) {
48
+ errors.region = 'Region must be selected';
49
+ }
50
+ if (!values.domain) {
51
+ errors.domain = 'Domain must be selected';
52
+ }
53
+ if (values.port && !values.port.match(/^[0-9]*$/)) {
54
+ errors.port = 'Port can only be a numeric value';
55
+ }
56
+ if (values.path && !values.path.match(/^[a-zA-Z0-9-\\]*$/)) {
57
+ errors.path = 'Path must be in the format of "abcd/bcef/xyz"';
58
+ }
59
+ return errors;
60
+ }
61
+
62
+ public componentDidMount(): void {
63
+ this.loadAccounts();
64
+ }
65
+
66
+ public componentWillUnmount(): void {
67
+ this.destroy$.next();
68
+ }
69
+
70
+ private loadAccounts(): void {
71
+ observableFrom(AccountService.listAccounts('cloudfoundry'))
72
+ .pipe(takeUntil(this.destroy$))
73
+ .subscribe((accounts) => {
74
+ this.setState({ accounts });
75
+ this.loadDomainsAndRegions();
76
+ });
77
+ }
78
+
79
+ private accountUpdated = (option: Option<string>): void => {
80
+ const account = option.value;
81
+ this.props.formik.setFieldValue('credentials', account);
82
+ this.loadDomainsAndRegions();
83
+ };
84
+
85
+ private loadDomainsAndRegions(): void {
86
+ const account = this.props.formik.values.credentials;
87
+ if (account) {
88
+ observableFrom(AccountService.getAccountDetails(account))
89
+ .pipe(takeUntil(this.destroy$))
90
+ .subscribe((accountDetails: ICloudFoundryAccount) => this.setState({ domains: accountDetails.domains }));
91
+ observableFrom(AccountService.getRegionsForAccount(account))
92
+ .pipe(takeUntil(this.destroy$))
93
+ .subscribe((regions) => this.setState({ regions }));
94
+ }
95
+ }
96
+
97
+ private regionUpdated = (option: Option<string>): void => {
98
+ const region = option.value;
99
+ this.props.formik.setFieldValue('region', region);
100
+ if (region) {
101
+ const { credentials } = this.props.formik.values;
102
+ observableFrom(AccountService.getAccountDetails(credentials))
103
+ .pipe(takeUntil(this.destroy$))
104
+ .subscribe((accountDetails: ICloudFoundryAccount) => {
105
+ const { domains } = accountDetails;
106
+ this.setState({
107
+ domains: domains.filter(
108
+ (domain) => domain.organization === undefined || region.match('^' + domain.organization.name),
109
+ ),
110
+ });
111
+ });
112
+ }
113
+ };
114
+
115
+ private domainUpdated = (domainName: string): void => {
116
+ this.props.formik.setFieldValue('domainName', domainName);
117
+ };
118
+
119
+ private hostChanged = (event: React.ChangeEvent<HTMLInputElement>): void => {
120
+ const host = event.target.value;
121
+ this.props.formik.values.host = host;
122
+ this.props.formik.setFieldValue('host', host);
123
+ };
124
+
125
+ private portChanged = (event: React.ChangeEvent<HTMLInputElement>): void => {
126
+ const port = event.target.value;
127
+ this.props.formik.values.port = port;
128
+ this.props.formik.setFieldValue('port', port);
129
+ };
130
+
131
+ private pathChanged = (event: React.ChangeEvent<HTMLInputElement>): void => {
132
+ const path = event.target.value;
133
+ this.props.formik.values.path = path;
134
+ this.props.formik.setFieldValue('path', path);
135
+ };
136
+
137
+ public render() {
138
+ const { values } = this.props.formik;
139
+ const { accounts, domains, regions } = this.state;
140
+ return (
141
+ <div className="container-fluid form-horizontal">
142
+ <div className="modal-body">
143
+ <div className="form-group">
144
+ <div className="col-md-3 sm-label-right">Account</div>
145
+ <div className="col-md-7">
146
+ <Select
147
+ options={
148
+ accounts &&
149
+ accounts.map((acc: IAccount) => ({
150
+ label: acc.name,
151
+ value: acc.name,
152
+ }))
153
+ }
154
+ clearable={false}
155
+ value={values.credentials}
156
+ onChange={this.accountUpdated}
157
+ />
158
+ </div>
159
+ </div>
160
+ <div className="form-group">
161
+ <div className="col-md-3 sm-label-right">Region</div>
162
+ <div className="col-md-7">
163
+ <Select
164
+ options={
165
+ regions &&
166
+ regions.map((region: IRegion) => ({
167
+ label: region.name,
168
+ value: region.name,
169
+ }))
170
+ }
171
+ clearable={false}
172
+ value={values.region}
173
+ onChange={this.regionUpdated}
174
+ />
175
+ </div>
176
+ </div>
177
+ <RouteDomainSelectField
178
+ labelColumns={3}
179
+ component={values}
180
+ field="domain"
181
+ account={values.credentials}
182
+ onChange={this.domainUpdated}
183
+ domains={domains}
184
+ />
185
+ <div className="form-group">
186
+ <div className="col-md-3 sm-label-right">Host</div>
187
+ <div className="col-md-7">
188
+ <input
189
+ className="form-control input-sm target-group-name"
190
+ type="text"
191
+ value={values.host}
192
+ name="host"
193
+ required={true}
194
+ onChange={this.hostChanged}
195
+ />
196
+ </div>
197
+ </div>
198
+ <div className="form-group">
199
+ <div className="col-md-3 sm-label-right">Port</div>
200
+ <div className="col-md-3">
201
+ <input
202
+ className="form-control input-sm target-group-name"
203
+ type="text"
204
+ value={values.port}
205
+ required={false}
206
+ name="port"
207
+ onChange={this.portChanged}
208
+ />
209
+ </div>
210
+ </div>
211
+ <div className="form-group">
212
+ <div className="col-md-3 sm-label-right">Path</div>
213
+ <div className="col-md-7">
214
+ <input
215
+ className="form-control input-sm target-group-name"
216
+ type="text"
217
+ value={values.path}
218
+ required={false}
219
+ name="path"
220
+ onChange={this.pathChanged}
221
+ />
222
+ </div>
223
+ </div>
224
+ </div>
225
+ </div>
226
+ );
227
+ }
228
+ }