mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-26 05:38:46 +00:00
fix: update regex to allow number at the end of app name
This commit is contained in:
@@ -54,9 +54,9 @@ const AddComposeSchema = z.object({
|
|||||||
.min(1, {
|
.min(1, {
|
||||||
message: "App name is required",
|
message: "App name is required",
|
||||||
})
|
})
|
||||||
.regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, {
|
.regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z0-9])?$/, {
|
||||||
message:
|
message:
|
||||||
"App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
|
"App name supports lowercase letters, numbers, '-' and must start with a letter, end with a letter or number, and cannot contain consecutive '-'",
|
||||||
}),
|
}),
|
||||||
description: z.string().optional(),
|
description: z.string().optional(),
|
||||||
serverId: z.string().optional(),
|
serverId: z.string().optional(),
|
||||||
@@ -78,9 +78,6 @@ export const AddCompose = ({ environmentId, projectName }: Props) => {
|
|||||||
const { mutateAsync, isLoading, error, isError } =
|
const { mutateAsync, isLoading, error, isError } =
|
||||||
api.compose.create.useMutation();
|
api.compose.create.useMutation();
|
||||||
|
|
||||||
// Get environment data to extract projectId
|
|
||||||
const { data: environment } = api.environment.one.useQuery({ environmentId });
|
|
||||||
|
|
||||||
const hasServers = servers && servers.length > 0;
|
const hasServers = servers && servers.length > 0;
|
||||||
// Show dropdown logic based on cloud environment
|
// Show dropdown logic based on cloud environment
|
||||||
// Cloud: show only if there are remote servers (no Dokploy option)
|
// Cloud: show only if there are remote servers (no Dokploy option)
|
||||||
|
|||||||
Reference in New Issue
Block a user