30 lines
588 B
TypeScript
30 lines
588 B
TypeScript
import { Component, Input, OnInit } from '@angular/core';
|
|
import { Zone, Host } from '@overflow/model/discovery';
|
|
|
|
const IPCIDR = require('ip-cidr');
|
|
|
|
@Component({
|
|
selector: 'app-zone-detail',
|
|
templateUrl: './zone-detail.component.html',
|
|
styleUrls: ['./zone-detail.component.scss'],
|
|
})
|
|
export class ZoneDetailComponent implements OnInit {
|
|
|
|
@Input() zone: Zone;
|
|
ipRange: string;
|
|
|
|
constructor(
|
|
) {
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
if (!this.zone) {
|
|
return;
|
|
}
|
|
|
|
const cidr = new IPCIDR(this.zone.network);
|
|
this.ipRange = cidr.start() + ' - ' + cidr.end();
|
|
|
|
}
|
|
}
|