init
This commit is contained in:
31
ui/src/domain/access.ts
Normal file
31
ui/src/domain/access.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const accessTypeMap: Map<string, string> = new Map([
|
||||
["tencent", "腾讯云"],
|
||||
["aliyun", "阿里云"],
|
||||
]);
|
||||
|
||||
export const accessFormType = z.union(
|
||||
[z.literal("aliyun"), z.literal("tencent")],
|
||||
{ message: "请选择云服务商" }
|
||||
);
|
||||
|
||||
export type Access = {
|
||||
id: string;
|
||||
name: string;
|
||||
configType: string;
|
||||
config: TencentConfig | AliyunConfig;
|
||||
deleted?: string;
|
||||
created?: string;
|
||||
updated?: string;
|
||||
};
|
||||
|
||||
export type TencentConfig = {
|
||||
secretId: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type AliyunConfig = {
|
||||
accessKeyId: string;
|
||||
accessKeySecret: string;
|
||||
};
|
||||
6
ui/src/domain/base.ts
Normal file
6
ui/src/domain/base.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type PbErrorData = {
|
||||
[key: string]: {
|
||||
message: string;
|
||||
code: string;
|
||||
};
|
||||
};
|
||||
33
ui/src/domain/deployment.ts
Normal file
33
ui/src/domain/deployment.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Domain } from "./domain";
|
||||
|
||||
export type Deployment = {
|
||||
id: string;
|
||||
domain: string;
|
||||
log: {
|
||||
apply?: Log[];
|
||||
check?: Log[];
|
||||
deploy?: Log[];
|
||||
};
|
||||
phase: Pahse;
|
||||
phaseSuccess: boolean;
|
||||
deployedAt: string;
|
||||
created: string;
|
||||
updated: string;
|
||||
expand: {
|
||||
domain?: Domain;
|
||||
};
|
||||
};
|
||||
|
||||
export type Pahse = "apply" | "check" | "deploy";
|
||||
|
||||
export type Log = {
|
||||
time: string;
|
||||
message: string;
|
||||
error: string;
|
||||
};
|
||||
|
||||
export type DeploymentListReq = {
|
||||
domain?: string;
|
||||
page?: number;
|
||||
perPage?: number;
|
||||
};
|
||||
25
ui/src/domain/domain.ts
Normal file
25
ui/src/domain/domain.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Deployment, Pahse } from "./deployment";
|
||||
|
||||
export type Domain = {
|
||||
id: string;
|
||||
domain: string;
|
||||
crontab: string;
|
||||
access: string;
|
||||
targetAccess: string;
|
||||
targetType: string;
|
||||
expiredAt?: string;
|
||||
phase?: Pahse;
|
||||
phaseSuccess?: boolean;
|
||||
lastDeployedAt?: string;
|
||||
enabled?: boolean;
|
||||
created?: string;
|
||||
updated?: string;
|
||||
deleted?: string;
|
||||
expand?: {
|
||||
lastDeployment?: Deployment;
|
||||
};
|
||||
};
|
||||
|
||||
export const getLastDeployment = (domain: Domain): Deployment | undefined => {
|
||||
return domain.expand?.lastDeployment;
|
||||
};
|
||||
Reference in New Issue
Block a user