178 lines
4.3 KiB
TypeScript
178 lines
4.3 KiB
TypeScript
import { Component, OnInit, AfterViewInit, AfterContentInit, ViewChild } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { TreeNode } from 'primeng/primeng';
|
|
|
|
@Component({
|
|
selector: 'of-infra-map',
|
|
templateUrl: './map.component.html',
|
|
})
|
|
export class MapComponent implements OnInit, AfterContentInit {
|
|
|
|
infraTree: TreeNode[] = testInfraList;
|
|
|
|
display = false;
|
|
|
|
constructor(
|
|
private router: Router,
|
|
) {
|
|
}
|
|
|
|
ngAfterContentInit() {
|
|
|
|
}
|
|
|
|
ngOnInit() {
|
|
}
|
|
|
|
showDialog() {
|
|
this.display = true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const testInfraList = [{
|
|
label: 'Infra',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Zone - 192.168.1.0/24',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Host - 192.168.1.106 - Snoop Host',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - WMI, SSH, SNMP',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
{
|
|
label: 'Service - FTP(21)',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - FTP, Sensor',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
],
|
|
}],
|
|
},
|
|
{
|
|
label: 'Host - 192.168.1.103 - Geek Host',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - WMI, SSH, SNMP',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
{
|
|
label: 'Service - MySQL(3306)',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - MySQL, PING',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: 'Service - PostgreSQL(5555)',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - PostgreSQL, PING',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
],
|
|
}],
|
|
}],
|
|
},
|
|
{
|
|
label: 'Zone - 192.168.10.0/24',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Host - 192.168.10.106 - Snoop Host',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - WMI, SSH, SNMP',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
{
|
|
label: 'Service - FTP(21)',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - FTP, Sensor',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
],
|
|
}],
|
|
},
|
|
{
|
|
label: 'Host - 192.168.10.103 - Geek Host',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - WMI, SSH, SNMP',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
{
|
|
label: 'Service - MySQL(3306)',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - MySQL, PING',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: 'Service - PostgreSQL(5555)',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
children: [{
|
|
label: 'Sensors - PostgreSQL, PING',
|
|
expandedIcon: 'fa-folder-open',
|
|
collapsedIcon: 'fa-folder',
|
|
expanded : true,
|
|
},
|
|
],
|
|
}],
|
|
}],
|
|
}],
|
|
}];
|