Commit 21a7c745 authored by wangqinghua's avatar wangqinghua

电压温度功率

parent df6fe5ee
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<p class="host-item-title">分区</p> <p class="host-item-title">分区</p>
<div class="time-group" style="top: 18px;"> <div class="time-group" style="top: 18px;">
<nz-select style="width: 150px;" nzPlaceHolder="选择磁盘" <nz-select style="width: 150px;" nzPlaceHolder="选择磁盘"
(ngModelChange)="setDiskChart($event)" [(ngModel)]="diskType"> (ngModelChange)="setDiskChart($event)" [(ngModel)]="diskType">
<ng-container *ngFor="let disk of hostObj.disk;let i = index;"> <ng-container *ngFor="let disk of hostObj.disk;let i = index;">
<nz-option [nzLabel]="disk.name" [nzValue]="i"></nz-option> <nz-option [nzLabel]="disk.name" [nzValue]="i"></nz-option>
</ng-container> </ng-container>
</nz-select> </nz-select>
</div> </div>
<div class="host-item-content" style="height: 300px;"> <div class="host-item-content" style="height: 300px;">
<ng-container *ngIf="noData"> <ng-container *ngIf="noData">
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<nz-row> <nz-row>
<nz-col class="padding-right-10" nzSpan="12"> <nz-col class="padding-right-10" nzSpan="12">
<p class="host-item-title">基本信息</p> <p class="host-item-title">基本信息</p>
<div class="host-item-content" style="height: 300px;"> <div class="host-item-content" style="height: 300px;">
<nz-row> <nz-row>
<nz-col nzSpan="8">资源状态:</nz-col> <nz-col nzSpan="8">资源状态:</nz-col>
<nz-col nzSpan="16">{{server?.waringName}}</nz-col> <nz-col nzSpan="16">{{server?.waringName}}</nz-col>
...@@ -105,19 +105,41 @@ ...@@ -105,19 +105,41 @@
<nz-col nzSpan="16">内存利用率(%):</nz-col> <nz-col nzSpan="16">内存利用率(%):</nz-col>
<nz-col nzSpan="8">{{hostObj.used || '-'}}</nz-col> <nz-col nzSpan="8">{{hostObj.used || '-'}}</nz-col>
</nz-row> </nz-row>
<!-- <nz-row>-->
<!-- <nz-col nzSpan="16">CPU个数:</nz-col>-->
<!-- <nz-col nzSpan="8">100</nz-col>-->
<!-- </nz-row>-->
<!-- <nz-row>-->
<!-- <nz-col nzSpan="16">接口数:</nz-col>-->
<!-- <nz-col nzSpan="8">100</nz-col>-->
<!-- </nz-row>-->
</div> </div>
</nz-col> </nz-col>
</nz-row> </nz-row>
</div> </div>
<div class="padding-10" style="height: 50%;position: relative">
<div class="time-group" style="top: 18px;">
<nz-select style="width: 150px;" nzPlaceHolder="选择指标"
(ngModelChange)="changeTrend(trendObj.type)" [(ngModel)]="trendObj.type">
<ng-container *ngFor="let flow of targetFlow">
<nz-option [nzLabel]="flow.label" [nzValue]="flow.value"></nz-option>
</ng-container>
</nz-select>
<nz-select style="width: 150px;" nzPlaceHolder="选择时间" [(ngModel)]="timeTypeTrend"
(ngModelChange)="changeTrend($event)">
<ng-container *ngFor="let time of timeList">
<nz-option [nzLabel]="time.label" [nzValue]="time.value"></nz-option>
</ng-container>
</nz-select>
</div>
<div class="host-item-title">
风扇
</div>
<div class="host-item-content">
<ng-container *ngIf="!fanObj.noData">
<nz-spin [nzSpinning]="fanObj.isFanLoading">
<div echarts [options]="fanObj.fanOption" style="height:360px;width: 100%"></div>
</nz-spin>
</ng-container>
<ng-container *ngIf="fanObj.noData">
<div class="img-noData" style="min-height: 300px">
<div class="noData" title="暂无数据"></div>
</div>
</ng-container>
</div>
</div>
</nz-col> </nz-col>
<nz-col nzSpan="12"> <nz-col nzSpan="12">
<div class="padding-10" style="height: 50%;position: relative"> <div class="padding-10" style="height: 50%;position: relative">
...@@ -162,6 +184,40 @@ ...@@ -162,6 +184,40 @@
</nz-spin> </nz-spin>
</div> </div>
</div> </div>
<div class="padding-10" style="height: 40%;">
<nz-row>
<nz-col class="padding-right-10" nzSpan="12">
<p class="host-item-title">温度</p>
<div class="host-item-content" style="height: 300px;">
<ng-container *ngIf="!temObj.noData">
<nz-spin [nzSpinning]="temObj.isFanLoading">
<div echarts [options]="temObj.fanOption" style="height:360px;width: 100%"></div>
</nz-spin>
</ng-container>
<ng-container *ngIf="temObj.noData">
<div class="img-noData" style="min-height: 300px">
<div class="noData" title="暂无数据"></div>
</div>
</ng-container>
</div>
</nz-col>
<nz-col class="padding-left-10" nzSpan="12">
<p class="host-item-title">电压与功率</p>
<div class="host-item-content" style="height: 300px;">
<ng-container *ngIf="!powerObj.noData">
<nz-spin [nzSpinning]="powerObj.isFanLoading">
<div echarts [options]="powerObj.fanOption" style="height:360px;width: 100%"></div>
</nz-spin>
</ng-container>
<ng-container *ngIf="powerObj.noData">
<div class="img-noData" style="min-height: 300px">
<div class="noData" title="暂无数据"></div>
</div>
</ng-container>
</div>
</nz-col>
</nz-row>
</div>
</nz-col> </nz-col>
</nz-row> </nz-row>
</div> </div>
...@@ -57,6 +57,27 @@ export class ServerComponent implements OnInit { ...@@ -57,6 +57,27 @@ export class ServerComponent implements OnInit {
chartDiskOption; chartDiskOption;
diskType; diskType;
//风扇
fanObj = {
isFanLoading: false,
fanOption: null,
noData: false
};
//温度
temObj = {
isTemLoading: false,
temOption: null,
noData: false
};
//电压与功率
powerObj = {
isPowerLoading: false,
powerOption: null,
noData: false
};
constructor(private commonSer: CommonService, private routerInfo: ActivatedRoute, constructor(private commonSer: CommonService, private routerInfo: ActivatedRoute,
private message: NzMessageService, private overAllSer: OverAllService, private message: NzMessageService, private overAllSer: OverAllService,
private hostCom: HostComponent) { private hostCom: HostComponent) {
...@@ -71,6 +92,9 @@ export class ServerComponent implements OnInit { ...@@ -71,6 +92,9 @@ export class ServerComponent implements OnInit {
this.changeHistory('0'); this.changeHistory('0');
this.changeTrend('0'); this.changeTrend('0');
this.getDisk(); this.getDisk();
this.getTep();
this.getFeng();
console.log('fang');
} }
getDetail() { getDetail() {
...@@ -79,9 +103,9 @@ export class ServerComponent implements OnInit { ...@@ -79,9 +103,9 @@ export class ServerComponent implements OnInit {
}; };
this.overAllSer.findDetailed(this.hostId).subscribe( this.overAllSer.findDetailed(this.hostId).subscribe(
(res) => { (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.server = res.data[0]; this.server = res.data[0];
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
...@@ -142,7 +166,7 @@ export class ServerComponent implements OnInit { ...@@ -142,7 +166,7 @@ export class ServerComponent implements OnInit {
this.diskType = 0; this.diskType = 0;
this.setDiskChart(0); this.setDiskChart(0);
this.noData = false; this.noData = false;
}else { } else {
this.noData = true; this.noData = true;
} }
} }
...@@ -304,4 +328,44 @@ export class ServerComponent implements OnInit { ...@@ -304,4 +328,44 @@ export class ServerComponent implements OnInit {
this.getHistory(); this.getHistory();
} }
//风扇
getFeng() {
const data = {
hostid: this.hostId
};
this.overAllSer.getfan(data).subscribe(
(res) => {
}
);
}
//电压与温度
getTep() {
const data = {
type: '1',
hostid: this.hostId,
startTime: '2019-07-02 10:05:40',
endTime: '2019-08-02 10:05:40'
};
this.overAllSer.getTemperature(data).subscribe(
(res) => {
}
);
data.type = '2';
this.overAllSer.getTemperature(data).subscribe(
(res) => {
}
);
data.type = '3';
this.overAllSer.getTemperature(data).subscribe(
(res) => {
}
);
}
} }
...@@ -538,6 +538,16 @@ export class OverAllService { ...@@ -538,6 +538,16 @@ export class OverAllService {
//查询系统信息 //查询系统信息
getSystem(): Observable<any> { getSystem(): Observable<any> {
return this.http.get( './json/system.json'); return this.http.get('./json/system.json');
}
//查询温度电压功率
getTemperature(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/host/getTemperature', data);
}
//获取主机风扇信息
getfan(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/host/fan', data);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment