ui/lib/shared/addon/components/container/new-edit/template.hbs

227 lines
6.2 KiB
Handlebars

<section class="header clearfix">
<h1>{{header}}</h1>
</section>
<div class="row">
<div class="col span-11-of-23 mt-0 mb-0">
{{form-name-description
name=name
nameDisabled=isUpgrade
nameRequired=true
bothColClass="col span-12 mt-0"
colClass="col span-12 mt-0"
description=description
namePlaceholder="newContainer.name.placeholder"
descriptionPlaceholder="newContainer.description.placeholder"
}}
</div>
<div class="col span-11-of-23 mt-0 mb-0 offset-1-of-23">
{{container/form-scale
initialScale=scale
isGlobal=isGlobal
launchConfigIndex=launchConfigIndex
workload=service
isUpgrade=isUpgrade
errors=scaleErrors
scaleMode=scaleMode
setScale=(action (mut scale))
}}
</div>
</div>
<hr class="mt-30 mb-30" />
<div class="row">
<div class="col span-11-of-23 mt-0 mb-0">
{{container/form-image
initialValue=launchConfig.image
errors=imageErrors
changed=(action 'setImage')
}}
</div>
<div class="col span-11-of-23 mt-0 mb-0 offset-1-of-23">
{{#if (or isSidekick isUpgrade)}}
{{!-- Only a new primary service or container picks stack --}}
{{else}}
{{form-namespace
namespace=namespace
errors=namespaceErrors
}}
{{/if}}
</div>
</div>
<hr class="mt-30 mb-30" />
<div class="row">
{{container/form-ports
initialPorts=launchConfig.ports
changed=(action (mut launchConfig.ports))
errors=portErrors
editing=true
}}
</div>
<hr class="mt-30 mb-30" />
<div class="row">
{{form-key-value
initialMap=launchConfig.environment
changed=(action (mut launchConfig.environment))
allowEmptyValue=true
editing=true
header=(t 'newContainer.environment.label')
addActionLabel="newContainer.environment.addAction"
keyLabel="newContainer.environment.keyLabel"
keyPlaceholder="newContainer.environment.keyPlaceholder"
valueLabel="newContainer.environment.valueLabel"
valuePlaceholder="newContainer.environment.valuePlaceholder"
}}
</div>
<hr class="mt-30 mb-30" />
{{#accordion-list as | al expandFn | }}
{{#unless isSidekick}}
{{container/form-scheduling
isGlobal=isGlobal
initialHostId=service.scheduling.node.nodeId
service=service
scheduling=service.scheduling
errors=schedulingErrors
editing=true
expandAll=null
setLabels=(action 'setLabels' 'scheduling')
setRequestedHost=(action 'setRequestedHostId')
expandAll=al.expandAll
expandFn=expandFn
}}
{{/unless}}
{{#accordion-list-item
title=(t 'formHealthCheck.title')
detail=(t 'formHealthCheck.detail' appName=settings.appName)
status=status
statusClass=statusClass
expandAll=al.expandAll
expand=(action expandFn)
}}
<div class="row">
<div class="col span-6 mt-0 mb-0">
<label class="acc-label">{{t 'formHealthCheck.readiness'}}</label>
</div>
<div class="col span-6 mt-0 mb-0">
{{#if separateLivenessCheck}}
<label class="acc-label">{{t 'formHealthCheck.liveness'}}</label>
<div class="pull-right text-small">
<button class="btn bg-transparent p-0" {{action "toggleSeparateLivenessCheck"}}>{{t 'formHealthCheck.combinedLivenessCheck'}}</button>
</div>
{{else}}
<div class="pull-right text-small">
<button class="btn bg-transparent p-0" {{action "toggleSeparateLivenessCheck"}}>{{t 'formHealthCheck.separateLivenessCheck'}}</button>
</div>
{{/if}}
</div>
</div>
<div class="row">
<div class="col {{if separateLivenessCheck 'span-6' 'span-12'}}">
{{form-healthcheck
initialCheck=launchConfig.readinessProbe
changed=(action (mut launchConfig.readinessProbe))
errors=readyCheckErrors
editing=true
}}
</div>
{{#if separateLivenessCheck}}
<div class="col span-6">
{{form-healthcheck
initialCheck=launchConfig.livenessProbe
changed=(action (mut launchConfig.livenessProbe))
errors=liveCheckErrors
editing=true
successMustBeOne=true
}}
</div>
{{/if}}
</div>
{{/accordion-list-item}}
{{#if (not isSidekick)}}
{{container/form-upgrade
workload=service
scaleMode=scaleMode
editing=true
isUpgrade=isUpgrade
expandAll=al.expandAll
expandFn=expandFn
}}
{{/if}}
{{#advanced-section advanced=false}}
{{container/form-volumes
isSidekick=isSidekick
launchConfig=launchConfig
workload=service
stack=stack
errors=volumeErrors
volumesToCreate=volumesToCreate
expandAll=al.expandAll
expandFn=expandFn
}}
{{container/form-command
classNames="accordion-wrapper"
instance=launchConfig
errors=commandErrors
service=service
expandAll=al.expandAll
expandFn=expandFn
}}
{{container/form-networking
classNames="accordion-wrapper"
instance=launchConfig
errors=networkingErrors
service=service
editing=true
expandAll=al.expandAll
expandFn=expandFn
}}
{{form-user-labels
classNames="accordion-wrapper"
errors=labelErrors
initialLabels=service.labels
setLabels=(action 'setLabels' 'user')
expandAll=al.expandAll
expandFn=expandFn
}}
{{form-annotations
classNames="accordion-wrapper"
model=service
errors=annotationErrors
expandAll=al.expandAll
expandFn=expandFn
}}
{{container/form-secrets
classNames="accordion-wrapper"
secrets=launchConfig.secrets
errors=secretErrors
editing=true
expandAll=al.expandAll
expandFn=expandFn
}}
{{container/form-security
instance=launchConfig
service=service
errors=securityErrors
editing=true
expandAll=al.expandAll
expandFn=expandFn
}}
{{/advanced-section}}
{{/accordion-list}}
{{top-errors errors=errors}}
{{save-cancel createLabel=(if isUpgrade 'newContainer.saveUpgrade' 'newContainer.saveNew') save="save" cancel="cancel"}}