@spinnaker/appengine 2026.3.2 → 2026.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/FormikAccountRegionSelector.d.ts +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/details/AppengineInstanceDetails.d.ts +2 -2
- package/dist/loadBalancer/configure/AppengineCreateLoadBalancerModal.d.ts +1 -1
- package/dist/loadBalancer/details/AppengineLoadBalancerActions.d.ts +2 -2
- package/dist/loadBalancer/details/AppengineLoadBalancerDetailsSection.d.ts +2 -2
- package/dist/pipeline/stages/AppengineExecutionDetails.d.ts +4 -4
- package/dist/pipeline/stages/AppengineServerGroupStageConfig.d.ts +4 -4
- package/dist/pipeline/stages/deployAppengineConfig/DeployAppengineConfigForm.d.ts +1 -1
- package/dist/pipeline/stages/deployAppengineConfig/DeployAppengineConfigurationConfig.d.ts +2 -2
- package/dist/pipeline/stages/editLoadBalancer/AppengineEditLoadBalancerStageConfig.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/AppengineCloneServerGroupModal.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/ConfigFileArtifactList.d.ts +2 -2
- package/dist/serverGroup/details/AppengineServerGroupActions.d.ts +2 -2
- package/dist/serverGroup/details/AppengineServerGroupDetailsSection.d.ts +2 -2
- package/package.json +5 -7
- package/src/appengine.module.spec.ts +4 -4
- package/src/common/FormikAccountRegionSelector.tsx +1 -1
- package/src/pipeline/stages/deployAppengineConfig/DeployAppengineConfigForm.tsx +1 -1
- package/src/serverGroup/configure/wizard/configFileArtifactList.spec.tsx +8 -9
- /package/dist/{appengine.logoc2c312af6aa99037.png → appengine.logoDdEgr2Bq.png} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,30 @@
|
|
|
1
|
-
import{HelpContentsRegistry as e,TaskMonitor as t,LoadBalancerWriter as a,ReactModal as n,ModalClose as r,TaskMonitorWrapper as i,noop as l,ConfirmationModalService as o,AppListExtractor as s,FormikFormField as c,ReactSelectInput as p,AccountService as d,StageArtifactSelectorDelegate as u,excludeAllTypesExcept as m,ArtifactTypePatterns as h,FormValidator as g,FormikStageConfig as f,Registry as v,ExecutionDetailsTasks as C,ExecutionArtifactTab as b,AccountRegionClusterSelector as E,StageConfigField as y,TargetSelect as A,StageConstants as S,PlatformHealthOverride as N,ExecutionDetailsSection as k,SETTINGS as F,StorageAccountReader as w,TaskExecutor as D,ServerGroupWarningMessageService as T,ServerGroupReader as x,ApplicationNameValidator as G,CloudProviderRegistry as B,DeploymentStrategyRegistry as P}from"@spinnaker/core";import I,{useState as O,useEffect as M}from"react";import{reduce as $,filter as L,chain as R,cloneDeep as U,has as q,camelCase as H,get as j,isEmpty as z}from"lodash";import{Modal as V}from"react-bootstrap";import{Subject as _,from as J,Observable as K}from"rxjs";import{takeUntil as W}from"rxjs/operators";[{key:"appengine.serverGroup.gcs.repositoryUrl",value:"The full URL to the GCS bucket or TAR file containing the source files for this deployment,\n including 'gs://'. For example, <b>gs://my-bucket/my-app</b> or <b>gs://my-bucket/app.tar</b>."},{key:"appengine.serverGroup.git.repositoryUrl",value:"The full URL to the git repository containing the source files for this deployment,\n including protocol. For example, <b>https://github.com/spinnaker/deck.git</b>"},{key:"appengine.serverGroup.gitCredentialType",value:"The credential type that will be used to access the git repository for this deployment.\n You can configure these credentials alongside your App Engine credentials."},{key:"appengine.serverGroup.branch",value:"The name of the branch in the above git repository to be used for this deployment."},{key:"appengine.serverGroup.applicationDirectoryRoot",value:"(Optional) Path to the directory root of the application to be deployed,\n starting from the root of the git repository. This is the directory from which\n <code>gcloud app deploy</code> will be run."},{key:"appengine.serverGroup.configFilepaths",value:"Paths to App Engine application configuration files, starting from the application directory root,\n specified above. In most cases, this will be <code>app.yaml</code> or <code>cron.yaml</code>,\n but could be <code>path/to/app.yaml</code> or <code>path/to/cron.yaml</code>."},{key:"appengine.serverGroup.configFiles",value:"<p>(Optional) The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file). These files should not conflict with the config filepaths above:\n if you include, for example, the contents of an <code>app.yaml</code>\n file here, you should <b>not</b> specify the file path to an <code>app.yaml</code> above.<br></p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>"},{key:"appengine.serverGroup.configFilesRequired",value:"<p>The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file).</p>\n <p>An <code>app.yaml</code> file is required and must have <code>runtime: custom</code> in\n order to deploy successfully.</p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>"},{key:"appengine.serverGroup.matchBranchOnRegex",value:"(Optional) A Jenkins trigger may produce details from multiple repositories and branches.\n Spinnaker will use the regex specified here to help resolve a branch for the deployment.\n If Spinnaker cannot resolve exactly one branch from the trigger, this pipeline will fail."},{key:"appengine.serverGroup.promote",value:"If selected, the newly deployed server group will receive all traffic."},{key:"appengine.serverGroup.stopPreviousVersion",value:"If selected, the previously running server group in this server group's <b>service</b>\n (Spinnaker load balancer) will be stopped. This option will be respected only if this server group will\n be receiving all traffic and the previous server group is using manual scaling."},{key:"appengine.serverGroup.containerImageUrl",value:"The full URL to the container image to use for deployment. The URL must be one of the valid GCR hostnames,\n for example <b>gcr.io/my-project/image:tag</b>"},{key:"appengine.serverGroup.suppress-version-string",value:'Spinnaker automatically versions your server groups. This means deployments through Spinnaker receive a\n short version string at the end of their name, like "v001". In most cases you will want to keep this\n version as part of the name. Preventing this string from being added to your server group will stop\n it from being considered when rolling back, promoting new versions or executing deployment strategies.\n If you are certain that you do not want the version string applied to this server group then check\n this box.'},{key:"appengine.loadBalancer.shardBy.cookie",value:'Diversion based on a specially named cookie, "GOOGAPPUID." The cookie must be set by the application itself or no diversion will occur.'},{key:"appengine.loadBalancer.shardBy.ip",value:"Diversion based on applying the modulus operation to a fingerprint of the IP address."},{key:"appengine.loadBalancer.migrateTraffic",value:"If selected, traffic will be gradually shifted to a single version. For gradual traffic migration,\n the target version must be located within instances that are configured for\n both warmup requests and automatic scaling.\n Gradual traffic migration is not supported in the App Engine flexible environment."},{key:"appengine.loadBalancer.allocations",value:"An allocation is the percent of traffic directed to a server group."},{key:"appengine.loadBalancer.textLocator",value:"Either the name of a server group, or a Spinnaker Pipeline Expression\n that resolves to the name of a server group."},{key:"appengine.instance.availability",value:"\n An instance's <b>availability</b> is determined by its version (Spinnaker server group).\n <ul>\n <li>Manual scaling versions use resident instances</li>\n <li>Basic scaling versions use dynamic instances</li>\n <li>Auto scaling versions use dynamic instances - but if you specify a number, N,\n of minimum idle instances, the first N instances will be resident,\n and additional dynamic instances will be created as necessary.\n </li>\n </ul>"},{key:"appengine.instance.averageLatency",value:"Average latency over the last minute in milliseconds."},{key:"appengine.instance.vmStatus",value:"Status of the virtual machine where this instance lives."},{key:"appengine.instance.qps",value:"Average queries per second over the last minute."},{key:"appengine.instance.errors",value:"Number of errors since this instance was started."},{key:"appengine.instance.requests",value:"Number of requests since this instance was started."}].forEach(t=>e.register(t.key,t.value));class X{static convertTrafficSplitToTrafficSplitDescription(e){const t=$(e.allocations,(e,t,a)=>e.concat({serverGroupName:a,allocation:t,locatorType:"fromExisting"}),[]);return{shardBy:e.shardBy,allocationDescriptions:t}}constructor(e){this.credentials=e.account||e.credentials,this.account=this.credentials,this.cloudProvider=e.cloudProvider,this.loadBalancerName=e.name,this.name=e.name,this.region=e.region,this.migrateTraffic=e.migrateTraffic||!1,this.serverGroups=e.serverGroups}mapAllocationsToDecimals(){this.splitDescription.allocationDescriptions.forEach(e=>{e.allocation=e.allocation/100})}mapAllocationsToPercentages(){this.splitDescription.allocationDescriptions.forEach(e=>{e.allocation=Math.round(1e3*e.allocation)/10})}}const Y=[{label:"Current Server Group",value:"current_asg_dynamic"},{label:"Previous Server Group",value:"ancestor_asg_dynamic"},{label:"Oldest Server Group",value:"oldest_asg_dynamic"}];const Q=class e extends I.Component{constructor(){super(...arguments),this.state={taskMonitor:new t({application:this.props.app,title:"Updating your load balancer",onDismiss:()=>this.props.dismissModal(),onTaskComplete:()=>this.props.app.getDataSource("loadBalancers").refresh()})},this.command=this.buildInitialCommand(),this.update=(e,t)=>{this.command[e]=t,this.forceUpdate()},this.updateSplit=(e,t)=>{this.command.splitDescription[e]=t,this.forceUpdate()},this.updateAllocation=(e,t,a)=>{this.command.splitDescription.allocationDescriptions[e][t]=a,this.forceUpdate()},this.updateAllocationLocatorType=(e,t)=>{this.command.splitDescription.allocationDescriptions[e]=function(e,t){const a={...e,locatorType:t};return"targetCoordinate"===t?(delete a.serverGroupName,a.target=a.target||Y[0].value):(delete a.cluster,delete a.target),a}(this.command.splitDescription.allocationDescriptions[e],t),this.forceUpdate()},this.addAllocation=()=>{this.command.splitDescription.allocationDescriptions.push({allocation:0,locatorType:this.props.forPipelineConfig?"text":"fromExisting",serverGroupName:""}),this.command.splitDescription.allocationDescriptions.length>1&&!this.command.splitDescription.shardBy&&(this.command.splitDescription.shardBy="IP"),this.forceUpdate()},this.removeAllocation=e=>{this.command.splitDescription.allocationDescriptions.splice(e,1),this.forceUpdate()},this.allocationTotal=()=>this.command.splitDescription.allocationDescriptions.reduce((e,t)=>e+Number(t.allocation||0),0),this.submit=()=>{const e=U(this.command);e.mapAllocationsToDecimals(),delete e.serverGroups,this.props.forPipelineConfig?this.props.closeModal(e):this.state.taskMonitor.submit(()=>a.upsertLoadBalancer(e,this.props.app,"Update"))}}static show(t){return n.show(e,t,{dialogClassName:"modal-lg"})}buildInitialCommand(){const e=this.props.loadBalancer||{},t=new X({...e,account:e.account||e.credentials,credentials:e.credentials||e.account,name:e.name,region:e.region,serverGroups:e.serverGroups||[],cloudProvider:"appengine",migrateTraffic:e.migrateTraffic||!1});return t.splitDescription=e.splitDescription||e.split&&X.convertTrafficSplitToTrafficSplitDescription(e.split)||{shardBy:"UNSPECIFIED",allocationDescriptions:(e.serverGroups||[]).slice(0,1).map(e=>({allocation:100,locatorType:"fromExisting",serverGroupName:e.name}))},t.mapAllocationsToPercentages(),t}renderAllocationTarget(e,t){return this.props.forPipelineConfig?I.createElement("div",null,I.createElement("div",{className:"radio"},I.createElement("label",null,I.createElement("input",{checked:"text"===e.locatorType,onChange:()=>this.updateAllocationLocatorType(t,"text"),type:"radio"})," ","Text input")),I.createElement("div",{className:"radio"},I.createElement("label",null,I.createElement("input",{checked:"targetCoordinate"===e.locatorType,onChange:()=>this.updateAllocationLocatorType(t,"targetCoordinate"),type:"radio"})," ","Target coordinate")),I.createElement("div",{className:"radio"},I.createElement("label",null,I.createElement("input",{checked:"fromExisting"===e.locatorType,onChange:()=>this.updateAllocationLocatorType(t,"fromExisting"),type:"radio"})," ","Existing server group")),"targetCoordinate"===e.locatorType?I.createElement("div",null,I.createElement("input",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"cluster",e.target.value),placeholder:"Cluster",value:e.cluster||""}),I.createElement("select",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"target",e.target.value),value:e.target||Y[0].value},Y.map(e=>I.createElement("option",{key:e.value,value:e.value},e.label)))):I.createElement("input",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"serverGroupName",e.target.value),placeholder:"text"===e.locatorType?"Server group expression or name":"Server group",value:e.serverGroupName||""})):I.createElement("input",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"serverGroupName",e.target.value),value:e.serverGroupName||""})}render(){const{dismissModal:e,isNew:t}=this.props;return I.createElement("div",null,I.createElement(r,{dismiss:e}),I.createElement(V.Header,null,I.createElement(V.Title,null,t?"Create":"Edit"," App Engine Load Balancer")),I.createElement(V.Body,null,I.createElement("div",{className:"form-horizontal"},I.createElement("label",null,"Name"),I.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("name",e.target.value),value:this.command.name||""}),I.createElement("label",null,"Account"),I.createElement("input",{className:"form-control input-sm",onChange:e=>{this.update("credentials",e.target.value),this.update("account",e.target.value)},value:this.command.credentials||this.command.account||""}),I.createElement("label",null,"Region"),I.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("region",e.target.value),value:this.command.region||""}),I.createElement("div",{className:"checkbox"},I.createElement("label",null,I.createElement("input",{checked:!!this.command.migrateTraffic,onChange:e=>this.update("migrateTraffic",e.target.checked),type:"checkbox"})," ","Migrate traffic")),(this.command.splitDescription.allocationDescriptions.length>1||this.command.migrateTraffic)&&I.createElement("div",null,I.createElement("label",null,"Shard By"),I.createElement("select",{className:"form-control input-sm",onChange:e=>this.updateSplit("shardBy",e.target.value),value:this.command.splitDescription.shardBy||"UNSPECIFIED"},I.createElement("option",{value:"UNSPECIFIED"},"Unspecified"),I.createElement("option",{value:"IP"},"IP"),I.createElement("option",{value:"COOKIE"},"Cookie"))),I.createElement("label",null,"Allocations"),I.createElement("table",{className:"table table-condensed"},I.createElement("thead",null,I.createElement("tr",null,I.createElement("th",null,"Server Group"),I.createElement("th",null,"Allocation %"),I.createElement("th",null))),I.createElement("tbody",null,this.command.splitDescription.allocationDescriptions.map((e,t)=>I.createElement("tr",{key:t},I.createElement("td",null,this.renderAllocationTarget(e,t)),I.createElement("td",null,I.createElement("input",{className:"form-control input-sm",min:0,onChange:e=>this.updateAllocation(t,"allocation",Number(e.target.value)),type:"number",value:e.allocation||0})),I.createElement("td",null,I.createElement("button",{className:"btn btn-sm btn-link",onClick:()=>this.removeAllocation(t),type:"button"},I.createElement("span",{className:"glyphicon glyphicon-trash"}))))))),I.createElement("button",{className:"btn btn-block btn-sm add-new",onClick:this.addAllocation,type:"button"},I.createElement("span",{className:"glyphicon glyphicon-plus-sign"})," Add allocation"),100!==this.allocationTotal()&&I.createElement("div",{className:"alert alert-warning"},"Traffic allocations must add up to 100%."))),I.createElement(i,{monitor:this.state.taskMonitor}),I.createElement(V.Footer,null,I.createElement("button",{className:"btn btn-default",onClick:()=>e(),type:"button"},"Cancel"),I.createElement("button",{className:"btn btn-primary",disabled:100!==this.allocationTotal(),onClick:this.submit,type:"button"},t?"Create":"Done")))}};Q.defaultProps={closeModal:l,dismissModal:l};let Z=Q;function ee(e){return"default"!==e.name}function te(e){const t=(e.serverGroups||[]).map(e=>e.name);return t.length?1===t.length?`<div class="alert alert-warning"><p>Deleting <b>${e.name}</b> will destroy <b>${t[0]}</b>.</p></div>`:`<div class="alert alert-warning"><p>Deleting <b>${e.name}</b> will destroy the following server groups:<ul>${t.map(e=>`<li>${e}</li>`).join("")}</ul></p></div>`:null}class ae extends I.Component{constructor(e){super(e),this.destroy$=new _,this.setRegionList=e=>{const{application:t}=this.props,a=t=>!t||t.account===e;J(t.ready()).pipe(W(this.destroy$)).subscribe(()=>{const e=s.getRegions([t],a);e.sort(),this.setState({availableRegions:e})})},this.accountChanged=e=>{this.setRegionList(e)};const t=e.credentialsField||"credentials";this.state={availableRegions:[],cloudProvider:e.cloudProvider,componentName:e.componentName||"",credentialsField:t}}componentDidMount(){const{componentName:e,formik:t}=this.props,{credentialsField:a}=this.state,n=j(t.values,e?`${e}.${a}`:`${a}`,void 0);this.setRegionList(n)}componentWillUnmount(){this.destroy$.next()}render(){const{accounts:e}=this.props,{credentialsField:t,availableRegions:a,componentName:n}=this.state;return I.createElement("div",{className:"col-md-9"},I.createElement("div",{className:"sp-margin-m-bottom"},I.createElement(c,{name:n?`${n}.${t}`:`${t}`,label:"Account",input:t=>I.createElement(p,{...t,stringOptions:e&&e.map(e=>e.name),clearable:!1}),onChange:this.accountChanged,required:!0})),I.createElement("div",{className:"sp-margin-m-bottom"},I.createElement(c,{name:n?`${n}.region`:"region",label:"Region",input:e=>I.createElement(p,{...e,stringOptions:a,clearable:!1}),required:!0})))}}const ne=class e extends I.Component{constructor(){super(...arguments),this.destroy$=new _,this.state={accounts:[]},this.onTemplateArtifactEdited=(e,t)=>{this.props.formik.setFieldValue(`${t}.id`,null),this.props.formik.setFieldValue(`${t}.artifact`,e),this.props.formik.setFieldValue(`${t}.account`,e.artifactAccount)},this.onTemplateArtifactSelected=(e,t)=>{this.props.formik.setFieldValue(`${t}.id`,e),this.props.formik.setFieldValue(`${t}.artifact`,null)},this.removeInputArtifact=e=>{this.props.formik.setFieldValue(e,null)},this.getInputArtifact=(e,t)=>e[t]?e[t]:{account:"",id:""}}componentDidMount(){J(d.listAccounts("appengine")).pipe(W(this.destroy$)).subscribe(e=>this.setState({accounts:e}))}render(){const t=this.props.formik.values,a=this.state.accounts;return I.createElement("div",null,I.createElement("div",{className:"col-md-offset-0 col-md-9"},I.createElement("h4",null,"Basic Settings")),I.createElement("div",null,I.createElement(ae,{componentName:"",accounts:a,application:this.props.application,cloudProvider:"appengine",credentialsField:"account",formik:this.props.formik})),I.createElement("div",{className:"col-md-offset-0 col-md-9"},I.createElement("h4",null,"Configuration Settings")),I.createElement("div",null,I.createElement("div",{className:"col-md-offset-1 col-md-9"},I.createElement(u,{artifact:this.getInputArtifact(t,"cronArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"cronArtifact").id,label:"Cron Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"cronArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"cronArtifact"),pipeline:this.props.pipeline,stage:t})),I.createElement("div",{className:"col-md-1"},I.createElement("div",{className:"form-control-static"},I.createElement("button",{onClick:()=>this.removeInputArtifact("cronArtifact")},I.createElement("span",{className:"glyphicon glyphicon-trash"}),I.createElement("span",{className:"sr-only"},"Remove field"))))),I.createElement("div",null,I.createElement("div",{className:"col-md-offset-1 col-md-9"},I.createElement(u,{artifact:this.getInputArtifact(t,"dispatchArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"dispatchArtifact").id,label:"Dispatch Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"dispatchArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"dispatchArtifact"),pipeline:this.props.pipeline,stage:t})),I.createElement("div",{className:"col-md-1"},I.createElement("div",{className:"form-control-static"},I.createElement("button",{onClick:()=>this.removeInputArtifact("dispatchArtifact")},I.createElement("span",{className:"glyphicon glyphicon-trash"}),I.createElement("span",{className:"sr-only"},"Remove field"))))),I.createElement("div",null,I.createElement("div",{className:"col-md-offset-1 col-md-9"},I.createElement(u,{artifact:this.getInputArtifact(t,"indexArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"indexArtifact").id,label:"Index Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"indexArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"indexArtifact"),pipeline:this.props.pipeline,stage:t})),I.createElement("div",{className:"col-md-1"},I.createElement("div",{className:"form-control-static"},I.createElement("button",{onClick:()=>this.removeInputArtifact("indexArtifact")},I.createElement("span",{className:"glyphicon glyphicon-trash"}),I.createElement("span",{className:"sr-only"},"Remove field"))))),I.createElement("div",null,I.createElement("div",{className:"col-md-offset-1 col-md-9"},I.createElement(u,{artifact:this.getInputArtifact(t,"queueArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"queueArtifact").id,label:"Queue Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"queueArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"queueArtifact"),pipeline:this.props.pipeline,stage:t})),I.createElement("div",{className:"col-md-1"},I.createElement("div",{className:"form-control-static"},I.createElement("button",{onClick:()=>this.removeInputArtifact("queueArtifact")},I.createElement("span",{className:"glyphicon glyphicon-trash"}),I.createElement("span",{className:"sr-only"},"Remove field"))))))}};ne.excludedArtifactTypes=m(h.BITBUCKET_FILE,h.CUSTOM_OBJECT,h.EMBEDDED_BASE64,h.GCS_OBJECT,h.GITHUB_FILE,h.GITLAB_FILE,h.S3_OBJECT,h.HTTP_FILE,h.ORACLE_OBJECT);let re=ne;function ie(e){const t=new g(e);return t.field("account").required(),t.field("region").required(),t.validateForm()}v.pipeline.registerStage({label:"Deploy App Engine Configuration",description:"Deploy index, dispatch, cron, and queue configuration to App Engine.",key:"deployAppEngineConfiguration",component:function({application:e,pipeline:t,stage:a,updateStage:n}){const r=I.useMemo(()=>({...U(a)}),[]);return I.createElement(f,{application:e,onChange:n,pipeline:t,stage:r,validate:ie,render:e=>I.createElement(re,{...e})})},producesArtifacts:!1,cloudProvider:"appengine",executionDetailsSections:[C,b],validateFn:ie});class le{}function oe(e,t){var a,n;e.cloudProvider="appengine",e.cloudProviderType="appengine",e.isNew&&(null==(a=null==t?void 0:t.attributes)?void 0:a.platformHealthOnlyShowOverride)&&(null==(n=null==t?void 0:t.attributes)?void 0:n.platformHealthOnly)&&(e.interestingHealthProviderNames=[le.PLATFORM])}function se({application:e,pipeline:t,stage:a,updateStage:n,showHealthOverride:r=!1}){var i;const[l,o]=O([]);M(()=>{oe(a,e),d.listAccounts("appengine").then(t=>{var r;o(t);const i=a.credentials||(null==(r=null==e?void 0:e.defaultCredentials)?void 0:r.appengine),l=function(e,t){var a;return null==(a=e.find(e=>e.name===t))?void 0:a.region}(t,i);(i||l)&&(a.credentials=i||a.credentials,a.region=l||a.region,n(a))})},[]);return I.createElement("div",{className:"form-horizontal"},!(null==t?void 0:t.strategy)&&I.createElement(E,{accounts:l,application:e,component:a,disableRegionSelect:!0,onAccountUpdate:e=>{d.getAccountDetails(e).then(e=>{a.region=(null==e?void 0:e.region)||a.region,n(a)})},onComponentUpdate:n,singleRegion:"true"}),I.createElement(y,{label:"Target"},I.createElement(A,{model:{target:a.target},onChange:e=>{a.target=e,n(a)},options:S.TARGET_LIST})),r&&(null==(i=null==e?void 0:e.attributes)?void 0:i.platformHealthOnlyShowOverride)&&I.createElement(N,{interestingHealthProviderNames:a.interestingHealthProviderNames||[],onChange:e=>{a.interestingHealthProviderNames=e,n(a)},platformHealthType:le.PLATFORM}))}function ce(e){return I.createElement(se,{...e,showHealthOverride:!0})}function pe({stage:e}){var t,a,n,r;const i=(null==(n=null==(a=null==(t=e.context)?void 0:t.exception)?void 0:a.details)?void 0:n.errors)||(null==(r=e.context)?void 0:r.failureMessages)||[];return i.length?I.createElement("div",{className:"alert alert-danger"},i.map((e,t)=>I.createElement("p",{key:t},e))):null}function de(e){const{stage:t}=e;return I.createElement("div",null,I.createElement("dl",{className:"dl-horizontal dl-narrow"},I.createElement("dt",null,"Account"),I.createElement("dd",null,t.context.credentials||t.context.account),I.createElement("dt",null,"Region"),I.createElement("dd",null,t.context.region),I.createElement("dt",null,t.context.cluster?"Cluster":"Server Group"),I.createElement("dd",null,(a=t.context).cluster||a.serverGroupName),t.context.target&&[I.createElement("dt",{key:"target-label"},"Target"),I.createElement("dd",{key:"target-value"},t.context.target)]),I.createElement(pe,{stage:t}));var a}function ue(e){return I.createElement(k,{name:ue.title,current:e.current},I.createElement(de,{...e}))}function me(e){return I.createElement(k,{name:me.title,current:e.current},I.createElement(de,{...e}))}function he(e){const t=e.stage.context.loadBalancers||[];return I.createElement(k,{name:he.title,current:e.current},I.createElement("table",{className:"table table-condensed"},I.createElement("thead",null,I.createElement("tr",null,I.createElement("th",null,"Account"),I.createElement("th",null,"Name"),I.createElement("th",null,"Region"))),I.createElement("tbody",null,t.map((e,t)=>I.createElement("tr",{key:t},I.createElement("td",null,e.credentials||e.account),I.createElement("td",null,e.name||e.loadBalancerName),I.createElement("td",null,e.region))))),I.createElement(pe,{stage:e.stage}))}le.PLATFORM="App Engine Service",v.pipeline.registerStage({provides:"destroyServerGroup",key:"destroyServerGroup",cloudProvider:"appengine",component:se,validators:[{type:"targetImpedance",message:"This pipeline will attempt to destroy a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),v.pipeline.registerStage({provides:"disableServerGroup",key:"disableServerGroup",cloudProvider:"appengine",component:ce,validators:[{type:"targetImpedance",message:"This pipeline will attempt to disable a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),ue.title="startServerGroupConfig",me.title="stopServerGroupConfig",he.title="editLoadBalancerConfig",v.pipeline.registerStage({label:"Edit Load Balancer",description:"Edits a load balancer",key:"upsertAppEngineLoadBalancers",cloudProvider:"appengine",component:function({application:e,stage:t,updateStage:a}){M(()=>{t.loadBalancers=t.loadBalancers||[],t.cloudProvider="appengine",a(t)},[]);const n=e=>{t.loadBalancers=e,a(t)};return I.createElement("div",{className:"well well-sm clearfix"},I.createElement("h4",null,"Load Balancers"),I.createElement("table",{className:"table table-condensed"},I.createElement("thead",null,I.createElement("tr",null,I.createElement("th",null,"Account"),I.createElement("th",null,"Name"),I.createElement("th",null,"Region"),I.createElement("th",null,"Actions"))),I.createElement("tbody",null,(t.loadBalancers||[]).map((a,r)=>I.createElement("tr",{key:`${a.name}-${r}`},I.createElement("td",null,a.credentials||a.account),I.createElement("td",null,a.name),I.createElement("td",null,a.region),I.createElement("td",{className:"condensed-actions"},I.createElement("button",{className:"btn btn-sm btn-link",onClick:()=>(a=>{Z.show({app:e,loadBalancer:t.loadBalancers[a],forPipelineConfig:!0,isNew:!1}).then(e=>{const r=[...t.loadBalancers];r[a]=e,n(r)}).catch(()=>{})})(r),type:"button"},I.createElement("span",{className:"glyphicon glyphicon-edit"})),I.createElement("button",{className:"btn btn-sm btn-link pad-left",onClick:()=>(e=>{n(t.loadBalancers.filter((t,a)=>a!==e))})(r),type:"button"},I.createElement("span",{className:"glyphicon glyphicon-trash"})))))),I.createElement("tfoot",null,I.createElement("tr",null,I.createElement("td",{colSpan:4},I.createElement("button",{className:"btn btn-block btn-sm add-new",onClick:()=>{Z.show({app:e,loadBalancer:null,forPipelineConfig:!0,isNew:!0}).then(e=>n([...t.loadBalancers||[],e])).catch(()=>{})},type:"button"},I.createElement("span",{className:"glyphicon glyphicon-plus-sign"})," Add load balancer"))))))},executionDetailsSections:[he,C],validators:[]}),v.pipeline.registerStage({provides:"enableServerGroup",key:"enableServerGroup",cloudProvider:"appengine",component:ce,validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),v.pipeline.registerStage({provides:"shrinkCluster",key:"shrinkCluster",cloudProvider:"appengine",component:function({application:e,pipeline:t,stage:a,updateStage:n}){var r;M(()=>{oe(a,e),void 0===a.shrinkToSize&&(a.shrinkToSize=1),void 0===a.allowDeleteActive&&(a.allowDeleteActive=!1),void 0===a.retainLargerOverNewer&&(a.retainLargerOverNewer="false"),a.retainLargerOverNewer=a.retainLargerOverNewer.toString(),n(a)},[]);const i=(e,t)=>{a[e]=t,n(a)};return I.createElement("div",{className:"form-horizontal"},I.createElement(se,{application:e,pipeline:t,stage:a,updateStage:n}),I.createElement("div",{className:"form-group"},I.createElement("label",{className:"col-md-3 sm-label-right"},"Shrink Options"),I.createElement("div",{className:"col-md-7 form-inline"},"Shrink to"," ",I.createElement("input",{className:"form-control input-sm",min:0,onChange:e=>i("shrinkToSize",Number(e.target.value)),style:{width:60},type:"number",value:a.shrinkToSize||0})," ","server groups, keeping the"," ",I.createElement("select",{className:"form-control input-sm",onChange:e=>i("retainLargerOverNewer",e.target.value),style:{width:100},value:a.retainLargerOverNewer||"false"},I.createElement("option",{value:"true"},"largest"),I.createElement("option",{value:"false"},"newest")))),I.createElement("div",{className:"form-group"},I.createElement("div",{className:"col-md-offset-3 col-md-7 checkbox"},I.createElement("label",null,I.createElement("input",{checked:!!a.allowDeleteActive,onChange:e=>i("allowDeleteActive",e.target.checked),type:"checkbox"})," ","Allow deletion of active server groups"))),(null==(r=null==e?void 0:e.attributes)?void 0:r.platformHealthOnlyShowOverride)&&I.createElement(N,{interestingHealthProviderNames:a.interestingHealthProviderNames||[],onChange:e=>{a.interestingHealthProviderNames=e,n(a)},platformHealthType:le.PLATFORM}))},validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"shrinkToSize",fieldLabel:"shrink to [X] Server Groups"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),v.pipeline.registerStage({label:"Start Server Group",description:"Starts a server group.",key:"startAppEngineServerGroup",component:ce,executionDetailsSections:[ue,C],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],cloudProvider:"appengine"}),v.pipeline.registerStage({label:"Stop Server Group",description:"Stops a server group.",key:"stopAppEngineServerGroup",component:ce,executionDetailsSections:[me,C],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],cloudProvider:"appengine"});const ge=F.providers.appengine||{defaults:{}};ge&&(ge.resetToOriginal=F.resetProvider("appengine"));var fe=(e=>(e.GCS="gcs",e.GIT="git",e.ARTIFACT="artifact",e.CONTAINER_IMAGE="containerImage",e))(fe||{});class ve{static getTriggerOptions(e){return(e.triggers||[]).filter(e=>"git"===e.type||"jenkins"===e.type||"travis"===e.type).map(e=>"git"===e.type?{source:e.source,project:e.project,slug:e.slug,branch:e.branch,type:"git"}:{master:e.master,job:e.job,type:e.type})}static getExpectedArtifacts(e){return e.expectedArtifacts||[]}buildNewServerGroupCommand(e,t,a="create"){null==t&&(t="appengine");const n={accounts:d.getAllAccountDetailsForProvider("appengine"),storageAccounts:w.getStorageAccounts()},r={mode:a,submitButtonLabel:this.getSubmitButtonLabel(a),disableStrategySelection:"create"===a};return this.resolveAll(n).then(a=>{const n=this.getCredentials(a.accounts),i=this.getRegion(a.accounts,n);return{application:e.name,backingData:a,viewState:r,fromArtifact:!1,credentials:n,region:i,selectedProvider:t,configArtifacts:[],configFilepaths:[],configFiles:[],interestingHealthProviderNames:[],sourceType:"git"}})}buildServerGroupCommandFromExisting(e,t){return this.buildNewServerGroupCommand(e,"appengine","clone").then(e=>(e.stack=t.stack,e.freeFormDetails=t.detail,e))}buildNewServerGroupCommandForPipeline(e,t){return Promise.resolve({viewState:{pipeline:t,stage:e},backingData:{triggerOptions:ve.getTriggerOptions(t),expectedArtifacts:ve.getExpectedArtifacts(t)}})}buildServerGroupCommandFromPipeline(e,t,a,n){return this.buildNewServerGroupCommand(e,"appengine","editPipeline").then(e=>e={...e,...t,backingData:{...e.backingData,triggerOptions:ve.getTriggerOptions(n),expectedArtifacts:ve.getExpectedArtifacts(n)},credentials:t.account||e.credentials,viewState:{...e.viewState,stage:a,pipeline:n}})}getCredentials(e){const t=(e||[]).map(e=>e.name),a=ge.defaults.account;return t.includes(a)?a:t[0]}getRegion(e,t){const a=e.find(e=>e.name===t);return a?a.region:null}getSubmitButtonLabel(e){switch(e){case"createPipeline":return"Add";case"editPipeline":return"Done";case"clone":return"Clone";default:return"Create"}}resolveAll(e){const t=Object.entries(e);return Promise.all(t.map(([,e])=>e)).then(e=>t.reduce((t,[a],n)=>({...t,[a]:e[n]}),{}))}}class Ce{constructor(e){this.cloudProvider="appengine",this.provider="appengine",this.credentials=e.credentials,this.account=e.credentials,this.application=e.application,this.stack=e.stack,this.freeFormDetails=e.freeFormDetails,this.repositoryUrl=e.repositoryUrl,this.branch=e.branch,this.configFilepaths=e.configFilepaths,this.promote=e.promote,this.stopPreviousVersion=e.stopPreviousVersion,this.type=e.type,this.region=e.region,this.strategy=e.strategy,this.strategyApplication=e.strategyApplication,this.strategyPipeline=e.strategyPipeline,this.fromTrigger=e.fromTrigger,this.trigger=e.trigger,this.gitCredentialType=e.gitCredentialType,this.configFiles=e.configFiles,this.configArtifacts=(e.configArtifacts||[]).filter(e=>!!e.id||!!e.artifact),this.applicationDirectoryRoot=e.applicationDirectoryRoot,this.interestingHealthProviderNames=e.interestingHealthProviderNames||[],this.expectedArtifactId=e.expectedArtifactId,this.expectedArtifact=e.expectedArtifact,this.fromArtifact=e.fromArtifact,this.sourceType=e.sourceType,this.storageAccountName=e.storageAccountName,this.containerImageUrl=e.containerImageUrl,this.suppressVersionString=e.suppressVersionString}}class be{cloneServerGroup(e,t){return e.type="createServerGroup",D.executeTask({job:[new Ce(e)],application:t,description:`Create App Engine Server Group in ${t.name}`})}startServerGroup(e,t){const a={job:[this.buildJob(e,t,"startAppEngineServerGroup")],application:t,description:`Start Server Group: ${e.name}`};return D.executeTask(a)}stopServerGroup(e,t){const a={job:[this.buildJob(e,t,"stopAppEngineServerGroup")],application:t,description:`Stop Server Group: ${e.name}`};return D.executeTask(a)}enableServerGroup(e,t,a={}){const n={...a,...this.buildJob(e,t,"enableServerGroup")};return D.executeTask({job:[n],application:t,description:`Enable Server Group: ${e.name}`})}disableServerGroup(e,t,a={}){const n={...a,...this.buildJob(e,t,"disableServerGroup")};return D.executeTask({job:[n],application:t,description:`Disable Server Group: ${e.name}`})}destroyServerGroup(e,t,a={}){const n={...a,...this.buildJob(e,t,"destroyServerGroup")};return D.executeTask({job:[n],application:t,description:`Destroy Server Group: ${e.name}`})}buildJob(e,t,a){return{type:a,region:e.region,serverGroupName:e.name,credentials:e.account,cloudProvider:"appengine",application:t.name}}}const Ee=new be;const ye=class e extends I.Component{constructor(){super(...arguments),this.state={taskMonitor:new t({application:this.props.application,title:"Creating your server group",onDismiss:()=>this.props.dismissModal(),onTaskComplete:()=>this.props.application.serverGroups.refresh()})},this.update=(e,t)=>{this.props.command[e]=t,this.forceUpdate()},this.submit=()=>{const{command:e}=this.props;"editPipeline"!==e.viewState.mode&&"createPipeline"!==e.viewState.mode?this.state.taskMonitor.submit(()=>Ee.cloneServerGroup(function(e){return{...e,configArtifacts:e.configArtifacts||[],configFilepaths:e.configFilepaths||[],configFiles:e.configFiles||[],interestingHealthProviderNames:e.interestingHealthProviderNames||[],fromArtifact:e.fromArtifact||!1,sourceType:e.sourceType||fe.GIT}}(e),this.props.application)):this.props.closeModal(e)}}static show(t){return n.show(e,t,{dialogClassName:"modal-lg"})}render(){var e;const{command:t,dismissModal:a,title:n}=this.props;return I.createElement("div",null,I.createElement(r,{dismiss:a}),I.createElement(V.Header,null,I.createElement(V.Title,null,n)),I.createElement(V.Body,null,I.createElement("div",{className:"form-horizontal"},I.createElement("label",null,"Account"),I.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("credentials",e.target.value),value:t.credentials||""}),I.createElement("label",null,"Region"),I.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("region",e.target.value),value:t.region||""}),I.createElement("label",null,"Branch"),I.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("branch",e.target.value),value:t.branch||""}))),I.createElement(i,{monitor:this.state.taskMonitor}),I.createElement(V.Footer,null,I.createElement("button",{className:"btn btn-default",onClick:()=>a(),type:"button"},"Cancel"),I.createElement("button",{className:"btn btn-primary",onClick:this.submit,type:"button"},(null==(e=t.viewState)?void 0:e.submitButtonLabel)||"Clone")))}};ye.defaultProps={closeModal:l,dismissModal:l};let Ae=ye;const Se=new be,Ne=new ve;function ke(e){var t;return"FLEXIBLE"===e.env||["MANUAL","BASIC"].includes(null==(t=e.scalingPolicy)?void 0:t.type)}function Fe(e){return ke(e)&&"STOPPED"===e.servingStatus}function we(e){return ke(e)&&"SERVING"===e.servingStatus}function De(e,t=[]){const a=t.find(t=>{var a;return Object.keys((null==(a=t.split)?void 0:a.allocations)||{}).includes(e.name)});if(!a)return null;const n={...a.split.allocations};delete n[e.name];const r=Object.values(n).reduce((e,t)=>e+t,0);if(!r)return{};const i="COOKIE"===a.split.shardBy?1e3:100;return Object.keys(n).forEach(e=>{n[e]=Math.round(n[e]/r*i)/i}),n}function Te(e,t=[]){return!(!e||e.disabled)&&Object.keys(De(e,t)||{}).length>0}function xe(e,t=[]){return!!e&&(e.disabled||Object.keys(De(e,t)||{}).length>0)}function Ge(e){return`<table class="table table-condensed"><thead><tr><th>Server Group</th><th>Allocation</th></tr></thead><tbody>${Object.keys(e||{}).map(t=>`<tr><td>${t}</td><td>${100*e[t]}%</td></tr>`).join("")}</tbody></table>`}function Be(e){var t,a,n;const r={platformHealthOnlyShowOverride:null==(t=e.attributes)?void 0:t.platformHealthOnlyShowOverride,platformHealthType:le.PLATFORM,interestingHealthProviderNames:[]};return(null==(a=e.attributes)?void 0:a.platformHealthOnlyShowOverride)&&(null==(n=e.attributes)?void 0:n.platformHealthOnly)&&(r.interestingHealthProviderNames=[le.PLATFORM]),r}function Pe(e,t){var a;const n=De(e,t);return`<div class="well well-sm">\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${null==(a=e.loadBalancers)?void 0:a[0]}</b> under the <b>Load Balancers</b> tab.</p>\n <div class="row"><div class="col-md-12">${Ge(n)}</div></div>\n </div>`}function Ie(e,t,a){var n;let r="";const i={};return T.addDestroyWarningMessage(e,t,i),i.body&&(r+=i.body),t.disabled||(r+=`<div class="well well-sm">\n <p>A destroy operation will first disable this server group.</p>\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${null==(n=t.loadBalancers)?void 0:n[0]}</b> under the <b>Load Balancers</b> tab.</p>\n <div class="row"><div class="col-md-12">${Ge(De(t,a))}</div></div>\n </div>`),r}G.registerValidator("appengine",new class{validate(e=""){const t=[],a=[];return e.length&&(this.validateSpecialCharacters(e,a),this.validateLength(e,t,a)),{warnings:t,errors:a}}validateSpecialCharacters(e,t){/^[a-z0-9]*$/g.test(e)||t.push("Only numbers and lowercase letters are allowed.")}validateLength(e,t,a){if(e.length>58)a.push("The maximum length for an App Engine application name is 63 characters.");else if(e.length>48)if(e.length>=56)t.push("You will not be able to include a stack or detail field for clusters.");else{const a=56-e.length;t.push(`If you plan to include a stack or detail field for clusters, you will only have\n ${a} character${a>1?"s":""} to do so.`)}}});!function(e,t){void 0===t&&(t={});var a=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('.cloud-provider-logo .icon-appengine {\n -webkit-mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22utf-8%22%3F%3E%3C!-- Generator%3A Adobe Illustrator 18.1.1%2C SVG Export Plug-In . SVG Version%3A 6.00 Build 0) --%3E%3Csvg version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22 width%3D%22128px%22%09 height%3D%22128px%22 viewBox%3D%2215 15 90 90%22 xml%3Aspace%3D%22preserve%22%3E%3Cfilter id%3D%22invert%22%3E %3CfeColorMatrix in%3D%22SourceGraphic%22 type%3D%22matrix%22 values%3D%22-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0%22%2F%3E%3C%2Ffilter%3E%3Cg id%3D%22art%22 filter%3D%22url(%23invert)%22%3E%09%3Cg%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9988%2C40.9577c-12.7278%2C0-23.0452%2C10.3167-23.0452%2C23.0464%09%09%09c0%2C12.726%2C10.3174%2C23.0463%2C23.0452%2C23.0463c12.7273%2C0%2C23.0446-10.3203%2C23.0446-23.0463%09%09%09C87.0434%2C51.2744%2C76.7261%2C40.9577%2C63.9988%2C40.9577 M63.9988%2C81.4887c-9.6584%2C0-17.4876-7.8286-17.4876-17.4846%09%09%09c0-9.6584%2C7.8291-17.4877%2C17.4876-17.4877c9.6578%2C0%2C17.4858%2C7.8292%2C17.4858%2C17.4877%09%09%09C81.4846%2C73.6601%2C73.6566%2C81.4887%2C63.9988%2C81.4887%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M100.1431%2C61.274l-9.6079-3.0195c0.3997%2C1.8539%2C0.615%2C3.7759%2C0.615%2C5.7478%09%09%09c0%2C1.3791-0.1047%2C2.7337-0.3021%2C4.0569h9.295c0.8587-0.2515%2C1.4327-0.7846%2C1.4327-1.5765v-3.6345%09%09%09C101.5759%2C62.0575%2C101.0018%2C61.5094%2C100.1431%2C61.274%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9923%2C36.8497c1.9303%2C0%2C3.8119%2C0.2046%2C5.6285%2C0.5884l-3.4443-9.5729%09%09%09c-0.2515-0.8606-0.7852-1.434-1.5765-1.434h-1.4392c-0.7913%2C0-1.3407%2C0.5734-1.5761%2C1.434l-2.9924%2C9.5236%09%09%09C60.3372%2C37.0368%2C62.1425%2C36.8497%2C63.9923%2C36.8497%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M36.8468%2C64.0023c0-1.9719%2C0.2154-3.8932%2C0.6145-5.7478l-9.6073%2C3.0195%09%09%09c-0.8587%2C0.2354-1.4322%2C0.7835-1.4322%2C1.5754v3.6344c0%2C0.7907%2C0.5735%2C1.3238%2C1.4322%2C1.5753h9.2955%09%09%09C36.9515%2C66.7366%2C36.8468%2C65.3814%2C36.8468%2C64.0023%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M72.2276%2C56.4819l-2.1802%2C2.1794v-0.0048c-1.5651-1.5639-3.6549-2.4274-5.8687-2.4274%09%09%09c-2.2192%2C0-4.303%2C0.8659-5.8704%2C2.4322c-3.2362%2C3.2355-3.2362%2C8.5037%2C0%2C11.7399l-2.1802%2C2.1783%09%09%09c2.0627%2C2.0609%2C4.9096%2C3.3383%2C8.0483%2C3.3383c6.2803%2C0%2C11.3896-5.1081%2C11.3896-11.3895%09%09%09C75.566%2C61.3883%2C74.289%2C58.5421%2C72.2276%2C56.4819 M67.7284%2C67.7342c-1.0278%2C1.0302-2.3799%2C1.5459-3.7284%2C1.5459%09%09%09c-1.3526%2C0-2.7012-0.5156-3.7313-1.5459c-2.0616-2.0615-2.0616-5.4018%2C0-7.4639c1.0301-1.0314%2C2.3787-1.544%2C3.7313-1.544%09%09%09c1.3485%2C0%2C2.7006%2C0.5127%2C3.7284%2C1.544C69.79%2C62.3312%2C69.79%2C65.6727%2C67.7284%2C67.7342%22%2F%3E%09%3C%2Fg%3E%3C%2Fg%3E%3Cg id%3D%22Guides%22 style%3D%22display%3Anone%3B%22%3E%3C%2Fg%3E%3C%2Fsvg%3E");\n mask-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22utf-8%22%3F%3E%3C!-- Generator%3A Adobe Illustrator 18.1.1%2C SVG Export Plug-In . SVG Version%3A 6.00 Build 0) --%3E%3Csvg version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22 width%3D%22128px%22%09 height%3D%22128px%22 viewBox%3D%2215 15 90 90%22 xml%3Aspace%3D%22preserve%22%3E%3Cfilter id%3D%22invert%22%3E %3CfeColorMatrix in%3D%22SourceGraphic%22 type%3D%22matrix%22 values%3D%22-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0%22%2F%3E%3C%2Ffilter%3E%3Cg id%3D%22art%22 filter%3D%22url(%23invert)%22%3E%09%3Cg%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9988%2C40.9577c-12.7278%2C0-23.0452%2C10.3167-23.0452%2C23.0464%09%09%09c0%2C12.726%2C10.3174%2C23.0463%2C23.0452%2C23.0463c12.7273%2C0%2C23.0446-10.3203%2C23.0446-23.0463%09%09%09C87.0434%2C51.2744%2C76.7261%2C40.9577%2C63.9988%2C40.9577 M63.9988%2C81.4887c-9.6584%2C0-17.4876-7.8286-17.4876-17.4846%09%09%09c0-9.6584%2C7.8291-17.4877%2C17.4876-17.4877c9.6578%2C0%2C17.4858%2C7.8292%2C17.4858%2C17.4877%09%09%09C81.4846%2C73.6601%2C73.6566%2C81.4887%2C63.9988%2C81.4887%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M100.1431%2C61.274l-9.6079-3.0195c0.3997%2C1.8539%2C0.615%2C3.7759%2C0.615%2C5.7478%09%09%09c0%2C1.3791-0.1047%2C2.7337-0.3021%2C4.0569h9.295c0.8587-0.2515%2C1.4327-0.7846%2C1.4327-1.5765v-3.6345%09%09%09C101.5759%2C62.0575%2C101.0018%2C61.5094%2C100.1431%2C61.274%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9923%2C36.8497c1.9303%2C0%2C3.8119%2C0.2046%2C5.6285%2C0.5884l-3.4443-9.5729%09%09%09c-0.2515-0.8606-0.7852-1.434-1.5765-1.434h-1.4392c-0.7913%2C0-1.3407%2C0.5734-1.5761%2C1.434l-2.9924%2C9.5236%09%09%09C60.3372%2C37.0368%2C62.1425%2C36.8497%2C63.9923%2C36.8497%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M36.8468%2C64.0023c0-1.9719%2C0.2154-3.8932%2C0.6145-5.7478l-9.6073%2C3.0195%09%09%09c-0.8587%2C0.2354-1.4322%2C0.7835-1.4322%2C1.5754v3.6344c0%2C0.7907%2C0.5735%2C1.3238%2C1.4322%2C1.5753h9.2955%09%09%09C36.9515%2C66.7366%2C36.8468%2C65.3814%2C36.8468%2C64.0023%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M72.2276%2C56.4819l-2.1802%2C2.1794v-0.0048c-1.5651-1.5639-3.6549-2.4274-5.8687-2.4274%09%09%09c-2.2192%2C0-4.303%2C0.8659-5.8704%2C2.4322c-3.2362%2C3.2355-3.2362%2C8.5037%2C0%2C11.7399l-2.1802%2C2.1783%09%09%09c2.0627%2C2.0609%2C4.9096%2C3.3383%2C8.0483%2C3.3383c6.2803%2C0%2C11.3896-5.1081%2C11.3896-11.3895%09%09%09C75.566%2C61.3883%2C74.289%2C58.5421%2C72.2276%2C56.4819 M67.7284%2C67.7342c-1.0278%2C1.0302-2.3799%2C1.5459-3.7284%2C1.5459%09%09%09c-1.3526%2C0-2.7012-0.5156-3.7313-1.5459c-2.0616-2.0615-2.0616-5.4018%2C0-7.4639c1.0301-1.0314%2C2.3787-1.544%2C3.7313-1.544%09%09%09c1.3485%2C0%2C2.7006%2C0.5127%2C3.7284%2C1.544C69.79%2C62.3312%2C69.79%2C65.6727%2C67.7284%2C67.7342%22%2F%3E%09%3C%2Fg%3E%3C%2Fg%3E%3Cg id%3D%22Guides%22 style%3D%22display%3Anone%3B%22%3E%3C%2Fg%3E%3C%2Fsvg%3E");\n background-color: #4285f4;\n}\n'),B.registerProvider("appengine",{name:"App Engine",instance:{details:function({instance:e}){return I.createElement("div",{className:"details-panel"},I.createElement("div",{className:"header"},I.createElement("div",{className:"header-text horizontal middle"},I.createElement("i",{className:"fa icon-instance"}),I.createElement("h3",{className:"horizontal middle space-between flex-1"},e.instanceId))),I.createElement("div",{className:"content"},I.createElement("dl",{className:"dl-horizontal dl-narrow"},I.createElement("dt",null,"Account"),I.createElement("dd",null,e.account),I.createElement("dt",null,"Region"),I.createElement("dd",null,e.region),I.createElement("dt",null,"Provider"),I.createElement("dd",null,e.provider))))}},serverGroup:{transformer:class{normalizeServerGroup(e){return Promise.resolve(e)}convertServerGroupCommandToDeployConfiguration(e){return new Ce(e)}},commandBuilder:ve,detailsActions:function({app:e,serverGroup:t}){const a=t,n=function(e){var t,a;return(null==(a=null==(t=e.getDataSource)?void 0:t.call(e,"loadBalancers"))?void 0:a.data)||[]}(e);return I.createElement("div",{className:"actions"},I.createElement("button",{className:"btn btn-sm btn-default",onClick:()=>{Ne.buildServerGroupCommandFromExisting(e,a).then(a=>{Ae.show({application:e,command:a,title:`Clone ${t.name}`})})},type:"button"},"Clone"),I.createElement("button",{className:"btn btn-sm btn-default",disabled:!Fe(a),onClick:()=>o.confirm({header:`Really start ${t.name}?`,buttonText:`Start ${t.name}`,account:a.account,taskMonitorConfig:{application:e,title:`Starting ${t.name}`},submitMethod:()=>Se.startServerGroup(a,e),askForReason:!0,...Be(e)}),type:"button"},"Start"),I.createElement("button",{className:"btn btn-sm btn-default",disabled:!we(a),onClick:()=>{var n;return o.confirm({header:`Really stop ${t.name}?`,buttonText:`Stop ${t.name}`,account:a.account,body:a.disabled?void 0:`<div class="alert alert-danger"><p>Stopping this server group will scale it down to zero instances.</p><p>This server group is currently serving traffic from <b>${null==(n=a.loadBalancers)?void 0:n[0]}</b>. Traffic directed to this server group after it has been stopped will not be handled.</p></div>`,taskMonitorConfig:{application:e,title:`Stopping ${t.name}`},submitMethod:()=>Se.stopServerGroup(a,e),askForReason:!0,...Be(e)})},type:"button"},"Stop"),I.createElement("button",{className:"btn btn-sm btn-default",onClick:()=>{var n,r;return o.confirm({header:`Really enable ${t.name}?`,buttonText:`Enable ${t.name}`,account:a.account,body:`<div class="well well-sm"><p>Enabling <b>${t.name}</b> will set its traffic allocation for <b>${null==(n=a.loadBalancers)?void 0:n[0]}</b> to 100%.</p><p>If you would like more fine-grained control, edit <b>${null==(r=a.loadBalancers)?void 0:r[0]}</b> under the <b>Load Balancers</b> tab.</p></div>`,taskMonitorConfig:{application:e,title:`Enabling ${t.name}`},submitMethod:t=>Se.enableServerGroup(a,e,t),askForReason:!0,...Be(e)})},type:"button"},"Enable"),I.createElement("button",{className:"btn btn-sm btn-default",disabled:!Te(a,n),onClick:()=>o.confirm({header:`Really disable ${t.name}?`,buttonText:`Disable ${t.name}`,account:a.account,body:Pe(a,n),taskMonitorConfig:{application:e,title:`Disabling ${t.name}`},submitMethod:t=>Se.disableServerGroup(a,e,t),askForReason:!0,...Be(e)}),type:"button"},"Disable"),I.createElement("button",{className:"btn btn-sm btn-default",disabled:!xe(a,n),onClick:()=>o.confirm({header:`Really destroy ${t.name}?`,buttonText:`Destroy ${t.name}`,account:a.account,body:Ie(e,a,n),taskMonitorConfig:{application:e,title:`Destroying ${t.name}`},submitMethod:t=>Se.destroyServerGroup(a,e,t),askForReason:!0,...Be(e)}),type:"button"},"Destroy"))},detailsGetter:function(e,t){const{app:a,serverGroup:n}=e;return new K(r=>{(function(e){const{app:t,serverGroup:a}=e;return t.ready().then(()=>{let e=t.serverGroups.data.find(e=>e.name===a.name&&e.account===a.accountId&&e.region===a.region);return e||t.loadBalancers.data.some(t=>t.account===a.accountId&&t.region===a.region&&(t.serverGroups||[]).some(t=>t.name===a.name&&(e=t,!0))),e})})(e).then(e=>{x.getServerGroup(a.name,n.accountId,n.region,n.name).then(a=>{Object.assign(a,e,{account:n.accountId}),z(a)?t():r.next(a)},t)},t)})},detailsSections:[function({serverGroup:e}){var t;const a=e;return I.createElement("div",{className:"content-section"},I.createElement("div",{className:"content-section-heading"},"App Engine Details"),I.createElement("dl",{className:"dl-horizontal dl-narrow"},I.createElement("dt",null,"Account"),I.createElement("dd",null,a.account),I.createElement("dt",null,"Region"),I.createElement("dd",null,a.region),I.createElement("dt",null,"Status"),I.createElement("dd",null,a.servingStatus||a.status||"Unknown"),I.createElement("dt",null,"Environment"),I.createElement("dd",null,a.env||"Unknown"),I.createElement("dt",null,"Scaling"),I.createElement("dd",null,(null==(t=a.scalingPolicy)?void 0:t.type)||"Unknown")))}],CloneServerGroupModal:Ae,skipUpstreamStageCheck:!0},loadBalancer:{transformer:class{normalizeLoadBalancer(e){e.provider=e.type,e.instanceCounts=this.buildInstanceCounts(e.serverGroups),e.instances=[],e.serverGroups.forEach(t=>{t.account=e.account,t.region=e.region,t.detachedInstances&&(t.detachedInstances=t.detachedInstances.map(e=>({id:e}))),t.instances=t.instances.concat(t.detachedInstances||[]).map(t=>this.transformInstance(t,e))});const t=L(e.serverGroups,{isDisabled:!1});return e.instances=R(t).map("instances").flatten().value(),Promise.resolve(e)}convertLoadBalancerForEditing(e,t){return t.getDataSource("loadBalancers").ready().then(()=>{const a=t.getDataSource("loadBalancers").data.find(t=>t.name===e.name&&(t.account===e.account||t.account===e.credentials));return a&&(e.serverGroups=U(a.serverGroups)),e})}convertLoadBalancerToUpsertDescription(e){return new X(e)}buildInstanceCounts(e){const t=R(e).map("instances").flatten().reduce((e,t)=>(q(t,"health.state")&&e[H(t.health.state)]++,e),{up:0,down:0,outOfService:0,succeeded:0,failed:0,starting:0,unknown:0}).value();return t.outOfService+=R(e).map("detachedInstances").flatten().value().length,t}transformInstance(e,t){e.provider=t.type,e.account=t.account,e.region=t.region,e.loadBalancers=[t.name];const a=e.health||{};return e.healthState=j(e,"health.state")||"OutOfService",e.health=[a],e}},useDetailsHook:function({app:e,loadBalancerParams:t,autoClose:a}){const[n,r]=O(),[i,l]=O(!0),o=async()=>{l(!0),await e.getDataSource("loadBalancers").ready();const n=e.getDataSource("loadBalancers").data.find(e=>e.name===t.name&&e.account===t.accountId);r(n),l(!1),n||a()};return M(()=>{o();const t=e.getDataSource("loadBalancers").onRefresh(o);return()=>t()},[t.name,t.accountId,t.region]),{data:n,loading:i,error:null,refetch:o}},detailsActions:function({app:e,loadBalancer:t}){return I.createElement("div",{className:"actions"},I.createElement("button",{className:"btn btn-sm btn-default",onClick:()=>Z.show({app:e,loadBalancer:t,isNew:!1}),type:"button"},"Edit"),I.createElement("button",{className:"btn btn-sm btn-default",disabled:!ee(t),onClick:()=>{const n={cloudProvider:t.cloudProvider,loadBalancerName:t.name,credentials:t.account};o.confirm({header:`Really delete ${t.name}?`,buttonText:`Delete ${t.name}`,body:te(t),account:t.account,taskMonitorConfig:{application:e,title:`Deleting ${t.name}`},submitMethod:()=>a.deleteLoadBalancer(n,e)})},type:"button"},"Delete"))},detailsSections:[function({loadBalancer:e}){var t,a;const n=e,r=(null==(t=n.split)?void 0:t.allocations)||{};return I.createElement("div",{className:"content-section"},I.createElement("div",{className:"content-section-heading"},"Traffic Split"),I.createElement("dl",{className:"dl-horizontal dl-narrow"},I.createElement("dt",null,"Account"),I.createElement("dd",null,n.account||n.credentials),I.createElement("dt",null,"Region"),I.createElement("dd",null,n.region),I.createElement("dt",null,"Shard By"),I.createElement("dd",null,(null==(a=n.split)?void 0:a.shardBy)||"Unspecified")),Object.keys(r).length>0&&I.createElement("table",{className:"table table-condensed"},I.createElement("thead",null,I.createElement("tr",null,I.createElement("th",null,"Server Group"),I.createElement("th",null,"Allocation"))),I.createElement("tbody",null,Object.entries(r).map(([e,t])=>I.createElement("tr",{key:e},I.createElement("td",null,e),I.createElement("td",null,Math.round(1e3*t)/10,"%"))))))}],CreateLoadBalancerModal:Z},logo:{path:"appengine.logoc2c312af6aa99037.png"}}),P.registerProvider("appengine",["custom"]);
|
|
1
|
+
(()=>{try{if(typeof document!="undefined"){var elementStyle=document.createElement("style");elementStyle.appendChild(document.createTextNode(".cloud-provider-logo .icon-appengine{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22utf-8%22%3F%3E%3C!-- Generator%3A Adobe Illustrator 18.1.1%2C SVG Export Plug-In . SVG Version%3A 6.00 Build 0) --%3E%3Csvg version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22 width%3D%22128px%22%09 height%3D%22128px%22 viewBox%3D%2215 15 90 90%22 xml%3Aspace%3D%22preserve%22%3E%3Cfilter id%3D%22invert%22%3E %3CfeColorMatrix in%3D%22SourceGraphic%22 type%3D%22matrix%22 values%3D%22-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0%22%2F%3E%3C%2Ffilter%3E%3Cg id%3D%22art%22 filter%3D%22url(%23invert)%22%3E%09%3Cg%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9988%2C40.9577c-12.7278%2C0-23.0452%2C10.3167-23.0452%2C23.0464%09%09%09c0%2C12.726%2C10.3174%2C23.0463%2C23.0452%2C23.0463c12.7273%2C0%2C23.0446-10.3203%2C23.0446-23.0463%09%09%09C87.0434%2C51.2744%2C76.7261%2C40.9577%2C63.9988%2C40.9577 M63.9988%2C81.4887c-9.6584%2C0-17.4876-7.8286-17.4876-17.4846%09%09%09c0-9.6584%2C7.8291-17.4877%2C17.4876-17.4877c9.6578%2C0%2C17.4858%2C7.8292%2C17.4858%2C17.4877%09%09%09C81.4846%2C73.6601%2C73.6566%2C81.4887%2C63.9988%2C81.4887%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M100.1431%2C61.274l-9.6079-3.0195c0.3997%2C1.8539%2C0.615%2C3.7759%2C0.615%2C5.7478%09%09%09c0%2C1.3791-0.1047%2C2.7337-0.3021%2C4.0569h9.295c0.8587-0.2515%2C1.4327-0.7846%2C1.4327-1.5765v-3.6345%09%09%09C101.5759%2C62.0575%2C101.0018%2C61.5094%2C100.1431%2C61.274%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9923%2C36.8497c1.9303%2C0%2C3.8119%2C0.2046%2C5.6285%2C0.5884l-3.4443-9.5729%09%09%09c-0.2515-0.8606-0.7852-1.434-1.5765-1.434h-1.4392c-0.7913%2C0-1.3407%2C0.5734-1.5761%2C1.434l-2.9924%2C9.5236%09%09%09C60.3372%2C37.0368%2C62.1425%2C36.8497%2C63.9923%2C36.8497%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M36.8468%2C64.0023c0-1.9719%2C0.2154-3.8932%2C0.6145-5.7478l-9.6073%2C3.0195%09%09%09c-0.8587%2C0.2354-1.4322%2C0.7835-1.4322%2C1.5754v3.6344c0%2C0.7907%2C0.5735%2C1.3238%2C1.4322%2C1.5753h9.2955%09%09%09C36.9515%2C66.7366%2C36.8468%2C65.3814%2C36.8468%2C64.0023%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M72.2276%2C56.4819l-2.1802%2C2.1794v-0.0048c-1.5651-1.5639-3.6549-2.4274-5.8687-2.4274%09%09%09c-2.2192%2C0-4.303%2C0.8659-5.8704%2C2.4322c-3.2362%2C3.2355-3.2362%2C8.5037%2C0%2C11.7399l-2.1802%2C2.1783%09%09%09c2.0627%2C2.0609%2C4.9096%2C3.3383%2C8.0483%2C3.3383c6.2803%2C0%2C11.3896-5.1081%2C11.3896-11.3895%09%09%09C75.566%2C61.3883%2C74.289%2C58.5421%2C72.2276%2C56.4819 M67.7284%2C67.7342c-1.0278%2C1.0302-2.3799%2C1.5459-3.7284%2C1.5459%09%09%09c-1.3526%2C0-2.7012-0.5156-3.7313-1.5459c-2.0616-2.0615-2.0616-5.4018%2C0-7.4639c1.0301-1.0314%2C2.3787-1.544%2C3.7313-1.544%09%09%09c1.3485%2C0%2C2.7006%2C0.5127%2C3.7284%2C1.544C69.79%2C62.3312%2C69.79%2C65.6727%2C67.7284%2C67.7342%22%2F%3E%09%3C%2Fg%3E%3C%2Fg%3E%3Cg id%3D%22Guides%22 style%3D%22display%3Anone%3B%22%3E%3C%2Fg%3E%3C%2Fsvg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22utf-8%22%3F%3E%3C!-- Generator%3A Adobe Illustrator 18.1.1%2C SVG Export Plug-In . SVG Version%3A 6.00 Build 0) --%3E%3Csvg version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22 width%3D%22128px%22%09 height%3D%22128px%22 viewBox%3D%2215 15 90 90%22 xml%3Aspace%3D%22preserve%22%3E%3Cfilter id%3D%22invert%22%3E %3CfeColorMatrix in%3D%22SourceGraphic%22 type%3D%22matrix%22 values%3D%22-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0%22%2F%3E%3C%2Ffilter%3E%3Cg id%3D%22art%22 filter%3D%22url(%23invert)%22%3E%09%3Cg%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9988%2C40.9577c-12.7278%2C0-23.0452%2C10.3167-23.0452%2C23.0464%09%09%09c0%2C12.726%2C10.3174%2C23.0463%2C23.0452%2C23.0463c12.7273%2C0%2C23.0446-10.3203%2C23.0446-23.0463%09%09%09C87.0434%2C51.2744%2C76.7261%2C40.9577%2C63.9988%2C40.9577 M63.9988%2C81.4887c-9.6584%2C0-17.4876-7.8286-17.4876-17.4846%09%09%09c0-9.6584%2C7.8291-17.4877%2C17.4876-17.4877c9.6578%2C0%2C17.4858%2C7.8292%2C17.4858%2C17.4877%09%09%09C81.4846%2C73.6601%2C73.6566%2C81.4887%2C63.9988%2C81.4887%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M100.1431%2C61.274l-9.6079-3.0195c0.3997%2C1.8539%2C0.615%2C3.7759%2C0.615%2C5.7478%09%09%09c0%2C1.3791-0.1047%2C2.7337-0.3021%2C4.0569h9.295c0.8587-0.2515%2C1.4327-0.7846%2C1.4327-1.5765v-3.6345%09%09%09C101.5759%2C62.0575%2C101.0018%2C61.5094%2C100.1431%2C61.274%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M63.9923%2C36.8497c1.9303%2C0%2C3.8119%2C0.2046%2C5.6285%2C0.5884l-3.4443-9.5729%09%09%09c-0.2515-0.8606-0.7852-1.434-1.5765-1.434h-1.4392c-0.7913%2C0-1.3407%2C0.5734-1.5761%2C1.434l-2.9924%2C9.5236%09%09%09C60.3372%2C37.0368%2C62.1425%2C36.8497%2C63.9923%2C36.8497%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M36.8468%2C64.0023c0-1.9719%2C0.2154-3.8932%2C0.6145-5.7478l-9.6073%2C3.0195%09%09%09c-0.8587%2C0.2354-1.4322%2C0.7835-1.4322%2C1.5754v3.6344c0%2C0.7907%2C0.5735%2C1.3238%2C1.4322%2C1.5753h9.2955%09%09%09C36.9515%2C66.7366%2C36.8468%2C65.3814%2C36.8468%2C64.0023%22%2F%3E%09%09%3Cpath style%3D%22fill%3A%23FFFFFF%3B%22 d%3D%22M72.2276%2C56.4819l-2.1802%2C2.1794v-0.0048c-1.5651-1.5639-3.6549-2.4274-5.8687-2.4274%09%09%09c-2.2192%2C0-4.303%2C0.8659-5.8704%2C2.4322c-3.2362%2C3.2355-3.2362%2C8.5037%2C0%2C11.7399l-2.1802%2C2.1783%09%09%09c2.0627%2C2.0609%2C4.9096%2C3.3383%2C8.0483%2C3.3383c6.2803%2C0%2C11.3896-5.1081%2C11.3896-11.3895%09%09%09C75.566%2C61.3883%2C74.289%2C58.5421%2C72.2276%2C56.4819 M67.7284%2C67.7342c-1.0278%2C1.0302-2.3799%2C1.5459-3.7284%2C1.5459%09%09%09c-1.3526%2C0-2.7012-0.5156-3.7313-1.5459c-2.0616-2.0615-2.0616-5.4018%2C0-7.4639c1.0301-1.0314%2C2.3787-1.544%2C3.7313-1.544%09%09%09c1.3485%2C0%2C2.7006%2C0.5127%2C3.7284%2C1.544C69.79%2C62.3312%2C69.79%2C65.6727%2C67.7284%2C67.7342%22%2F%3E%09%3C%2Fg%3E%3C%2Fg%3E%3Cg id%3D%22Guides%22 style%3D%22display%3Anone%3B%22%3E%3C%2Fg%3E%3C%2Fsvg%3E\");background-color:#4285f4}\n"));document.head.appendChild(elementStyle)}}catch(error){console.error("spinnaker-css-injected-by-js",error)}})();
|
|
2
|
+
import{HelpContentsRegistry as e,TaskMonitor as t,LoadBalancerWriter as a,noop as n,ReactModal as r,ModalClose as i,TaskMonitorWrapper as l,ConfirmationModalService as o,AppListExtractor as s,FormikFormField as c,ReactSelectInput as p,excludeAllTypesExcept as d,ArtifactTypePatterns as u,AccountService as m,StageArtifactSelectorDelegate as h,FormValidator as g,FormikStageConfig as f,Registry as v,ExecutionDetailsTasks as b,ExecutionArtifactTab as E,AccountRegionClusterSelector as y,StageConfigField as A,TargetSelect as S,StageConstants as N,PlatformHealthOverride as k,ExecutionDetailsSection as T,SETTINGS as C,StorageAccountReader as w,TaskExecutor as G,ServerGroupWarningMessageService as x,ServerGroupReader as D,ApplicationNameValidator as P,CloudProviderRegistry as B,DeploymentStrategyRegistry as I}from"@spinnaker/core";import F,{useState as O,useEffect as L}from"react";import{reduce as $,filter as R,chain as M,cloneDeep as U,has as q,camelCase as H,get as j,isEmpty as z}from"lodash";import{Modal as _}from"react-bootstrap";import{Subject as V,from as J,Observable as K}from"rxjs";import{takeUntil as W}from"rxjs/operators";[{key:"appengine.serverGroup.gcs.repositoryUrl",value:"The full URL to the GCS bucket or TAR file containing the source files for this deployment,\n including 'gs://'. For example, <b>gs://my-bucket/my-app</b> or <b>gs://my-bucket/app.tar</b>."},{key:"appengine.serverGroup.git.repositoryUrl",value:"The full URL to the git repository containing the source files for this deployment,\n including protocol. For example, <b>https://github.com/spinnaker/deck.git</b>"},{key:"appengine.serverGroup.gitCredentialType",value:"The credential type that will be used to access the git repository for this deployment.\n You can configure these credentials alongside your App Engine credentials."},{key:"appengine.serverGroup.branch",value:"The name of the branch in the above git repository to be used for this deployment."},{key:"appengine.serverGroup.applicationDirectoryRoot",value:"(Optional) Path to the directory root of the application to be deployed,\n starting from the root of the git repository. This is the directory from which\n <code>gcloud app deploy</code> will be run."},{key:"appengine.serverGroup.configFilepaths",value:"Paths to App Engine application configuration files, starting from the application directory root,\n specified above. In most cases, this will be <code>app.yaml</code> or <code>cron.yaml</code>,\n but could be <code>path/to/app.yaml</code> or <code>path/to/cron.yaml</code>."},{key:"appengine.serverGroup.configFiles",value:"<p>(Optional) The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file). These files should not conflict with the config filepaths above:\n if you include, for example, the contents of an <code>app.yaml</code>\n file here, you should <b>not</b> specify the file path to an <code>app.yaml</code> above.<br></p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>"},{key:"appengine.serverGroup.configFilesRequired",value:"<p>The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file).</p>\n <p>An <code>app.yaml</code> file is required and must have <code>runtime: custom</code> in\n order to deploy successfully.</p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>"},{key:"appengine.serverGroup.matchBranchOnRegex",value:"(Optional) A Jenkins trigger may produce details from multiple repositories and branches.\n Spinnaker will use the regex specified here to help resolve a branch for the deployment.\n If Spinnaker cannot resolve exactly one branch from the trigger, this pipeline will fail."},{key:"appengine.serverGroup.promote",value:"If selected, the newly deployed server group will receive all traffic."},{key:"appengine.serverGroup.stopPreviousVersion",value:"If selected, the previously running server group in this server group's <b>service</b>\n (Spinnaker load balancer) will be stopped. This option will be respected only if this server group will\n be receiving all traffic and the previous server group is using manual scaling."},{key:"appengine.serverGroup.containerImageUrl",value:"The full URL to the container image to use for deployment. The URL must be one of the valid GCR hostnames,\n for example <b>gcr.io/my-project/image:tag</b>"},{key:"appengine.serverGroup.suppress-version-string",value:'Spinnaker automatically versions your server groups. This means deployments through Spinnaker receive a\n short version string at the end of their name, like "v001". In most cases you will want to keep this\n version as part of the name. Preventing this string from being added to your server group will stop\n it from being considered when rolling back, promoting new versions or executing deployment strategies.\n If you are certain that you do not want the version string applied to this server group then check\n this box.'},{key:"appengine.loadBalancer.shardBy.cookie",value:'Diversion based on a specially named cookie, "GOOGAPPUID." The cookie must be set by the application itself or no diversion will occur.'},{key:"appengine.loadBalancer.shardBy.ip",value:"Diversion based on applying the modulus operation to a fingerprint of the IP address."},{key:"appengine.loadBalancer.migrateTraffic",value:"If selected, traffic will be gradually shifted to a single version. For gradual traffic migration,\n the target version must be located within instances that are configured for\n both warmup requests and automatic scaling.\n Gradual traffic migration is not supported in the App Engine flexible environment."},{key:"appengine.loadBalancer.allocations",value:"An allocation is the percent of traffic directed to a server group."},{key:"appengine.loadBalancer.textLocator",value:"Either the name of a server group, or a Spinnaker Pipeline Expression\n that resolves to the name of a server group."},{key:"appengine.instance.availability",value:"\n An instance's <b>availability</b> is determined by its version (Spinnaker server group).\n <ul>\n <li>Manual scaling versions use resident instances</li>\n <li>Basic scaling versions use dynamic instances</li>\n <li>Auto scaling versions use dynamic instances - but if you specify a number, N,\n of minimum idle instances, the first N instances will be resident,\n and additional dynamic instances will be created as necessary.\n </li>\n </ul>"},{key:"appengine.instance.averageLatency",value:"Average latency over the last minute in milliseconds."},{key:"appengine.instance.vmStatus",value:"Status of the virtual machine where this instance lives."},{key:"appengine.instance.qps",value:"Average queries per second over the last minute."},{key:"appengine.instance.errors",value:"Number of errors since this instance was started."},{key:"appengine.instance.requests",value:"Number of requests since this instance was started."}].forEach(t=>e.register(t.key,t.value));class X{static convertTrafficSplitToTrafficSplitDescription(e){const t=$(e.allocations,(e,t,a)=>e.concat({serverGroupName:a,allocation:t,locatorType:"fromExisting"}),[]);return{shardBy:e.shardBy,allocationDescriptions:t}}constructor(e){this.credentials=e.account||e.credentials,this.account=this.credentials,this.cloudProvider=e.cloudProvider,this.loadBalancerName=e.name,this.name=e.name,this.region=e.region,this.migrateTraffic=e.migrateTraffic||!1,this.serverGroups=e.serverGroups}mapAllocationsToDecimals(){this.splitDescription.allocationDescriptions.forEach(e=>{e.allocation=e.allocation/100})}mapAllocationsToPercentages(){this.splitDescription.allocationDescriptions.forEach(e=>{e.allocation=Math.round(1e3*e.allocation)/10})}}const Y=[{label:"Current Server Group",value:"current_asg_dynamic"},{label:"Previous Server Group",value:"ancestor_asg_dynamic"},{label:"Oldest Server Group",value:"oldest_asg_dynamic"}];const Q=class e extends F.Component{constructor(){super(...arguments),this.state={taskMonitor:new t({application:this.props.app,title:"Updating your load balancer",onDismiss:()=>this.props.dismissModal(),onTaskComplete:()=>this.props.app.getDataSource("loadBalancers").refresh()})},this.command=this.buildInitialCommand(),this.update=(e,t)=>{this.command[e]=t,this.forceUpdate()},this.updateSplit=(e,t)=>{this.command.splitDescription[e]=t,this.forceUpdate()},this.updateAllocation=(e,t,a)=>{this.command.splitDescription.allocationDescriptions[e][t]=a,this.forceUpdate()},this.updateAllocationLocatorType=(e,t)=>{this.command.splitDescription.allocationDescriptions[e]=function(e,t){const a={...e,locatorType:t};return"targetCoordinate"===t?(delete a.serverGroupName,a.target=a.target||Y[0].value):(delete a.cluster,delete a.target),a}(this.command.splitDescription.allocationDescriptions[e],t),this.forceUpdate()},this.addAllocation=()=>{this.command.splitDescription.allocationDescriptions.push({allocation:0,locatorType:this.props.forPipelineConfig?"text":"fromExisting",serverGroupName:""}),this.command.splitDescription.allocationDescriptions.length>1&&!this.command.splitDescription.shardBy&&(this.command.splitDescription.shardBy="IP"),this.forceUpdate()},this.removeAllocation=e=>{this.command.splitDescription.allocationDescriptions.splice(e,1),this.forceUpdate()},this.allocationTotal=()=>this.command.splitDescription.allocationDescriptions.reduce((e,t)=>e+Number(t.allocation||0),0),this.submit=()=>{const e=U(this.command);e.mapAllocationsToDecimals(),delete e.serverGroups,this.props.forPipelineConfig?this.props.closeModal(e):this.state.taskMonitor.submit(()=>a.upsertLoadBalancer(e,this.props.app,"Update"))}}static show(t){return r.show(e,t,{dialogClassName:"modal-lg"})}buildInitialCommand(){const e=this.props.loadBalancer||{},t=new X({...e,account:e.account||e.credentials,credentials:e.credentials||e.account,name:e.name,region:e.region,serverGroups:e.serverGroups||[],cloudProvider:"appengine",migrateTraffic:e.migrateTraffic||!1});return t.splitDescription=e.splitDescription||e.split&&X.convertTrafficSplitToTrafficSplitDescription(e.split)||{shardBy:"UNSPECIFIED",allocationDescriptions:(e.serverGroups||[]).slice(0,1).map(e=>({allocation:100,locatorType:"fromExisting",serverGroupName:e.name}))},t.mapAllocationsToPercentages(),t}renderAllocationTarget(e,t){return this.props.forPipelineConfig?/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"radio"},/* @__PURE__ */F.createElement("label",null,/* @__PURE__ */F.createElement("input",{checked:"text"===e.locatorType,onChange:()=>this.updateAllocationLocatorType(t,"text"),type:"radio"})," ","Text input")),/* @__PURE__ */F.createElement("div",{className:"radio"},/* @__PURE__ */F.createElement("label",null,/* @__PURE__ */F.createElement("input",{checked:"targetCoordinate"===e.locatorType,onChange:()=>this.updateAllocationLocatorType(t,"targetCoordinate"),type:"radio"})," ","Target coordinate")),/* @__PURE__ */F.createElement("div",{className:"radio"},/* @__PURE__ */F.createElement("label",null,/* @__PURE__ */F.createElement("input",{checked:"fromExisting"===e.locatorType,onChange:()=>this.updateAllocationLocatorType(t,"fromExisting"),type:"radio"})," ","Existing server group")),"targetCoordinate"===e.locatorType?/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"cluster",e.target.value),placeholder:"Cluster",value:e.cluster||""}),/* @__PURE__ */F.createElement("select",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"target",e.target.value),value:e.target||Y[0].value},Y.map(e=>/* @__PURE__ */F.createElement("option",{key:e.value,value:e.value},e.label)))):/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"serverGroupName",e.target.value),placeholder:"text"===e.locatorType?"Server group expression or name":"Server group",value:e.serverGroupName||""})):/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.updateAllocation(t,"serverGroupName",e.target.value),value:e.serverGroupName||""})}render(){const{dismissModal:e,isNew:t}=this.props;/* @__PURE__ */
|
|
3
|
+
return F.createElement("div",null,/* @__PURE__ */F.createElement(i,{dismiss:e}),/* @__PURE__ */F.createElement(_.Header,null,/* @__PURE__ */F.createElement(_.Title,null,t?"Create":"Edit"," App Engine Load Balancer")),/* @__PURE__ */F.createElement(_.Body,null,/* @__PURE__ */F.createElement("div",{className:"form-horizontal"},/* @__PURE__ */F.createElement("label",null,"Name"),/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("name",e.target.value),value:this.command.name||""}),/* @__PURE__ */F.createElement("label",null,"Account"),/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>{this.update("credentials",e.target.value),this.update("account",e.target.value)},value:this.command.credentials||this.command.account||""}),/* @__PURE__ */F.createElement("label",null,"Region"),/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("region",e.target.value),value:this.command.region||""}),/* @__PURE__ */F.createElement("div",{className:"checkbox"},/* @__PURE__ */F.createElement("label",null,/* @__PURE__ */F.createElement("input",{checked:!!this.command.migrateTraffic,onChange:e=>this.update("migrateTraffic",e.target.checked),type:"checkbox"})," ","Migrate traffic")),(this.command.splitDescription.allocationDescriptions.length>1||this.command.migrateTraffic)&&/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("label",null,"Shard By"),/* @__PURE__ */F.createElement("select",{className:"form-control input-sm",onChange:e=>this.updateSplit("shardBy",e.target.value),value:this.command.splitDescription.shardBy||"UNSPECIFIED"},
|
|
4
|
+
/* @__PURE__ */F.createElement("option",{value:"UNSPECIFIED"},"Unspecified"),
|
|
5
|
+
/* @__PURE__ */F.createElement("option",{value:"IP"},"IP"),
|
|
6
|
+
/* @__PURE__ */F.createElement("option",{value:"COOKIE"},"Cookie"))),/* @__PURE__ */F.createElement("label",null,"Allocations"),/* @__PURE__ */F.createElement("table",{className:"table table-condensed"},/* @__PURE__ */F.createElement("thead",null,/* @__PURE__ */F.createElement("tr",null,/* @__PURE__ */F.createElement("th",null,"Server Group"),/* @__PURE__ */F.createElement("th",null,"Allocation %"),/* @__PURE__ */F.createElement("th",null))),/* @__PURE__ */F.createElement("tbody",null,this.command.splitDescription.allocationDescriptions.map((e,t)=>/* @__PURE__ */F.createElement("tr",{key:t},/* @__PURE__ */F.createElement("td",null,this.renderAllocationTarget(e,t)),/* @__PURE__ */F.createElement("td",null,/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",min:0,onChange:e=>this.updateAllocation(t,"allocation",Number(e.target.value)),type:"number",value:e.allocation||0})),/* @__PURE__ */F.createElement("td",null,/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-link",onClick:()=>this.removeAllocation(t),type:"button"},
|
|
7
|
+
/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}))))))),/* @__PURE__ */F.createElement("button",{className:"btn btn-block btn-sm add-new",onClick:this.addAllocation,type:"button"},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-plus-sign"})," Add allocation"),100!==this.allocationTotal()&&/* @__PURE__ */F.createElement("div",{className:"alert alert-warning"},"Traffic allocations must add up to 100%."))),/* @__PURE__ */F.createElement(l,{monitor:this.state.taskMonitor}),/* @__PURE__ */F.createElement(_.Footer,null,/* @__PURE__ */F.createElement("button",{className:"btn btn-default",onClick:()=>e(),type:"button"},"Cancel"),/* @__PURE__ */F.createElement("button",{className:"btn btn-primary",disabled:100!==this.allocationTotal(),onClick:this.submit,type:"button"},t?"Create":"Done")))}};Q.defaultProps={closeModal:n,dismissModal:n};let Z=Q;function ee(e){return"default"!==e.name}function te(e){const t=(e.serverGroups||[]).map(e=>e.name);return t.length?1===t.length?`<div class="alert alert-warning"><p>Deleting <b>${e.name}</b> will destroy <b>${t[0]}</b>.</p></div>`:`<div class="alert alert-warning"><p>Deleting <b>${e.name}</b> will destroy the following server groups:<ul>${t.map(e=>`<li>${e}</li>`).join("")}</ul></p></div>`:null}const ae=new URL("appengine.logoDdEgr2Bq.png",import.meta.url).href;class ne extends F.Component{constructor(e){super(e),this.destroy$=new V,this.setRegionList=e=>{const{application:t}=this.props,a=t=>!t||t.account===e;J(t.ready()).pipe(W(this.destroy$)).subscribe(()=>{const e=s.getRegions([t],a);e.sort(),this.setState({availableRegions:e})})},this.accountChanged=e=>{this.setRegionList(e)};const t=e.credentialsField||"credentials";this.state={availableRegions:[],cloudProvider:e.cloudProvider,componentName:e.componentName||"",credentialsField:t}}componentDidMount(){const{componentName:e,formik:t}=this.props,{credentialsField:a}=this.state,n=j(t.values,e?`${e}.${a}`:`${a}`,void 0);this.setRegionList(n)}componentWillUnmount(){this.destroy$.next()}render(){const{accounts:e}=this.props,{credentialsField:t,availableRegions:a,componentName:n}=this.state;/* @__PURE__ */
|
|
8
|
+
return F.createElement("div",{className:"col-md-9"},/* @__PURE__ */F.createElement("div",{className:"sp-margin-m-bottom"},/* @__PURE__ */F.createElement(c,{name:n?`${n}.${t}`:`${t}`,label:"Account",input:t=>/* @__PURE__ */F.createElement(p,{...t,stringOptions:e&&e.map(e=>e.name),clearable:!1}),onChange:this.accountChanged,required:!0})),/* @__PURE__ */F.createElement("div",{className:"sp-margin-m-bottom"},/* @__PURE__ */F.createElement(c,{name:n?`${n}.region`:"region",label:"Region",input:e=>/* @__PURE__ */F.createElement(p,{...e,stringOptions:a,clearable:!1}),required:!0})))}}const re=class e extends F.Component{constructor(){super(...arguments),this.destroy$=new V,this.state={accounts:[]},this.onTemplateArtifactEdited=(e,t)=>{this.props.formik.setFieldValue(`${t}.id`,null),this.props.formik.setFieldValue(`${t}.artifact`,e),this.props.formik.setFieldValue(`${t}.account`,e.artifactAccount)},this.onTemplateArtifactSelected=(e,t)=>{this.props.formik.setFieldValue(`${t}.id`,e),this.props.formik.setFieldValue(`${t}.artifact`,null)},this.removeInputArtifact=e=>{this.props.formik.setFieldValue(e,null)},this.getInputArtifact=(e,t)=>e[t]?e[t]:{account:"",id:""}}componentDidMount(){J(m.listAccounts("appengine")).pipe(W(this.destroy$)).subscribe(e=>this.setState({accounts:e}))}render(){const t=this.props.formik.values,a=this.state.accounts;/* @__PURE__ */
|
|
9
|
+
return F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-0 col-md-9"},/* @__PURE__ */F.createElement("h4",null,"Basic Settings")),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement(ne,{componentName:"",accounts:a,application:this.props.application,cloudProvider:"appengine",credentialsField:"account",formik:this.props.formik})),/* @__PURE__ */F.createElement("div",{className:"col-md-offset-0 col-md-9"},/* @__PURE__ */F.createElement("h4",null,"Configuration Settings")),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"cronArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"cronArtifact").id,label:"Cron Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"cronArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"cronArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("cronArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"dispatchArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"dispatchArtifact").id,label:"Dispatch Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"dispatchArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"dispatchArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("dispatchArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"indexArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"indexArtifact").id,label:"Index Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"indexArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"indexArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("indexArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"queueArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"queueArtifact").id,label:"Queue Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"queueArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"queueArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("queueArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))))}};re.excludedArtifactTypes=d(u.BITBUCKET_FILE,u.CUSTOM_OBJECT,u.EMBEDDED_BASE64,u.GCS_OBJECT,u.GITHUB_FILE,u.GITLAB_FILE,u.S3_OBJECT,u.HTTP_FILE,u.ORACLE_OBJECT);let ie=re;function le(e){const t=new g(e);return t.field("account").required(),t.field("region").required(),t.validateForm()}v.pipeline.registerStage({label:"Deploy App Engine Configuration",description:"Deploy index, dispatch, cron, and queue configuration to App Engine.",key:"deployAppEngineConfiguration",component:function({application:e,pipeline:t,stage:a,updateStage:n}){const r=F.useMemo(()=>({...U(a)}),[]);/* @__PURE__ */
|
|
10
|
+
return F.createElement(f,{application:e,onChange:n,pipeline:t,stage:r,validate:le,render:e=>/* @__PURE__ */F.createElement(ie,{...e})})},producesArtifacts:!1,cloudProvider:"appengine",executionDetailsSections:[b,E],validateFn:le});const oe=class{};oe.PLATFORM="App Engine Service";let se=oe;function ce(e,t){var a,n;e.cloudProvider="appengine",e.cloudProviderType="appengine",e.isNew&&(null==(a=null==t?void 0:t.attributes)?void 0:a.platformHealthOnlyShowOverride)&&(null==(n=null==t?void 0:t.attributes)?void 0:n.platformHealthOnly)&&(e.interestingHealthProviderNames=[se.PLATFORM])}function pe({application:e,pipeline:t,stage:a,updateStage:n,showHealthOverride:r=!1}){var i;const[l,o]=O([]);L(()=>{ce(a,e),m.listAccounts("appengine").then(t=>{var r;o(t);const i=a.credentials||(null==(r=null==e?void 0:e.defaultCredentials)?void 0:r.appengine),l=function(e,t){var a;return null==(a=e.find(e=>e.name===t))?void 0:a.region}(t,i);(i||l)&&(a.credentials=i||a.credentials,a.region=l||a.region,n(a))})},[]);/* @__PURE__ */
|
|
11
|
+
return F.createElement("div",{className:"form-horizontal"},!(null==t?void 0:t.strategy)&&/* @__PURE__ */F.createElement(y,{accounts:l,application:e,component:a,disableRegionSelect:!0,onAccountUpdate:e=>{m.getAccountDetails(e).then(e=>{a.region=(null==e?void 0:e.region)||a.region,n(a)})},onComponentUpdate:n,singleRegion:"true"}),/* @__PURE__ */F.createElement(A,{label:"Target"},/* @__PURE__ */F.createElement(S,{model:{target:a.target},onChange:e=>{a.target=e,n(a)},options:N.TARGET_LIST})),r&&(null==(i=null==e?void 0:e.attributes)?void 0:i.platformHealthOnlyShowOverride)&&/* @__PURE__ */F.createElement(k,{interestingHealthProviderNames:a.interestingHealthProviderNames||[],onChange:e=>{a.interestingHealthProviderNames=e,n(a)},platformHealthType:se.PLATFORM}))}function de(e){/* @__PURE__ */
|
|
12
|
+
return F.createElement(pe,{...e,showHealthOverride:!0})}function ue({stage:e}){var t,a,n,r;const i=(null==(n=null==(a=null==(t=e.context)?void 0:t.exception)?void 0:a.details)?void 0:n.errors)||(null==(r=e.context)?void 0:r.failureMessages)||[];return i.length?/* @__PURE__ */F.createElement("div",{className:"alert alert-danger"},i.map((e,t)=>/* @__PURE__ */F.createElement("p",{key:t},e))):null}function me(e){const{stage:t}=e;/* @__PURE__ */
|
|
13
|
+
return F.createElement("div",null,/* @__PURE__ */F.createElement("dl",{className:"dl-horizontal dl-narrow"},/* @__PURE__ */F.createElement("dt",null,"Account"),/* @__PURE__ */F.createElement("dd",null,t.context.credentials||t.context.account),/* @__PURE__ */F.createElement("dt",null,"Region"),/* @__PURE__ */F.createElement("dd",null,t.context.region),/* @__PURE__ */F.createElement("dt",null,t.context.cluster?"Cluster":"Server Group"),/* @__PURE__ */F.createElement("dd",null,(a=t.context).cluster||a.serverGroupName),t.context.target&&[
|
|
14
|
+
/* @__PURE__ */F.createElement("dt",{key:"target-label"},"Target"),
|
|
15
|
+
/* @__PURE__ */F.createElement("dd",{key:"target-value"},t.context.target)]),/* @__PURE__ */F.createElement(ue,{stage:t}));var a}function he(e){/* @__PURE__ */
|
|
16
|
+
return F.createElement(T,{name:he.title,current:e.current},/* @__PURE__ */F.createElement(me,{...e}))}function ge(e){/* @__PURE__ */
|
|
17
|
+
return F.createElement(T,{name:ge.title,current:e.current},/* @__PURE__ */F.createElement(me,{...e}))}function fe(e){const t=e.stage.context.loadBalancers||[];/* @__PURE__ */
|
|
18
|
+
return F.createElement(T,{name:fe.title,current:e.current},/* @__PURE__ */F.createElement("table",{className:"table table-condensed"},/* @__PURE__ */F.createElement("thead",null,/* @__PURE__ */F.createElement("tr",null,/* @__PURE__ */F.createElement("th",null,"Account"),/* @__PURE__ */F.createElement("th",null,"Name"),/* @__PURE__ */F.createElement("th",null,"Region"))),/* @__PURE__ */F.createElement("tbody",null,t.map((e,t)=>/* @__PURE__ */F.createElement("tr",{key:t},/* @__PURE__ */F.createElement("td",null,e.credentials||e.account),/* @__PURE__ */F.createElement("td",null,e.name||e.loadBalancerName),/* @__PURE__ */F.createElement("td",null,e.region))))),/* @__PURE__ */F.createElement(ue,{stage:e.stage}))}v.pipeline.registerStage({provides:"destroyServerGroup",key:"destroyServerGroup",cloudProvider:"appengine",component:pe,validators:[{type:"targetImpedance",message:"This pipeline will attempt to destroy a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),v.pipeline.registerStage({provides:"disableServerGroup",key:"disableServerGroup",cloudProvider:"appengine",component:de,validators:[{type:"targetImpedance",message:"This pipeline will attempt to disable a server group without deploying a new version into the same cluster."},{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),he.title="startServerGroupConfig",ge.title="stopServerGroupConfig",fe.title="editLoadBalancerConfig",v.pipeline.registerStage({label:"Edit Load Balancer",description:"Edits a load balancer",key:"upsertAppEngineLoadBalancers",cloudProvider:"appengine",component:function({application:e,stage:t,updateStage:a}){L(()=>{t.loadBalancers=t.loadBalancers||[],t.cloudProvider="appengine",a(t)},[]);const n=e=>{t.loadBalancers=e,a(t)};/* @__PURE__ */
|
|
19
|
+
return F.createElement("div",{className:"well well-sm clearfix"},/* @__PURE__ */F.createElement("h4",null,"Load Balancers"),/* @__PURE__ */F.createElement("table",{className:"table table-condensed"},/* @__PURE__ */F.createElement("thead",null,/* @__PURE__ */F.createElement("tr",null,/* @__PURE__ */F.createElement("th",null,"Account"),/* @__PURE__ */F.createElement("th",null,"Name"),/* @__PURE__ */F.createElement("th",null,"Region"),/* @__PURE__ */F.createElement("th",null,"Actions"))),/* @__PURE__ */F.createElement("tbody",null,(t.loadBalancers||[]).map((a,r)=>/* @__PURE__ */F.createElement("tr",{key:`${a.name}-${r}`},/* @__PURE__ */F.createElement("td",null,a.credentials||a.account),/* @__PURE__ */F.createElement("td",null,a.name),/* @__PURE__ */F.createElement("td",null,a.region),/* @__PURE__ */F.createElement("td",{className:"condensed-actions"},/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-link",onClick:()=>(a=>{Z.show({app:e,loadBalancer:t.loadBalancers[a],forPipelineConfig:!0,isNew:!1}).then(e=>{const r=[...t.loadBalancers];r[a]=e,n(r)}).catch(()=>{})})(r),type:"button"},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-edit"})),/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-link pad-left",onClick:()=>(e=>{n(t.loadBalancers.filter((t,a)=>a!==e))})(r),type:"button"},
|
|
20
|
+
/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"})))))),/* @__PURE__ */F.createElement("tfoot",null,/* @__PURE__ */F.createElement("tr",null,/* @__PURE__ */F.createElement("td",{colSpan:4},/* @__PURE__ */F.createElement("button",{className:"btn btn-block btn-sm add-new",onClick:()=>{Z.show({app:e,loadBalancer:null,forPipelineConfig:!0,isNew:!0}).then(e=>n([...t.loadBalancers||[],e])).catch(()=>{})},type:"button"},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-plus-sign"})," Add load balancer"))))))},executionDetailsSections:[fe,b],validators:[]}),v.pipeline.registerStage({provides:"enableServerGroup",key:"enableServerGroup",cloudProvider:"appengine",component:de,validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),v.pipeline.registerStage({provides:"shrinkCluster",key:"shrinkCluster",cloudProvider:"appengine",component:function({application:e,pipeline:t,stage:a,updateStage:n}){var r;L(()=>{ce(a,e),void 0===a.shrinkToSize&&(a.shrinkToSize=1),void 0===a.allowDeleteActive&&(a.allowDeleteActive=!1),void 0===a.retainLargerOverNewer&&(a.retainLargerOverNewer="false"),a.retainLargerOverNewer=a.retainLargerOverNewer.toString(),n(a)},[]);const i=(e,t)=>{a[e]=t,n(a)};/* @__PURE__ */
|
|
21
|
+
return F.createElement("div",{className:"form-horizontal"},/* @__PURE__ */F.createElement(pe,{application:e,pipeline:t,stage:a,updateStage:n}),/* @__PURE__ */F.createElement("div",{className:"form-group"},/* @__PURE__ */F.createElement("label",{className:"col-md-3 sm-label-right"},"Shrink Options"),/* @__PURE__ */F.createElement("div",{className:"col-md-7 form-inline"},"Shrink to"," ",/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",min:0,onChange:e=>i("shrinkToSize",Number(e.target.value)),style:{width:60},type:"number",value:a.shrinkToSize||0})," ","server groups, keeping the"," ",/* @__PURE__ */F.createElement("select",{className:"form-control input-sm",onChange:e=>i("retainLargerOverNewer",e.target.value),style:{width:100},value:a.retainLargerOverNewer||"false"},
|
|
22
|
+
/* @__PURE__ */F.createElement("option",{value:"true"},"largest"),
|
|
23
|
+
/* @__PURE__ */F.createElement("option",{value:"false"},"newest")))),/* @__PURE__ */F.createElement("div",{className:"form-group"},/* @__PURE__ */F.createElement("div",{className:"col-md-offset-3 col-md-7 checkbox"},/* @__PURE__ */F.createElement("label",null,/* @__PURE__ */F.createElement("input",{checked:!!a.allowDeleteActive,onChange:e=>i("allowDeleteActive",e.target.checked),type:"checkbox"})," ","Allow deletion of active server groups"))),(null==(r=null==e?void 0:e.attributes)?void 0:r.platformHealthOnlyShowOverride)&&/* @__PURE__ */F.createElement(k,{interestingHealthProviderNames:a.interestingHealthProviderNames||[],onChange:e=>{a.interestingHealthProviderNames=e,n(a)},platformHealthType:se.PLATFORM}))},validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"shrinkToSize",fieldLabel:"shrink to [X] Server Groups"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}]}),v.pipeline.registerStage({label:"Start Server Group",description:"Starts a server group.",key:"startAppEngineServerGroup",component:de,executionDetailsSections:[he,b],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],cloudProvider:"appengine"}),v.pipeline.registerStage({label:"Stop Server Group",description:"Stops a server group.",key:"stopAppEngineServerGroup",component:de,executionDetailsSections:[ge,b],validators:[{type:"requiredField",fieldName:"cluster"},{type:"requiredField",fieldName:"target"},{type:"requiredField",fieldName:"credentials",fieldLabel:"account"}],cloudProvider:"appengine"});const ve=C.providers.appengine||{defaults:{}};ve&&(ve.resetToOriginal=C.resetProvider("appengine"));var be=/* @__PURE__ */(e=>(e.GCS="gcs",e.GIT="git",e.ARTIFACT="artifact",e.CONTAINER_IMAGE="containerImage",e))(be||{});class Ee{static getTriggerOptions(e){return(e.triggers||[]).filter(e=>"git"===e.type||"jenkins"===e.type||"travis"===e.type).map(e=>"git"===e.type?{source:e.source,project:e.project,slug:e.slug,branch:e.branch,type:"git"}:{master:e.master,job:e.job,type:e.type})}static getExpectedArtifacts(e){return e.expectedArtifacts||[]}buildNewServerGroupCommand(e,t,a="create"){null==t&&(t="appengine");const n={accounts:m.getAllAccountDetailsForProvider("appengine"),storageAccounts:w.getStorageAccounts()},r={mode:a,submitButtonLabel:this.getSubmitButtonLabel(a),disableStrategySelection:"create"===a};return this.resolveAll(n).then(a=>{const n=this.getCredentials(a.accounts),i=this.getRegion(a.accounts,n);return{application:e.name,backingData:a,viewState:r,fromArtifact:!1,credentials:n,region:i,selectedProvider:t,configArtifacts:[],configFilepaths:[],configFiles:[],interestingHealthProviderNames:[],sourceType:"git"}})}buildServerGroupCommandFromExisting(e,t){return this.buildNewServerGroupCommand(e,"appengine","clone").then(e=>(e.stack=t.stack,e.freeFormDetails=t.detail,e))}buildNewServerGroupCommandForPipeline(e,t){return Promise.resolve({viewState:{pipeline:t,stage:e},backingData:{triggerOptions:Ee.getTriggerOptions(t),expectedArtifacts:Ee.getExpectedArtifacts(t)}})}buildServerGroupCommandFromPipeline(e,t,a,n){return this.buildNewServerGroupCommand(e,"appengine","editPipeline").then(e=>e={...e,...t,backingData:{...e.backingData,triggerOptions:Ee.getTriggerOptions(n),expectedArtifacts:Ee.getExpectedArtifacts(n)},credentials:t.account||e.credentials,viewState:{...e.viewState,stage:a,pipeline:n}})}getCredentials(e){const t=(e||[]).map(e=>e.name),a=ve.defaults.account;return t.includes(a)?a:t[0]}getRegion(e,t){const a=e.find(e=>e.name===t);return a?a.region:null}getSubmitButtonLabel(e){switch(e){case"createPipeline":return"Add";case"editPipeline":return"Done";case"clone":return"Clone";default:return"Create"}}resolveAll(e){const t=Object.entries(e);return Promise.all(t.map(([,e])=>e)).then(e=>t.reduce((t,[a],n)=>({...t,[a]:e[n]}),{}))}}class ye{constructor(e){this.cloudProvider="appengine",this.provider="appengine",this.credentials=e.credentials,this.account=e.credentials,this.application=e.application,this.stack=e.stack,this.freeFormDetails=e.freeFormDetails,this.repositoryUrl=e.repositoryUrl,this.branch=e.branch,this.configFilepaths=e.configFilepaths,this.promote=e.promote,this.stopPreviousVersion=e.stopPreviousVersion,this.type=e.type,this.region=e.region,this.strategy=e.strategy,this.strategyApplication=e.strategyApplication,this.strategyPipeline=e.strategyPipeline,this.fromTrigger=e.fromTrigger,this.trigger=e.trigger,this.gitCredentialType=e.gitCredentialType,this.configFiles=e.configFiles,this.configArtifacts=(e.configArtifacts||[]).filter(e=>!!e.id||!!e.artifact),this.applicationDirectoryRoot=e.applicationDirectoryRoot,this.interestingHealthProviderNames=e.interestingHealthProviderNames||[],this.expectedArtifactId=e.expectedArtifactId,this.expectedArtifact=e.expectedArtifact,this.fromArtifact=e.fromArtifact,this.sourceType=e.sourceType,this.storageAccountName=e.storageAccountName,this.containerImageUrl=e.containerImageUrl,this.suppressVersionString=e.suppressVersionString}}class Ae{cloneServerGroup(e,t){return e.type="createServerGroup",G.executeTask({job:[new ye(e)],application:t,description:`Create App Engine Server Group in ${t.name}`})}startServerGroup(e,t){const a={job:[this.buildJob(e,t,"startAppEngineServerGroup")],application:t,description:`Start Server Group: ${e.name}`};return G.executeTask(a)}stopServerGroup(e,t){const a={job:[this.buildJob(e,t,"stopAppEngineServerGroup")],application:t,description:`Stop Server Group: ${e.name}`};return G.executeTask(a)}enableServerGroup(e,t,a={}){const n={...a,...this.buildJob(e,t,"enableServerGroup")};return G.executeTask({job:[n],application:t,description:`Enable Server Group: ${e.name}`})}disableServerGroup(e,t,a={}){const n={...a,...this.buildJob(e,t,"disableServerGroup")};return G.executeTask({job:[n],application:t,description:`Disable Server Group: ${e.name}`})}destroyServerGroup(e,t,a={}){const n={...a,...this.buildJob(e,t,"destroyServerGroup")};return G.executeTask({job:[n],application:t,description:`Destroy Server Group: ${e.name}`})}buildJob(e,t,a){return{type:a,region:e.region,serverGroupName:e.name,credentials:e.account,cloudProvider:"appengine",application:t.name}}}const Se=new Ae;const Ne=class e extends F.Component{constructor(){super(...arguments),this.state={taskMonitor:new t({application:this.props.application,title:"Creating your server group",onDismiss:()=>this.props.dismissModal(),onTaskComplete:()=>this.props.application.serverGroups.refresh()})},this.update=(e,t)=>{this.props.command[e]=t,this.forceUpdate()},this.submit=()=>{const{command:e}=this.props;"editPipeline"!==e.viewState.mode&&"createPipeline"!==e.viewState.mode?this.state.taskMonitor.submit(()=>Se.cloneServerGroup(function(e){return{...e,configArtifacts:e.configArtifacts||[],configFilepaths:e.configFilepaths||[],configFiles:e.configFiles||[],interestingHealthProviderNames:e.interestingHealthProviderNames||[],fromArtifact:e.fromArtifact||!1,sourceType:e.sourceType||be.GIT}}(e),this.props.application)):this.props.closeModal(e)}}static show(t){return r.show(e,t,{dialogClassName:"modal-lg"})}render(){var e;const{command:t,dismissModal:a,title:n}=this.props;/* @__PURE__ */
|
|
24
|
+
return F.createElement("div",null,/* @__PURE__ */F.createElement(i,{dismiss:a}),/* @__PURE__ */F.createElement(_.Header,null,/* @__PURE__ */F.createElement(_.Title,null,n)),/* @__PURE__ */F.createElement(_.Body,null,/* @__PURE__ */F.createElement("div",{className:"form-horizontal"},/* @__PURE__ */F.createElement("label",null,"Account"),/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("credentials",e.target.value),value:t.credentials||""}),/* @__PURE__ */F.createElement("label",null,"Region"),/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("region",e.target.value),value:t.region||""}),/* @__PURE__ */F.createElement("label",null,"Branch"),/* @__PURE__ */F.createElement("input",{className:"form-control input-sm",onChange:e=>this.update("branch",e.target.value),value:t.branch||""}))),/* @__PURE__ */F.createElement(l,{monitor:this.state.taskMonitor}),/* @__PURE__ */F.createElement(_.Footer,null,/* @__PURE__ */F.createElement("button",{className:"btn btn-default",onClick:()=>a(),type:"button"},"Cancel"),/* @__PURE__ */F.createElement("button",{className:"btn btn-primary",onClick:this.submit,type:"button"},(null==(e=t.viewState)?void 0:e.submitButtonLabel)||"Clone")))}};Ne.defaultProps={closeModal:n,dismissModal:n};let ke=Ne;const Te=new Ae,Ce=new Ee;function we(e){var t;return"FLEXIBLE"===e.env||["MANUAL","BASIC"].includes(null==(t=e.scalingPolicy)?void 0:t.type)}function Ge(e){return we(e)&&"STOPPED"===e.servingStatus}function xe(e){return we(e)&&"SERVING"===e.servingStatus}function De(e,t=[]){const a=t.find(t=>{var a;return Object.keys((null==(a=t.split)?void 0:a.allocations)||{}).includes(e.name)});if(!a)return null;const n={...a.split.allocations};delete n[e.name];const r=Object.values(n).reduce((e,t)=>e+t,0);if(!r)return{};const i="COOKIE"===a.split.shardBy?1e3:100;return Object.keys(n).forEach(e=>{n[e]=Math.round(n[e]/r*i)/i}),n}function Pe(e,t=[]){return!(!e||e.disabled)&&Object.keys(De(e,t)||{}).length>0}function Be(e,t=[]){return!!e&&(e.disabled||Object.keys(De(e,t)||{}).length>0)}function Ie(e){return`<table class="table table-condensed"><thead><tr><th>Server Group</th><th>Allocation</th></tr></thead><tbody>${Object.keys(e||{}).map(t=>`<tr><td>${t}</td><td>${100*e[t]}%</td></tr>`).join("")}</tbody></table>`}function Fe(e){var t,a,n;const r={platformHealthOnlyShowOverride:null==(t=e.attributes)?void 0:t.platformHealthOnlyShowOverride,platformHealthType:se.PLATFORM,interestingHealthProviderNames:[]};return(null==(a=e.attributes)?void 0:a.platformHealthOnlyShowOverride)&&(null==(n=e.attributes)?void 0:n.platformHealthOnly)&&(r.interestingHealthProviderNames=[se.PLATFORM]),r}function Oe(e,t){var a;const n=De(e,t);return`<div class="well well-sm">\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${null==(a=e.loadBalancers)?void 0:a[0]}</b> under the <b>Load Balancers</b> tab.</p>\n <div class="row"><div class="col-md-12">${Ie(n)}</div></div>\n </div>`}function Le(e,t,a){var n;let r="";const i={};return x.addDestroyWarningMessage(e,t,i),i.body&&(r+=i.body),t.disabled||(r+=`<div class="well well-sm">\n <p>A destroy operation will first disable this server group.</p>\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${null==(n=t.loadBalancers)?void 0:n[0]}</b> under the <b>Load Balancers</b> tab.</p>\n <div class="row"><div class="col-md-12">${Ie(De(t,a))}</div></div>\n </div>`),r}P.registerValidator("appengine",new class{validate(e=""){const t=[],a=[];return e.length&&(this.validateSpecialCharacters(e,a),this.validateLength(e,t,a)),{warnings:t,errors:a}}validateSpecialCharacters(e,t){/^[a-z0-9]*$/g.test(e)||t.push("Only numbers and lowercase letters are allowed.")}validateLength(e,t,a){if(e.length>58)a.push("The maximum length for an App Engine application name is 63 characters.");else if(e.length>48)if(e.length>=56)t.push("You will not be able to include a stack or detail field for clusters.");else{const a=56-e.length;t.push(`If you plan to include a stack or detail field for clusters, you will only have\n ${a} character${a>1?"s":""} to do so.`)}}}),B.registerProvider("appengine",{name:"App Engine",instance:{details:function({instance:e}){/* @__PURE__ */
|
|
25
|
+
return F.createElement("div",{className:"details-panel"},/* @__PURE__ */F.createElement("div",{className:"header"},/* @__PURE__ */F.createElement("div",{className:"header-text horizontal middle"},/* @__PURE__ */F.createElement("i",{className:"fa icon-instance"}),/* @__PURE__ */F.createElement("h3",{className:"horizontal middle space-between flex-1"},e.instanceId))),/* @__PURE__ */F.createElement("div",{className:"content"},/* @__PURE__ */F.createElement("dl",{className:"dl-horizontal dl-narrow"},/* @__PURE__ */F.createElement("dt",null,"Account"),/* @__PURE__ */F.createElement("dd",null,e.account),/* @__PURE__ */F.createElement("dt",null,"Region"),/* @__PURE__ */F.createElement("dd",null,e.region),/* @__PURE__ */F.createElement("dt",null,"Provider"),/* @__PURE__ */F.createElement("dd",null,e.provider))))}},serverGroup:{transformer:class{normalizeServerGroup(e){return Promise.resolve(e)}convertServerGroupCommandToDeployConfiguration(e){return new ye(e)}},commandBuilder:Ee,detailsActions:function({app:e,serverGroup:t}){const a=t,n=function(e){var t,a;return(null==(a=null==(t=e.getDataSource)?void 0:t.call(e,"loadBalancers"))?void 0:a.data)||[]}(e);/* @__PURE__ */
|
|
26
|
+
return F.createElement("div",{className:"actions"},/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",onClick:()=>{Ce.buildServerGroupCommandFromExisting(e,a).then(a=>{ke.show({application:e,command:a,title:`Clone ${t.name}`})})},type:"button"},"Clone"),/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",disabled:!Ge(a),onClick:()=>o.confirm({header:`Really start ${t.name}?`,buttonText:`Start ${t.name}`,account:a.account,taskMonitorConfig:{application:e,title:`Starting ${t.name}`},submitMethod:()=>Te.startServerGroup(a,e),askForReason:!0,...Fe(e)}),type:"button"},"Start"),/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",disabled:!xe(a),onClick:()=>{var n;return o.confirm({header:`Really stop ${t.name}?`,buttonText:`Stop ${t.name}`,account:a.account,body:a.disabled?void 0:`<div class="alert alert-danger"><p>Stopping this server group will scale it down to zero instances.</p><p>This server group is currently serving traffic from <b>${null==(n=a.loadBalancers)?void 0:n[0]}</b>. Traffic directed to this server group after it has been stopped will not be handled.</p></div>`,taskMonitorConfig:{application:e,title:`Stopping ${t.name}`},submitMethod:()=>Te.stopServerGroup(a,e),askForReason:!0,...Fe(e)})},type:"button"},"Stop"),/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",onClick:()=>{var n,r;return o.confirm({header:`Really enable ${t.name}?`,buttonText:`Enable ${t.name}`,account:a.account,body:`<div class="well well-sm"><p>Enabling <b>${t.name}</b> will set its traffic allocation for <b>${null==(n=a.loadBalancers)?void 0:n[0]}</b> to 100%.</p><p>If you would like more fine-grained control, edit <b>${null==(r=a.loadBalancers)?void 0:r[0]}</b> under the <b>Load Balancers</b> tab.</p></div>`,taskMonitorConfig:{application:e,title:`Enabling ${t.name}`},submitMethod:t=>Te.enableServerGroup(a,e,t),askForReason:!0,...Fe(e)})},type:"button"},"Enable"),/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",disabled:!Pe(a,n),onClick:()=>o.confirm({header:`Really disable ${t.name}?`,buttonText:`Disable ${t.name}`,account:a.account,body:Oe(a,n),taskMonitorConfig:{application:e,title:`Disabling ${t.name}`},submitMethod:t=>Te.disableServerGroup(a,e,t),askForReason:!0,...Fe(e)}),type:"button"},"Disable"),/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",disabled:!Be(a,n),onClick:()=>o.confirm({header:`Really destroy ${t.name}?`,buttonText:`Destroy ${t.name}`,account:a.account,body:Le(e,a,n),taskMonitorConfig:{application:e,title:`Destroying ${t.name}`},submitMethod:t=>Te.destroyServerGroup(a,e,t),askForReason:!0,...Fe(e)}),type:"button"},"Destroy"))},detailsGetter:function(e,t){const{app:a,serverGroup:n}=e;return new K(r=>{(function(e){const{app:t,serverGroup:a}=e;return t.ready().then(()=>{let e=t.serverGroups.data.find(e=>e.name===a.name&&e.account===a.accountId&&e.region===a.region);return e||t.loadBalancers.data.some(t=>t.account===a.accountId&&t.region===a.region&&(t.serverGroups||[]).some(t=>t.name===a.name&&(e=t,!0))),e})})(e).then(e=>{D.getServerGroup(a.name,n.accountId,n.region,n.name).then(a=>{Object.assign(a,e,{account:n.accountId}),z(a)?t():r.next(a)},t)},t)})},detailsSections:[function({serverGroup:e}){var t;const a=e;/* @__PURE__ */
|
|
27
|
+
return F.createElement("div",{className:"content-section"},/* @__PURE__ */F.createElement("div",{className:"content-section-heading"},"App Engine Details"),/* @__PURE__ */F.createElement("dl",{className:"dl-horizontal dl-narrow"},/* @__PURE__ */F.createElement("dt",null,"Account"),/* @__PURE__ */F.createElement("dd",null,a.account),/* @__PURE__ */F.createElement("dt",null,"Region"),/* @__PURE__ */F.createElement("dd",null,a.region),/* @__PURE__ */F.createElement("dt",null,"Status"),/* @__PURE__ */F.createElement("dd",null,a.servingStatus||a.status||"Unknown"),/* @__PURE__ */F.createElement("dt",null,"Environment"),/* @__PURE__ */F.createElement("dd",null,a.env||"Unknown"),/* @__PURE__ */F.createElement("dt",null,"Scaling"),/* @__PURE__ */F.createElement("dd",null,(null==(t=a.scalingPolicy)?void 0:t.type)||"Unknown")))}],CloneServerGroupModal:ke,skipUpstreamStageCheck:!0},loadBalancer:{transformer:class{normalizeLoadBalancer(e){e.provider=e.type,e.instanceCounts=this.buildInstanceCounts(e.serverGroups),e.instances=[],e.serverGroups.forEach(t=>{t.account=e.account,t.region=e.region,t.detachedInstances&&(t.detachedInstances=t.detachedInstances.map(e=>({id:e}))),t.instances=t.instances.concat(t.detachedInstances||[]).map(t=>this.transformInstance(t,e))});const t=R(e.serverGroups,{isDisabled:!1});return e.instances=M(t).map("instances").flatten().value(),Promise.resolve(e)}convertLoadBalancerForEditing(e,t){return t.getDataSource("loadBalancers").ready().then(()=>{const a=t.getDataSource("loadBalancers").data.find(t=>t.name===e.name&&(t.account===e.account||t.account===e.credentials));return a&&(e.serverGroups=U(a.serverGroups)),e})}convertLoadBalancerToUpsertDescription(e){return new X(e)}buildInstanceCounts(e){const t=M(e).map("instances").flatten().reduce((e,t)=>(q(t,"health.state")&&e[H(t.health.state)]++,e),{up:0,down:0,outOfService:0,succeeded:0,failed:0,starting:0,unknown:0}).value();return t.outOfService+=M(e).map("detachedInstances").flatten().value().length,t}transformInstance(e,t){e.provider=t.type,e.account=t.account,e.region=t.region,e.loadBalancers=[t.name];const a=e.health||{};return e.healthState=j(e,"health.state")||"OutOfService",e.health=[a],e}},useDetailsHook:function({app:e,loadBalancerParams:t,autoClose:a}){const[n,r]=O(),[i,l]=O(!0),o=async()=>{l(!0),await e.getDataSource("loadBalancers").ready();const n=e.getDataSource("loadBalancers").data.find(e=>e.name===t.name&&e.account===t.accountId);r(n),l(!1),n||a()};return L(()=>{o();const t=e.getDataSource("loadBalancers").onRefresh(o);return()=>t()},[t.name,t.accountId,t.region]),{data:n,loading:i,error:null,refetch:o}},detailsActions:function({app:e,loadBalancer:t}){/* @__PURE__ */
|
|
28
|
+
return F.createElement("div",{className:"actions"},/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",onClick:()=>Z.show({app:e,loadBalancer:t,isNew:!1}),type:"button"},"Edit"),/* @__PURE__ */F.createElement("button",{className:"btn btn-sm btn-default",disabled:!ee(t),onClick:()=>{const n={cloudProvider:t.cloudProvider,loadBalancerName:t.name,credentials:t.account};o.confirm({header:`Really delete ${t.name}?`,buttonText:`Delete ${t.name}`,body:te(t),account:t.account,taskMonitorConfig:{application:e,title:`Deleting ${t.name}`},submitMethod:()=>a.deleteLoadBalancer(n,e)})},type:"button"},"Delete"))},detailsSections:[function({loadBalancer:e}){var t,a;const n=e,r=(null==(t=n.split)?void 0:t.allocations)||{};/* @__PURE__ */
|
|
29
|
+
return F.createElement("div",{className:"content-section"},/* @__PURE__ */F.createElement("div",{className:"content-section-heading"},"Traffic Split"),/* @__PURE__ */F.createElement("dl",{className:"dl-horizontal dl-narrow"},/* @__PURE__ */F.createElement("dt",null,"Account"),/* @__PURE__ */F.createElement("dd",null,n.account||n.credentials),/* @__PURE__ */F.createElement("dt",null,"Region"),/* @__PURE__ */F.createElement("dd",null,n.region),/* @__PURE__ */F.createElement("dt",null,"Shard By"),/* @__PURE__ */F.createElement("dd",null,(null==(a=n.split)?void 0:a.shardBy)||"Unspecified")),Object.keys(r).length>0&&/* @__PURE__ */F.createElement("table",{className:"table table-condensed"},/* @__PURE__ */F.createElement("thead",null,/* @__PURE__ */F.createElement("tr",null,/* @__PURE__ */F.createElement("th",null,"Server Group"),/* @__PURE__ */F.createElement("th",null,"Allocation"))),/* @__PURE__ */F.createElement("tbody",null,Object.entries(r).map(([e,t])=>/* @__PURE__ */F.createElement("tr",{key:e},/* @__PURE__ */F.createElement("td",null,e),/* @__PURE__ */F.createElement("td",null,Math.round(1e3*t)/10,"%"))))))}],CreateLoadBalancerModal:Z},logo:{path:ae}}),I.registerProvider("appengine",["custom"]);
|
|
2
30
|
//# sourceMappingURL=index.js.map
|