ui/lib/shared/addon/components/cluster-driver/driver-aliyunkcs/template.hbs

367 lines
12 KiB
Handlebars

{{#accordion-list showExpandAll=false as | al expandFn |}}
{{#accordion-list-item title=(t "clusterNew.aliyunkcs.access.title")
detail=(t "clusterNew.aliyunkcs.access.detail")
expandAll=expandAll
expand=(action expandFn)
expandOnInit=true
}}
<div class="row">
<div class="col span-4">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.regionId.label"}}
</label>
{{#input-or-display
editable=(and isNew (eq step 1))
value=config.regionId
}}
{{searchable-select
class="form-control"
content=regionChoices
value=config.regionId
}}
{{/input-or-display}}
</div>
<div class="col span-4">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.accessKeyId.label"}}{{field-required}}
</label>
{{#if (eq step 1)}}
{{input type="text"
name="username"
classNames="form-control"
placeholder=(t "clusterNew.aliyunkcs.accessKeyId.placeholder")
value=config.accessKeyId
}}
{{else}}
<div>{{config.accessKeyId}}</div>
{{/if}}
</div>
<div class="col span-4">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.accessKeySecret.label"}}{{field-required}}
</label>
{{#if (eq step 1)}}
{{input
type="password"
name="password"
classNames="form-control"
placeholder=(t "clusterNew.aliyunkcs.accessKeySecret.placeholder")
value=config.accessKeySecret
}}
{{else}}
<div class="text-muted text-italic">
{{t "clusterNew.aliyunkcs.accessKeySecret.provided"}}
</div>
{{/if}}
</div>
</div>
{{/accordion-list-item}}
{{#if (eq step 1)}}
{{save-cancel editing=(eq mode "edit")
save=(action "aliyunLogin")
cancel=close
createLabel="clusterNew.aliyunkcs.access.next"
savingLabel="clusterNew.aliyunkcs.access.loading"
}}
{{/if}}
{{#if (gte step 2)}}
{{#accordion-list-item title=(t "clusterNew.aliyunkcs.cluster.title")
detail=(t "clusterNew.aliyunkcs.cluster.detail")
showExpand=false
expandOnInit=true
expandAll=al.expandAll
expand=(action expandFn)
}}
<div class="row">
<div class="col span-4">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.clusters.label"}}{{field-required}}
</label>
{{#if (and (eq step 2) isNew)}}
{{searchable-select class="form-control"
content=clusterTypeChoices
value=config.clusterType
localizedLabel=true
}}
{{else}}
<div>{{config.clusterType}}</div>
{{/if}}
</div>
<div class="col span-4">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.version.label"}}
</label>
{{#if (and (eq step 2) (eq config.clusterType "Kubernetes"))}}
{{searchable-select
allowCustom=true
value=config.kubernetesVersion
content=versionChoices
}}
{{else if (and (eq step 2) (eq config.clusterType "ManagedKubernetes"))}}
{{searchable-select
allowCustom=true
value=config.kubernetesVersion
content=managedVersionChoices
}}
{{else if config.kubernetesVersion}}
<div>{{config.kubernetesVersion}}</div>
{{else}}
<div>{{t "generic.default"}}</div>
{{/if}}
</div>
<div class="col span-4">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.zoneId.label"}}{{field-required}}
</label>
{{#if (and (eq step 2) isNew)}}
{{searchable-select class="form-control"
content=zoneChoices
value=config.zoneId
}}
{{else}}
<div>{{selectedZone.label}}</div>
{{/if}}
</div>
</div>
{{/accordion-list-item}}
{{#if (and (eq step 2) (eq config.clusterType "Kubernetes"))}}
{{save-cancel editing=(eq mode "edit")
save=(action "configMaster")
cancel=close
createLabel="clusterNew.aliyunkcs.cluster.next"
savingLabel="clusterNew.aliyunkcs.cluster.loading"
}}
{{else if (and (eq step 2) (eq config.clusterType "ManagedKubernetes"))}}
{{save-cancel editing=(eq mode "edit")
save=(action "configWorker")
cancel=close
createLabel="clusterNew.aliyunkcs.master.next"
savingLabel="clusterNew.aliyunkcs.master.loading"
}}
{{/if}}
{{/if}}
{{#if (and (gte step 3) (eq config.clusterType "Kubernetes"))}}
{{#accordion-list-item title=(t "clusterNew.aliyunkcs.master.title")
detail=(t "clusterNew.aliyunkcs.master.detail")
showExpand=false
expandOnInit=true
expandAll=al.expandAll
expand=(action expandFn)
}}
<div class="row">
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.instanceType.label"}}{{field-required}}
</label>
{{#if (and (eq step 3) isNew)}}
{{searchable-select class="form-control"
content=instanceChoices
value=config.masterInstanceType
}}
{{else}}
<div>{{config.masterInstanceType}}</div>
{{/if}}
</div>
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.masterNum.label"}}
</label>
<div>3</div>
</div>
</div>
<div class="row">
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.rootType.label"}}
</label>
{{#if (and (eq step 3) isNew)}}
{{searchable-select class="form-control"
content=diskChoices
localizedLabel=true
value=config.masterSystemDiskCategory
}}
{{else}}
<div>{{config.masterSystemDiskCategory}}</div>
{{/if}}
</div>
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.rootSize.label"}}
</label>
{{#if (and (eq step 3) isNew)}}
<div class="input-group">
{{input-integer
min=40
max=500
value=config.masterSystemDiskSize
classNames="form-control"
placeholder=(t "clusterNew.aliyunkcs.rootSize.placeholder")
}}
<span class="input-group-addon bg-default">
{{t "generic.gigabyte"}}
</span>
</div>
{{else}}
<div>{{config.masterSystemDiskSize}} {{t "generic.gigabyte"}}</div>
{{/if}}
</div>
</div>
{{/accordion-list-item}}
{{#if (eq step 3)}}
{{save-cancel editing=(eq mode "edit")
save=(action "configWorker")
cancel=close
createLabel="clusterNew.aliyunkcs.master.next"
savingLabel="clusterNew.aliyunkcs.master.loading"
}}
{{/if}}
{{/if}}
{{#if (gte step 4)}}
{{#accordion-list-item title=(t "clusterNew.aliyunkcs.worker.title")
detail=(t "clusterNew.aliyunkcs.worker.detail")
showExpand=false
expandOnInit=true
expandAll=al.expandAll
expand=(action expandFn)
}}
<div class="row">
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.instanceType.label"}}{{field-required}}
</label>
{{#if (and (eq step 4) isNew)}}
{{searchable-select class="form-control"
content=instanceChoices
value=config.workerInstanceType
}}
{{else}}
<div>{{config.workerInstanceType}}</div>
{{/if}}
</div>
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.numOfNodes.label"}}
</label>
{{#if (eq step 4)}}
{{input-integer
min=minNumOfNodes
max=300
value=config.numOfNodes
classNames="form-control"
placeholder=(t "clusterNew.aliyunkcs.numOfNodes.placeholder")
}}
<p class="help-block">
{{t "clusterNew.aliyunkcs.numOfNodes.help"}}
</p>
{{else}}
<div>{{config.numOfNodes}}</div>
{{/if}}
</div>
</div>
<div class="row">
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.rootType.label"}}
</label>
{{#input-or-display
editable=isNew
value=config.workerSystemDiskCategory
}}
{{searchable-select
class="form-control"
content=diskChoices
localizedLabel=true
value=config.workerSystemDiskCategory
}}
{{/input-or-display}}
</div>
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.rootSize.label"}}
</label>
{{#if isNew}}
<div class="input-group">
{{input-integer
min=40
max=500
value=config.workerSystemDiskSize
classNames="form-control"
placeholder=(t "clusterNew.aliyunkcs.rootSize.placeholder")
}}
<span class="input-group-addon bg-default">
{{t "generic.gigabyte"}}
</span>
</div>
{{else}}
<div>{{config.workerSystemDiskSize}} {{t "generic.gigabyte"}}</div>
{{/if}}
</div>
</div>
<div class="row">
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.storageType.label"}}
</label>
{{#input-or-display
editable=isNew
value=config.workerSystemDiskCategory
}}
{{searchable-select
class="form-control"
content=diskChoices
localizedLabel=true
value=config.workerDataDiskCategory
}}
{{/input-or-display}}
</div>
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.storageSize.label"}}
</label>
{{#if isNew}}
<div class="input-group">
{{input-integer
min=40
max=32768
value=config.workerDataDiskSize
classNames="form-control"
placeholder=(t "clusterNew.aliyunkcs.rootSize.placeholder")
}}
<span class="input-group-addon bg-default">
{{t "generic.gigabyte"}}
</span>
</div>
{{else}}
<div>{{config.workerDataDiskSize}} {{t "generic.gigabyte"}}</div>
{{/if}}
</div>
</div>
<div class="row">
<div class="col span-6">
<label class="acc-label">
{{t "clusterNew.aliyunkcs.keyPair.label"}}{{field-required}}
</label>
{{#input-or-display
editable=isNew
value=config.keyPair
}}
{{searchable-select
class="form-control"
content=keyChoices
value=config.keyPair
}}
{{/input-or-display}}
</div>
</div>
{{/accordion-list-item}}
{{#if (eq step 4)}}
{{save-cancel editing=(eq mode "edit")
save=(action "save")
cancel=close
}}
{{/if}}
{{/if}}
{{top-errors errors=errors}}
{{top-errors errors=otherErrors}}
{{top-errors errors=clusterErrors}}
{{/accordion-list}}