force deploy and custom nameservers

This commit is contained in:
yoan
2024-09-18 22:42:18 +08:00
parent 2d37c42584
commit ba6a504588
11 changed files with 1086 additions and 300 deletions

View File

@@ -13,8 +13,10 @@ export type Domain = {
phaseSuccess?: boolean;
lastDeployedAt?: string;
variables?: string;
nameservers?: string;
group?: string;
enabled?: boolean;
deployed?: boolean;
created?: string;
updated?: string;
deleted?: string;

View File

@@ -1 +1 @@
export const version = "Certimate v0.1.7";
export const version = "Certimate v0.1.8";

View File

@@ -80,6 +80,7 @@ const Edit = () => {
}),
variables: z.string().optional(),
group: z.string().optional(),
nameservers: z.string().optional(),
});
const form = useForm<z.infer<typeof formSchema>>({
@@ -93,6 +94,7 @@ const Edit = () => {
targetType: "",
variables: "",
group: "",
nameservers: "",
},
});
@@ -107,6 +109,7 @@ const Edit = () => {
targetType: domain.targetType,
variables: domain.variables,
group: domain.group,
nameservers: domain.nameservers,
});
}
}, [domain, form]);
@@ -153,6 +156,7 @@ const Edit = () => {
targetAccess: targetAccess,
targetType: data.targetType,
variables: data.variables,
nameservers: data.nameservers,
};
try {
@@ -515,6 +519,26 @@ const Edit = () => {
</FormItem>
)}
/>
<FormField
control={form.control}
name="nameservers"
render={({ field }) => (
<FormItem hidden={tab != "advance"}>
<FormLabel></FormLabel>
<FormControl>
<Textarea
placeholder={`自定义域名服务器,多个用分号隔开,如:\n8.8.8.8;\n8.8.4.4;`}
{...field}
className="placeholder:whitespace-pre-wrap"
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className="flex justify-end">
<Button type="submit"></Button>
</div>

View File

@@ -149,6 +149,10 @@ const Home = () => {
}
};
const handleForceClick = async (domain: Domain) => {
await handleRightNowClick({ ...domain, deployed: false });
};
const handleDownloadClick = async (domain: Domain) => {
const zipName = `${domain.id}-${domain.domain}.zip`;
const files: CustomFile[] = [
@@ -291,6 +295,23 @@ const Home = () => {
</Button>
</Show>
<Show
when={
(domain.enabled ? true : false) && domain.deployed
? true
: false
}
>
<Separator orientation="vertical" className="h-4 mx-2" />
<Button
variant={"link"}
className="p-0"
onClick={() => handleForceClick(domain)}
>
</Button>
</Show>
<Show when={domain.expiredAt ? true : false}>
<Separator orientation="vertical" className="h-4 mx-2" />
<Button