<div class="clr-row" style="padding-left: 50px; padding-right: 150px;">
  <div class="clr-row flex-items-xs-between flex-items-xs-top" style="padding-left: 15px; padding-right: 15px;">
    <h3 class="header-title" id="创建部署模版">
      {{'DEPLOYMENT.CREATE_TMP' | translate}}
    </h3>
  </div>
  <div style="position: fixed;right: 0;top: 100px; width: 200px; max-height: calc(100% - 160px);overflow-y: auto;">
    <wayne-navigation container=".content-area" [node]="naviList"></wayne-navigation>
  </div>
  <form #ngForm="ngForm" style="padding-right: 30px;width: 100%">
    <section class="form-block wrap">
      <div>
        <label class="label-level1" id="发布信息">{{'TEMPLATE.RELEASE_MESSAGE' | translate}}</label>
        <div class="form-group form-group-padding">
          <label class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.RELEASE_EXPLAIN' | translate}}</label>
          <textarea name="deployment_description" [(ngModel)]="deploymentTpl.description" rows="3" style="width: 65%"
                    required>
          </textarea>
        </div>
      </div>
    </section>
    <section class="form-block wrap">
      <div>
        <label class="label-level1" id="更新策略">{{'TEMPLATE.UPDATE_STRATEGY' | translate}}</label>
        <div class="form-group form-group-padding">
          <label class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.UPDATE_WAY' | translate}}</label>
          <div class="radio-inline">
            <input type="radio" name="statefulSetStrategyType" id="statefulSetStrategyType1" value="RollingUpdate"
                   [(ngModel)]="kubeDeployment.spec.strategy.type" checked>
            <label for="statefulSetStrategyType1">{{'TEMPLATE.SCROLL_UPDATE' | translate}}</label>
          </div>
          <div class="radio-inline">
            <input type="radio" name="statefulSetStrategyType" id="statefulSetStrategyType2" value="Recreate"
                   [(ngModel)]="kubeDeployment.spec.strategy.type">
            <label for="statefulSetStrategyType2">{{'TEMPLATE.REBUILD' | translate}}</label>
          </div>
        </div>
        <div *ngIf="kubeDeployment.spec.strategy.type === 'RollingUpdate'" class="form-group form-group-padding">
          <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.SCROLL_NUM' | translate}}
            <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-lg">
              <clr-icon shape="info-circle" size="24"></clr-icon>
              <span class="tooltip-content">{{'RULE.SCROLL' | translate}}</span>
            </a>
          </label>
          <label aria-haspopup="true" role="tooltip" [class.invalid]="formValid('rollingUpdate_maxSurge')"
                 class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <input type="text" required name="rollingUpdate_maxSurge" pattern="^(100|[1-9]?\d(\.\d\d?\d?)?)%$|[0-9]$"
                   [(ngModel)]="kubeDeployment.spec.strategy.rollingUpdate.maxSurge"
                   [placeholder]="'RULE.NUMBER' | translate">
            <span class="tooltip-content">
                {{'RULE.NUMBER' | translate}}
              </span>
          </label>
          <label class="clr-col-md-3 form-group-label-override" style="color: #000">{{'TEMPLATE.MAX_LIMIT' | translate}}
            <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-lg">
              <clr-icon shape="info-circle" size="24"></clr-icon>
              <span class="tooltip-content">{{'RULE.SCROLL' | translate}}</span>
            </a>
          </label>
          <label aria-haspopup="true" role="tooltip" [class.invalid]="formValid('rollingUpdate_maxUnavailable')"
                 class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <input type="text" required name="rollingUpdate_maxUnavailable"
                   [(ngModel)]="kubeDeployment.spec.strategy.rollingUpdate.maxUnavailable"
                   [placeholder]="'RULE.NUMBER' | translate">
            <span class="tooltip-content">
                {{"RULE.NUMBER" | translate}}
          </span>
          </label>
        </div>
      </div>
    </section>
    <section *ngFor="let container of kubeDeployment.spec.template.spec.containers; let i = index"
             class="form-block wrap">
      <div>
        <label class="label-level1" [id]="i ? '容器配置' + i : '容器配置'">{{'TEMPLATE.CONTAINER_CONFIG' | translate}}
          <clr-icon (click)="onDeleteContainer(i)" shape="trash" title="删除容器" class="is-solid"></clr-icon>
        </label>
        <div class="container-box">
          <label class="label-level2" [id]="i ? '镜像配置' + i : '镜像配置'">{{'TEMPLATE.IMAGE_CONFIG' | translate}}</label>
          <div class="form-group form-group-padding">
            <label class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.CONTAINER_NAME' | translate}}</label>
            <label aria-haspopup="true" role="tooltip" [class.invalid]="containerIsInvalid(i,'container.name_')"
                   class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
              <input type="text" class="clr-col-sm-12" size="90" required name="container.name_{{i}}"
                     pattern="[a-z]([-a-z0-9]*[a-z0-9])?" [(ngModel)]="container.name"
                     [placeholder]="'RULE.CONTAINER' | translate">
              <span class="tooltip-content">
                {{'RULE.REGEXT' | translate}}[a-z]([-a-z0-9]*[a-z0-9])?
              </span>
            </label>
          </div>
          <div class="form-group form-group-padding">
            <label class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.IMAGE_ADDRESS' | translate}}</label>
            <label aria-haspopup="true" role="tooltip" [class.invalid]="containerIsInvalid(i,'container.image_')"
                   class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
              <input type="text" size="90" class="clr-col-sm-12" name="container.image_{{i}}" required
                     pattern="{{getImagePrefixReg()}}" [(ngModel)]="container.image"
                     [placeholder]="'TEMPLATE.IMAGE_ADDRESS' | translate">
              <span class="tooltip-content">
                {{'RULE.REGEXT' | translate}}{{getImagePrefixReg()}}
              </span>
            </label>
          </div>
          <div class="form-group form-group-padding">
            <label class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.MEMORY_NUM' | translate}}</label>
            <label aria-haspopup="true" [class.invalid]="!checkMemory(container.resources.limits.memory)"
                   style="padding-right: 0;margin-right: 0;padding-left: 0"
                   role="tooltip" class="clr-col-md-6 tooltip tooltip-validation tooltip-md tooltip-bottom-left">
              <input type="number" style="width:inherit" name="container.resources.limits.memory_{{i}}" required
                     [(ngModel)]="container.resources.limits.memory"
                     [placeholder]="'UNIT.MEMORY' | translate">
              <span [translate]="'RULE.MEMORY'" [translateParams]="{value: memoryLimit}" class="tooltip-content">
              </span>
            </label>
            <label class="clr-col-md-4">G&nbsp;&nbsp;&nbsp;
              <label
                style="color: red">price: {{container.resources.limits.memory * memoryUnitPrice | number:'1.2-2'}}{{'UNIT.PRICE' | translate}}</label>
            </label>
          </div>
          <div class="form-group form-group-padding">
            <label class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.CORE_NUM' | translate}}</label>
            <label aria-haspopup="true" [class.invalid]="!checkCpu(container.resources.limits.cpu)"
                   style="padding-right: 0;margin-right: 0;padding-left: 0"
                   role="tooltip" class="clr-col-md-6 tooltip tooltip-validation tooltip-md tooltip-bottom-left">
              <input type="number" name="container.resources.limits.cpu_{{i}}"
                     [(ngModel)]="container.resources.limits.cpu" style="width:inherit"
                     required [placeholder]="'UNIT.CPU' | translate">
              <span [translate]="'RULE.CPU'" translateParams="{value: cpuLimit}" class="tooltip-content">
              </span>
            </label>
            <label class="clr-col-md-4">{{'UNIT.CORE' | translate}}&nbsp;&nbsp;&nbsp;
              <label
                style="color: red">price: {{container.resources.limits.cpu * cpuUnitPrice | number:'1.2-2'}}{{'UNIT.PRICE' | translate}}</label>
            </label>
          </div>

        </div>

        <div class="container-box">
          <label class="label-level2" [id]="i ? '环境变量配置' + i : '环境变量配置'">{{'TEMPLATE.ENVIRONMENT_VAR' | translate}}
            <button (click)="onAddEnvFrom(i)" style="margin-left: 10px;" class="wayne-button primary">
              <clr-icon shape="add-text"></clr-icon>
              {{'TEMPLATE.ADD_GROUP' | translate}}</button>
            <button (click)="onAddEnv(i)" style="margin-left: 10px;" class="wayne-button primary">
              <clr-icon shape="add"></clr-icon>
              {{'TEMPLATE.ADD_ONE' | translate}}</button>
          </label>
          <div *ngFor="let envFrom of container.envFrom; let j = index">
            <div class="form-group form-group-padding">
              <label for="envFromType-{{i}}-{{j}}"
                     class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.LOAD_GROUP' | translate}}
                <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-md">
                  <clr-icon shape="info-circle" size="24"></clr-icon>
                  <span class="tooltip-content">{{'TEMPLATE.LOAD_GROUP_MESSAGE' | translate}}</span>
                </a>
              </label>
              <div class="select">
                <select id="envFromType-{{i}}-{{j}}" name="envFrom.type_{{i}}_{{j}}"
                        (change)="envFromChange($event.target.value,i,j)">
                  <option value="1" [selected]="envFrom.configMapRef">{{'TEMPLATE.LOAD_CONFIGMAP' | translate}}</option>
                  <option value="2" [selected]="envFrom.secretRef">{{'TEMPLATE.LOAD_SECRET' | translate}}</option>
                </select>
              </div>

              <clr-icon style="margin-top: 10px;margin-right: 8px" (click)="onAddEnvFrom(i)" shape="plus-circle"
                        [title]="'TEMPLATE.ADD_ENVIRONMENT' | translate" class="is-solid"></clr-icon>
              <clr-icon style="margin-top: 10px" (click)="onDeleteEnvFrom(i,j)" shape="trash"
                        [title]="'TEMPLATE.DELETE_ENVIRONMENT' | translate" class="is-solid"></clr-icon>
            </div>
            <div *ngIf="envFrom" class="form-group form-group-padding">
              <input type="text" size="40" name="envFrom.prefix_{{i}}_{{j}}" [(ngModel)]="envFrom.prefix"
                     [placeholder]="'PLACEHOLDER.ENVIRONMENT' | translate">
            </div>
            <div *ngIf="envFrom && envFrom.configMapRef" class="form-group form-group-padding">
              <input type="text" size="40" required name="envFrom.configMapRef.name_{{i}}_{{j}}"
                     [(ngModel)]="envFrom.configMapRef.name"
                     [placeholder]="'TEMPLATE.CONFIGMAP_NAME' | translate">
            </div>
            <div *ngIf="envFrom && envFrom.secretRef" class="form-group form-group-padding">
              <input type="text" size="40" required name="envFrom.secretRef.name_{{i}}_{{j}}"
                     [(ngModel)]="envFrom.secretRef.name"
                     [placeholder]="'TEMPLATE.SECRET_NAME' | translate">
            </div>

          </div>

          <div *ngFor="let env of container.env; let j = index">
            <div class="form-group form-group-padding">
              <label for="envType-{{i}}-{{j}}"
                     class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.ADD_ONE' | translate}}
                <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-md">
                  <clr-icon shape="info-circle" size="24"></clr-icon>
                  <span class="tooltip-content">{{'TEMPLATE.SUPPORT_ENVIRONMENT_MESSAGE' | translate}}</span>
                </a>
              </label>
              <div class="select">
                <select id="envType-{{i}}-{{j}}" name="env.type_{{i}}_{{j}}"
                        (change)="envChange($event.target.value,i,j)">
                  <option value="0" [selected]="env.value!=null">{{'TEMPLATE.LOAD_ENVIRONMENT' | translate}}</option>
                  <option value="1"
                          [selected]="env.valueFrom?.configMapKeyRef">{{'TEMPLATE.LOAD_CONFIGMAP' | translate}}</option>
                  <option value="2" [selected]="env.valueFrom?.secretKeyRef">{{'TEMPLATE.LOAD_SECRET' | translate}}</option>
                  <option value="3" selected>{{'OTHER' | translate}}</option>
                </select>
              </div>
              <clr-icon style="margin-top: 10px;margin-right: 8px" (click)="onAddEnv(i)" shape="plus-circle"
                        [title]="'TEMPLATE.ADD_ENVIRONMENT' | translate" class="is-solid"></clr-icon>
              <clr-icon style="margin-top: 10px" (click)="onDeleteEnv(i,j)" shape="trash"
                        [title]="'TEMPLATE.DELETE_ENVIRONMENT' | translate" class="is-solid"></clr-icon>
            </div>
            <div class="form-group form-group-padding">
              <input [(ngModel)]="env.name" required name="env.name_{{i}}_{{j}}" type="text" size="45"
                     [placeholder]="'TEMPLATE.ENVIRONMENT_NAME' | translate">
            </div>
            <div *ngIf="env.value != null" class="form-group form-group-padding">
              <input [(ngModel)]="env.value" required name="env.value_{{i}}_{{j}}" type="text" size="45"
                     [placeholder]="'TEMPLATE.ENVIRONMENT_NUM' | translate">
            </div>
            <div *ngIf="env.valueFrom && env.valueFrom.configMapKeyRef" class="form-group form-group-padding">
              <input type="text" size="40" required name="env.valueFrom.configMapKeyRef.name_{{i}}_{{j}}"
                     [(ngModel)]="env.valueFrom.configMapKeyRef.name"
                     [placeholder]="'TEMPLATE.CONFIGMAP_NAME' | translate">
              <input type="text" size="40" required name="env.valueFrom.configMapKeyRef.key_{{i}}_{{j}}"
                     [(ngModel)]="env.valueFrom.configMapKeyRef.key"
                     [placeholder]="'TEMPLATE.CONFIGMAP_KEY' | translate">
            </div>
            <div *ngIf="env.valueFrom && env.valueFrom.secretKeyRef" class="form-group form-group-padding">
              <input type="text" size="40" required name="env.valueFrom.secretKeyRef.name_{{i}}_{{j}}"
                     [(ngModel)]="env.valueFrom.secretKeyRef.name"
                     [placeholder]="'TEMPLATE.SECRET_NAME' | translate">
              <input type="text" size="40" required name="env.valueFrom.secretKeyRef.key_{{i}}_{{j}}"
                     [(ngModel)]="env.valueFrom.secretKeyRef.key"
                     [placeholder]="'TEMPLATE.SECRET_KEY' | translate">
            </div>
          </div>
        </div>

        <div class="container-box">
          <div class="toggle-switch">
            <input type="checkbox" [checked]="container.readinessProbe" (change)="readinessProbeChange(i)"
                   id="readinessProbe{{i}}">
            <label class="label-level2" [id]="i ? '可用性检查' + i : '可用性检查'"
                   for="readinessProbe{{i}}">{{'TEMPLATE.USABLE_CHECK' | translate}}
              <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-lg">
                <clr-icon shape="info-circle" size="24"></clr-icon>
                <span class="tooltip-content">{{'TEMPLATE.USABLE_MESSAGE' | translate}}</span>
              </a>
            </label>
          </div>

          <div *ngIf="container.readinessProbe" style="color:#000">
            <div class="form-group form-group-padding">
              <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.EXTEND_TIME' | translate}}
                <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm">
                  <clr-icon shape="info-circle" size="24"></clr-icon>
                  <span class="tooltip-content">{{'TEMPLATE.EXTEND_TIME_MESSAGE' | translate}}</span>
                </a>
              </label>
              <input type="number" required name="container.readinessProbe.timeoutSeconds_{{i}}"
                     [(ngModel)]="container.readinessProbe.timeoutSeconds"
                     [placeholder]="'PLACEHOLDER.SECOND' | translate">
              <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.CHECK_CYCLE' | translate}}
                <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm">
                  <clr-icon shape="info-circle" size="24"></clr-icon>
                  <span class="tooltip-content">{{'TEMPLATE.CHECK_CYCLE_MESSAGE' | translate}}</span>
                </a>
              </label>
              <input type="number" required name="container.readinessProbe.periodSeconds{{i}}"
                     [(ngModel)]="container.readinessProbe.periodSeconds"
                     [placeholder]="'PLACEHOLDER.SECOND' | translate">
            </div>
            <div class="form-group form-group-padding">
              <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.FAIL_NUM' | translate}}</label>
              <input type="number" required name="container.readinessProbe.failureThreshold{{i}}"
                     [(ngModel)]="container.readinessProbe.failureThreshold">
            </div>

            <div class="form-group form-group-padding">
              <label for="readinessProbeType_{{i}}"
                     class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.USABLE_CHECK_WAY' | translate}}</label>
              <div class="select">
                <select name="readinessProbeType_{{i}}" (change)="readinessProbeTypeChange($event.target.value,i)">
                  <option value="0"
                          [selected]="container.readinessProbe.httpGet">{{'TEMPLATE.HTTP_REQUEST' | translate}}</option>
                  <option value="1"
                          [selected]="container.readinessProbe.tcpSocket">{{'TEMPLATE.TCP_PORT' | translate}}</option>
                  <option value="2"
                          [selected]="container.readinessProbe.exec">{{'TEMPLATE.EXECUTE_COMMAND' | translate}}</option>
                </select>
              </div>
            </div>
            <div *ngIf="container.readinessProbe.httpGet" class="form-group form-group-padding">
              <input type="number" size="30" required name="container.readinessProbe.httpGet.port_{{i}}"
                     [(ngModel)]="container.readinessProbe.httpGet.port"
                     [placeholder]="'TEMPLATE.REQUEST_HTTP_PORT' | translate">
              <input type="text" size="70" required name="container.readinessProbe.httpGet.path_{{i}}"
                     [(ngModel)]="container.readinessProbe.httpGet.path"
                     [placeholder]="'TEMPLATE.REQUEST_URL' | translate">
            </div>
            <div *ngIf="container.readinessProbe.tcpSocket" class="form-group form-group-padding">
              <input type="number" size="30" required name="container.readinessProbe.tcpSocket.port_{{i}}"
                     [(ngModel)]="container.readinessProbe.tcpSocket.port"
                     [placeholder]="'TEMPLATE.REQUEST_TCP_PORT' | translate">
            </div>
            <div *ngIf="container.readinessProbe.exec">
              <div class="form-group form-group-padding">
                <textarea name="container.readinessProbe.exec.command_{{i}}"
                          [(ngModel)]="container.readinessProbe.exec.command[0]"
                          [placeholder]="'PLACEHOLDER.CMOMAND' | translate"></textarea>
              </div>


            </div>
          </div>
        </div>

        <div class="container-box">
          <div class="toggle-switch">
            <input type="checkbox" [checked]="container.livenessProbe" (change)="livenessProbeChange(i)"
                   id="livenessProbe{{i}}">
            <label class="label-level2" [id]="i ? '存活检查' + i : '存活检查'"
                   for="livenessProbe{{i}}">{{'TEMPLATE.LIVE_CHECK' | translate}}
              <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-lg">
                <clr-icon shape="info-circle" size="24"></clr-icon>
                <span class="tooltip-content">{{'TEMPLATE.LIVE_CHECK_MESSAGE' | translate}}</span>
              </a>
            </label>
          </div>

          <div *ngIf="container.livenessProbe" style="color:#000">
            <div class="form-group form-group-padding">
              <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.EXTEND_TIME' | translate}}
                <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm">
                  <clr-icon shape="info-circle" size="24"></clr-icon>
                  <span class="tooltip-content">{{'MESSAGE_EXTEND_TIME' | translate}}</span>
                </a>
              </label>
              <input type="number" required name="container.livenessProbe.timeoutSeconds_{{i}}"
                     [(ngModel)]="container.livenessProbe.timeoutSeconds"
                     [placeholder]="'PLACEHOLDER.SECOND' | translate">
              <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.CHECK_CYCLE' | translate}}
                <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm">
                  <clr-icon shape="info-circle" size="24"></clr-icon>
                  <span class="tooltip-content">{{'TEMPLATE.CHECK_CYCLE_MESSAGE' | translate}}</span>
                </a>
              </label>
              <input type="number" required name="container.livenessProbe.periodSeconds{{i}}"
                     [(ngModel)]="container.livenessProbe.periodSeconds"
                     [placeholder]="'PLACEHOLDER.SECOND' | translate">
            </div>
            <div class="form-group form-group-padding">
              <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.FAIL_NUM' | translate}}</label>
              <input type="number" required name="container.livenessProbe.failureThreshold{{i}}"
                     [(ngModel)]="container.livenessProbe.failureThreshold">
              <label class="clr-col-md-3 form-group-label-override">{{'TEMPLATE.CHECK_DELAY' | translate}}
                <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-md">
                  <clr-icon shape="info-circle" size="24"></clr-icon>
                  <span class="tooltip-content">{{'TEMPLATE.CHECK_DELAY_MESSAGE' | translate}}</span>
                </a>
              </label>
              <input type="number" required name="container.livenessProbe.initialDelaySeconds{{i}}"
                     [(ngModel)]="container.livenessProbe.initialDelaySeconds"
                     [placeholder]="'PLACEHOLDER.SECOND' | translate">
            </div>

            <div class="form-group form-group-padding">
              <label for="livenessProbeType_{{i}}"
                     class="clr-col-md-3 form-group-label-override required">{{'TEMPLATE.USABLE_CHECK_WAY' | translate}}</label>
              <div class="select">
                <select name="livenessProbeType_{{i}}" (change)="livenessProbeTypeChange($event.target.value,i)">
                  <option value="0"
                          [selected]="container.livenessProbe.httpGet">{{'TEMPLATE.HTTP_REQUEST' | translate}}</option>
                  <option value="1"
                          [selected]="container.livenessProbe.tcpSocket">{{'TEMPLATE.TCP_PORT' | translate}}</option>
                  <option value="2"
                          [selected]="container.livenessProbe.exec">{{'TEMPLATE.EXECUTE_COMMAND' | translate}}</option>
                </select>
              </div>
            </div>
            <div *ngIf="container.livenessProbe.httpGet" class="form-group form-group-padding">
              <input type="number" size="30" required name="container.livenessProbe.httpGet.port_{{i}}"
                     [(ngModel)]="container.livenessProbe.httpGet.port"
                     [placeholder]="'TEMPLATE.REQUEST_HTTP_PORT' | translate">
              <input type="text" size="70" required name="container.livenessProbe.httpGet.path_{{i}}"
                     [(ngModel)]="container.livenessProbe.httpGet.path"
                     [placeholder]="'TEMPLATE.REQUEST_URL' | translate">
            </div>
            <div *ngIf="container.livenessProbe.tcpSocket" class="form-group form-group-padding">
              <input type="number" size="30" required name="container.livenessProbe.tcpSocket.port_{{i}}"
                     [(ngModel)]="container.livenessProbe.tcpSocket.port"
                     [placeholder]="'TEMPLATE.REQUEST_TCP_PORT' | translate">
            </div>
            <div *ngIf="container.livenessProbe.exec">
              <div class="form-group form-group-padding">
                <textarea name="container.livenessProbe.exec.command_{{i}}"
                          [(ngModel)]="container.livenessProbe.exec.command[0]"
                          [placeholder]="'PLACEHOLDER.COMMAND' | translate"></textarea>
              </div>


            </div>
          </div>
        </div>
        <div class="container-box">
          <div class="toggle-switch">
            <input type="checkbox" [checked]="container.lifecycle" id="lifecycle{{i}}" (change)="lifecycleChange(i)">
            <label class="label-level2" [id]="i ? '生命周期' + i : '生命周期'"
                   for="lifecycle{{i}}">{{'TEMPLATE.LIFE_CYCLE' | translate}}
              <a role="tooltip" aria-haspopup="true" class="tooltip tooltip-lg">
                <clr-icon shape="info-circle" size="24"></clr-icon>
                <span class="tooltip-content">{{'TEMPLATE.LIFE_CYCLE_MESSAGE' | translate}}</span>
              </a>
            </label>
          </div>

          <div *ngIf="container.lifecycle" style="color:#000">
            <div class="form-group form-group-padding">
              <label for="lifecycleType_{{i}}" class="clr-col-md-3 form-group-label-override required">postStart</label>
              <div class="select">
                <select name="lifecycleType_{{i}}" (change)="lifecyclePostStartProbeTypeChange($event.target.value,i)">
                  <option value="-1" [selected]="!container.lifecycle.postStart">{{'TEMPLATE.NOT_USE' | translate}}</option>
                  <option value="0"
                          [selected]="container.lifecycle.postStart && container.lifecycle.postStart.httpGet">{{'TEMPLATE.HTTP_REQUEST' | translate}}</option>
                  <option value="1"
                          [selected]="container.lifecycle.postStart && container.lifecycle.postStart.tcpSocket">{{'TEMPLATE.TCP_PORT' | translate}}</option>
                  <option value="2"
                          [selected]="container.lifecycle.postStart && container.lifecycle.postStart.exec">{{'TEMPLATE.EXECUTE_COMMAND' | translate}}</option>
                </select>
              </div>
            </div>
            <div *ngIf="container.lifecycle.postStart && container.lifecycle.postStart.httpGet"
                 class="form-group form-group-padding">
              <input type="number" size="30" required name="container.lifecycle.postStart.httpGet.port_{{i}}"
                     [(ngModel)]="container.lifecycle.postStart.httpGet.port"
                     [placeholder]="'TEMPLATE.REQUEST_HTTP_PORT' | translate">
              <input type="text" size="70" required name="container.lifecycle.postStart.httpGet.path_{{i}}"
                     [(ngModel)]="container.lifecycle.postStart.httpGet.path"
                     [placeholder]="'TEMPLATE.REQUEST_URL' | translate">
            </div>
            <div *ngIf="container.lifecycle.postStart && container.lifecycle.postStart.tcpSocket"
                 class="form-group form-group-padding">
              <input type="number" size="30" required name="container.lifecycle.postStart.tcpSocket.port_{{i}}"
                     [(ngModel)]="container.lifecycle.postStart.tcpSocket.port"
                     [placeholder]="'TEMPLATE.REQUEST_TCP_PORT' | translate">
            </div>
            <div *ngIf="container.lifecycle.postStart && container.lifecycle.postStart.exec">
              <div class="form-group form-group-padding">
                <textarea name="container.lifecycle.postStart.exec.command_{{i}}"
                          [(ngModel)]="container.lifecycle.postStart.exec.command[0]"
                          [placeholder]="'PLACEHOLDER.COMMAND' | translate"></textarea>
              </div>
            </div>
          </div>
          <div *ngIf="container.lifecycle" style="color:#000">
            <div class="form-group form-group-padding">
              <label for="lifecycleType_{{i}}" class="clr-col-md-3 form-group-label-override required">preStop</label>
              <div class="select">
                <select name="lifecycleType_{{i}}" (change)="lifecyclePreStopProbeTypeChange($event.target.value,i)">
                  <option value="-1" [selected]="!container.lifecycle.preStop">{{'TEMPLATE.NOT_USE' | translate}}</option>
                  <option value="0"
                          [selected]="container.lifecycle.preStop && container.lifecycle.preStop.httpGet">{{'TEMPLATE.HTTP_REQUEST' | translate}}</option>
                  <option value="1"
                          [selected]="container.lifecycle.preStop && container.lifecycle.preStop.tcpSocket">{{'TEMPLATE.TCP_PORT' | translate}}</option>
                  <option value="2"
                          [selected]="container.lifecycle.preStop && normalPreStopExecSelected(i)">{{'TEMPLATE.EXECUTE_COMMAND' | translate}}</option>
                  <option value="3"
                          [selected]="container.lifecycle.preStop && safeExitSelected(i)">{{'TEMPLATE.SAFE_QUIT' | translate}}</option>
                </select>
              </div>
            </div>
            <div *ngIf="container.lifecycle.preStop && container.lifecycle.preStop.httpGet"
                 class="form-group form-group-padding">
              <input type="number" size="30" required name="container.lifecycle.preStop.httpGet.port_{{i}}"
                     [(ngModel)]="container.lifecycle.preStop.httpGet.port"
                     [placeholder]="'TEMPLATE.REQUEST_HTTP_PORT' | translate">
              <input type="text" size="70" required name="container.lifecycle.preStop.httpGet.path_{{i}}"
                     [(ngModel)]="container.lifecycle.preStop.httpGet.path"
                     [placeholder]="'TEMPLATE.REQUEST_URL' | translate">
            </div>
            <div *ngIf="container.lifecycle.preStop && container.lifecycle.preStop.tcpSocket"
                 class="form-group form-group-padding">
              <input type="number" size="30" required name="container.lifecycle.preStop.tcpSocket.port_{{i}}"
                     [(ngModel)]="container.lifecycle.preStop.tcpSocket.port"
                     [placeholder]="'TEMPLATE.REQUEST_TCP_PORT' | translate">
            </div>
            <div *ngIf="container.lifecycle.preStop && normalPreStopExecSelected(i)">
              <div class="form-group form-group-padding">
                <textarea name="container.lifecycle.preStop.exec.command_{{i}}"
                          [(ngModel)]="container.lifecycle.preStop.exec.command[0]"
                          [placeholder]="'PLACEHOLDER.COMMAND' | translate"></textarea>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </form>
</div>
<div class="clr-wizard-footer-buttons tpl-bottom" [style.top.px]="top">
  <button type="button" class="btn btn-outline" (click)="onCancel()">{{'BUTTON.CANCEL' | translate}}</button>
  <button type="button" class="btn btn-primary"
          (click)="onAddContainer()">{{'BUTTON.ADD_CONTAINER' | translate}}</button>
  <button type="button" class="btn btn-primary" (click)="openModal()">{{'BUTTON.ADVANCED_CONFIG' | translate}}</button>
  <button type="button" class="btn btn-primary" [disabled]="!isValid"
          (click)="onSubmit()">{{'BUTTON.SUBMIT' | translate}}</button>
  <span
    style="color: red">{{'TEMPLATE.PRICE_TOTAL' | translate}}{{totalFee | number:'1.2-2' }}{{'UNIT.PRICE' | translate}}</span>
</div>
<wayne-ace-editor (outputObj)="saveDeployment($event)"></wayne-ace-editor>
