Commit 7d9b25df authored by wangqinghua's avatar wangqinghua

style update

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