Commit 954cc6d9 authored by wangqinghua's avatar wangqinghua

服务器

parent f91ff121
...@@ -24,6 +24,12 @@ import {WorkService} from '../../work/work.service'; ...@@ -24,6 +24,12 @@ import {WorkService} from '../../work/work.service';
padding: 2px 4px; padding: 2px 4px;
border-radius: 4px; border-radius: 4px;
} }
.tag-warn span.select-border {
border: 1px solid #6097b7;
border-radius: 5px;
padding: 2px;
margin-right: 5px;
}
:host ::ng-deep .tag-warn .ant-tag{ :host ::ng-deep .tag-warn .ant-tag{
margin-right: 0px; margin-right: 0px;
} }
...@@ -51,7 +57,6 @@ export class NowAlarmComponent implements OnInit, OnDestroy { ...@@ -51,7 +57,6 @@ export class NowAlarmComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.search(null);
this.getType(); this.getType();
this.time_ = setInterval(()=>{ this.time_ = setInterval(()=>{
this.search(null); this.search(null);
...@@ -76,6 +81,7 @@ export class NowAlarmComponent implements OnInit, OnDestroy { ...@@ -76,6 +81,7 @@ export class NowAlarmComponent implements OnInit, OnDestroy {
(res)=>{ (res)=>{
if(res.errCode == 10000){ if(res.errCode == 10000){
this.warnCountList = res.data; this.warnCountList = res.data;
this.search(this.warnCountList[0].hostid);
}else{ }else{
this.message.info(res.errMsg); this.message.info(res.errMsg);
} }
......
...@@ -33,21 +33,21 @@ ...@@ -33,21 +33,21 @@
<div class="host-item-content" style="height: 300px;"> <div class="host-item-content" style="height: 300px;">
<ng-container *ngIf="hostObj.disk.length > 0"> <ng-container *ngIf="hostObj.disk.length > 0">
<nz-spin [nzSpinning]="isDiskLoading"> <nz-spin [nzSpinning]="isDiskLoading">
<div echarts [options]="chartDiskOption" style="height: 360px;width: 100%"></div> <div echarts [options]="chartDiskOption" style="height: 150px;width: 100%"></div>
<div> <div class="text-center margin-bottom-10">
<span>{{hostObj.disk[diskType].name}}</span> <span style="border: 1px solid #d8c5c5;padding: 4px 8px;border-radius: 3px;">{{hostObj.disk[diskType].name}}</span>
</div> </div>
<nz-row> <nz-row>
<nz-col nzSpan="12">总大小</nz-col> <nz-col nzSpan="12">总大小</nz-col>
<nz-col nzSpan="12">{{hostObj.disk[diskType].total}}</nz-col> <nz-col nzSpan="12">{{hostObj.disk[diskType].total || '-'}}</nz-col>
</nz-row> </nz-row>
<nz-row> <nz-row>
<nz-col nzSpan="12">已用大小</nz-col> <nz-col nzSpan="12">已用大小</nz-col>
<nz-col nzSpan="12">{{hostObj.disk[diskType].use}}</nz-col> <nz-col nzSpan="12">{{hostObj.disk[diskType].use || '-'}}</nz-col>
</nz-row> </nz-row>
<nz-row> <nz-row>
<nz-col nzSpan="12">剩余容量</nz-col> <nz-col nzSpan="12">剩余容量</nz-col>
<nz-col nzSpan="12">{{hostObj.disk[diskType].total - hostObj.disk[diskType].use}}</nz-col> <nz-col nzSpan="12">{{(hostObj.disk[diskType].total - hostObj.disk[diskType].use) || '-'}}</nz-col>
</nz-row> </nz-row>
</nz-spin> </nz-spin>
</ng-container> </ng-container>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,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"> <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>
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
</nz-col> </nz-col>
<nz-col class="padding-left-10" nzSpan="12"> <nz-col class="padding-left-10" nzSpan="12">
<p class="host-item-title">指标列表</p> <p class="host-item-title">指标列表</p>
<div class="host-item-content"> <div class="host-item-content" style="height: 300px;">
<nz-row> <nz-row>
<nz-col nzSpan="16">CPU利用率(%):</nz-col> <nz-col nzSpan="16">CPU利用率(%):</nz-col>
<nz-col nzSpan="8">{{hostObj.cpu}}</nz-col> <nz-col nzSpan="8">{{hostObj.cpu}}</nz-col>
...@@ -94,20 +94,20 @@ ...@@ -94,20 +94,20 @@
<nz-row> <nz-row>
<nz-col nzSpan="16">Ping延时(ms):</nz-col> <nz-col nzSpan="16">Ping延时(ms):</nz-col>
<nz-col nzSpan="8">100</nz-col> <nz-col nzSpan="8">{{hostObj.response}}</nz-col>
</nz-row> </nz-row>
<nz-row> <nz-row>
<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-row>-->
<nz-col nzSpan="16">CPU个数:</nz-col> <!-- <nz-col nzSpan="16">CPU个数:</nz-col>-->
<nz-col nzSpan="8">100</nz-col> <!-- <nz-col nzSpan="8">100</nz-col>-->
</nz-row> <!-- </nz-row>-->
<nz-row> <!-- <nz-row>-->
<nz-col nzSpan="16">接口数:</nz-col> <!-- <nz-col nzSpan="16">接口数:</nz-col>-->
<nz-col nzSpan="8">100</nz-col> <!-- <nz-col nzSpan="8">100</nz-col>-->
</nz-row> <!-- </nz-row>-->
</div> </div>
</nz-col> </nz-col>
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
</div> </div>
<div class="host-item-content"> <div class="host-item-content">
<nz-spin [nzSpinning]="isTrendLoading"> <nz-spin [nzSpinning]="isTrendLoading">
<div echarts [options]="chartTrendOption" style="height: 360px;width: 100%"></div> <div echarts [options]="chartTrendOption" style="height:360px;width: 100%"></div>
</nz-spin> </nz-spin>
</div> </div>
</div> </div>
......
...@@ -134,6 +134,7 @@ export class ServerComponent implements OnInit { ...@@ -134,6 +134,7 @@ export class ServerComponent implements OnInit {
(res) => { (res) => {
this.hostObj.disk = res.data.disks; this.hostObj.disk = res.data.disks;
if (this.hostObj.disk.length > 0) { if (this.hostObj.disk.length > 0) {
this.diskType = 0;
this.setDiskChart(0); this.setDiskChart(0);
} }
} }
...@@ -149,7 +150,6 @@ export class ServerComponent implements OnInit { ...@@ -149,7 +150,6 @@ export class ServerComponent implements OnInit {
}, },
series: [ series: [
{ {
type: 'pie', type: 'pie',
radius: ['50%', '70%'], radius: ['50%', '70%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
...@@ -168,7 +168,7 @@ export class ServerComponent implements OnInit { ...@@ -168,7 +168,7 @@ export class ServerComponent implements OnInit {
}, },
labelLine: { labelLine: {
normal: { normal: {
show: false show: true
} }
}, },
data: [ data: [
...@@ -178,6 +178,7 @@ export class ServerComponent implements OnInit { ...@@ -178,6 +178,7 @@ export class ServerComponent implements OnInit {
} }
] ]
}; };
this.isDiskLoading = false;
} }
//获取趋势数据 //获取趋势数据
......
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