ing discovery result

This commit is contained in:
snoop 2018-03-20 16:27:29 +09:00
parent 9c1f768d30
commit 4ae2106219
2 changed files with 43 additions and 3 deletions

View File

@ -63,17 +63,22 @@
<tree-root id="tree2" [focused]="true" [nodes]="hosts"> <tree-root id="tree2" [focused]="true" [nodes]="hosts">
<ng-template #treeNodeFullTemplate let-node let-index="index" let-templates="templates"> <ng-template #treeNodeFullTemplate let-node let-index="index" let-templates="templates">
<div class="tree-node"> <div class="tree-node">
<input type="checkbox" [checked]="node.isActive" (change)="clickCheck(node)" /> <input type="checkbox" [checked]="node.isActive" (change)="checkDiscoveryResult(node)" />
<tree-node-expander [node]="node"></tree-node-expander> <tree-node-expander [node]="node"></tree-node-expander>
<div <div
class="node-content-wrapper" class="node-content-wrapper"
[class.node-content-wrapper-active]="node.isActive" [class.node-content-wrapper-active]="node.isActive"
[class.node-content-wrapper-focused]="node.isFocused" [class.node-content-wrapper-focused]="node.isFocused"
(click)="clickCheck(node)"> (click)="checkDiscoveryResult(node)">
<span [class]="node.data.className" [class.title]="true">{{ node.data.title }}</span> <span [class]="node.data.className" [class.title]="true">{{ node.data.title }}</span>
</div> </div>
<tree-node-children [node]="node" [templates]="templates"></tree-node-children> <tree-node-children [node]="node" [templates]="templates"></tree-node-children>
</div> </div>
</ng-template> </ng-template>
</tree-root> </tree-root>
<mat-dialog-actions fxLayoutAlign="end">
<button mat-button mat-dialog-close>Cancel</button>
<button mat-button color="primary" (click)="discoveryResultSave()">Save</button>
<!-- <button mat-raised-button type="submit" color="primary">Start</button> -->
</mat-dialog-actions>
</div> </div>

View File

@ -41,6 +41,8 @@ export class SettingComponent implements OnInit, AfterContentInit {
hosts = nodes; hosts = nodes;
checkedSet = new Set();
constructor( constructor(
private discoverdstore: Store<DiscoveredStore.State>, private discoverdstore: Store<DiscoveredStore.State>,
private discoverstore: Store<DiscoverStore.State>, private discoverstore: Store<DiscoverStore.State>,
@ -116,10 +118,43 @@ export class SettingComponent implements OnInit, AfterContentInit {
}; };
// this.store.dispatch(new DiscoverySettingStore.Setting(startInfo)); // this.store.dispatch(new DiscoverySettingStore.Setting(startInfo));
this.discoverstore.dispatch(new DiscoverStore.DiscoverZone({probeID: '52abd6fd57e511e7ac52080027658d13', discoveryZone: discoveryZone})); this.discoverstore.dispatch(new DiscoverStore.DiscoverZone(
{probeID: '52abd6fd57e511e7ac52080027658d13', discoveryZone: discoveryZone}));
this.started = true; this.started = true;
} }
checkDiscoveryResult(node) {
node.toggleActivated(true);
if (node.isActive) {
if (this.checkedSet.has(node.data) === false) {
this.checkedSet.add(node.data);
}
} else {
if (this.checkedSet.has(node.data)) {
this.checkedSet.delete(node.data);
}
}
}
discoveryResultSave() {
console.log(this.checkedSet);
}
findHost(host) {
}
findPort(port) {
}
findService(service) {
}
} }