Commit db2204d9 authored by wangqinghua's avatar wangqinghua

template

parent c38ed6a2
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
<nz-form-explain *ngIf="validateForm.get('type').dirty && validateForm.get('type').errors">请选择监测点类型!</nz-form-explain> <nz-form-explain *ngIf="validateForm.get('type').dirty && validateForm.get('type').errors">请选择监测点类型!</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<ng-container *ngIf="isInterface">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired nzFor="interfaceid">主机接口</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired nzFor="interfaceid">主机接口</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
<nz-form-explain *ngIf="validateForm.get('interfaceid').dirty && validateForm.get('interfaceid').errors">请选择主机接口!</nz-form-explain> <nz-form-explain *ngIf="validateForm.get('interfaceid').dirty && validateForm.get('interfaceid').errors">请选择主机接口!</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</ng-container>
<ng-container *ngIf="validateForm.value.type == 1 || validateForm.value.type == 4 || validateForm.value.type == 6"> <ng-container *ngIf="validateForm.value.type == 1 || validateForm.value.type == 4 || validateForm.value.type == 6">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="snmp_oid">SNMP OID</nz-form-label> <nz-form-label [nzSpan]="6" nzFor="snmp_oid">SNMP OID</nz-form-label>
......
...@@ -35,6 +35,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -35,6 +35,7 @@ export class BasiCheckComponent implements OnInit {
title; title;
isCheck = false; isCheck = false;
isInterface = true;
nzSize = 'large'; nzSize = 'large';
hostId; //主机ID hostId; //主机ID
hostName; //主机name hostName; //主机name
...@@ -71,10 +72,8 @@ export class BasiCheckComponent implements OnInit { ...@@ -71,10 +72,8 @@ export class BasiCheckComponent implements OnInit {
value_type: [null, [Validators.required]], value_type: [null, [Validators.required]],
type: [null, [Validators.required]], type: [null, [Validators.required]],
units: [null], units: [null],
// formula: [null, [Validators.required]],
history: ['3600'], history: ['3600'],
trends: [null], trends: [null],
// valuemapid: ['0'],
delay: [null, [Validators.required]], delay: [null, [Validators.required]],
snmp_oid: ['interfaces.ifTable.ifEntry.ifInOctets.1'], snmp_oid: ['interfaces.ifTable.ifEntry.ifInOctets.1'],
snmp_community: ['public'], snmp_community: ['public'],
...@@ -88,17 +87,25 @@ export class BasiCheckComponent implements OnInit { ...@@ -88,17 +87,25 @@ export class BasiCheckComponent implements OnInit {
} }
//新增 //新增
showAddModal(hostId, hostName) { showAddModal(hostId, hostName,title) {
this.title = '添加监测点'; this.title = title;
this.isCheck = true; if(this.title == '添加监测点'){
this.hostId = hostId;
this.hostName = hostName;
//主机接口 //主机接口
this.overAllSer.findDetailed(this.hostId).subscribe( this.overAllSer.findDetailed(this.hostId).subscribe(
(res) => { (res) => {
this.interfaceList = res.data[0].interfaces; this.interfaceList = res.data[0].interfaces;
} }
); );
this.isInterface = true;
this.validateForm.get('interfaceid').setValidators(Validators.email);
}
if(this.title == '添加模版监测点'){
this.isInterface = false;
this.validateForm.get('interfaceid').clearValidators();
}
this.isCheck = true;
this.hostId = hostId;
this.hostName = hostName;
this.getItemType(); this.getItemType();
} }
...@@ -171,7 +178,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -171,7 +178,7 @@ export class BasiCheckComponent implements OnInit {
} }
this.validateForm.value.applications = [this.validateForm.value.applications]; this.validateForm.value.applications = [this.validateForm.value.applications];
this.validateForm.value.hostid = this.hostId; this.validateForm.value.hostid = this.hostId;
if (this.title == '添加监测点') { if (this.title == '添加监测点' || this.title == "添加模版监测点") {
this.create(); this.create();
} }
if (this.title == '编辑监测点') { if (this.title == '编辑监测点') {
......
...@@ -626,7 +626,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -626,7 +626,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//添加监测点 //添加监测点
showCheckModal() { showCheckModal() {
this.smartCheck.showAddModal(this.hostId,this.realName); this.smartCheck.showAddModal(this.hostId,this.realName,'添加监测点');
} }
//编辑监测点 //编辑监测点
......
...@@ -213,7 +213,7 @@ export class BasicComponent implements OnInit { ...@@ -213,7 +213,7 @@ export class BasicComponent implements OnInit {
//添加监测点 //添加监测点
showBasicCheckModal(hostid, host) { showBasicCheckModal(hostid, host) {
this.smartCheck.showAddModal(hostid, host); this.smartCheck.showAddModal(hostid, host,'添加监测点');
} }
//列表 //列表
......
...@@ -77,14 +77,13 @@ ...@@ -77,14 +77,13 @@
<span (click)="showDeleteGroupConfirm(item)">删除</span> <span (click)="showDeleteGroupConfirm(item)">删除</span>
</ng-container> </ng-container>
<ng-container *ngIf="item.level"> <ng-container *ngIf="item.level">
<span (click)="showBasicCheckModal(item.hostid,item.host)">添加监测点</span> <span (click)="showBasicCheckModal(item.templateid,item.host)">添加监测点</span>
<span (click)="showTempEditModal(item)">编辑</span> <span (click)="showTempEditModal(item)">编辑</span>
<span (click)="showDeleteConfirm(item)">删除</span> <span (click)="showDeleteConfirm(item)">删除</span>
<nz-dropdown [nzTrigger]="'click'" class="table-dropdown"> <nz-dropdown [nzTrigger]="'click'" class="table-dropdown">
<a nz-dropdown>更多 <i class="anticon anticon-down"></i> <a nz-dropdown>更多 <i class="anticon anticon-down"></i>
</a> </a>
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li *ngIf="!item.monitorTask" (click)="showTempStop(item)" nz-menu-item><a>临时暂停</a></li>
<li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li> <li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li>
<li (click)="showAlarm(item)" nz-menu-item><a>添加告警</a></li> <li (click)="showAlarm(item)" nz-menu-item><a>添加告警</a></li>
</ul> </ul>
...@@ -107,14 +106,13 @@ ...@@ -107,14 +106,13 @@
</td> </td>
<td></td> <td></td>
<td class="handle main-color"> <td class="handle main-color">
<span (click)="showBasicCheckModal(item.hostid,item.host)">添加监测点</span> <span (click)="showBasicCheckModal(item.templateid,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"> <nz-dropdown [nzTrigger]="'click'" class="table-dropdown">
<a nz-dropdown>更多 <i class="anticon anticon-down"></i> <a nz-dropdown>更多 <i class="anticon anticon-down"></i>
</a> </a>
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li (click)="showTempStop(item)" nz-menu-item><a>临时暂停</a></li>
<li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li> <li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li>
<li (click)="showAlarm(item)" nz-menu-item><a>添加告警</a></li> <li (click)="showAlarm(item)" nz-menu-item><a>添加告警</a></li>
</ul> </ul>
......
...@@ -175,7 +175,7 @@ export class TemplateComponent implements OnInit { ...@@ -175,7 +175,7 @@ export class TemplateComponent implements OnInit {
//添加监测点 //添加监测点
showBasicCheckModal(hostid, host) { showBasicCheckModal(hostid, host) {
this.smartCheck.showAddModal(hostid, host); this.smartCheck.showAddModal(hostid, host,"添加模版监测点");
} }
toTree(index) { toTree(index) {
......
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