Commit 7ec5a6ec authored by wangqinghua's avatar wangqinghua

update

parent f4fae93f
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;
......
...@@ -18,6 +18,16 @@ ...@@ -18,6 +18,16 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired nzFor="interfaceid">主机接口</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select name="interfaceid" formControlName="interfaceid" nzPlaceHolder="选择主机接口">
<nz-option *ngFor="let item of interfaceList" nzValue="{{item.id}}"
nzLabel="{{item.ip}}:{{item.port}}"></nz-option>
</nz-select>
<nz-form-explain *ngIf="validateForm.get('interfaceid').dirty && validateForm.get('interfaceid').errors">请选择主机接口!</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="snmpCommunity">SNMP community</nz-form-label> <nz-form-label [nzSpan]="6" nzFor="snmpCommunity">SNMP community</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input id="snmpCommunity" name="snmpCommunity" type="text" nz-input <input id="snmpCommunity" name="snmpCommunity" type="text" nz-input
......
...@@ -43,6 +43,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -43,6 +43,7 @@ export class BasiCheckComponent implements OnInit {
checkList; //监测点分类 checkList; //监测点分类
interval; //间隔时长 interval; //间隔时长
templateid; //模版id templateid; //模版id
interfaceList = [];
tabNum: number; tabNum: number;
triggerObj = { triggerObj = {
...@@ -72,8 +73,8 @@ export class BasiCheckComponent implements OnInit { ...@@ -72,8 +73,8 @@ export class BasiCheckComponent implements OnInit {
snmpCommunity: ['public'], snmpCommunity: ['public'],
delay: [null, [Validators.required]], delay: [null, [Validators.required]],
interfaceid: [null], interfaceid: [null],
templateid:[null], templateid: [null],
description:[null,[Validators.required]], description: [null, [Validators.required]],
}); });
this.triggerObj = { this.triggerObj = {
condition: '', condition: '',
...@@ -83,15 +84,16 @@ export class BasiCheckComponent implements OnInit { ...@@ -83,15 +84,16 @@ export class BasiCheckComponent implements OnInit {
} }
//新增 //新增
showAddModal(hostId, hostName,title) { showAddModal(hostObj, hostId, hostName, title) {
this.title = title; this.title = title;
this.isCheck = true; this.isCheck = true;
this.hostId = hostId; this.hostId = hostId;
this.hostName = hostName; this.hostName = hostName;
this.interfaceList = hostObj.interfaces;
} }
//编辑 //编辑
showEditModal(item,hostId, id, hostName,templateid,title) { showEditModal(hostObj, item, hostId, id, hostName, templateid, title) {
this.title = title; this.title = title;
this.hostId = hostId; this.hostId = hostId;
this.templateid = templateid; this.templateid = templateid;
...@@ -101,6 +103,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -101,6 +103,7 @@ export class BasiCheckComponent implements OnInit {
item.type += ''; item.type += '';
item.valueType += ''; item.valueType += '';
this.validateForm.patchValue(item); this.validateForm.patchValue(item);
this.interfaceList = hostObj.interfaces;
} }
//获取监测点分类 //获取监测点分类
...@@ -118,8 +121,8 @@ export class BasiCheckComponent implements OnInit { ...@@ -118,8 +121,8 @@ export class BasiCheckComponent implements OnInit {
//添加 //添加
handleCheckOk() { handleCheckOk() {
const list = ['0','1','3','4','6','10','12','13','14','16','17']; const list = ['0', '1', '3', '4', '6', '10', '12', '13', '14', '16', '17'];
if(list.indexOf(this.validateForm.value.type) > -1){ if (list.indexOf(this.validateForm.value.type) > -1) {
this.validateForm.get('type').setValidators(Validators.required); this.validateForm.get('type').setValidators(Validators.required);
} }
for (let i in this.validateForm.controls) { for (let i in this.validateForm.controls) {
...@@ -132,10 +135,10 @@ export class BasiCheckComponent implements OnInit { ...@@ -132,10 +135,10 @@ export class BasiCheckComponent implements OnInit {
} }
this.validateForm.value.hostid = this.hostId; this.validateForm.value.hostid = this.hostId;
this.isOkLoading = true; this.isOkLoading = true;
if (this.title == '添加监测点' || this.title == "添加模版监测点") { if (this.title == '添加监测点' || this.title == '添加模版监测点') {
this.create(); this.create();
} }
if (this.title == '编辑监测点' || this.title == "编辑模版监测点") { if (this.title == '编辑监测点' || this.title == '编辑模版监测点') {
this.update(); this.update();
} }
} }
...@@ -161,8 +164,8 @@ export class BasiCheckComponent implements OnInit { ...@@ -161,8 +164,8 @@ export class BasiCheckComponent implements OnInit {
//修改监控项 //修改监控项
update() { update() {
this.validateForm.patchValue({ this.validateForm.patchValue({
templateid:this.templateid templateid: this.templateid
}) });
this.validateForm.addControl('id', new FormControl(this.itemId)); this.validateForm.addControl('id', new FormControl(this.itemId));
this.overAllSer.itemUpdata(this.validateForm.value).subscribe( this.overAllSer.itemUpdata(this.validateForm.value).subscribe(
(res) => { (res) => {
......
<nz-modal [nzWidth]="880" [(nzVisible)]="isVisiable" [nzTitle]="title" [nzOkLoading]="isOkLoading" <nz-modal [nzWidth]="880" [(nzVisible)]="isVisiable" [nzTitle]="title" [nzOkLoading]="isOkLoading"
(nzOnCancel)="handleCheckCancel()" (nzOnOk)="saveTrigger()"> (nzOnCancel)="handleCheckCancel()" (nzOnOk)="saveTrigger()">
<div style="padding-left: 30px;">
<p>{{demo}}</p>
<p>当前监测点id:{{itemId}}</p>
</div>
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-control [nzOffset]="4" [nzSpan]="14"> <nz-form-control [nzOffset]="4" [nzSpan]="14">
<nz-radio-group [(ngModel)]="conditionType"> <nz-radio-group [(ngModel)]="conditionType">
......
...@@ -29,6 +29,7 @@ export class ThresholdComponent implements OnInit { ...@@ -29,6 +29,7 @@ export class ThresholdComponent implements OnInit {
faultCondition: '', faultCondition: '',
itemName: '' itemName: ''
}; };
demo = `示例1.{监测点id}>10 or {监测点id}=1 示例2. {监测点id}<10 and {监测点id}>3`;
constructor(private overAllSer: OverAllService, private fb: FormBuilder, constructor(private overAllSer: OverAllService, private fb: FormBuilder,
private message: NzMessageService) { private message: NzMessageService) {
......
...@@ -56,6 +56,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -56,6 +56,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
color = color; color = color;
loading = false; loading = false;
hostId: string; hostId: string;
hostObj;
tabNum = 0; tabNum = 0;
hostName; hostName;
realName; realName;
...@@ -134,6 +135,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -134,6 +135,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this.overAllSer.findDetailed(this.hostId).subscribe( this.overAllSer.findDetailed(this.hostId).subscribe(
(res) => { (res) => {
let data = res.data; let data = res.data;
this.hostObj = data;
this.hostName = data.name; //显示名 this.hostName = data.name; //显示名
this.realName = data.host; //主机名 this.realName = data.host; //主机名
} }
...@@ -645,12 +647,12 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -645,12 +647,12 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//添加监测点 //添加监测点
showCheckModal() { showCheckModal() {
this.smartCheck.showAddModal(this.hostId, this.realName, '添加监测点'); this.smartCheck.showAddModal(this.hostObj,this.hostId, this.realName, '添加监测点');
} }
//编辑监测点 //编辑监测点
showEditModal(item) { showEditModal(item) {
this.smartCheck.showEditModal(item,this.hostId, item.id, item.name, item.templateid, '编辑监测点'); this.smartCheck.showEditModal(this.hostObj,item,this.hostId, item.id, item.name, item.templateid, '编辑监测点');
} }
//添加阈值 //添加阈值
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
</ng-container> </ng-container>
</td> </td>
<td class="handle main-color"> <td class="handle main-color">
<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>
<span (click)="openHost(item)"> <span (click)="openHost(item)">
......
...@@ -292,7 +292,7 @@ export class BasicComponent implements OnInit { ...@@ -292,7 +292,7 @@ export class BasicComponent implements OnInit {
//添加监测点 //添加监测点
showBasicCheckModal(hostid, host) { showBasicCheckModal(hostid, host) {
this.smartCheck.showAddModal(hostid, host, '添加监测点'); // this.smartCheck.showAddModal(hostid, host, '添加监测点');
} }
//列表 //列表
......
...@@ -162,7 +162,7 @@ export class ItemListComponent implements OnInit { ...@@ -162,7 +162,7 @@ export class ItemListComponent implements OnInit {
//添加监测点 //添加监测点
showAddModal(){ showAddModal(){
this.smartBasiCheck.showAddModal(this.hostId,this.tempName,"添加模版监测点"); // this.smartBasiCheck.showAddModal(this.hostId,this.tempName,"添加模版监测点");
} }
//编辑监测点 //编辑监测点
......
...@@ -181,7 +181,7 @@ export class TemplateComponent implements OnInit { ...@@ -181,7 +181,7 @@ export class TemplateComponent implements OnInit {
//模版监测点 //模版监测点
showBasicCheckModal(hostid, host) { showBasicCheckModal(hostid, host) {
this.smartCheck.showAddModal(hostid, host, '添加模版监测点'); // this.smartCheck.showAddModal(hostid, host, '添加模版监测点');
} }
//添加自动发现 //添加自动发现
......
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