Commit 7d9b25df authored by wangqinghua's avatar wangqinghua

style update

parent 60f5e480
export const VERSION = process.env.VERSION;
export const DEBUG_INFO_ENABLED: boolean = !!process.env.DEBUG_INFO_ENABLED;
export const SERVER_API_URL_COMS = '/coms';
// export const SERVER_API_URL = '/anke';
export const SERVER_API_URL = '/zhouxi';
export const SERVER_API_URL = '/anke';
// export const SERVER_API_URL = '/zhouxi';
// export const SERVER_API_URL = '/zabbixBox';
export const SERVER_API_URL_MONITOR = '/api';
export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP;
......
......@@ -68,7 +68,7 @@
</div>
</div>
<div #rightDiv nz-col nzSpan="8" class="rightDiv" style="height: 500px;">
<h2>资源数量统计<span><span class="main-color-font">{{deviceNo}}</span>个资源</span></h2>
<h2>设备类型></h2>
<div echarts [options]="rightTwoChart" style="height: 250px;width: 100%;margin-top: 50px"></div>
</div>
</div>
......
......@@ -90,8 +90,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
this.findHostCount();
this.getGroup();
this.findSize();
}
ngAfterViewInit(){
......@@ -332,7 +330,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
center: ['50%', '60%'],
data:res.data.map(e=>{
const arr = {
value:e.count,
value:e.hostcount,
name:e.name
}
return arr;
......@@ -352,15 +350,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
)
}
//监控设备数
findSize() {
this.overAllSer.findSize().subscribe(
(res) => {
this.deviceNo = res.data.size;
}
);
}
getAlarmList() {
this.loading = true;
const data = {
......
......@@ -32,7 +32,7 @@ export class LayoutService {
//查询设备类型下主机的数量
findHostCount(): Observable<any> {
return this.http.get(SERVER_API_URL + '/statistics/findHostCount');
return this.http.get(SERVER_API_URL + '/hostType/findHostCount');
}
//主机状态统计(用于首页)
......
......@@ -93,7 +93,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="4" nzFor="templates">监控策略</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select name="templates" style="width: 100%" [(ngModel)]="validateForm.templates"
<nz-select name="templates" style="width: 100%" [(ngModel)]="tempArr"
[nzSize]="nzSize" nzMode="tags" nzPlaceHolder="选择监控策略">
<nz-option *ngFor="let option of tempList" [nzLabel]="option.name"
[nzValue]="option.id"></nz-option>
......
......@@ -39,6 +39,7 @@ export class BasicEditComponent implements OnInit {
panel2 = {name: '配置宏', active: true};
templatesResoure = [];
tempArr = [];
//加密
otherHost;
......@@ -157,12 +158,9 @@ export class BasicEditComponent implements OnInit {
//模版对象
if (data.parentTemplates) {
let tempArr = [];
tempArr = data.parentTemplates.map(res => {
return res.templateid;
this.tempArr = data.parentTemplates.map(e => {
return e.id;
});
this.validateForm.templates = tempArr;
this.templatesResoure = tempArr;
}
//接口对象
......@@ -186,7 +184,9 @@ export class BasicEditComponent implements OnInit {
//宏对象
if (data.macros) {
this.macroList1 = data.macros;
data.macros.forEach(e => {
this.macroList1.push({'macro': e.macro, 'value': e.value});
});
}
//资产对象
......@@ -236,11 +236,12 @@ export class BasicEditComponent implements OnInit {
}
}
this.validateForm.groups = groupArr;
let tempArr = [];
this.validateForm.templates.forEach(e=>{
tempArr.push({id:e})
this.tempArr.forEach(res => {
const d = {
id: res
};
this.validateForm.templates.push(d);
});
this.validateForm.templates = tempArr;
this.isOkLoading = true;
if (this.modalTitle == '编辑资源') {
this.update();
......@@ -267,16 +268,6 @@ export class BasicEditComponent implements OnInit {
if (!this.isInVentory) {
this.validateForm.inventoryExtend = null;
}
let clearArr = [];
if(this.validateForm.templates && this.validateForm.templates.length > 0){
this.validateForm.templates.forEach(e=>{
const d = {
id:e
};
clearArr.push(d);
});
this.validateForm.templates = clearArr;
}
this.overAllSer.createHost(this.validateForm).subscribe(
(res) => {
if (res.errCode == 10000) {
......@@ -308,21 +299,9 @@ export class BasicEditComponent implements OnInit {
});
this.validateForm.interfaces = interfaceArr;
//比较监控模版是否发生变化
const clearArr = [];
if (!this.isInVentory) {
this.validateForm.inventoryExtend = null;
}
this.templatesResoure.forEach(res => {
if (this.validateForm.templates.indexOf(res) == -1) {
const d = {
id:res
};
clearArr.push(d);
}
});
// this.validateForm.clearTemplateids = clearArr;
if (this.macroTYpe == 'macroExpand') {
this.validateForm.macros = this.macroList2;
}
......@@ -348,7 +327,7 @@ export class BasicEditComponent implements OnInit {
//取消
handleEditCancel(): void {
this.isBasicEdit = false;
this.isOkLoading = false;
this.isOkLoading = false;
this.initForm();
}
......
......@@ -43,7 +43,7 @@ export class CreateGroupComponent implements OnInit {
showEditModal(title,item){
this.title = title;
this.isCreate = true;
this.groupid = item.groupid;
this.groupid = item.id;
this.validateForm.patchValue(item);
}
......@@ -81,7 +81,7 @@ export class CreateGroupComponent implements OnInit {
update() {
const data = {
groupid:this.groupid,
id:this.groupid,
groupDescribe:this.validateForm.value.groupDescribe,
name:this.validateForm.value.name
}
......
......@@ -20,22 +20,23 @@
</nz-select>
</div>
<div nz-col nzSpan="6" class="text-right">
<nz-select *ngIf="selectedValue == 'group'" style="width: 200px;" nzPlaceHolder="所有分组" nzShowSearch
<nz-select nzAllowClear *ngIf="selectedValue == 'group'" style="width: 200px;" nzPlaceHolder="所有分组" nzShowSearch
(ngModelChange)="changeGroup($event)" [(ngModel)]="groupid">
<ng-container *ngFor="let item of groupList">
<nz-option [nzLabel]="item.name" [nzValue]="item.groupid"></nz-option>
<nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container>
</nz-select>
<nz-select *ngIf="selectedValue == 'type'" style="width: 200px;" nzPlaceHolder="所有设备类型" nzShowSearch
(ngModelChange)="changeEquiment($event)" [(ngModel)]="equipmentTypeid">
<ng-container *ngFor="let item of groupList">
<nz-option [nzLabel]="item.equipmentType" [nzValue]="item.equipmentTypeId"></nz-option>
<nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container>
</nz-select>
</div>
<div nz-col nzSpan="6" class="search-input text-right">
<input (keyup.enter)="search()" type="text" nz-input [(ngModel)]="searchName" placeholder="输入资源名称">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search" style="color: #6097b7"></i>搜索
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"
style="color: #6097b7"></i>搜索
</button>
</div>
<div nz-col nzSpan="2" class="text-right">
......@@ -71,27 +72,27 @@
</span>
</div>
<div nz-col nzSpan="9" class="button">
<button nz-button nzType="default" (click)="showGroupModal()">
<button nz-button nzType="default" (click)="showGroupModal()">
<i class="anticon anticon-plus-circle-o"></i>添加分组
</button>
<button nz-button nzType="default" (click)="updateGroup()">
<button nz-button nzType="default" (click)="updateGroup()">
<i class="anticon anticon-form"></i>编辑分组
</button>
<button nz-button nzType="default" (click)="showDeleteGroupConfirm()">
<button nz-button nzType="default" (click)="showDeleteGroupConfirm()">
<i class="anticon anticon-close-circle-o"></i>删除分组
</button>
<button nz-button nzType="default" (click)="showBasicEditModal()">
<button nz-button nzType="default" (click)="showBasicEditModal()">
<i class="anticon anticon-plus-circle-o"></i>添加资源
</button>
</div>
<div nz-col nzSpan="7" class="text-right button">
<button (click)="openBatchHost(1,'停止')" nz-button nzType="default">
<button (click)="openBatchHost(1,'停止')" nz-button nzType="default">
<i class="anticon anticon-pause-circle-o"></i>停止监控
</button>
<button (click)="openBatchHost(0,'开启')" nz-button nzType="default">
<button (click)="openBatchHost(0,'开启')" nz-button nzType="default">
<i class="anticon anticon-play-circle-o"></i>开启监控
</button>
<button (click)="batchDeleteConfirm()" nz-button nzType="default" >
<button (click)="batchDeleteConfirm()" nz-button nzType="default">
<i class="anticon anticon-close-circle-o"></i>删除资源
</button>
</div>
......@@ -104,7 +105,6 @@
<th [nzChecked]="allChecked"></th>
<th>名称</th>
<th>状态</th>
<th>关联资产</th>
<th>设备类型</th>
<th>可用性</th>
<th>操作</th>
......@@ -119,24 +119,11 @@
<span (click)="goDetail(item)">{{item.name}}</span>
</td>
<td class="round-tag tag-form">
<ng-container *ngIf="item.waringName == '正常'">
<nz-tag class="tag-green" [nzColor]="color.green"></nz-tag>
</ng-container>
<ng-container *ngIf="item.waringName == '禁用'">
<nz-tag class="tag-gray" [nzColor]="color.gray"></nz-tag>
</ng-container>
<ng-container *ngIf="item.waringName == '告警'">
<nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
</ng-container>
<ng-container *ngIf="item.waringName == '严重'">
<nz-tag class="tag-red" [nzColor]="color.red"></nz-tag>
</ng-container>
<ng-container *ngIf="item.status == 1">停止</ng-container>
<ng-container *ngIf="item.status == 0">开启</ng-container>
</td>
<td class="cursor">
<span (click)="goTOInventory(item?.inventory?.id)">{{item?.inventory?.name}}</span>
</td>
<td class="cursor main-color">
<span (click)="goEquip(item)">{{item?.equipmentType}}</span>
<span >{{item?.equname}}--{{item?.secname}}</span>
</td>
<td class="default">
<ng-container *ngIf=" !item.snmp_available || item.snmp_available == 0">
......@@ -169,18 +156,10 @@
<span (click)="showBasicCheckModal(item.hostid,item.host)">添加监测点</span>
<span (click)="editBasicModal(item)">编辑</span>
<span (click)="showDeleteConfirm(item)">删除</span>
<nz-dropdown [nzTrigger]="'click'" class="table-dropdown">
<a nz-dropdown>更多 <i class="anticon anticon-down main-color"></i>
</a>
<ul nz-menu nzSelectable>
<li (click)="showTempStop(item)" nz-menu-item><a>临时暂停</a></li>
<li (click)="openHost(item)" nz-menu-item><a>
<ng-container *ngIf="item.status == 1">开启</ng-container>
<span (click)="openHost(item)">
<ng-container *ngIf="item.status == 1">开启</ng-container>
<ng-container *ngIf="item.status == 0">停止</ng-container>监控
</a></li>
<!-- <li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li>-->
</ul>
</nz-dropdown>
</span>
</td>
</tr>
</ng-container>
......
......@@ -191,14 +191,14 @@ export class BasicComponent implements OnInit {
}
changeStatus(status) {
this.loading = true;
if (this.status == status) {
this.status = null;
} else {
this.status = status;
}
this.pageNum = 1;
this.search();
// this.loading = true;
// if (this.status == status) {
// this.status = null;
// } else {
// this.status = status;
// }
// this.pageNum = 1;
// this.search();
}
/*
......@@ -230,17 +230,15 @@ export class BasicComponent implements OnInit {
const data = {
pageNum: this.pageNum,
pageCount: this.pageCount,
obj: {
name: this.searchName,
waringName: this.status,
equipmentTypeid: this.equipmentTypeid,
groupids: []
}
name: this.searchName,
waringName: this.status,
equipmentTypeid: this.equipmentTypeid,
groupids: []
};
if (this.groupid) {
data.obj.groupids.push(this.groupid);
data.groupids.push(this.groupid);
} else {
data.obj.groupids = [];
data.groupids = [];
}
this.overAllSer.findHostPageNew(data).subscribe(
(res) => {
......@@ -365,7 +363,7 @@ export class BasicComponent implements OnInit {
let item;
if (this.groupid) {
this.groupList.forEach(e => {
if (e.groupid == this.groupid) {
if (e.id == this.groupid) {
item = e;
}
});
......@@ -408,7 +406,7 @@ export class BasicComponent implements OnInit {
handleOk(e) {
this.loading = true;
this.searchRe();
this.getGroup();
}
//根据设备类型查询主机资源
......@@ -468,16 +466,16 @@ export class BasicComponent implements OnInit {
//开启or停止监控
openHost(item) {
this.commonSer.confirmThing('暂停',`确定开启监控设备${item.name}?`,()=>{
this.commonSer.confirmThing('暂停', `确定开启监控设备${item.name}?`, () => {
this.loading = true;
let params1 = 0;
if (item.status == 0) {
params1 = 1;
}
const data = {
hostid:item.hostid,
status:params1,
}
hostid: item.hostid,
status: params1,
};
this.overAllSer.updateHostStatus(data).subscribe(
(res) => {
if (res.errCode == 10000) {
......@@ -486,7 +484,7 @@ export class BasicComponent implements OnInit {
}
}
);
})
});
}
//批量开启or停止监控
......
......@@ -142,7 +142,7 @@ export class OverAllService {
//修改分组
updataGroup(data): Observable<any> {
return this.http.put(SERVER_API_URL + '/groups/updata', data);
return this.http.put(SERVER_API_URL + '/groups/update', 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