mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 所有的dnsprovider 支持导入域名列表
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { AbstractDnsProvider, CreateRecordOptions, DomainRecord, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
|
||||
import { DnslaAccess } from "./access.js";
|
||||
import { Pager, PageRes, PageSearch } from "@certd/pipeline";
|
||||
|
||||
export type DnslaRecord = {
|
||||
id: string;
|
||||
@@ -176,6 +177,24 @@ export class DnslaDnsProvider extends AbstractDnsProvider<DnslaRecord> {
|
||||
await this.doRequestApi(url, null, 'delete');
|
||||
this.logger.info(`删除域名解析成功:fullRecord=${fullRecord},value=${value}`);
|
||||
}
|
||||
|
||||
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
|
||||
const pager = new Pager(req);
|
||||
const url = `/api/domain?pageIndex=${pager.pageNo}&pageSize=${pager.pageSize}`;
|
||||
const ret = await this.doRequestApi(url, null, 'get');
|
||||
|
||||
|
||||
let list = ret.data.results || []
|
||||
list = list.map((item: any) => ({
|
||||
id: item.id,
|
||||
domain: item.domain,
|
||||
}));
|
||||
const total = ret.data.total || list.length;
|
||||
return {
|
||||
total,
|
||||
list,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//实例化这个provider,将其自动注册到系统中
|
||||
|
||||
Reference in New Issue
Block a user