Commit 43458f66 authored by wangqinghua's avatar wangqinghua

bug 修正

parents b5d9bb59 065e2802
import {RouterModule} from "@angular/router";
import {RouterModule} from '@angular/router';
import {CUSTOM_ELEMENTS_SCHEMA, NgModule, NO_ERRORS_SCHEMA} from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgxEchartsModule } from "ngx-echarts";
import {CommonModule} from '@angular/common';
import {NgxEchartsModule} from 'ngx-echarts';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {NgZorroAntdModule,NZ_I18N,zh_CN} from 'ng-zorro-antd';
import {NgZorroAntdModule, NZ_I18N, zh_CN} from 'ng-zorro-antd';
import {AlarmListComponent} from './alarm/alarm-list/alarm-list.component';
import {AlarmLogComponent} from './alarm/alarm-log/alarm-log.component';
import {AlarmSetComponent} from './alarm/alarm-set/alarm-set.component';
......@@ -111,14 +111,16 @@ import {DisableControlDirective} from './shared/common/disable-control.directive
import {SelectTriggerComponent} from './modal/select-trigger/select-trigger.component';
import {WebModalComponent} from './modal/web-modal/web-modal.component';
import {WorkReportComponent} from './business/modal/work-report/work-report.component';
import {SignalComponent} from './shared/signal/signal.component';
import {ServerComponent} from './overAll/modal/server/server.component';
import {DatabaseComponent} from './overAll/modal/database/database.component';
import {SwitchComponent} from './overAll/modal/switch/switch.component';
import {PipeModule} from './shared/pipe/pipe.module';
import {SignalComponent} from './shared/signal/signal.component';
import {MineComponent} from './mine/mine.component';
@NgModule({
imports: [
PipeModule,
RouterModule,
CommonModule,
NgxEchartsModule,
......@@ -229,13 +231,13 @@ import {MineComponent} from './mine/mine.component';
SelectTriggerComponent,
WebModalComponent,
WorkReportComponent,
SignalComponent,
ServerComponent,
DatabaseComponent,
SwitchComponent,
SignalComponent,
MineComponent,
],
providers:[
providers: [
OverAllService,
SystemService,
AlarmService,
......@@ -243,9 +245,9 @@ import {MineComponent} from './mine/mine.component';
AnalysisService,
WorkService,
BusinessService,
{ provide: NZ_I18N, useValue: zh_CN },
{provide: NZ_I18N, useValue: zh_CN},
],
exports:[
exports: [
BasiCheckComponent,
BasicEditComponent,
BasicKeyComponent,
......@@ -254,6 +256,7 @@ import {MineComponent} from './mine/mine.component';
WarnListComponent,
PauseComponent
],
schemas: [ CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA ],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
})
export class AppMainModule { }
export class AppMainModule {
}
......@@ -4,7 +4,7 @@ import {BehaviorSubject, Subscription} from 'rxjs';
@Injectable()
export class AppService {
private themeSource:BehaviorSubject<string> = new BehaviorSubject('white');
private themeSource:BehaviorSubject<string> = new BehaviorSubject('dark');
public theme = this.themeSource.asObservable();
public setTheme(value: string){
......
......@@ -119,30 +119,6 @@
</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>-->
<!--&lt;!&ndash;<th nzWidth="150px">图表</th>&ndash;&gt;-->
<!--</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>-->
<!--&lt;!&ndash;<td>图表</td>&ndash;&gt;-->
<!--</tr>-->
<!--</tbody>-->
<!--</nz-table>-->
<!--</div>-->
</section>
</nz-tab>
<nz-tab nzTitle="监测点列表">
......@@ -151,7 +127,7 @@
<button (click)="getCheckList()" nz-button nzType="default"><i class="anticon anticon-search" style="color: #6097b7"></i>搜索</button>
</div>
<div class="padding-15-0">
<nz-radio-group [(ngModel)]="itemTypeValue" [nzButtonStyle]="'solid'">
<nz-radio-group [(ngModel)]="itemTypeValue">
<label *ngFor="let item of itemTypeList" (click)="changeType(item)" nz-radio-button [nzValue]="item.applicationid">{{item.name}}</label>
</nz-radio-group>
</div>
......
......@@ -23,12 +23,13 @@
<div class="padding-10" style="height: 40%;position: relative">
<p class="host-item-title">分区</p>
<div class="time-group" style="top: 18px;">
<nz-select style="width: 150px;" nzPlaceHolder="选择磁盘"
(ngModelChange)="setDiskChart($event)" [(ngModel)]="diskType">
<nz-select style="width: 150px;" nzPlaceHolder="选择磁盘" (ngModelChange)="setDiskChart($event)"
[(ngModel)]="diskType">
<ng-container *ngFor="let disk of hostObj.disk;let i = index;">
<nz-option [nzLabel]="disk.name" [nzValue]="i"></nz-option>
</ng-container>
</nz-select>
</div>
<div class="host-item-content" style="height: 300px;">
<ng-container *ngIf="noData">
......@@ -44,15 +45,15 @@
</div>
<nz-row>
<nz-col nzSpan="12">总大小:</nz-col>
<nz-col nzSpan="12">{{hostObj.disk[diskType].total || '-'}}</nz-col>
<nz-col nzSpan="12">{{hostObj.disk[diskType].total | unitConversion}}</nz-col>
</nz-row>
<nz-row>
<nz-col nzSpan="12">已用大小:</nz-col>
<nz-col nzSpan="12">{{hostObj.disk[diskType].use || '-'}}</nz-col>
<nz-col nzSpan="12">{{hostObj.disk[diskType].used | unitConversion}}</nz-col>
</nz-row>
<nz-row>
<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].used) | unitConversion }}</nz-col>
</nz-row>
</nz-spin>
</ng-container>
......@@ -63,6 +64,7 @@
<nz-col class="padding-right-10" nzSpan="12">
<p class="host-item-title">基本信息</p>
<div class="host-item-content" style="height: 300px;">
<nz-row>
<nz-col nzSpan="8">资源状态:</nz-col>
<nz-col nzSpan="16">{{server?.waringName}}</nz-col>
......@@ -81,7 +83,8 @@
</nz-row>
<nz-row>
<nz-col nzSpan="8">资产编号:</nz-col>
<nz-col nzSpan="16">{{server?.inventory?.no || '-'}}</nz-col>
<nz-col nzSpan="16">{{server?.inventory?.inventoryNo || '-'}}</nz-col>
</nz-row>
<nz-row>
<nz-col nzSpan="8">负责人:</nz-col>
......@@ -105,14 +108,6 @@
<nz-col nzSpan="16">内存利用率(%):</nz-col>
<nz-col nzSpan="8">{{hostObj.used || '-'}}</nz-col>
</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>
</nz-col>
......
......@@ -32,7 +32,9 @@
</nz-row>
<nz-row>
<nz-col nzSpan="8">IP地址:</nz-col>
<nz-col nzSpan="16">{{switch?.ip || '-'}}</nz-col>
<nz-col nzSpan="16">{{switch?.host || '-'}}</nz-col>
</nz-row>
<nz-row>
<nz-col nzSpan="8">设备类型:</nz-col>
......@@ -40,7 +42,8 @@
</nz-row>
<nz-row>
<nz-col nzSpan="8">资产编号:</nz-col>
<nz-col nzSpan="16">{{switch?.inventory?.no || '-'}}</nz-col>
<nz-col nzSpan="16">{{switch?.inventory?.inventoryNo || '-'}}</nz-col>
</nz-row>
<nz-row>
<nz-col nzSpan="8">负责人:</nz-col>
......@@ -53,19 +56,21 @@
<div class="host-item-content" style="height: 100%;">
<nz-row>
<nz-col nzSpan="8">CPU利用率(%):</nz-col>
<nz-col nzSpan="16">{{hostObj.cpu}}</nz-col>
<nz-col nzSpan="16">{{hostObj.cpu || '-'}}</nz-col>
</nz-row>
<nz-row>
<nz-col nzSpan="8">Ping延时(ms):</nz-col>
<nz-col nzSpan="16">{{hostObj.response}}</nz-col>
<nz-col nzSpan="16">{{hostObj.response || '-'}}</nz-col>
</nz-row>
<nz-row>
<nz-col nzSpan="8">丢包数:</nz-col>
<nz-col nzSpan="16">{{hostObj.losed}}</nz-col>
<nz-col nzSpan="16">{{hostObj.losed || '-'}}</nz-col>
</nz-row>
<nz-row>
<nz-col nzSpan="8">内存利用率(%):</nz-col>
<nz-col nzSpan="16">{{hostObj.used}}</nz-col>
<nz-col nzSpan="16">{{hostObj.used || '-'}}</nz-col>
</nz-row>
</div>
</div>
......
......@@ -33,7 +33,6 @@ export class SwitchComponent implements OnInit {
isNetworkLoading = false;
chartNetworkOption;
isTrendLoading = false;
chartTrendOption;
......@@ -131,7 +130,7 @@ export class SwitchComponent implements OnInit {
this.overAllSer.responseTime(this.hostId).subscribe(
(res)=>{
if (res.data) {
this.hostObj.response = res.data.response;
this.hostObj.response = res.data.responseTime;
} else {
this.hostObj.response = 0;
}
......
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import {UnitConversionPipe} from './unit-conversion/unit-conversion.pipe';
@NgModule({
imports: [
],
declarations: [
UnitConversionPipe
],
providers: [
],
entryComponents: [],
exports: [
UnitConversionPipe
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class PipeModule {}
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'unitConversion'
})
export class UnitConversionPipe implements PipeTransform {
transform(value: any, args?: any): any {
console.log(value);
let res = '';
let Gbps = 1000 * 1000 * 1000;
let Mbps = 1000 * 1000;
let kbps = 1000;
let size = Math.abs(value);
if (size / Gbps > 1) {
res += (size / Gbps).toFixed(2) + 'Gbps';
} else if (size / Mbps > 1) {
res += (size / Mbps).toFixed(2) + 'Mbps';
} else if (size / kbps > 1) {
res += (size / kbps).toFixed(2) + 'kbps';
} else {
res += (size) + 'bps';
}
return res;
}
}
......@@ -19,13 +19,15 @@ import {ReactiveFormsModule} from '@angular/forms';
import {CommonService} from './common/common.service';
import {UtilService} from './common/util.service';
import {DisableControlDirective} from './common/disable-control.directive';
import {PipeModule} from './pipe/pipe.module';
@NgModule({
imports: [
ReactiveFormsModule,
NgZorroAntdModule,
BootappSharedLibsModule,
BootappSharedCommonModule
BootappSharedCommonModule,
PipeModule,
],
declarations: [
JhiLoginModalComponent,
......
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