Commit c7d456a5 authored by wangqinghua's avatar wangqinghua

update

parent 68020c1a
......@@ -70,7 +70,7 @@
<th>状态</th>
<th>发送方式</th>
<th>发送对象</th>
<th>操作</th>
<!--<th>操作</th>-->
</tr>
</thead>
<tbody>
......@@ -100,9 +100,9 @@
<td>
{{data.sendto}}
</td>
<td class="handle main-color">
<span (click)="deleteLog(data)">删除</span>
</td>
<!--<td class="handle main-color">-->
<!--<span (click)="deleteLog(data)">删除</span>-->
<!--</td>-->
</tr>
</tbody>
</nz-table>
......
......@@ -15,6 +15,7 @@
<tr>
<th></th>
<th>名称</th>
<th>主机名</th>
<th>键值</th>
</tr>
</thead>
......@@ -22,6 +23,7 @@
<tr *ngFor="let data of basicTable1.data">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="inselectItem(data,$event)"></td>
<td>{{data.name}}</td>
<td>{{data.hostName}}</td>
<td>{{data.key}}</td>
</tr>
</tbody>
......@@ -40,6 +42,7 @@
<tr>
<th></th>
<th>名称</th>
<th>主机名</th>
<th>键值</th>
</tr>
</thead>
......@@ -47,6 +50,7 @@
<tr *ngFor="let data of basicTable2.data">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="outselectItem(data,$event)"></td>
<td>{{data.name}}</td>
<td>{{data.hostName}}</td>
<td>{{data.key}}</td>
</tr>
</tbody>
......
......@@ -100,7 +100,7 @@ export class LineComponent implements OnInit {
showModal(linkObj) {
this.hostIds = linkObj.hostIds; //线条上的主机id;
if(linkObj.itemId.length > 0){
if(linkObj.itemId && linkObj.itemId.length > 0){
this.itemId = linkObj.itemId.split(','); //线条上的监测点id;
}
this.isLine = true;
......@@ -124,6 +124,7 @@ export class LineComponent implements OnInit {
this.inList.forEach(e=>{ //进口流量回显
if(e.itemId == this.itemId[0]){
e.checked = true;
this.inSelect = e;
}
})
}
......@@ -147,6 +148,7 @@ export class LineComponent implements OnInit {
this.outList.forEach(e=>{
if(e.itemId == this.itemId[1]){ //出口流量回显
e.checked = true;
this.outSelect = e;
}
})
}
......@@ -156,22 +158,23 @@ export class LineComponent implements OnInit {
//进出口流量
handleLineCancel() {
this.inList = [];
this.outList = [];
this.inSearchName = null;
this.outSearchName = null;
this.isLine = false;
this.initForm();
localStorage.setItem("line",'false');
}
handleLineOk() {
this.initForm();
editor.utils.setLink(this.inSelect,this.outSelect);
localStorage.setItem("line",'false');
}
initForm(){
this.inList = [];
this.outList = [];
this.itemId = [];
this.inSearchName = null;
this.outSearchName = null;
this.isLine = false;
editor.utils.setLink(this.inSelect,this.outSelect);
localStorage.setItem("line",'false');
}
}
......@@ -37,7 +37,7 @@
<div nz-row class="layui-layout layui-layout-admin header-bar">
<div nz-col nzSpan="12" class="layui-header ">
<span (click)="addDevice()">添加设备</span>
<span (click)="addCheck()">添加监测点</span>
<!--<span (click)="addCheck()">添加监测点</span>-->
<span (click)="showAddImg()">添加图片</span>
<span onClick="editor.utils.deleteSelectedNodes()">移除</span>
<nz-select style="width: 200px;" nzPlaceHolder="选择线条" [(ngModel)]="lineType"
......
......@@ -64,8 +64,8 @@ declare var layui: any;
.lineList{
position: absolute;
top: 5px;
left: 20px;
color: #6097b7;
right: 20px;
color: red;
cursor: pointer;
}
......@@ -89,6 +89,7 @@ declare var layui: any;
})
export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDestroy {
@ViewChild('topologyCanvas') topologyCanvas: ElementRef;
@ViewChild('topologyBody') topologyBody: ElementRef;
@ViewChild('smartTopology') smartTopology: TopologyComponent;
@ViewChild('smartCheck') smartCheck: CheckComponent;
@ViewChild('smartSelectGroup') smartSelectGroup: SelectGroupComponent;
......@@ -135,7 +136,9 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
}
ngAfterViewInit() {
this.loadCanvas();
const canvasWidth = this.topologyBody.nativeElement.clientWidth;
const canvasHeight = this.topologyBody.nativeElement.clientHeight;
editor.loadTopology('','', 'img/backimg.png',canvasWidth,canvasHeight);
}
ngDoCheck(){
......@@ -251,7 +254,7 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
}
this.topologySer.findByHostIdOrWeb(data).subscribe(
(res)=>{
editor.utils.addNode(res.data[0].url, '',e[0]);
editor.utils.addNode(res.data[0].url, res.data[0].name,e[0]);
}
)
}
......@@ -286,6 +289,7 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
if (res.errCode == 10000) {
this.message.success('编辑成功');
this.getList();
this.getDetail();
} else {
this.message.error(res.errMsg);
}
......@@ -293,28 +297,11 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
);
}
//load
loadCanvas() {
editor.loadTopology('','', 'img/backimg.png');
}
interval(arr,str){
arr.forEach(e2=>{
setInterval(function(){
if(e2.alarm == str){
e2.alarm = null;
}else{
e2.alarm = str
}
}, 600);
})
}
//查询单个
getDetail(id) {
getDetail() {
this.isLoading = true;
this.topologySer.findItem(id).subscribe(
this.topologySer.findItem( this.topoId).subscribe(
(res) => {
if (res.errCode == 10000) {
if (res.data.json.length > 0) {
......@@ -348,6 +335,7 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
const hostIds = [];
arr.forEach(e=>{
if(e.elementType == 'link' && e.itemId && e.itemId.length > 0){
console.log(e);
const data = {
itemIdIn:e.itemId.split(',')[0],
itemIdOut:e.itemId.split(',')[1],
......@@ -379,20 +367,20 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
if(e1.elementId == e2.hostId){
if(e1.status == -2){
e2.alarm = "主机被删除,请及时清理";
e2.fontColor='255,255,255';
e2.fontColor='0,0,0';
e2.alarmAlpha=0.9;
// dlist.push(e2)
}
if(e1.status == 1){
e2.alarm = "危险";
e2.fontColor='255,255,255';
e2.fontColor='0,0,0';
e2.alarmColor='255,153,18';
e2.alarmAlpha=0.9;
// wlist.push(e2);
}
if(e1.status == 2){
e2.alarm = "故障";
e2.fontColor='255,255,255';
e2.fontColor='0,0,0';
e2.alarmAlpha=0.9;
// glist.push(e2);
}
......
......@@ -67,7 +67,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
dataSet: any[];
panel1 = {active: true, name: '响应时间与丢包率', disabled: false};
panel2 = {active: true, name: 'CPU使用率及内存使用率',disabled: false};
panel3 = {active: true, name: '磁盘使用', disabled: false};
panel3 = {active: true, name: '磁盘使用情况', disabled: false};
//监控点
isBasicEdit;
......@@ -122,19 +122,18 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
constructor(private routerInfo: ActivatedRoute, private message: NzMessageService,
private overAllSer: OverAllService, private renderer: Renderer,private router:Router,
private fb: FormBuilder, private modalService: NzModalService,private datePipe:DatePipe) {
}
ngOnInit() {
this.isSpinning = true;
this.routerInfo.queryParams.subscribe(queryParams => {
this.hostId = queryParams.hostId;
this.hostName = queryParams.name;
this.realName = queryParams.hostName;
});
}
ngOnInit() {
this.isSpinning = true;
this.responseTime();
this.losed();
this.cpused();
this.disks();
this.used();
// this.inOutInfo();
......@@ -144,6 +143,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//历史告警
const obj = {};
this.warnList.getList(obj);
this.disks();
}
ngAfterViewInit() {
......@@ -459,14 +459,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
show: false,
},
yAxis: {
axisLabel:{
interval:0,
margin:95,
textStyle: {
align:'left',
baseline:'middle'
}
},
triggerEvent: true,
type: 'category',
axisTick: {
show: false
......@@ -481,6 +474,13 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
data: res.data.disks.map((item) => {
return item.name;
}),
axisLabel:res.data.disks.map((item) => {
let data = item.name;
if(data.length > 5) {
data = data.substring(0, 4) + "..";
}
return data;
}),
},
color: ['#ed7a7b', '#f2f2f2'],
series: [
......@@ -592,6 +592,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}
]
};
} else {
this.message.info(res.errMsg);
}
......@@ -600,6 +601,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
);
}
extension(){
}
add(arr) {
let total = 0;
for (let i = 0; i < arr.length; i++) {
......
......@@ -36,7 +36,6 @@
<th>说明</th>
<!--<th>权限模块</th>-->
<!--<th>资源权限</th>-->
<th>有效</th>
<th>操作</th>
</tr>
</thead>
......@@ -46,11 +45,11 @@
<td>{{data.comment}}</td>
<!--<td>{{data.key3}}</td>-->
<!--<td>{{data.key4}}</td>-->
<td>
<ng-container *ngIf="data.status == 0">
<i class="anticon anticon-check"></i>
</ng-container>
</td>
<!--<td>-->
<!--<ng-container *ngIf="data.status == 0">-->
<!--<i class="anticon anticon-check"></i>-->
<!--</ng-container>-->
<!--</td>-->
<td class="handle main-color">
<span (click)="grantUser(data)">授予用户</span>
<!--<span (click)="lookRole(data)">查看</span>-->
......
......@@ -46,7 +46,7 @@ TopologyPanel.prototype.resetTopology = function (url) {
* @param topologyGuid 拓扑 表记录ID
* @param backImg 拓扑图的背景图片
*/
TopologyPanel.prototype.loadTopology = function (response, topologyGuid, backImg) {
TopologyPanel.prototype.loadTopology = function (response, topologyGuid, backImg,canvasWidth,canvasHeight) {
// 错误处理
if (!response) {
// 拓扑不存在,创建一个空白的拓扑图
......@@ -68,10 +68,10 @@ TopologyPanel.prototype.loadTopology = function (response, topologyGuid, backImg
}
]
}
editor.init(topologyGuid, backImg, initTopologyJson, '')
editor.init(topologyGuid, backImg, initTopologyJson,canvasWidth,canvasHeight)
} else {
// 拓扑存在,渲染拓扑图
editor.init(topologyGuid, backImg, response, '')
editor.init(topologyGuid, backImg, response,canvasWidth,canvasHeight)
}
}
......@@ -507,7 +507,7 @@ TopologyEditor.prototype.replaceStage = function (url) {
* @param backImg 背景图片
* @param topologyJson 拓扑JSON结构
*/
TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) {
TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson,canvasWidth,canvasHeight) {
if (!topologyJson) {
// alert('加载拓扑编辑器失败!')
return
......@@ -515,8 +515,8 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson) {
this.topologyGuid = topologyGuid
// 创建jTopo舞台屏幕对象
var canvas = document.getElementById('topology-canvas')
canvas.width = $('#topology-body').width()
canvas.height = $('#topology-body').height()
canvas.width = canvasWidth;
canvas.height = canvasHeight;
// 加载空白的编辑器
if (topologyJson === '-1') {
this.stage = new JTopo.Stage(canvas) // 定义舞台对象
......@@ -1181,6 +1181,8 @@ editor.utils = {
};
var self = this;
var link = editor.scene.selectedElements;
link[0].itemId = "";
link[0].text = "";
if(inItem){
link[0].text = "进口流量:"+inItem.name;
link[0].itemId = (inItem.itemId)
......@@ -1197,6 +1199,7 @@ editor.utils = {
};
var self = this;
var node = editor.scene.selectedElements;
node[0].text = "";
node[0].text = item.name;
// node[0].setImage(topoImgPath + item.img);
// node[0].nodeImage = item.img;
......
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