support ssh deployemnt
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user