Commit bd08a093 authored by wangqinghua's avatar wangqinghua

兼容性测试

parent 9e8886d0
......@@ -40,7 +40,7 @@ Module ng g module my-module
版本更新:
v2.0.1 修复选择节点之后 流量查询不出来
****上传文件到服务器******
scp -r 22 build/www root@10.10.38.99:/home/nginx
scp -r 22 build/wx root@10.10.38.99:/home/nginx/www
......@@ -27,8 +27,7 @@
</nz-select>
</div>
<div nz-col nzSpan="7">
<nz-radio-group style="width: 100%;" [(ngModel)]="timeType" (ngModelChange)="changeType()"
[nzButtonStyle]="'solid'">
<nz-radio-group style="width: 100%;" [(ngModel)]="timeType" (ngModelChange)="changeType()">
<label nz-radio-button nzValue="1">今天</label>
<label nz-radio-button nzValue="2">昨天</label>
<label nz-radio-button nzValue="3">三天</label>
......
......@@ -31,6 +31,7 @@ export class ResourceUsabilComponent implements OnInit {
lastList;
obj = {
timeType:this.timeType,
type: '',
groupid: '',
startTime: '',
......
......@@ -72,7 +72,7 @@
</div>
</div>
</div>
<nz-tabset class="tabs-smart">
<nz-tabset class="tabs-smart" [nzType]="'card'">
<nz-tab nzTitle="网站监测">
<div style="min-height: 500px">
<ng-container *ngIf="noData">
......@@ -183,4 +183,4 @@
</nz-tab>
</nz-tabset>
</div>
</div>
\ No newline at end of file
</div>
This diff is collapsed.
<!--告警推送-->
<nz-modal [nzWidth]="1080" [(nzVisible)]="isShow" [nzTitle]="title" (nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()" [nzOkLoading]="isOkLoading">
<nz-tabset [(nzSelectedIndex)]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tabset [nzType]="'card'" [(nzSelectedIndex)]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="选定告警目标">
<div nz-form class="ant-advanced-search-form form-select">
<nz-form-item>
......
<!--添加资源-->
<nz-modal [nzWidth]="1080" [(nzVisible)]="isBasicEdit" [nzTitle]="modalTitle" (nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()" [nzOkLoading]="isOkLoading">
<nz-tabset [(nzSelectedIndex)]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tabset [(nzSelectedIndex)]="tabNum" [nzType]="'card'" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="资源信息">
<div nz-form class="ant-advanced-search-form form-select">
<nz-form-item>
......@@ -232,7 +232,7 @@
全局值(配置)
</div>
</div>
<div nz-row [nzGutter]="12" *ngFor="let item of macroList2">
<div nz-row [nzGutter]="12" *ngFor="let item of macroList2;let i = index;">
<nz-form-control nz-col [nzOffset]="2" [nzSpan]="6">
<input nz-input placeholder="{$SNMP_COMMUNITY}" value="{{item.macro}}">
</nz-form-control>
......
<nz-modal [nzWidth]="880" [nzFooter]="null" [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleCancel()"
(nzOnOk)="handleOk()">
<nz-tabset [nzSelectedIndex]="tabNum" (nzSelectedIndexChange)="tabsChange($event)"
<nz-tabset [nzType]="'card'" [nzSelectedIndex]="tabNum" (nzSelectedIndexChange)="tabsChange($event)"
style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="模版">
<div nz-form>
......
<nz-modal [nzWidth]="1080" [(nzVisible)]="isVisible" nzTitle="{{title}}" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" [nzOkLoading]="isOkLoading">
<nz-tabset [nzSelectedIndex]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tabset [nzType]="'card'" [nzSelectedIndex]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="1.场景">
<div nz-form class="ant-advanced-search-form form-select">
<form nz-form class="ant-advanced-search-form">
......@@ -318,4 +318,4 @@
</form>
</nz-tab>
</nz-tabset>
</nz-modal>
\ No newline at end of file
</nz-modal>
<!--进出口流量-->
<nz-modal [nzWidth]="780" [(nzVisible)]="isLine" nzTitle="流量配置" (nzOnCancel)="handleLineCancel()" (nzOnOk)="handleLineOk()">
<form nz-form>
<nz-tabset>
<nz-tabset [nzType]="'card'">
<nz-tab nzTitle="进流量">
<div class="padding-10">
<input (keyup.enter)="getInList()" name="inSearchName" style="width: 200px;" type="text" nz-input [(ngModel)]="inSearchName" placeholder="输入名称">
......@@ -58,4 +58,4 @@
</nz-tab>
</nz-tabset>
</form>
</nz-modal>
\ No newline at end of file
</nz-modal>
......@@ -50,7 +50,7 @@
{{checkStatus.disabled}}
</span>
</div>
<nz-tabset [nzSelectedIndex]="tabNum" class="tabs-smart">
<nz-tabset [nzType]="'card'" [nzSelectedIndex]="tabNum" class="tabs-smart">
<nz-tab nzTitle="资源详情">
<section>
<p class="padding-8-0">{{hostName}}</p>
......
......@@ -81,7 +81,7 @@ export class BasicComponent implements OnInit {
totalNum;
constructor(private fb: FormBuilder, private overAllSer: OverAllService, private router: Router,
private commonSer:CommonService,
private commonSer: CommonService,
private modalService: NzModalService, private message: NzMessageService, private main: JhiMainComponent) {
}
......@@ -176,10 +176,10 @@ export class BasicComponent implements OnInit {
this.findOpStatus();
}
changeStatus(status){
if(this.status == status){
changeStatus(status) {
if (this.status == status) {
this.status = null;
}else{
} else {
this.status = status;
}
this.pageNum = 1;
......@@ -189,7 +189,7 @@ export class BasicComponent implements OnInit {
/*
//waringName:(值为:正常,禁用,告警,严重)
*/
search(){
search() {
this.pageNum = 1;
this.searchRe();
}
......@@ -198,28 +198,28 @@ export class BasicComponent implements OnInit {
this.loading = true;
this.searchStatus = true;
const data = {
pageNum:this.pageNum,
pageCount:this.pageCount,
obj:{
name:this.searchName,
waringName:this.status,
groupids:[]
pageNum: this.pageNum,
pageCount: this.pageCount,
obj: {
name: this.searchName,
waringName: this.status,
groupids: []
}
}
};
this.overAllSer.findHostPageNew(data).subscribe(
(res)=>{
(res) => {
if (res.errCode == 10000) {
this.dataSet = res.data.data;
this.totalNum = res.data.totalNum;
}
this.loading = false;
}
)
);
}
//翻页
change(event){
if(event > 0){
change(event) {
if (event > 0) {
this.pageNum = event;
this.searchRe();
}
......@@ -235,7 +235,7 @@ export class BasicComponent implements OnInit {
//查询设备状态
findOpStatus() {
this.overAllSer.findHostCountByStatusByHost().subscribe(
(res)=>{
(res) => {
if (res.errCode == 10000) {
this.green = res.data.normal;
this.gray = res.data.disable;
......@@ -246,7 +246,7 @@ export class BasicComponent implements OnInit {
this.message.info(res.Msg);
}
}
)
);
}
//添加资源
......@@ -261,7 +261,7 @@ export class BasicComponent implements OnInit {
//添加监测点
showBasicCheckModal(hostid, host) {
this.smartCheck.showAddModal(hostid, host,'添加监测点');
this.smartCheck.showAddModal(hostid, host, '添加监测点');
}
//列表
......@@ -325,7 +325,7 @@ export class BasicComponent implements OnInit {
//删除单个资源
showDeleteConfirm(item) {
this.commonSer.confirmThing("删除","确认删除该资源吗?",()=>{
this.commonSer.confirmThing('删除', '确认删除该资源吗?', () => {
const data = {
hostids: []
};
......@@ -340,7 +340,7 @@ export class BasicComponent implements OnInit {
}
}
);
})
});
}
//批量删除资源
......@@ -350,7 +350,7 @@ export class BasicComponent implements OnInit {
return false;
}
this.commonSer.confirmThing("删除","确认要删除所选设备吗?",()=>{
this.commonSer.confirmThing('删除', '确认要删除所选设备吗?', () => {
const data = {
hostids: this.batchDelList
};
......@@ -406,7 +406,7 @@ export class BasicComponent implements OnInit {
//添加告警
showAlarm() {
this.smartAlarmModal.showAddModal('添加告警',null);
this.smartAlarmModal.showAddModal('添加告警', null);
}
handleOk(e) {
......
......@@ -27,7 +27,7 @@
<button (click)="showDeleteConfirm()" nz-button nzType="default">删除</button>
</div>
<div class="releative">
<nz-tabset class="tabs-smart ">
<nz-tabset class="tabs-smart" [nzType]="'card'">
<nz-tab nzTitle="监测信息">
<section>
<div nz-row nzGutter="24">
......
import {Injectable, OnInit} from "@angular/core";
import {Injectable, OnInit} from '@angular/core';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../../app.constants';
import {DatePipe} from '@angular/common';
declare var ActiveXObject: ActiveXObject;
interface ActiveXObject {
new (type: string): ActiveXObject;
SendKeys(key: string): void;
}
@Injectable()
export class CommonService implements OnInit {
constructor(private modalSer:NzModalService,private datePipe:DatePipe,
private message:NzMessageService) {
constructor(private modalSer: NzModalService, private datePipe: DatePipe,
private message: NzMessageService) {
// 定义发射事件
}
......@@ -14,9 +20,9 @@ export class CommonService implements OnInit {
}
exists(list, parentId,myId){
for(let i=0; i<list.length; i++){
if(list[i][myId] == parentId){
exists(list, parentId, myId) {
for (let i = 0; i < list.length; i++) {
if (list[i][myId] == parentId) {
return true;
}
}
......@@ -30,26 +36,26 @@ export class CommonService implements OnInit {
* @param list
* @returns {any[]}
*/
listToTree(myId,pId,list){
const nodes = [];
for(let i=0; i<list.length; i++){
listToTree(myId, pId, list) {
const nodes = [];
for (let i = 0; i < list.length; i++) {
list[i].checked = false;
const row = list[i];
if ( !this.exists(list, row[pId],myId) ){
if (!this.exists(list, row[pId], myId)) {
nodes.push(row);
}
}
const toDo = [];
for(let i=0; i<nodes.length; i++){
for (let i = 0; i < nodes.length; i++) {
toDo.push(nodes[i]);
}
while(toDo.length){
while (toDo.length) {
const node = toDo.shift(); // the parent node
for(let i=0; i<list.length; i++){
for (let i = 0; i < list.length; i++) {
const row = list[i];
if (row[pId] == node[myId]){
if (node.children){
if (row[pId] == node[myId]) {
if (node.children) {
node.children.push(row);
} else {
node.children = [row];
......@@ -66,7 +72,7 @@ export class CommonService implements OnInit {
* @param data json格式的数据
* @returns {string}
*/
toQuery(data){
toQuery(data) {
let str = '';
for (let key in data) {
if (data.hasOwnProperty(key)) {
......@@ -83,16 +89,16 @@ export class CommonService implements OnInit {
* @param title 提示语
* @param callback 回调函数
*/
confirmThing(title,content,callback){
confirmThing(title, content, callback) {
this.modalSer.confirm({
nzTitle: title,
nzContent: '<b style="color: red;">'+content+'</b>',
nzContent: '<b style="color: red;">' + content + '</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: callback,
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel'),
})
});
}
/**
......@@ -131,11 +137,24 @@ export class CommonService implements OnInit {
* @param method 全屏方法
* @returns {any}
*/
showInFullScreen(element, method){
showInFullScreen(element, method) {
let usablePrefixMethod;
['webkit', 'moz', 'ms', 'o', ''].forEach( (prefix)=> {
const ie = navigator.userAgent.match(/MSIE\s([\d.]+)/),
ie11 = navigator.userAgent.match(/Trident\/7.0/) && navigator.userAgent.match(/rv:11/),
ieEDGE = navigator.userAgent.match(/Edge/g),
ieVer = (ie ? ie[1] : (ie11 ? 11 : (ieEDGE ? 12 : -1)));
if (ieVer > -1) {
if(typeof (<any>window).ActiveXObject !== "undefined") {
//这的方法 模拟f11键,使浏览器全屏
const wscript = new ActiveXObject("WScript.Shell");
if(wscript != null) {
wscript.SendKeys("{F11}");
}
}
}
['webkit', 'moz', 'ms', 'o', ''].forEach((prefix) => {
if (usablePrefixMethod) {
return
return;
}
if (prefix === '') {
// 无前缀,方法首字母小写
......@@ -144,13 +163,13 @@ export class CommonService implements OnInit {
let typePrefixMethod = typeof element[prefix + method];
if (typePrefixMethod + '' !== 'undefined') {
if (typePrefixMethod === 'function') {
usablePrefixMethod = element[prefix + method]()
usablePrefixMethod = element[prefix + method]();
} else {
usablePrefixMethod = element[prefix + method]
usablePrefixMethod = element[prefix + method];
}
}
}
)
);
return usablePrefixMethod;
}
......@@ -158,12 +177,12 @@ export class CommonService implements OnInit {
* 根据type 查询时间段
* @param timeType 0:最近一小时 1:今天 2:昨天(最近一天) 3:最近三天 4:最近一周 5:最近一个月
*/
getTimeByType(timeType){
getTimeByType(timeType) {
const nowDate = new Date().getTime();
let day1, day2; //当作变量使用
let obj = {startTime:'',endTime:''};
let obj = {startTime: '', endTime: ''};
switch (timeType) {
case'0':{ //最近一小时
case'0': { //最近一小时
day1 = nowDate - 1 * 60 * 60 * 1000;
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd HH:mm:ss');
obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd HH:mm:ss');
......
......@@ -29,7 +29,7 @@
<button (click)="showEditModal()" nz-button nzType="default">编辑</button>
<button (click)="deleteModal()" nz-button nzType="default">删除</button>
</div>
<nz-tabset class="tabs-smart ">
<nz-tabset [nzType]="'card'" class="tabs-smart ">
<nz-tab #thirdTabs nzTitle="资产信息">
<div nz-form class="ant-advanced-search-form form-select">
......@@ -255,4 +255,4 @@
<!--选择资源-->
<smart-select-group #smartSelectGroup (done)="setLink($event)"></smart-select-group>
<!--资产-->
<smart-assets #smartAssets (done)="getDetail()"></smart-assets>
\ No newline at end of file
<smart-assets #smartAssets (done)="getDetail()"></smart-assets>
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