support ssh deployemnt

This commit is contained in:
yoan
2024-08-22 20:24:00 +08:00
parent 1bfd477587
commit bcd8f8dea1
15 changed files with 1060 additions and 23 deletions

View File

@@ -3,10 +3,11 @@ import { z } from "zod";
export const accessTypeMap: Map<string, [string, string]> = new Map([
["tencent", ["腾讯云", "/imgs/providers/tencent.svg"]],
["aliyun", ["阿里云", "/imgs/providers/aliyun.svg"]],
["ssh", ["SSH部署", "/imgs/providers/ssh.png"]],
]);
export const accessFormType = z.union(
[z.literal("aliyun"), z.literal("tencent")],
[z.literal("aliyun"), z.literal("tencent"), z.literal("ssh")],
{ message: "请选择云服务商" }
);
@@ -14,7 +15,7 @@ export type Access = {
id: string;
name: string;
configType: string;
config: TencentConfig | AliyunConfig;
config: TencentConfig | AliyunConfig | SSHConfig;
deleted?: string;
created?: string;
updated?: string;
@@ -29,3 +30,15 @@ export type AliyunConfig = {
accessKeyId: string;
accessKeySecret: string;
};
export type SSHConfig = {
host: string;
port: string;
command: string;
username: string;
password?: string;
key?: string;
keyFile?: string;
certPath: string;
keyPath: string;
};

View File

@@ -28,6 +28,7 @@ export const getLastDeployment = (domain: Domain): Deployment | undefined => {
export const targetTypeMap: Map<string, [string, string]> = new Map([
["aliyun-cdn", ["阿里云-CDN", "/imgs/providers/aliyun.svg"]],
["aliyun-oss", ["阿里云-OSS", "/imgs/providers/aliyun.svg"]],
["ssh", ["SSH部署", "/imgs/providers/ssh.png"]],
]);
export const targetTypeKeys = Array.from(targetTypeMap.keys());