map tree design
This commit is contained in:
parent
8025ad1d12
commit
fcae5d70ce
|
@ -10,8 +10,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-12 ui-md-7 ui-g-nopad">
|
<div class="ui-g-12 ui-md-7 ui-g-nopad">
|
||||||
<div style="float: right;">
|
<div style="float: right;">
|
||||||
<button pButton type="button" class="ui-button-secondary ui-button-width-fit" label="Expand all" style="margin-top: 16px;" (click)="expandAll()"></button>
|
<button pButton type="button" class="ui-button-secondary ui-button-width-fit" label="Expand all" style="margin-top: 16px;"
|
||||||
<button pButton type="button" class="ui-button-secondary ui-button-width-fit" label="Collapse all" style="margin-top: 16px;" (click)="collapseAll()"></button>
|
(click)="expandAll()"></button>
|
||||||
|
<button pButton type="button" class="ui-button-secondary ui-button-width-fit" label="Collapse all" style="margin-top: 16px;"
|
||||||
|
(click)="collapseAll()"></button>
|
||||||
</div>
|
</div>
|
||||||
<div style="float: right; margin: 30px 15px 0 0;">
|
<div style="float: right; margin: 30px 15px 0 0;">
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>Up
|
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>Up
|
||||||
|
@ -23,7 +25,33 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-12 ui-g-nopad">
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
<p-tree [value]="infraTree" selectionMode="single" [(selection)]="selectedTree" ></p-tree>
|
<p-tree [value]="infraTree" selectionMode="single" [(selection)]="selectedTree">
|
||||||
|
|
||||||
|
<ng-template let-node pTemplate="default">
|
||||||
|
<div>{{node.label}}</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template let-node pTemplate="infra">
|
||||||
|
<div>{{node.label}}</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template let-node pTemplate="probe">
|
||||||
|
<div>{{node.label}}</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template let-node pTemplate="host">
|
||||||
|
<div>{{node.label}}</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template let-node pTemplate="service">
|
||||||
|
<div>{{node.label}}</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template let-node pTemplate="sensor">
|
||||||
|
<p-button label="{{node.label}}"></p-button>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
</p-tree>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -144,21 +144,18 @@ export class MapComponent implements OnInit, AfterContentInit {
|
||||||
// for (const itt of this.infraTree) {
|
// for (const itt of this.infraTree) {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
for (const sensor of sensorList) {
|
for (const sensor of sensorList) {
|
||||||
const st = {
|
const st = {
|
||||||
label: 'Sensors - ' + sensor.crawler.name,
|
label: 'Sensors - ' + sensor.crawler.name,
|
||||||
expandedIcon: 'fa-folder-open',
|
type: 'sensor',
|
||||||
collapsedIcon: 'fa-folder',
|
|
||||||
obj: sensor,
|
obj: sensor,
|
||||||
expanded: true
|
expanded: true
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME:: target test id ....
|
// FIXME:: target test id ....
|
||||||
const tt = this.targetTreeMap.get(3);
|
const tt = this.targetTreeMap.get(4);
|
||||||
// const tt = this.targetTreeMap.get(sensor.target.id);
|
// const tt = this.targetTreeMap.get(sensor.target.id);
|
||||||
if (tt !== undefined && tt !== null) {
|
if (tt !== undefined && tt !== null) {
|
||||||
tt.children.push(st);
|
tt.children.push(st);
|
||||||
|
@ -206,6 +203,7 @@ export class MapComponent implements OnInit, AfterContentInit {
|
||||||
|
|
||||||
const infraTree = {
|
const infraTree = {
|
||||||
label: 'Infra',
|
label: 'Infra',
|
||||||
|
type: 'infra',
|
||||||
expandedIcon: 'fa-folder-open',
|
expandedIcon: 'fa-folder-open',
|
||||||
collapsedIcon: 'fa-folder',
|
collapsedIcon: 'fa-folder',
|
||||||
expanded: true,
|
expanded: true,
|
||||||
|
@ -216,6 +214,7 @@ export class MapComponent implements OnInit, AfterContentInit {
|
||||||
|
|
||||||
const tp = {
|
const tp = {
|
||||||
label: 'Probe - ' + key,
|
label: 'Probe - ' + key,
|
||||||
|
type: 'probe',
|
||||||
expandedIcon: 'fa-folder-open',
|
expandedIcon: 'fa-folder-open',
|
||||||
collapsedIcon: 'fa-folder',
|
collapsedIcon: 'fa-folder',
|
||||||
expanded: this.DEFAULT_EXPANDED.valueOf(),
|
expanded: this.DEFAULT_EXPANDED.valueOf(),
|
||||||
|
@ -228,6 +227,7 @@ export class MapComponent implements OnInit, AfterContentInit {
|
||||||
|
|
||||||
const th = {
|
const th = {
|
||||||
label: 'Host - ' + ih.ip,
|
label: 'Host - ' + ih.ip,
|
||||||
|
type: 'host',
|
||||||
expandedIcon: 'fa-folder-open',
|
expandedIcon: 'fa-folder-open',
|
||||||
collapsedIcon: 'fa-folder',
|
collapsedIcon: 'fa-folder',
|
||||||
expanded: this.DEFAULT_EXPANDED.valueOf(),
|
expanded: this.DEFAULT_EXPANDED.valueOf(),
|
||||||
|
@ -246,6 +246,7 @@ export class MapComponent implements OnInit, AfterContentInit {
|
||||||
for (let i = 0 ; i < ifsl.length; ++i) {
|
for (let i = 0 ; i < ifsl.length; ++i) {
|
||||||
const ts = {
|
const ts = {
|
||||||
label: 'Service - ' + ifsl[i].vendor.name,
|
label: 'Service - ' + ifsl[i].vendor.name,
|
||||||
|
type: 'service',
|
||||||
expandedIcon: 'fa-folder-open',
|
expandedIcon: 'fa-folder-open',
|
||||||
collapsedIcon: 'fa-folder',
|
collapsedIcon: 'fa-folder',
|
||||||
expanded: this.DEFAULT_EXPANDED.valueOf(),
|
expanded: this.DEFAULT_EXPANDED.valueOf(),
|
||||||
|
@ -376,18 +377,21 @@ export class MapComponent implements OnInit, AfterContentInit {
|
||||||
const testInfraList = [
|
const testInfraList = [
|
||||||
{
|
{
|
||||||
label: 'Infra',
|
label: 'Infra',
|
||||||
|
type: 'infra',
|
||||||
expandedIcon: 'fa-folder-open',
|
expandedIcon: 'fa-folder-open',
|
||||||
collapsedIcon: 'fa-folder',
|
collapsedIcon: 'fa-folder',
|
||||||
expanded: true,
|
expanded: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
label: 'Zone - 192.168.1.0/24',
|
label: 'Zone - 192.168.1.0/24',
|
||||||
|
type: 'zone',
|
||||||
expandedIcon: 'fa-folder-open',
|
expandedIcon: 'fa-folder-open',
|
||||||
collapsedIcon: 'fa-folder',
|
collapsedIcon: 'fa-folder',
|
||||||
expanded: true,
|
expanded: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
label: 'Host - 192.168.1.106 - Snoop Host',
|
label: 'Host - 192.168.1.106 - Snoop Host',
|
||||||
|
type: 'host',
|
||||||
expandedIcon: 'fa-folder-open',
|
expandedIcon: 'fa-folder-open',
|
||||||
collapsedIcon: 'fa-folder',
|
collapsedIcon: 'fa-folder',
|
||||||
expanded: true,
|
expanded: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user