Commit 9a8a65c0 authored by wangqinghua's avatar wangqinghua

update

parent eb661895
<div class="logo padding-40">智能监控平台</div> <div class="logo padding-40">运维管理系统</div>
<ul nz-menu [nzMode]="'inline'"> <ul nz-menu [nzMode]="'inline'">
<ng-container *ngFor="let item of menuList"> <ng-container *ngFor="let item of menuList">
<li nz-submenu (nzOpenChange)="openHandler(item)" [(nzOpen)]="item.checked"> <li nz-submenu (nzOpenChange)="openHandler(item)" [(nzOpen)]="item.checked">
......
...@@ -31,18 +31,6 @@ ...@@ -31,18 +31,6 @@
<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-label [nzSpan]="6" 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.interfaceid}}"
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>
</ng-container>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired nzFor="key_">键值</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired nzFor="key_">键值</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
......
...@@ -17,11 +17,9 @@ export class DiscoveryComponent implements OnInit { ...@@ -17,11 +17,9 @@ export class DiscoveryComponent implements OnInit {
title; title;
isVisiable = false; isVisiable = false;
isInterface = true;
nzSize = 'large'; nzSize = 'large';
hostId; //主机ID hostId; //主机ID
itemId; //监控项id itemId; //监控项id
interfaceList: any[];
valueMapList = []; valueMapList = [];
validateForm: FormGroup; validateForm: FormGroup;
checkList; //监测点分类 checkList; //监测点分类
...@@ -44,7 +42,6 @@ export class DiscoveryComponent implements OnInit { ...@@ -44,7 +42,6 @@ export class DiscoveryComponent implements OnInit {
snmp_oid: ['interfaces.ifTable.ifEntry.ifInOctets.1'], snmp_oid: ['interfaces.ifTable.ifEntry.ifInOctets.1'],
snmp_community: ['public'], snmp_community: ['public'],
port: [this.hostId], port: [this.hostId],
interfaceid: [null,],
delay: [null, [Validators.required]], delay: [null, [Validators.required]],
description: [null], description: [null],
lifetime: ['3600'], lifetime: ['3600'],
...@@ -57,12 +54,6 @@ export class DiscoveryComponent implements OnInit { ...@@ -57,12 +54,6 @@ export class DiscoveryComponent implements OnInit {
this.title = title; this.title = title;
this.isVisiable = true; this.isVisiable = true;
this.hostId = hostId; this.hostId = hostId;
//主机接口
this.overAllSer.findInterface(this.hostId).subscribe(
(res) => {
this.interfaceList = res.data;
}
);
} }
//编辑 //编辑
...@@ -75,18 +66,10 @@ export class DiscoveryComponent implements OnInit { ...@@ -75,18 +66,10 @@ export class DiscoveryComponent implements OnInit {
(res) => { (res) => {
const data = res.data[0]; const data = res.data[0];
data.type += ''; data.type += '';
data.interfaceid += '';
data.value_type += ''; data.value_type += '';
this.validateForm.patchValue(data); this.validateForm.patchValue(data);
} }
); );
//主机接口
this.overAllSer.findInterface(this.hostId).subscribe(
(res) => {
this.interfaceList = res.data;
}
);
} }
//添加 //添加
...@@ -101,9 +84,9 @@ export class DiscoveryComponent implements OnInit { ...@@ -101,9 +84,9 @@ export class DiscoveryComponent implements OnInit {
} }
let d = this.validateForm.value.status == true ? 1 : 0; let d = this.validateForm.value.status == true ? 1 : 0;
this.validateForm.patchValue({ this.validateForm.patchValue({
status:d status:d,
hostid:this.hostId
}) })
this.validateForm.value.hostid = this.hostId;
if (this.title == '添加自动发现') { if (this.title == '添加自动发现') {
this.create(); this.create();
} }
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td> <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td class="round-tag tag-form">{{data.name}}</td> <td class="round-tag tag-form">{{data.name}}</td>
<td>{{data.key_}}</td> <td>{{data.key_}}</td>
<td>{{data.usedcount}}</td> <td>{{data.delay}}</td>
<td> <td>
<span *ngIf="data.status == 0">启用</span> <span *ngIf="data.status == 0">启用</span>
<span *ngIf="data.status == 1">禁用</span> <span *ngIf="data.status == 1">禁用</span>
......
<div class="background"> <div class="background">
<div class="login-center"> <div class="login-center">
<div class="login-logo"> <div class="login-logo">
<img src="../../../content/images/logo.png" alt="智能监控平台"> <img src="../../../content/images/logo-hongqiao.png" alt="智能监控平台">
</div> </div>
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()"> <form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item> <nz-form-item>
......
...@@ -13,11 +13,12 @@ var SysUtil = { ...@@ -13,11 +13,12 @@ var SysUtil = {
var localhostPath = curWwwPath.substring(0, pos) var localhostPath = curWwwPath.substring(0, pos)
// 获取带"/"的项目名,如:/uimcardprj // 获取带"/"的项目名,如:/uimcardprj
var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 2) var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 2)
return localhostPath + projectName return localhostPath;
} }
} }
// url根路径 // url根路径
var rootPath = "http://10.10.38.99:8282"; var rootPath = SysUtil.getRootPath();
// var topoImgPath = 'javascript/jtopo/img/';
var topoImgPath = rootPath + '/file/icon/'; var topoImgPath = rootPath + '/file/icon/';
/* /*
......
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