This commit is contained in:
insanity 2018-06-22 11:44:36 +09:00
parent 674b6860b3
commit 32b83f52a4
5 changed files with 20 additions and 27 deletions

View File

@ -360,7 +360,7 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
saveTargets() { saveTargets() {
this.pending$ = of(true); this.pending$ = of(true);
const targets: Target[] = []; const infraIDs: number[] = [];
this.selectedItems.forEach(node => { this.selectedItems.forEach(node => {
let infraID = node.data.infraID; let infraID = node.data.infraID;
if (null === infraID) { // 새로 발견된 Host or Service if (null === infraID) { // 새로 발견된 Host or Service
@ -389,19 +389,12 @@ export class DiscoveryInfraTreeComponent implements OnChanges {
console.log('INFRA ID not found.'); console.log('INFRA ID not found.');
return; return;
} }
const target: Target = { infraIDs.push(infraID);
infra: {
id: infraID
},
name: node.label,
sensorCount: 0,
};
targets.push(target);
}); });
console.log(targets); console.log(infraIDs);
this.targetService.registAll(targets, this.probeHost.probe.id) this.targetService.registAll(infraIDs, this.probeHost.probe.id)
.pipe( .pipe(
tap(() => { tap(() => {
}), }),

View File

@ -3,11 +3,11 @@
<p-panel *ngIf="probeHost" #content [showHeader]="false" class="block-panel"> <p-panel *ngIf="probeHost" #content [showHeader]="false" class="block-panel">
<of-probe-general [probe]="probeHost.probe" (modified)="modifiedGeneral($event)"></of-probe-general> <of-probe-general [probe]="probeHost.probe" (modified)="modifiedGeneral($event)"></of-probe-general>
<of-probe-host [infraHost]="probeHost.infraHost"></of-probe-host> <of-probe-host *ngIf="probeHost.infraHost" [infraHost]="probeHost.infraHost"></of-probe-host>
<div class="ui-g" dir="rtl"> <div class="ui-g" dir="rtl">
<button class="ui-button-danger ui-button-width-fit" [disabled]="true" type="button" label="Remove this Probe" icon="ui-icon-close" pButton <button class="ui-button-danger ui-button-width-fit" [disabled]="true" type="button" label="Remove this Probe" icon="ui-icon-close"
(click)="remove(probeHost)"></button> pButton (click)="remove(probeHost)"></button>
<button class="ui-button-width-fit" type="button" label="Discovery" icon="ui-icon-search" pButton (click)="discovery.emit(probeHost.id)"></button> <button class="ui-button-width-fit" type="button" label="Discovery" icon="ui-icon-search" pButton (click)="discovery.emit(probeHost.id)"></button>
</div> </div>
</p-panel> </p-panel>

View File

@ -18,15 +18,15 @@
<p-panel [showHeader]="false"> <p-panel [showHeader]="false">
<div *ngIf="infraHost"> <div *ngIf="infraHost">
<div class="ui-g"> <div class="ui-g">
<div class="ui-g-12 ui-md-6 ui-key-value"> <div class="ui-g-12 ui-md-6 ui-key-value" *ngIf="infraHost.infraZone">
<of-key-value [key]="'IP ver'" [value]="infraHost.infraZone.metaIPType.name"></of-key-value> <of-key-value [key]="'IP ver'" [value]="infraHost.infraZone.metaIPType.name"></of-key-value>
</div> </div>
<div class="ui-g-12 ui-md-6 ui-key-value"> <div class="ui-g-12 ui-md-6 ui-key-value" *ngIf="infraHost.infraZone">
<of-key-value [key]="'CIDR'" [value]="infraHost.infraZone.network"></of-key-value> <of-key-value [key]="'CIDR'" [value]="infraHost.infraZone.network"></of-key-value>
</div> </div>
<div class="ui-g-12 ui-md-6 ui-key-value"> <div class="ui-g-12 ui-md-6 ui-key-value" *ngIf="infraHost.infraZone">
<of-key-value [key]="'Interface'" [value]="infraHost.infraZone.iface"></of-key-value> <of-key-value [key]="'Interface'" [value]="infraHost.infraZone.iface"></of-key-value>
</div> </div>
@ -34,15 +34,15 @@
<of-key-value [key]="'Host Type'" [value]="infraHost.metaTargetHostType.name"></of-key-value> <of-key-value [key]="'Host Type'" [value]="infraHost.metaTargetHostType.name"></of-key-value>
</div> </div>
<div class="ui-g-12 ui-md-6 ui-key-value"> <div class="ui-g-12 ui-md-6 ui-key-value" *ngIf="infraHost.infraHostIPs">
<of-key-value [key]="'Host IP'" [value]="infraHost.infraZone.address"></of-key-value> <of-key-value [key]="'Host IP'" [value]="infraHost.infraHostIPs[0].address"></of-key-value>
</div> </div>
<div class="ui-g-12 ui-md-6 ui-key-value"> <div class="ui-g-12 ui-md-6 ui-key-value" *ngIf="infraHost.infraZone">
<of-key-value [key]="'Host Mac'" [value]="infraHost.infraZone.mac"></of-key-value> <of-key-value [key]="'Host Mac'" [value]="infraHost.infraZone.mac"></of-key-value>
</div> </div>
<div class="ui-g-12 ui-md-6 ui-key-value"> <div class="ui-g-12 ui-md-6 ui-key-value" *ngIf="infraHost.infraHostOS">
<of-key-value [key]="'Host OS'" [value]="infraHost.infraHostOS.name"></of-key-value> <of-key-value [key]="'Host OS'" [value]="infraHost.infraHostOS.name"></of-key-value>
</div> </div>

View File

@ -22,12 +22,12 @@
<td>{{probeHost.probe.name}}</td> <td>{{probeHost.probe.name}}</td>
<td>{{getUptime(probeHost.probe)}}</td> <td>{{getUptime(probeHost.probe)}}</td>
<td>{{probeHost.probe.cidr}}</td> <td>{{probeHost.probe.cidr}}</td>
<td>{{probeHost.infraHost.infraHostIPs[0].address}}</td> <td>{{probeHost.infraHost.infraHostIPs ? probeHost.infraHost.infraHostIPs[0].address : ''}}</td>
<td>{{probeHost.infraHost.infraHostOS.name}}</td> <td>{{probeHost.infraHost.infraHostOS ? probeHost.infraHost.infraHostOS.name : '' }}</td>
<td>{{probeHost.infraHost.infraZone.iface}}</td> <td>{{probeHost.infraHost.infraZone ? probeHost.infraHost.infraZone.iface : ''}}</td>
<td>{{probeHost.probe.targetCount}}</td> <td>{{probeHost.probe.targetCount}}</td>
<td>{{probeHost.probe.authorizeDate | date: 'dd.MM.yyyy'}}</td> <td>{{probeHost.probe.authorizeDate | date: 'dd.MM.yyyy'}}</td>
<td>{{probeHost.probe.authorizeMember.name}}</td> <td>{{probeHost.probe.authorizeMember.name || ''}}</td>
</tr> </tr>
</ng-template> </ng-template>
</p-table> </p-table>

View File

@ -19,8 +19,8 @@ export class TargetService {
return this.rpcService.call<Target>('TargetService.regist', target, probeID); return this.rpcService.call<Target>('TargetService.regist', target, probeID);
} }
public registAll(targets: Target[], probeID: number): Observable<Target[]> { public registAll(infraIDs: number[], probeID: number): Observable<Target[]> {
return this.rpcService.call<Target[]>('TargetService.registAll', targets, probeID); return this.rpcService.call<Target[]>('TargetService.registAll', infraIDs, probeID);
} }
public remove(id: number, probeID: number) { public remove(id: number, probeID: number) {