import InfiniteRepeater from "@social-mail/social-mail-client/dist/common/controls/repeater/InfiniteRepeater.js"; import InjectProperty from "@web-atoms/core/dist/core/InjectProperty.js"; import XNode from "@web-atoms/core/dist/core/XNode.js"; import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater.js"; import { ContentPage } from "@web-atoms/web-controls/dist/mobile-app/MobileApp.js"; import DnsZoneService from "./DnsZoneService.js"; import { DnsZone, IDnsZone } from "../../../model/model.js"; import Action from "@web-atoms/core/dist/view-model/Action.js"; import AdminCommands from "../../commands/AdminCommands.js"; import { DateFormats } from "@social-mail/social-mail-client/dist/common/date/DateFormats.js"; import PopupService from "@web-atoms/core/dist/web/services/PopupService.js"; export default class DnsZoneListPage extends ContentPage { start = 0; size = 100; version = 1; @InjectProperty private dnsZoneService: DnsZoneService; private zones: IDnsZone[] = []; async init() { this.renderer =
(c, e, cancelToken) => this.dnsZoneService.list({ start, cancelToken, version: this.version }))} itemRenderer={(item: IDnsZone) =>
} />
; this.footerRenderer = () =>
; } @Action({ onEvent: "delete-zone", confirm: "Are you sure you want to delete this zone?"}) async deleteZone (zone: IDnsZone) { zone.$deleted = true; await this.dnsZoneService.save(zone); this.zones.remove(zone); this.version++; } @Action({ onEvent: "view-zone"}) async viewZone(zone: IDnsZone) { PopupService.alert({ title: zone.zone, message:
{zone.unsigned}
}); } @Action({ onEvent: "view-ds"}) async viewDS(zone: IDnsZone) { PopupService.alert({ title: zone.zone, message:
{zone.ksk.digest}
}); } @Action({ onEvent: "add-new"}) async addNew() { const zone = prompt("Add host"); if (!zone) { return; } await this.dnsZoneService.save(DnsZone.create({ zone })); this.version++; } }