<button (click)="createCronjob()" class="wayne-button primary"
        *ngIf="authService.currentAppPermission.cronjob.create || authService.currentUser.admin">
  {{'CRONJOB.CREATE' | translate}}
</button>
<create-edit-cronjob (create)="create($event)"></create-edit-cronjob>
<div *ngIf="cronjobId && cronjobs?.length>0">
  <wayne-tabs>
    <wayne-tab (click)="tabClick(cronjob.id, cronjob.name)"
               [id]="cronjob.id"
               *ngFor="let cronjob of cronjobs"
               [active]="cronjob.id==cronjobId"
               [description]="cronjob.description"
    >
      {{cronjob.name}}
    </wayne-tab>
  </wayne-tabs>
  <div class="table-search">
    <div class="table-search-left">
      <button (click)="createCronjobTpl()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.cronjob.create || authService.currentUser.admin">
        {{'CRONJOB.CREATE_TMP' | translate}}
      </button>
      <button (click)="editCronjob()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.cronjob.update || authService.currentUser.admin">
        {{'CRONJOB.EDIT' | translate}}
      </button>
      <button (click)="publishHistory()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.cronjob.read || authService.currentUser.admin">
        {{'BUTTON.HISTORY' | translate}}
      </button>
      <button (click)="deleteCronjob()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.cronjob.offline || authService.currentUser.admin">
        {{'CRONJOB.DELETE' | translate}}
      </button>
      <button class="wayne-button normal" (click)="diffTpl()">{{'BUTTON.COMPARE_TEMPLATES' | translate}}</button>
      <wayne-filter-box (confirm)="confirmEvent()" (cancel)="cancelEvent()">
        <wayne-checkbox-group [(ngModel)]="showList">
          <wayne-checkbox value="create_time">{{'TITLE.CREATE_TIME' | translate}}</wayne-checkbox>
          <wayne-checkbox value="version">{{'TITLE.VERSION' | translate}}</wayne-checkbox>
          <wayne-checkbox value="online_cluster">{{'TITLE.ONLINE_CLUSTER' | translate}}</wayne-checkbox>
          <wayne-checkbox value="scheduling_interval">{{'TITLE.SCHEDULING_INTERVAL' | translate}}</wayne-checkbox>
          <wayne-checkbox value="release_explain">{{'TITLE.RELEASE_EXPLAIN' | translate}}</wayne-checkbox>
          <wayne-checkbox value="create_user">{{'TITLE.CREATE_USER' | translate}}</wayne-checkbox>
          <wayne-checkbox value="action">{{'TITLE.ACTION' | translate}}</wayne-checkbox>
        </wayne-checkbox-group>
      </wayne-filter-box>
    </div>
    <div class="table-search-right">
      <div class="toggle-switch">
        <input type="checkbox" id="toggle_1" [(ngModel)]="isOnline" (change)="onlineChange()">
        <label for="toggle_1">{{'MESSAGE.ONLY_ONLINE_TEMPLATE' | translate}}</label>
      </div>
    </div>
  </div>
  <list-cronjob [cronjobTpls]="changedCronjobTpls"
                (paginate)="retrieve($event)"
                (edit)="editCronjob($event)"
                (createTpl)="createCronjobTpl($event)"
                (cloneTpl)="cloneCronjobTpl($event)"
                [appId]="appId"
                [showState]="showState"
                [page]="pageState.page"></list-cronjob>
</div>
<div *ngIf="cronjobName && cronjobs?.length">
  <div class="clr-row flex-items-xs-between flex-items-xs-top" style="padding-left: 15px; padding-right: 15px;">
    <h2 class="header-title">{{'CRONJOB.JOB' | translate}}</h2>
  </div>
  <list-job [jobs]="changedJobs"
            [currentCronjobName]="cronjobName"
            (paginate)="retrieveJob($event)"
            [page]="jobPageState.page"
  ></list-job>
</div>
