
<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>
                <a routerLink="../basic">基础资源监控</a>
            </nz-breadcrumb-item>
            <nz-breadcrumb-item>
                {{hostName}}
            </nz-breadcrumb-item>
        </nz-breadcrumb>
    </div>
    <div nz-col nzSpan="8" class="text-right">
        <button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
        <button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
    </div>
</div>
<div class="tabset">
    <div class="tabset-btn">
        <button (click)="showCheckModal()" nz-button nzType="default">添加监测点</button>
        <!--<button nz-button nzType="default">编辑</button>-->
        <button nz-button nzType="default">删除</button>
    </div>
    <div class="releative" #checkEle>
        <div #colorEle class="checkTags tag-form">
            <span (click)="changeState('正常')">
                <nz-tag [nzColor]="color.green"></nz-tag>
                 <i *ngIf="!checkStatus.normal && checkStatus.normal !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>{{checkStatus.normal}}
            </span>
            <span (click)="changeState('告警')"> <nz-tag [nzColor]="color.yellow"></nz-tag>
                 <i *ngIf="!checkStatus.warning && checkStatus.warning !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
                {{checkStatus.warning}}
            </span>
            <span (click)="changeState('严重')"> <nz-tag [nzColor]="color.red"></nz-tag>
                 <i *ngIf="!checkStatus.high && checkStatus.high !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
                {{checkStatus.high}}
            </span>
            <span (click)="changeState('禁用')"> <nz-tag [nzColor]="color.gray"></nz-tag>
                 <i *ngIf="!checkStatus.disabled && checkStatus.disabled !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
                {{checkStatus.disabled}}
            </span>
        </div>
        <nz-tabset [nzSelectedIndex]="tabNum" class="tabs-smart">

            <nz-tab nzTitle="资源详情">
                <section>
                    资源显示名称
                    <div nz-row nzGutter="24">
                        <div nz-col nzSpan="12">
                            <nz-collapse>
                                <nz-collapse-panel [nzHeader]="panel1.name" [nzActive]="panel1.active"
                                                   [nzDisabled]="panel1.disabled">
                                    <div nz-row>
                                        <div class="releative" nz-col nzSpan="12">
                                            <div echarts [options]="chartOption1" style="height: 220px;width: 100%"></div>
                                            <div class="posiabsolutStr">
                                                <p>{{responseTimeStr}}</p>
                                                <p>ms</p>
                                            </div>
                                        </div>
                                        <div class="releative" nz-col nzSpan="12">
                                            <div echarts [options]="chartOption2" style="height: 220px;width: 100%;"></div>
                                            <div class="posiabsolutStr">
                                                <p>{{losedStr}}</p>
                                                <p>%</p>
                                            </div>
                                        </div>
                                    </div>
                                </nz-collapse-panel>
                            </nz-collapse>
                        </div>
                        <div nz-col nzSpan="12">
                            <nz-collapse>
                                <nz-collapse-panel [nzHeader]="panel2.name" [nzActive]="panel2.active"
                                                   [nzDisabled]="panel2.disabled">
                                    <div nz-row>
                                        <div class="releative" nz-col nzSpan="12">
                                            <div echarts [options]="chartOption3" style="height: 220px;width: 100%;"></div>
                                            <div class="posiabsolutStr">
                                                <p>{{cpuUsedStr}}</p>
                                                <p>%</p>
                                            </div>
                                        </div>
                                        <div class="releative" nz-col nzSpan="12">
                                            <div echarts [options]="chartOption4" style="height: 220px;width: 100%"></div>
                                            <div class="posiabsolutStr">
                                                <p>{{usedStr}}</p>
                                                <p>%</p>
                                            </div>
                                        </div>
                                    </div>
                                </nz-collapse-panel>
                            </nz-collapse>
                        </div>
                    </div>
                    <div nz-row style="margin: 30px 0;">
                        <nz-collapse>
                            <nz-collapse-panel [nzHeader]="panel3.name" [nzActive]="panel3.active"
                                               [nzDisabled]="panel3.disabled">
                                <div nz-col nzSpan="16">
                                    <div echarts [options]="secondOptionLeft" class="demo-chart"></div>
                                </div>
                                <div nz-col nzSpan="8">
                                    <div echarts [options]="secondOptionRight" class="demo-chart"></div>
                                </div>
                            </nz-collapse-panel>
                        </nz-collapse>
                    </div>
                    <div nz-row>
                        <nz-table #basicTable [nzData]="dataSet" [nzFrontPagination]="false" [nzTotal]="totalNumInOut" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="changeInoutInfo($event)" [nzLoading]="inOutLoading">
                            <thead>
                            <tr>
                                <th>状态</th>
                                <th>接口</th>
                                <th>进流量</th>
                                <th>出流量</th>
                                <th>状态变更时间</th>
                                <th nzWidth="150px">图表</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr *ngFor="let data of basicTable.data">
                                <td>{{data.state}}</td>
                                <td>{{data.name}}</td>
                                <td>{{data.in}}</td>
                                <td>{{data.out}}</td>
                                <td>{{data.changeState}}</td>
                                <td>图表</td>
                            </tr>
                            </tbody>
                        </nz-table>
                    </div>
                </section>
            </nz-tab>
            <nz-tab  nzTitle="监测点列表">
                <div nz-row>
                    <div class="padding-15-0">
                        <nz-radio-group [(ngModel)]="itemTypeValue" [nzButtonStyle]="'solid'">
                            <label *ngFor="let item of itemTypeList" (click)="changeType(item.applicationid)" nz-radio-button nzValue="{{item.applicationid}}">{{item.name}}</label>
                        </nz-radio-group>
                    </div>
                    <nz-table #checkTable [nzData]="checkList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageIndex" [nzPageSize]="pageSize" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
                        <thead>
                        <tr>
                            <th nzWidth="250px">监测点名称</th>
                            <th >最新数据</th>
                            <th nzWidth="250px">最新数据时间</th>
                            <th>监测点分类</th>
                            <th>更新时间间隔</th>
                            <th>图表</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr *ngFor="let data of checkTable.data">
                            <td class="tag-form">
                                <nz-tag *ngIf="data.priority == 4 || data.priority == 5" [nzColor]="color.red"></nz-tag>
                                <nz-tag *ngIf="data.priority == 2 || data.priority == 3" [nzColor]="color.yellow"></nz-tag>
                                <nz-tag *ngIf="data.priority != 2 && data.priority != 3 && data.priority != 4 && data.priority != 5 && data.status == 0" [nzColor]="color.green"></nz-tag>
                                <nz-tag *ngIf="data.priority != 2 && data.priority != 3 && data.priority != 4 && data.priority != 5 && data.status == 1" [nzColor]="color.gray"></nz-tag>
                                {{data.name}}</td>
                            <td>{{data.lastvalue}}</td>
                            <td>{{data.lastclock}}</td>
                            <td>{{data.itemType}}</td>
                            <td>{{data.delay}}</td>
                            <td class="cursor">
                                <span (click)="showImageModal(data)">图表</span>
                            </td>
                            <td class="handle cursor">
                                <span (click)="showEditModal(data)">编辑</span>
                                <span (click)="deleteCheckItem(data)">删除</span>
                                <span *ngIf="data.status == 0 && data.state==0" (click)="updateItem(data.itemid,1)" style="color: red">停止</span>
                                <span *ngIf="data.status == 0 && data.state==1" (click)="updateItem(data.itemid,1)" style="color: red">不支持的</span>
                                <span *ngIf="data.status == 1 && data.state==0" (click)="updateItem(data.itemid,0)" style="color: green">启用</span>
                                <span *ngIf="data.status == 1 && data.state==1" (click)="updateItem(data.itemid,0)" style="color: green">启用</span>
                            </td>
                        </tr>
                        </tbody>
                    </nz-table>
                </div>
            </nz-tab>
            <nz-tab #thirdTabs nzTitle="历史告警" >
                <smart-warn-list #warnList></smart-warn-list>
            </nz-tab>
        </nz-tabset>
    </div>
</div>

<!--添加监测点-->
<smart-basi-check #smartCheck (done)="getList()"></smart-basi-check>

<nz-modal [nzFooter]="null" nzWidth="1080" [(nzVisible)]="isGrapha" nzTitle="" (nzOnCancel)="handleImageCancel()">
    <div class="releative">
        <div class="time-select">
            <nz-date-picker [(ngModel)]="imageSelectDate" (ngModelChange)="getGraphDate()" [nzSize]="size"></nz-date-picker>
        </div>
        <div echarts [options]="chartOptionGrapha" style="height: 520px;width: 100%"></div>
    </div>
</nz-modal>
