add discovery 2 page

This commit is contained in:
snoop 2018-03-19 20:05:24 +09:00
parent b4923a19d5
commit f701873a40
3 changed files with 136 additions and 1 deletions

View File

@ -60,5 +60,21 @@
</div> </div>
<div *ngIf="started"> <div *ngIf="started">
tree 나올꼬얌 <tree-root id="tree2" [focused]="true" [nodes]="hosts">
<ng-template #treeNodeFullTemplate let-node let-index="index" let-templates="templates">
<div class="tree-node">
<input type="checkbox" [checked]="node.isActive" (change)="clickCheck(node)" />
<tree-node-expander [node]="node"></tree-node-expander>
<div
class="node-content-wrapper"
[class.node-content-wrapper-active]="node.isActive"
[class.node-content-wrapper-focused]="node.isFocused"
(click)="clickCheck(node)">
<span [class]="node.data.className + 'Index'">{{ index }}</span>
<span [class]="node.data.className" [class.title]="true">{{ node.data.title }}</span>
</div>
<tree-node-children [node]="node" [templates]="templates"></tree-node-children>
</div>
</ng-template>
</tree-root>
</div> </div>

View File

@ -34,6 +34,9 @@ export class SettingComponent implements OnInit, AfterContentInit {
{ name: 'Tomcat' }, { name: 'Tomcat' },
{ name: 'Nginx' }, { name: 'Nginx' },
]; ];
hosts = nodes;
constructor( constructor(
private store: Store<DiscoverySettingStore.State>, private store: Store<DiscoverySettingStore.State>,
) { ) {
@ -104,3 +107,117 @@ export class SettingComponent implements OnInit, AfterContentInit {
} }
} }
const nodes = [
{
title: 'host - 3232235781',
className: 'className3232235781',
children: [
{
title: 'Port - 22',
className: 'className22',
children: [
{
title: 'SSH',
className: 'classNameSSH'
}
]
},
{
title: 'Port - 80',
className: 'className80',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
},
{
title: 'Port - 1936',
className: 'className1936',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
}
]
},
{
title: 'host - 3232235781',
className: 'className3232235781',
children: [
{
title: 'Port - 22',
className: 'className22',
children: [
{
title: 'SSH',
className: 'classNameSSH'
}
]
},
{
title: 'Port - 80',
className: 'className80',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
},
{
title: 'Port - 1936',
className: 'className1936',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
}
]
},
{
title: 'host - 3232235781',
className: 'className3232235781',
children: [
{
title: 'Port - 22',
className: 'className22',
children: [
{
title: 'SSH',
className: 'classNameSSH'
}
]
},
{
title: 'Port - 80',
className: 'className80',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
},
{
title: 'Port - 1936',
className: 'className1936',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
}
]
}
];

View File

@ -9,6 +9,7 @@ import { InputChipModule } from 'packages/commons/component/input-chip/input-chi
import { DiscoveryStoreModule } from './discovery-store.module'; import { DiscoveryStoreModule } from './discovery-store.module';
import { COMPONENTS } from './component'; import { COMPONENTS } from './component';
import { SERVICES } from './service'; import { SERVICES } from './service';
import { TreeModule } from 'angular-tree-component';
@NgModule({ @NgModule({
imports: [ imports: [
@ -17,6 +18,7 @@ import { SERVICES } from './service';
InputChipModule, InputChipModule,
FormsModule, FormsModule,
DiscoveryStoreModule, DiscoveryStoreModule,
TreeModule
], ],
declarations: [ declarations: [
COMPONENTS COMPONENTS