add mobile config form

This commit is contained in:
Ildar Kamalov
2025-01-13 16:57:12 +03:00
parent b538096ab0
commit 61cba0e212
3 changed files with 88 additions and 48 deletions

View File

@@ -180,7 +180,7 @@ export const validateConfigClientId = (value: any) => {
}
const formattedValue = value.trim();
if (formattedValue && !R_CLIENT_ID.test(formattedValue)) {
return 'form_error_client_id_format';
return i18next.t('form_error_client_id_format');
}
return undefined;
};
@@ -195,7 +195,7 @@ export const validateServerName = (value: any) => {
}
const formattedValue = value ? value.trim() : value;
if (formattedValue && !R_DOMAIN.test(formattedValue)) {
return 'form_error_server_name';
return i18next.t('form_error_server_name');
}
return undefined;
};
@@ -239,7 +239,7 @@ export const validateMac = (value: any) => {
*/
export const validatePort = (value: any) => {
if ((value || value === 0) && (value < STANDARD_WEB_PORT || value > MAX_PORT)) {
return 'form_error_port_range';
return i18next.t('form_error_port_range');
}
return undefined;
};
@@ -281,7 +281,7 @@ export const validatePortQuic = validatePortTLS;
*/
export const validateIsSafePort = (value: any) => {
if (UNSAFE_PORTS.includes(value)) {
return 'form_error_port_unsafe';
return i18next.t('form_error_port_unsafe');
}
return undefined;
};