Add local deployer

This commit is contained in:
yoan
2024-09-26 17:04:49 +08:00
parent 253075e7c0
commit 2634789769
12 changed files with 1117 additions and 35 deletions

View File

@@ -9,6 +9,7 @@ export const accessTypeMap: Map<string, [string, string]> = new Map([
["qiniu", ["七牛云", "/imgs/providers/qiniu.svg"]],
["ssh", ["SSH部署", "/imgs/providers/ssh.svg"]],
["webhook", ["Webhook", "/imgs/providers/webhook.svg"]],
["local", ["本地部署", "/imgs/providers/local.svg"]],
]);
export const getProviderInfo = (t: string) => {
@@ -25,6 +26,7 @@ export const accessFormType = z.union(
z.literal("qiniu"),
z.literal("namesilo"),
z.literal("godaddy"),
z.literal("local"),
],
{ message: "请选择云服务商" }
);
@@ -45,7 +47,8 @@ export type Access = {
| CloudflareConfig
| QiniuConfig
| NamesiloConfig
| GodaddyConfig;
| GodaddyConfig
| LocalConfig;
deleted?: string;
created?: string;
@@ -95,6 +98,12 @@ export type SSHConfig = {
keyPath: string;
};
export type LocalConfig = {
command: string;
certPath: string;
keyPath: string;
};
export const getUsageByConfigType = (configType: string): AccessUsage => {
switch (configType) {
case "aliyun":
@@ -103,6 +112,7 @@ export const getUsageByConfigType = (configType: string): AccessUsage => {
case "ssh":
case "webhook":
case "qiniu":
case "local":
return "deploy";
case "cloudflare":

View File

@@ -47,6 +47,7 @@ export const targetTypeMap: Map<string, [string, string]> = new Map([
["ssh", ["SSH部署", "/imgs/providers/ssh.svg"]],
["qiniu-cdn", ["七牛云-CDN", "/imgs/providers/qiniu.svg"]],
["webhook", ["Webhook", "/imgs/providers/webhook.svg"]],
["local", ["本地部署", "/imgs/providers/local.svg"]],
]);
export const targetTypeKeys = Array.from(targetTypeMap.keys());