Compare commits

...

2 Commits

Author SHA1 Message Date
Henry 4f460c91f7 add password validation 2025-08-14 21:32:43 +08:00
Henry d46518bf1a minor execution view ui fix 2025-08-14 21:04:11 +08:00
3 changed files with 21 additions and 6 deletions

View File

@ -18,6 +18,16 @@ export function isInvalidDateTime(dateTime: unknown): boolean {
}
export function isInvalidPassword(password: unknown): boolean {
// Minimum Length: At least 8 characters
// Maximum Length: No more than 128 characters
// Lowercase Letter: Must contain at least one lowercase letter (a-z)
// Uppercase Letter: Must contain at least one uppercase letter (A-Z)
// Digit: Must contain at least one number (0-9)
// Special Character: Must contain at least one special character (anything that's not a letter or number)
if (!password || typeof password !== 'string' || password.length > 128) {
return true
}
const regexPassword = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).{8,}$/
return !password || typeof password !== 'string' || !regexPassword.test(password)
return !regexPassword.test(password)
}

View File

@ -725,7 +725,8 @@ export const ExecutionDetails = ({ open, isPublic, execution, metadata, onClose,
flex: '1 1 35%',
padding: 2,
borderRight: 1,
borderColor: 'divider'
borderColor: 'divider',
overflow: 'auto'
}}
>
<Box

View File

@ -10,7 +10,7 @@ import executionsApi from '@/api/executions'
import useApi from '@/hooks/useApi'
// MUI
import { Box, Card, Stack, Typography, useTheme } from '@mui/material'
import { Box, Card, Stack, Typography, useTheme, CircularProgress } from '@mui/material'
import { IconCircleXFilled } from '@tabler/icons-react'
import { alpha } from '@mui/material/styles'
@ -56,9 +56,13 @@ const PublicExecutionDetails = () => {
return (
<>
{!isLoading ? (
{isLoading ? (
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '80vh' }}>
<CircularProgress size={60} />
</Box>
) : (
<>
{!execution || getExecutionByIdPublicApi.error ? (
{getExecutionByIdPublicApi.error ? (
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '80vh' }}>
<Box sx={{ maxWidth: '500px', width: '100%' }}>
<Card
@ -96,7 +100,7 @@ const PublicExecutionDetails = () => {
/>
)}
</>
) : null}
)}
</>
)
}