<div nz-row class="breadcrumbs" >
  <div nz-col nzSpan="16">
    <nz-breadcrumb class="padding-8-0">
      <nz-breadcrumb-item>
        首页
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        <a>告警管理</a>
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        发送方式设置
      </nz-breadcrumb-item>
    </nz-breadcrumb>
  </div>
  <div nz-col nzSpan="8" class="text-right">
    <button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
    <smart-full-screen></smart-full-screen>
  </div>
</div>
<div nz-row class="search-form" style="border-top: none;padding: 0 0 15px 0;">
  <button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>新增发送方式</button>
</div>

<nz-table #nzTable [nzData]="sendList" [nzLoading]="isLoading">
  <thead>
  <tr>
    <th nzShowSort>名称</th>
    <th>类型</th>
    <th>用于告警推送</th>
    <th>状态</th>
    <th nzWidth="25%">细节</th>
    <th style="text-align: center">操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of sendList">
    <td class="round-tag tag-form">
      {{data.description}}
    </td>
    <td>
      <span *ngIf="data.type == 0">邮件</span>
      <span *ngIf="data.type == 1">脚本</span>
      <span *ngIf="data.type == 2">SMS</span>
      <span *ngIf="data.type == 3">Jabber</span>
      <span *ngIf="data.type == 100">EZ texting</span>
    </td>
    <td>用于告警中</td>
    <td>
      <span class="color-green"  *ngIf="data.status == 0">启用</span>
      <span class="color-red"  *ngIf="data.status == 1">暂停</span>
    </td>
    <td>
      <span *ngIf="data.type == 0">GSM 调制解调器："{{data.gsm_modem}}"</span>
      <span *ngIf="data.type == 1">脚本名称："{{data.exec_path}}"</span>
      <span *ngIf="data.type == 2">GSM 调制解调器："{{data.gsm_modem}}"</span>
      <span *ngIf="data.type == 3">Jabber 标识符："{{data.username}}"</span>
      <span *ngIf="data.type == 100">用户名称："{{data.username}}"</span>
    </td>
    <td class="handle text-center main-color">
      <span (click)="showEditModal(data)">编辑</span>
      <span (click)="deleteSend(data)">删除</span>
      <span (click)="operationSend('启用',0,data)" *ngIf="data.status == 1">启用</span>
      <span (click)="operationSend('暂停',1,data)" *ngIf="data.status == 0">暂停</span>
    </td>
  </tr>
  </tbody>
</nz-table>

<!--新增发送方式-->
<smart-media-type #smartMediaType (done)="getList()"></smart-media-type>