add powerdns,http request apply.

This commit is contained in:
Roy
2024-10-19 22:46:15 +08:00
parent 4382474449
commit d6d296b546
12 changed files with 88 additions and 330 deletions

View File

@@ -9,6 +9,8 @@ export const accessTypeMap: Map<string, [string, string]> = new Map([
["cloudflare", ["common.provider.cloudflare", "/imgs/providers/cloudflare.svg"]],
["namesilo", ["common.provider.namesilo", "/imgs/providers/namesilo.svg"]],
["godaddy", ["common.provider.godaddy", "/imgs/providers/godaddy.svg"]],
["pdns", ["common.provider.pdns", "/imgs/providers/pdns.svg"]],
["httpreq", ["common.provider.httpreq", "/imgs/providers/httpreq.svg"]],
["local", ["common.provider.local", "/imgs/providers/local.svg"]],
["ssh", ["common.provider.ssh", "/imgs/providers/ssh.svg"]],
["webhook", ["common.provider.webhook", "/imgs/providers/webhook.svg"]],
@@ -29,6 +31,8 @@ export const accessFormType = z.union(
z.literal("cloudflare"),
z.literal("namesilo"),
z.literal("godaddy"),
z.literal("pdns"),
z.literal("httpreq"),
z.literal("local"),
z.literal("ssh"),
z.literal("webhook"),
@@ -54,6 +58,8 @@ export type Access = {
| CloudflareConfig
| NamesiloConfig
| GodaddyConfig
| PdnsConfig
| HttpreqConfig
| LocalConfig
| SSHConfig
| WebhookConfig
@@ -104,6 +110,18 @@ export type GodaddyConfig = {
apiSecret: string;
};
export type PdnsConfig = {
apiUrl: string;
apiKey: string;
};
export type HttpreqConfig = {
endpoint: string;
mode: string;
username: string;
password: string;
};
export type LocalConfig = Record<string, string>;
export type SSHConfig = {
@@ -142,6 +160,8 @@ export const getUsageByConfigType = (configType: string): AccessUsage => {
case "cloudflare":
case "namesilo":
case "godaddy":
case "pdns":
case "httpreq":
return "apply";
default: