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'">
<ng-container *ngFor="let item of menuList">
<li nz-submenu (nzOpenChange)="openHandler(item)" [(nzOpen)]="item.checked">
......
......@@ -31,18 +31,6 @@
<nz-form-explain *ngIf="validateForm.get('type').dirty && validateForm.get('type').errors">请选择监测点类型!</nz-form-explain>
</nz-form-control>
</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-label [nzSpan]="6" nzRequired nzFor="key_">键值</nz-form-label>
<nz-form-control [nzSpan]="14">
......
......@@ -17,11 +17,9 @@ export class DiscoveryComponent implements OnInit {
title;
isVisiable = false;
isInterface = true;
nzSize = 'large';
hostId; //主机ID
itemId; //监控项id
interfaceList: any[];
valueMapList = [];
validateForm: FormGroup;
checkList; //监测点分类
......@@ -44,7 +42,6 @@ export class DiscoveryComponent implements OnInit {
snmp_oid: ['interfaces.ifTable.ifEntry.ifInOctets.1'],
snmp_community: ['public'],
port: [this.hostId],
interfaceid: [null,],
delay: [null, [Validators.required]],
description: [null],
lifetime: ['3600'],
......@@ -57,12 +54,6 @@ export class DiscoveryComponent implements OnInit {
this.title = title;
this.isVisiable = true;
this.hostId = hostId;
//主机接口
this.overAllSer.findInterface(this.hostId).subscribe(
(res) => {
this.interfaceList = res.data;
}
);
}
//编辑
......@@ -75,18 +66,10 @@ export class DiscoveryComponent implements OnInit {
(res) => {
const data = res.data[0];
data.type += '';
data.interfaceid += '';
data.value_type += '';
this.validateForm.patchValue(data);
}
);
//主机接口
this.overAllSer.findInterface(this.hostId).subscribe(
(res) => {
this.interfaceList = res.data;
}
);
}
//添加
......@@ -101,9 +84,9 @@ export class DiscoveryComponent implements OnInit {
}
let d = this.validateForm.value.status == true ? 1 : 0;
this.validateForm.patchValue({
status:d
status:d,
hostid:this.hostId
})
this.validateForm.value.hostid = this.hostId;
if (this.title == '添加自动发现') {
this.create();
}
......
......@@ -50,7 +50,7 @@
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td class="round-tag tag-form">{{data.name}}</td>
<td>{{data.key_}}</td>
<td>{{data.usedcount}}</td>
<td>{{data.delay}}</td>
<td>
<span *ngIf="data.status == 0">启用</span>
<span *ngIf="data.status == 1">禁用</span>
......
<div class="background">
<div class="login-center">
<div class="login-logo">
<img src="../../../content/images/logo.png" alt="智能监控平台">
<img src="../../../content/images/logo-hongqiao.png" alt="智能监控平台">
</div>
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
<nz-form-item>
......
......@@ -3,21 +3,22 @@
* @type {{getRootPath: SysUtil.getRootPath}}
*/
var SysUtil = {
getRootPath: function () {
// 获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp
var curWwwPath = window.document.location.href
// 获取主机地址之后的目录,如: uimcardprj/share/meun.jsp
var pathName = window.document.location.pathname
var pos = curWwwPath.indexOf(pathName, 7)
// 获取主机地址,如: http://localhost:8083
var localhostPath = curWwwPath.substring(0, pos)
// 获取带"/"的项目名,如:/uimcardprj
var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 2)
return localhostPath + projectName
}
getRootPath: function () {
// 获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp
var curWwwPath = window.document.location.href
// 获取主机地址之后的目录,如: uimcardprj/share/meun.jsp
var pathName = window.document.location.pathname
var pos = curWwwPath.indexOf(pathName, 7)
// 获取主机地址,如: http://localhost:8083
var localhostPath = curWwwPath.substring(0, pos)
// 获取带"/"的项目名,如:/uimcardprj
var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 2)
return localhostPath;
}
}
// url根路径
var rootPath = "http://10.10.38.99:8282";
var rootPath = SysUtil.getRootPath();
// var topoImgPath = 'javascript/jtopo/img/';
var topoImgPath = rootPath + '/file/icon/';
/*
......@@ -25,13 +26,13 @@ var topoImgPath = rootPath + '/file/icon/';
* @param x 0-9或a-f范围内的一个32位十六进制数
*/
function generateUUID () {
var d = new Date().getTime()
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0
d = Math.floor(d / 16)
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)
});
return uuid
var d = new Date().getTime()
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0
d = Math.floor(d / 16)
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)
});
return uuid
}
function getParam(formId) {
......@@ -52,30 +53,30 @@ function getParam(formId) {
* @type {{startTime: {}, timeSpan: number, start: Timer.start, stop: Timer.stop, getTimeSpan: Timer.getTimeSpan}}
*/
var Timer = {
startTime: {},
stoppedStatus: true,
start: function () {
if (this.stoppedStatus) {
this.startTime = new Date()
this.stoppedStatus = false
}
},
pause: function () {
var startTime = this.startTime
if (startTime) {
return new Date() - startTime
} else {
return -1
}
},
stop: function () {
var startTime = this.startTime
if (startTime) {
this.stoppedStatus = true
return new Date() - startTime
} else {
this.stoppedStatus = true
return -1
startTime: {},
stoppedStatus: true,
start: function () {
if (this.stoppedStatus) {
this.startTime = new Date()
this.stoppedStatus = false
}
},
pause: function () {
var startTime = this.startTime
if (startTime) {
return new Date() - startTime
} else {
return -1
}
},
stop: function () {
var startTime = this.startTime
if (startTime) {
this.stoppedStatus = true
return new Date() - startTime
} else {
this.stoppedStatus = true
return -1
}
}
}
}
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