Commit 7ec5a6ec authored by wangqinghua's avatar wangqinghua

update

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