Commit ac3e0334 authored by wangqinghua's avatar wangqinghua

update

parent dd88d9d5
...@@ -61,8 +61,7 @@ ...@@ -61,8 +61,7 @@
</div> </div>
</div> </div>
<nz-table #nzTable [nzData]="logList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" <nz-table #nzTable [nzData]="logList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)">
[nzPageSize]="pageCount" (nzPageIndexChange)="change($event)">
<thead> <thead>
<tr> <tr>
<th nzWidth="20%">告警名称</th> <th nzWidth="20%">告警名称</th>
...@@ -78,8 +77,8 @@ ...@@ -78,8 +77,8 @@
<tbody> <tbody>
<tr *ngFor="let data of logList"> <tr *ngFor="let data of logList">
<td class="round-tag tag-form"> <td class="round-tag tag-form">
<nz-tag [nzColor]="'#fc0d1b'"></nz-tag> <!--<nz-tag [nzColor]="'#fc0d1b'"></nz-tag>-->
{{data.subject}} {{data.name}}
</td> </td>
<td>{{data.clock | date:"yyyy-MM-dd HH:mm:ss"}}</td> <td>{{data.clock | date:"yyyy-MM-dd HH:mm:ss"}}</td>
<td> <td>
...@@ -110,8 +109,7 @@ ...@@ -110,8 +109,7 @@
</tbody> </tbody>
</nz-table> </nz-table>
<!--告警内容--> <!--告警内容-->
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="null" nzTitle="查看告警内容" (nzOnCancel)="handleCancel()" <nz-modal [(nzVisible)]="isVisible" [nzFooter]="null" nzTitle="查看告警内容" (nzOnCancel)="handleCancel()">
>
<div style="padding: 10px;"> <div style="padding: 10px;">
<p>主题:</p> <p>主题:</p>
<p>{{title}}</p> <p>{{title}}</p>
......
...@@ -63,17 +63,17 @@ export class AlarmLogComponent implements OnInit { ...@@ -63,17 +63,17 @@ export class AlarmLogComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.getType(); this.getType();
this.getWarnGroup(); this.getWarnGroup();
this.getList(this.obj); this.getList();
} }
//获取list //获取list
getList(obj){ getList(){
const data = { const data = {
"eventPage":this.pageNum, "eventPage":this.pageNum,
"pageRecords":this.pageCount, "pageRecords":this.pageCount,
"alertGroupId":this.obj.alertGroupId, "alertGroupId":this.obj.alertGroupId,
"time_from":obj.time_from, "time_from":this.obj.time_from,
"time_till":obj.time_till, "time_till":this.obj.time_till,
"mediatypeids":[this.obj.mediatypeids], "mediatypeids":[this.obj.mediatypeids],
"hostids":[this.obj.hostids] "hostids":[this.obj.hostids]
}; };
...@@ -162,12 +162,12 @@ export class AlarmLogComponent implements OnInit { ...@@ -162,12 +162,12 @@ export class AlarmLogComponent implements OnInit {
search(){ search(){
this.obj.time_from = new Date(this.obj.time_from).getTime(); this.obj.time_from = new Date(this.obj.time_from).getTime();
this.obj.time_till = new Date(this.obj.time_till).getTime(); this.obj.time_till = new Date(this.obj.time_till).getTime();
this.getList(this.obj); this.getList();
} }
change(e){ change(e){
this.pageNum = e; this.pageNum = e;
// this.getList(null); this.getList();
} }
//查看消息内容 //查看消息内容
......
<nz-modal [nzWidth]="700" [(nzVisible)]="isShow" nzTitle="发送记录" (nzOnCancel)="closeModal()" (nzOnOk)="closeModal()"> <nz-modal [nzWidth]="980" [(nzVisible)]="isShow" [nzFooter]="null" nzTitle="发送记录" (nzOnCancel)="closeModal()" (nzOnOk)="closeModal()">
<nz-table #nzTable [nzData]="logList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading"> <nz-table #nzTable [nzData]="logList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead> <thead>
<tr> <tr>
<th>告警名称</th> <th nzWidth="15%">告警名称</th>
<th>告警时间</th> <th nzWidth="20%">告警时间</th>
<th>告警资源</th> <!--<th>告警资源</th>-->
<th>告警内容</th> <th nzWidth="30%">告警内容</th>
<th>状态</th> <th>状态</th>
<th>发送方式</th> <th>发送方式</th>
<th>发送对象</th> <th>发送对象</th>
...@@ -13,16 +13,20 @@ ...@@ -13,16 +13,20 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let data of logList"> <tr *ngFor="let data of logList">
<td>{{data.subject}}</td> <td>{{data.name}}</td>
<td>{{data.clock | date:"yyyy-MM-dd hh:mm:ss"}}</td> <td>{{data.clock | date:"yyyy-MM-dd hh:mm:ss"}}</td>
<td>告警资源</td> <!--<td>告警资源</td>-->
<td>{{data.message}}</td> <td>{{data.message}}</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>
<span *ngIf="data.status == 2">经多次重试后失败</span> <span *ngIf="data.status == 2">经多次重试后失败</span>
</td> </td>
<td>{{data.mediatypes[0].description}}</td> <td>
<ng-container *ngIf="data.mediatypes">
{{data.mediatypes[0].description}}
</ng-container>
</td>
<td class="list-icon">{{data.sendto}}</td> <td class="list-icon">{{data.sendto}}</td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -8,9 +8,13 @@ import { Router } from "@angular/router"; ...@@ -8,9 +8,13 @@ import { Router } from "@angular/router";
export class AppComponent { export class AppComponent {
constructor(private router: Router){ constructor(private router: Router){
//火狐拖动图片会打开新tab
document.body.ondrop = (event)=> { document.body.ondrop = (event)=> {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
} }
//监听打开弹窗
} }
} }
...@@ -36,11 +36,13 @@ ...@@ -36,11 +36,13 @@
<div class="layui-layout layui-layout-admin"> <div class="layui-layout layui-layout-admin">
<div class="layui-header layui-bg-gray"> <div class="layui-header layui-bg-gray" style="line-height: 60px">
<input style="width: 200px;" type="text" [(ngModel)]="name" nz-input placeholder="请输入拓扑图名称"> <input style="width: 200px;" type="text" [(ngModel)]="name" nz-input placeholder="请输入拓扑图名称">
图标:<span onclick="editor.utils.addNode()">添加</span>
<span onclick="editor.utils.deleteSelectedNodes()">移除</span>
<!-- 顶部工具栏 --> <!-- 顶部工具栏 -->
<div class="layui-nav layui-layout-right" style="line-height: 60px"> <div class="layui-nav layui-layout-right" >
<!--<span aria-hidden="true" title="编辑" onClick="editor.utils.editTopology()">编辑</span>-->
<span aria-hidden="true" title="全屏查看" <span aria-hidden="true" title="全屏查看"
onClick="editor.utils.showInFullScreen(editor.stage.canvas,'RequestFullScreen')"> onClick="editor.utils.showInFullScreen(editor.stage.canvas,'RequestFullScreen')">
全屏查看</span> 全屏查看</span>
...@@ -51,8 +53,6 @@ ...@@ -51,8 +53,6 @@
<span aria-hidden="true" title="保存" (click)="save()">保存</span> <span aria-hidden="true" title="保存" (click)="save()">保存</span>
<span aria-hidden="true" title="复制" <span aria-hidden="true" title="复制"
onClick="editor.utils.cloneSelectedNodes()">复制</span> onClick="editor.utils.cloneSelectedNodes()">复制</span>
<span aria-hidden="true" title="删除"
onClick="editor.utils.deleteSelectedNodes()">删除</span>
<span aria-hidden="true" title="清空" <span aria-hidden="true" title="清空"
onClick="editor.utils.clearTopology()">清空</span> onClick="editor.utils.clearTopology()">清空</span>
<span aria-hidden="true" title="放大" <span aria-hidden="true" title="放大"
...@@ -556,7 +556,7 @@ ...@@ -556,7 +556,7 @@
<span>当前时间:<label name="current_time"></label></span> <span>当前时间:<label name="current_time"></label></span>
</div> </div>
<canvas class="topology-context" id="topology-canvas" #topologyCanvas <canvas class="topology-context" id="topology-canvas" #topologyCanvas
style="height: 580px;width: 100%;"> style="height: 580px;">
您的浏览器不支持HTML5! 您的浏览器不支持HTML5!
</canvas> </canvas>
<span class="tips">{{topoType}}</span> <span class="tips">{{topoType}}</span>
...@@ -565,3 +565,109 @@ ...@@ -565,3 +565,109 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 设备编辑 -->
<div id="node-dialog" style="display: none;">
<form id="node-form" class="layui-form" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">类型</label>
<div class="layui-input-block">
<select name="city">
<option value=""></option>
<option value="0">主机</option>
<option value="1">拓扑图</option>
<option value="2">触发器</option>
<option value="3">主机群组</option>
<option value="4">图片</option>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">标签</label>
<div class="layui-input-block">
<input type="text" name="text" required autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">标签位置</label>
<div class="layui-input-block">
<select name="textPosition">
<option value="Bottom_Center">默认</option>
<option value="Top_Left">顶部居左</option>
<option value="Top_Center">顶部居中</option>
<option value="Top_Right">顶部居右</option>
<option value="Bottom_Left">低部居左</option>
<option value="Bottom_Center">低部居中</option>
<option value="Bottom_Right">低部居右</option>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">坐标</label>
<div class="layui-input-inline" style="width: 100px;">
<input type="text" name="x" placeholder="X" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 100px;">
<input type="text" name="y" placeholder="Y" autocomplete="off" class="layui-input">
</div>
</div>
</form>
</div>
<!--连线编辑-->
<div id="link-dialog" style="display: none;">
<form id="link-form" class="layui-form" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">线类型</label>
<div class="layui-input-block">
<select name="textPosition">
<option value="0"></option>
<option value="1">———</option>
<option value="2">· · · ·</option>
<option value="dashedPattern">- - - -</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">线宽</label>
<div class="layui-input-block">
<input type="text" name="lineWidth" required autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input type="text" name="lineName" required autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">x1</label>
<div class="layui-input-inline" style="width: 60px;">
<input type="text" name="x1" placeholder="X" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">y1</label>
<div class="layui-input-inline" style="width: 60px;">
<input type="text" name="y1" placeholder="Y" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">x2</label>
<div class="layui-input-inline" style="width: 60px;">
<input type="text" name="x2" placeholder="X" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">y2</label>
<div class="layui-input-inline" style="width: 60px;">
<input type="text" name="y2" placeholder="Y" autocomplete="off" class="layui-input">
</div>
</div>
</form>
</div>
<nz-modal >
</nz-modal>
\ No newline at end of file
...@@ -20,7 +20,7 @@ declare let layui: any; ...@@ -20,7 +20,7 @@ declare let layui: any;
color: #666666; color: #666666;
} }
.layui-layout-right span { .layui-header span {
margin-right: 15px; margin-right: 15px;
cursor: pointer; cursor: pointer;
} }
......
...@@ -160,9 +160,10 @@ ...@@ -160,9 +160,10 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let data of checkTable.data"> <tr *ngFor="let data of checkTable.data">
<td> <td class="tag-form">
<nz-tag *ngIf="data.priority == 4 || data.priority == 5" [nzColor]="color.red"></nz-tag> <nz-tag *ngIf="data.priority == 4 || data.priority == 5" [nzColor]="color.red"></nz-tag>
<nz-tag *ngIf="data.priority == 2 || data.priority == 3" [nzColor]="color.yellow"></nz-tag> <nz-tag *ngIf="data.priority == 2 || data.priority == 3" [nzColor]="color.yellow"></nz-tag>
<nz-tag *ngIf="data.priority == -1" [nzColor]="color.green"></nz-tag>
{{data.name}}</td> {{data.name}}</td>
<td>{{data.lastvalue}}</td> <td>{{data.lastvalue}}</td>
<td>{{data.lastclock}}</td> <td>{{data.lastclock}}</td>
......
...@@ -185,7 +185,7 @@ export class OverAllService { ...@@ -185,7 +185,7 @@ export class OverAllService {
} }
itemUpdata(data): Observable<any>{ itemUpdata(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/item/updata/' , data); return this.http.put(SERVER_API_URL + '/item/updata/' , data);
} }
//临时暂停 //临时暂停
......
...@@ -18,50 +18,6 @@ export class PowerComponent implements OnInit { ...@@ -18,50 +18,6 @@ export class PowerComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.dataSet = [
{
key1: '角色名称',
key2: '说明',
key3: '权限模块',
key4: '资源权限',
key5: '有效'
},
{
key1: '角色名称',
key2: '说明',
key3: '权限模块',
key4: '资源权限',
key5: '有效'
},
{
key1: '角色名称',
key2: '说明',
key3: '权限模块',
key4: '资源权限',
key5: '有效'
},
{
key1: '角色名称',
key2: '说明',
key3: '权限模块',
key4: '资源权限',
key5: '有效'
},
{
key1: '角色名称',
key2: '说明',
key3: '权限模块',
key4: '资源权限',
key5: '有效'
},
{
key1: '角色名称',
key2: '说明',
key3: '权限模块',
key4: '资源权限',
key5: '有效'
},
];
this.getRole(); this.getRole();
} }
......
...@@ -30,7 +30,6 @@ TopologyPanel.prototype.saveTopology = function (url) { ...@@ -30,7 +30,6 @@ TopologyPanel.prototype.saveTopology = function (url) {
} }
// 获取json // 获取json
let topologyJSON = editor.stage.toJson(); let topologyJSON = editor.stage.toJson();
console.log(topologyJSON);
return topologyJSON; return topologyJSON;
// 保存拓扑图数据 // 保存拓扑图数据
} }
...@@ -476,7 +475,6 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) { ...@@ -476,7 +475,6 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) {
// alert('加载拓扑编辑器失败!') // alert('加载拓扑编辑器失败!')
return return
} }
console.log(topologyJson);
this.topologyGuid = topologyGuid this.topologyGuid = topologyGuid
// 创建jTopo舞台屏幕对象 // 创建jTopo舞台屏幕对象
let canvas = document.getElementById('topology-canvas') let canvas = document.getElementById('topology-canvas')
...@@ -487,7 +485,6 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) { ...@@ -487,7 +485,6 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) {
this.stage = new JTopo.Stage(canvas) // 定义舞台对象 this.stage = new JTopo.Stage(canvas) // 定义舞台对象
this.scene = new JTopo.Scene(this.stage) // 定义场景对象 this.scene = new JTopo.Scene(this.stage) // 定义场景对象
} else { } else {
console.log(topologyJson);
this.stage = JTopo.createStageFromJson(topologyJson, canvas) // 根据保存好的jsonStr(拓扑结构)创建舞台对象 this.stage = JTopo.createStageFromJson(topologyJson, canvas) // 根据保存好的jsonStr(拓扑结构)创建舞台对象
this.scene = this.stage.childs[0] // 场景对象列表,childs是舞台的属性 this.scene = this.stage.childs[0] // 场景对象列表,childs是舞台的属性
} }
...@@ -626,9 +623,13 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) { ...@@ -626,9 +623,13 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) {
self.currentNode.text = param.text; self.currentNode.text = param.text;
self.currentNode.textPosition = param.textPosition; self.currentNode.textPosition = param.textPosition;
self.currentNode.setLocation(param.x, param.y); self.currentNode.setLocation(param.x, param.y);
$("#node-dialog").css("display","none")
}, },
btn2: function () { btn2: function () {
editor.utils.deleteNode(self.currentNode); editor.utils.deleteNode(self.currentNode);
},
cancel:function () {
$("#node-dialog").css("display","none")
} }
}); });
} else if (event.target instanceof JTopo.Link && editor.stageMode === 'edit') { } else if (event.target instanceof JTopo.Link && editor.stageMode === 'edit') {
...@@ -640,12 +641,17 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) { ...@@ -640,12 +641,17 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) {
btn: ["应用", "删除", "取消"], btn: ["应用", "删除", "取消"],
yes: function(index, layero){ yes: function(index, layero){
let param = getParam("link-form"); let param = getParam("link-form");
self.currentNode.text = param.text; self.currentNode.text = param.lineName;
self.currentNode.textPosition = param.textPosition; self.currentNode.textPosition = param.textPosition;
self.currentNode.setLocation(param.x, param.y); self.currentNode.setLocation(param.x, param.y);
$('#link-dialog').css('display', 'none')
layer.close(index);
}, },
btn2: function () { btn2: function () {
editor.utils.deleteNode(self.currentNode); editor.utils.deleteNode(self.currentNode);
},
cancel:function () {
$('#link-dialog').css('display', 'none')
} }
}); });
} }
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
height: 100%; height: 100%;
font-weight: 400; font-weight: 400;
} }
body{
padding-right: 0 !important;
}
.square-flip { .square-flip {
position: relative; position: relative;
width: 100%; width: 100%;
...@@ -57,7 +59,7 @@ ...@@ -57,7 +59,7 @@
} }
</style> </style>
<body class="layui-layout-body"> <body>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade
your browser</a> to improve your experience.</p> your browser</a> to improve your experience.</p>
...@@ -71,7 +73,7 @@ ...@@ -71,7 +73,7 @@
<h1>You must enable javascript to view this page</h1> <h1>You must enable javascript to view this page</h1>
</noscript> </noscript>
<script src="javascript/jquery-3.3.1/jquery-3.3.1.min.js" type="text/javascript"></script> <script src="javascript/jquery-3.3.1/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="javascript/layui-2.3.0/layui.js" type="text/javascript"></script> <script src="javascript/layui-2.3.0/layui.all.js" type="text/javascript"></script>
<!-- js of this project --> <!-- js of this project -->
<script src="javascript/jtopo/js/util.js" type="text/javascript"></script> <script src="javascript/jtopo/js/util.js" type="text/javascript"></script>
<script src="javascript/jtopo/js/jtopo-0.4.8-dev.js" type="text/javascript"></script> <script src="javascript/jtopo/js/jtopo-0.4.8-dev.js" type="text/javascript"></script>
......
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