CI / changes (push) Successful in 10s
CI / commitlint (push) Has been skipped
CI / openapi (push) Successful in 25s
CI / web (push) Successful in 36s
CI / go (push) Successful in 49s
CI / bird2 (push) Successful in 17s
CI / release (push) Successful in 3m59s
- Merged birdSettingsSchema and revisionSettingsSchema into settingsKnownSchema, marking the previous schema as deprecated. - Updated emptySettingsKnownForm to utilize emptyBirdSettingsForm and emptyRevisionSettingsForm. - Refactored layout and page components to streamline theme management and improve tab synchronization in network and operations pages. - Introduced new system settings tab in operations and updated settings page to manage theme preferences.
20 lines
603 B
TypeScript
20 lines
603 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const revisionSettingsSchema = z.object({
|
|
revision_retention_minutes: z.string().refine(
|
|
(v) => {
|
|
const s = v.trim();
|
|
if (s === '') return true;
|
|
const ttl = Number(s);
|
|
return /^\d+$/.test(s) && Number.isInteger(ttl) && ttl >= 15 && ttl <= 43200;
|
|
},
|
|
{ message: 'TTL ревизий должен быть целым числом от 15 до 43200 минут' }
|
|
)
|
|
});
|
|
|
|
export type RevisionSettingsForm = z.infer<typeof revisionSettingsSchema>;
|
|
|
|
export const emptyRevisionSettingsForm = (): RevisionSettingsForm => ({
|
|
revision_retention_minutes: ''
|
|
});
|