app/src/commons/component/zone-detail.component.ts
2018-09-12 20:18:38 +09:00

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();
}
}