Skip to content

Commit

Permalink
fix: remove period from service name pattern validation
Browse files Browse the repository at this point in the history
  • Loading branch information
agatha197 committed Oct 25, 2024
1 parent 5a5bcfe commit 92d5651
Show file tree
Hide file tree
Showing 22 changed files with 122 additions and 43 deletions.
18 changes: 17 additions & 1 deletion react/src/components/ServiceLauncherPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,23 @@ const ServiceLauncherPageContent: React.FC<ServiceLauncherPageContentProps> = ({
name="serviceName"
rules={[
{
pattern: /^(?=.{4,24}$)\w[\w.-]*\w$/,
min: 4,
message: t('modelService.ServiceNameMinLength'),
type: 'string',
},
{
max: 24,
message: t('modelService.ServiceNameMaxLength'),
type: 'string',
},
{
pattern: /^(?:[^-]|[^-].*[^-])$/,
message: t(
'modelService.ServiceNameCannotStartWithHyphen',
),
},
{
pattern: /^[\w-]+$/,
message: t('modelService.ServiceNameRule'),
},
{
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@
"FormValidationFailed": "Formularüberprüfung fehlgeschlagen",
"StartNewServing": "Neue Portion starten",
"ServiceName": "Dienst Name",
"ServiceNameRule": "Erlaubt sind nur 4 bis 24 alphanumerische Zeichen, Unterstrich(_), Bindestrich(-) und Punkt(.) und er muss mit einem alphanumerischen Zeichen enden.",
"ServiceNameRule": "Erlauben Sie nur alphanumerische Zeichen, Unterstriche (_) und Bindestriche (-) und müssen mit einem alphanumerischen Zeichen enden.",
"OpenToPublic": "Offen für die Öffentlichkeit",
"DesiredRoutingCount": "Gewünschte Routinganzahl",
"ServingRouteErrorModalTitle": "Serving Route Fehler",
Expand Down Expand Up @@ -1604,7 +1604,10 @@
"UpdateService": "Update-Service",
"StartNewService": "Neuen Dienst starten",
"RuntimeVariant": "Inferenz Laufzeitvariante",
"Chatting": "Chatten"
"Chatting": "Chatten",
"ServiceNameMinLength": "Bitte geben Sie mindestens 4 Zeichen ein.",
"ServiceNameMaxLength": "Bitte geben Sie maximal 24 Zeichen ein.",
"ServiceNameCannotStartWithHyphen": "Bindestriche (-) dürfen an beiden Enden nicht verwendet werden."
},
"ErrorBoundary": {
"title": "Es ist ein Fehler aufgetreten.",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@
"FormValidationFailed": "Η επικύρωση της φόρμας απέτυχε",
"StartNewServing": "Έναρξη νέου σερβιρίσματος",
"ServiceName": "Όνομα υπηρεσίας",
"ServiceNameRule": "Επιτρέπονται μόνο 4 έως 24 αλφαριθμητικοί χαρακτήρες, υπογράμμιση(_), παύλα(-) και τελεία(.) και πρέπει να τελειώνουν με έναν αλφαριθμητικό χαρακτήρα.",
"ServiceNameRule": "Επιτρέπονται μόνο αλφαριθμητικά, κάτω παύλα(_) και παύλα(-) και πρέπει να τελειώνει με αλφαριθμητικό χαρακτήρα.",
"OpenToPublic": "Ανοιχτό για το κοινό",
"DesiredRoutingCount": "Επιθυμητός αριθμός δρομολόγησης",
"ServingRouteErrorModalTitle": "Σφάλμα διαδρομής εξυπηρέτησης",
Expand Down Expand Up @@ -1604,7 +1604,10 @@
"UpdateService": "Υπηρεσία ενημέρωσης",
"StartNewService": "Ξεκινήστε τη Νέα Υπηρεσία",
"RuntimeVariant": "Παραλλαγή χρόνου εκτέλεσης εξαγωγής συμπερασμάτων",
"Chatting": "Συζήτηση"
"Chatting": "Συζήτηση",
"ServiceNameMinLength": "Εισαγάγετε τουλάχιστον 4 χαρακτήρες.",
"ServiceNameMaxLength": "Εισαγάγετε 24 χαρακτήρες ή λιγότερους.",
"ServiceNameCannotStartWithHyphen": "Οι παύλες (-) δεν μπορούν να χρησιμοποιηθούν σε κανένα άκρο."
},
"ErrorBoundary": {
"title": "Εμφανίστηκε σφάλμα.",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
"ExpiredDate": "Expired Date",
"TokenExpiredDateHelp": "The default token expiration time is 24 hours later.",
"TokenExpiredDateError": "The token expiration time must be after the current time",
"ServiceNameRule": "Only allow 4 to 24 characters of alphanumeric, underscore(_), hyphen(-), and period(.) and it must end with an alphanumeric character.",
"ServiceNameRule": "Only allow alphanumeric, underscore(_), and hyphen(-) and it must end with an alphanumeric character.",
"FormValidationFailed": "Form validation failed",
"CannotValidateNow": "Cannot validate service now. Please check resource allocation or other configurations.",
"resources": "Resources",
Expand All @@ -507,7 +507,10 @@
"StartNewService": "Start New Service",
"UpdateService": "Update Service",
"RuntimeVariant": "Inference Runtime Variant",
"Chatting": "Chatting"
"Chatting": "Chatting",
"ServiceNameMinLength": "Please enter at least 4 characters.",
"ServiceNameMaxLength": "Please enter 24 characters or less.",
"ServiceNameCannotStartWithHyphen": "Hyphens (-) cannot be used at either end."
},
"button": {
"Cancel": "Cancel",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@
"ServiceEndpoint": "Punto final del servicio",
"ServiceInfo": "Información de servicio",
"ServiceName": "Nombre del servicio",
"ServiceNameRule": "Sólo se permiten de 4 a 24 caracteres alfanuméricos, guión bajo(_), guión(-) y punto(.) y debe terminar con un carácter alfanumérico.",
"ServiceNameRule": "Solo se permiten caracteres alfanuméricos, guiones bajos (_) y guiones (-) y deben terminar con un carácter alfanumérico.",
"Services": "Servicios",
"ServingRouteErrorModalTitle": "Error de ruta de servicio",
"SessionId": "ID de sesión",
Expand Down Expand Up @@ -835,7 +835,10 @@
"UpdateService": "Servicio de actualización",
"StartNewService": "Iniciar nuevo servicio",
"RuntimeVariant": "Variante de tiempo de ejecución de la inferencia",
"Chatting": "Charlando"
"Chatting": "Charlando",
"ServiceNameMinLength": "Por favor ingrese al menos 4 caracteres.",
"ServiceNameMaxLength": "Por favor ingrese 24 caracteres o menos.",
"ServiceNameCannotStartWithHyphen": "No se pueden utilizar guiones (-) en ninguno de los extremos."
},
"notification": {
"Initializing": "Inicializando...",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
"ServiceEndpoint": "Palvelun päätepiste",
"ServiceInfo": "Palvelun tiedot",
"ServiceName": "Palvelun nimi",
"ServiceNameRule": "Ainoastaan aakkosnumeerisia merkkejä, alaviivoja(_), väliviivoja(-) ja pisteitä(.) saa olla 4-24 merkkiä, ja sen on päätyttävä aakkosnumeeriseen merkkiin.",
"ServiceNameRule": "Salli vain aakkosnumeeriset, alaviivat (_) ja yhdysviivat (-), ja sen tulee päättyä aakkosnumeeriseen merkkiin.",
"Services": "Palvelut",
"ServingRouteErrorModalTitle": "Palvelevan reitin virhe",
"SessionId": "Istunnon ID",
Expand Down Expand Up @@ -832,7 +832,10 @@
"SyncRoutesRequested": "Reitin synkronointia on pyydetty.",
"UpdateService": "Päivityspalvelu",
"StartNewService": "Aloita uusi palvelu",
"RuntimeVariant": "Päättelyn suoritusaikamuunnos"
"RuntimeVariant": "Päättelyn suoritusaikamuunnos",
"ServiceNameMinLength": "Kirjoita vähintään 4 merkkiä.",
"ServiceNameMaxLength": "Anna enintään 24 merkkiä.",
"ServiceNameCannotStartWithHyphen": "Tavuviivoja (-) ei voi käyttää kummassakaan päässä."
},
"notification": {
"Initializing": "Aloitetaan...",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@
"TokenExpiredDateHelp": "Le délai d'expiration par défaut du jeton est de 24 heures.",
"TokenExpiredDateError": "L'heure d'expiration du jeton doit être postérieure à l'heure actuelle.",
"FormValidationFailed": "La validation du formulaire a échoué",
"ServiceNameRule": "Seuls 4 à 24 caractères alphanumériques, le trait de soulignement (_), le trait d'union (-) et le point (.) sont autorisés et le texte doit se terminer par un caractère alphanumérique.",
"ServiceNameRule": "Autorisez uniquement les caractères alphanumériques, les traits de soulignement (_) et les traits d'union (-) et ils doivent se terminer par un caractère alphanumérique.",
"resources": "Ressources",
"Image": "Image",
"Owner": "Propriétaire",
Expand Down Expand Up @@ -1657,7 +1657,10 @@
"UpdateService": "Service de mise à jour",
"StartNewService": "Démarrer un nouveau service",
"RuntimeVariant": "Variante d'exécution de l'inférence",
"Chatting": "Bavardage"
"Chatting": "Bavardage",
"ServiceNameMinLength": "Veuillez saisir au moins 4 caractères.",
"ServiceNameMaxLength": "Veuillez saisir 24 caractères ou moins.",
"ServiceNameCannotStartWithHyphen": "Les tirets (-) ne peuvent pas être utilisés à chaque extrémité."
},
"ErrorBoundary": {
"title": "Une erreur s'est produite.",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@
"TokenExpiredDateHelp": "Waktu kedaluwarsa token default adalah 24 jam kemudian.",
"TokenExpiredDateError": "Waktu kedaluwarsa token harus setelah waktu saat ini",
"FormValidationFailed": "Validasi formulir gagal",
"ServiceNameRule": "Hanya mengizinkan 4 hingga 24 karakter alfanumerik, garis bawah (_), tanda hubung (-), dan titik (.) dan harus diakhiri dengan karakter alfanumerik.",
"ServiceNameRule": "Hanya diperbolehkan alfanumerik, garis bawah(_), dan tanda hubung(-) dan harus diakhiri dengan karakter alfanumerik.",
"resources": "Sumber daya",
"Image": "Gambar",
"Owner": "Pemilik",
Expand Down Expand Up @@ -1657,7 +1657,10 @@
"UpdateService": "Layanan Pembaruan",
"StartNewService": "Mulai Layanan Baru",
"RuntimeVariant": "Varian Runtime Inferensi",
"Chatting": "Mengobrol"
"Chatting": "Mengobrol",
"ServiceNameMinLength": "Silakan masukkan setidaknya 4 karakter.",
"ServiceNameMaxLength": "Silakan masukkan 24 karakter atau kurang.",
"ServiceNameCannotStartWithHyphen": "Tanda hubung (-) tidak dapat digunakan pada kedua ujungnya."
},
"ErrorBoundary": {
"title": "Telah terjadi kesalahan.",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@
"FormValidationFailed": "Convalida del modulo non riuscita",
"StartNewServing": "Iniziare un nuovo servizio",
"ServiceName": "Nome del servizio",
"ServiceNameRule": "Sono consentiti solo da 4 a 24 caratteri alfanumerici, underscore(_), trattino(-) e punto(.) e devono terminare con un carattere alfanumerico.",
"ServiceNameRule": "Consenti solo caratteri alfanumerici, trattino basso (_) e trattino (-) e deve terminare con un carattere alfanumerico.",
"OpenToPublic": "Aperto al pubblico",
"DesiredRoutingCount": "Conteggio dell'instradamento desiderato",
"ServingRouteErrorModalTitle": "Errore del percorso di servizio",
Expand Down Expand Up @@ -1604,7 +1604,10 @@
"UpdateService": "Servizio di aggiornamento",
"StartNewService": "Avvia nuovo servizio",
"RuntimeVariant": "Variante di runtime dell'inferenza",
"Chatting": "Chiacchierando"
"Chatting": "Chiacchierando",
"ServiceNameMinLength": "Inserisci almeno 4 caratteri.",
"ServiceNameMaxLength": "Inserisci 24 caratteri o meno.",
"ServiceNameCannotStartWithHyphen": "I trattini (-) non possono essere utilizzati alle due estremità."
},
"ErrorBoundary": {
"title": "Si è verificato un errore.",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@
"FormValidationFailed": "フォーム検証の失敗",
"StartNewServing": "新サービス開始",
"ServiceName": "サービス名",
"ServiceNameRule": "4~24文字の英字、数字、アンダーライン(_)、ハイフン(-)、ピリオド(.)のみを許可し、英文で英字または数字で終わる必要があります",
"ServiceNameRule": "英数字、アンダースコア (_)、およびハイフン (-) のみを使用でき、英数字で終わる必要があります",
"OpenToPublic": "アプリを外部に公開",
"DesiredRoutingCount": "希望のルーティング数",
"ServingRouteErrorModalTitle": "サービングルートエラー",
Expand Down Expand Up @@ -1603,7 +1603,10 @@
"UpdateService": "アップデートサービス",
"StartNewService": "新しいサービスを開始する",
"RuntimeVariant": "推論ランタイム・バリアント",
"Chatting": "おしゃべり"
"Chatting": "おしゃべり",
"ServiceNameMinLength": "少なくとも 4 文字を入力してください。",
"ServiceNameMaxLength": "24文字以内で入力してください。",
"ServiceNameCannotStartWithHyphen": "両端にハイフン(-)を使用することはできません。"
},
"ErrorBoundary": {
"title": "エラーが発生しました。",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"ExpiredDate": "토큰 만료 시각",
"TokenExpiredDateHelp": "토큰 만료 시각 기본 값은 24시간 뒤입니다.",
"TokenExpiredDateError": "토큰 만료 시간은 현재 시간 이후여야 합니다.",
"ServiceNameRule": "4~24자의 영문, 숫자, 밑줄(_), 하이픈(-), 마침표(.)만 허용하며, 영문으로 영문이나 숫자로 끝나야합니다.",
"ServiceNameRule": "영숫자, 밑줄(_), 하이픈(-)만 허용하며 영숫자로 끝나야 합니다.",
"FormValidationFailed": "양식 유효성 검사 실패",
"resources": "자원",
"Image": "이미지",
Expand Down Expand Up @@ -495,7 +495,10 @@
"UpdateService": "서비스 업데이트",
"StartNewService": "새로운 서비스 시작",
"RuntimeVariant": "인퍼런스 런타임 종류",
"Chatting": "채팅"
"Chatting": "채팅",
"ServiceNameMinLength": "4자 이상 입력해주세요.",
"ServiceNameMaxLength": "24자 이하로 입력해주세요.",
"ServiceNameCannotStartWithHyphen": "하이픈(-)은 양쪽 끝에 사용할 수 없습니다."
},
"button": {
"Cancel": "취소",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/mn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@
"TokenExpiredDateHelp": "Өгөгдмөл токен дуусах хугацаа нь 24 цагийн дараа байна.",
"TokenExpiredDateError": "Токен дуусах хугацаа нь одоогийн цагаас хойш байх ёстой",
"FormValidationFailed": "Маягтын баталгаажуулалт амжилтгүй боллоо",
"ServiceNameRule": "Зөвхөн 4-24 үсэг тоо, доогуур зураас(_), зураас(-), цэг(.) оруулахыг зөвшөөрөх ба энэ нь үсэг, тоон тэмдэгтээр төгсөх ёстой.",
"ServiceNameRule": "Зөвхөн үсэг тоо, доогуур зураас(_), зураас(-) оруулахыг зөвшөөрөх ба энэ нь үсэг, тоон тэмдэгтээр төгсөх ёстой.",
"resources": "Нөөц",
"Image": "Зураг",
"Owner": "Эзэмшигч",
Expand Down Expand Up @@ -1657,7 +1657,10 @@
"UpdateService": "Үйлчилгээг шинэчлэх",
"StartNewService": "Шинэ үйлчилгээг эхлүүлэх",
"RuntimeVariant": "Дүгнэлт Runtime Variant",
"Chatting": "Чатлаж байна"
"Chatting": "Чатлаж байна",
"ServiceNameMinLength": "Дор хаяж 4 тэмдэгт оруулна уу.",
"ServiceNameMaxLength": "24 ба түүнээс бага тэмдэгт оруулна уу.",
"ServiceNameCannotStartWithHyphen": "Хоёр төгсгөлд зураас (-) ашиглах боломжгүй."
},
"ErrorBoundary": {
"title": "Алдаа гарсан байна.",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@
"FormValidationFailed": "Pengesahan borang gagal",
"StartNewServing": "Mulakan hidangan baharu",
"ServiceName": "Nama Perkhidmatan",
"ServiceNameRule": "Hanya benarkan 4 hingga 24 aksara abjad angka, garis bawah(_), sempang(-), dan noktah(.) dan ia mesti berakhir dengan aksara abjad angka.",
"ServiceNameRule": "Hanya benarkan abjad angka, garis bawah(_), dan sempang(-) dan ia mesti berakhir dengan aksara abjad angka.",
"OpenToPublic": "Terbuka Kepada Umum",
"DesiredRoutingCount": "Kiraan Laluan yang Diingini",
"ServingRouteErrorModalTitle": "Ralat Laluan Pelayanan",
Expand Down Expand Up @@ -1644,7 +1644,10 @@
"UpdateService": "Perkhidmatan Kemas Kini",
"StartNewService": "Mulakan Perkhidmatan Baharu",
"RuntimeVariant": "Varian Masa Jalan Inferens",
"Chatting": "Berbual"
"Chatting": "Berbual",
"ServiceNameMinLength": "Sila masukkan sekurang-kurangnya 4 aksara.",
"ServiceNameMaxLength": "Sila masukkan 24 aksara atau kurang.",
"ServiceNameCannotStartWithHyphen": "Tanda sempang (-) tidak boleh digunakan pada kedua-dua hujung."
},
"totp": {
"TotpSetupCompleted": "Didayakan 2FA",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@
"FormValidationFailed": "Walidacja formularza nie powiodła się",
"StartNewServing": "Rozpocznij nową porcję",
"ServiceName": "Nazwa usługi",
"ServiceNameRule": "Dozwolone są tylko 4 do 24 znaki alfanumeryczne, podkreślenie(_), myślnik(-) i kropka(.) i muszą kończyć się znakiem alfanumerycznym.",
"ServiceNameRule": "Zezwalaj tylko na znaki alfanumeryczne, podkreślenie (_) i łącznik (-) i muszą one kończyć się znakiem alfanumerycznym.",
"OpenToPublic": "Otwarte dla publiczności",
"DesiredRoutingCount": "Pożądana liczba tras",
"ServingRouteErrorModalTitle": "Błąd trasy serwowania",
Expand Down Expand Up @@ -1604,7 +1604,10 @@
"UpdateService": "Aktualizuj usługę",
"StartNewService": "Uruchom nową usługę",
"RuntimeVariant": "Inference Runtime Variant",
"Chatting": "Czatowanie"
"Chatting": "Czatowanie",
"ServiceNameMinLength": "Proszę wpisać co najmniej 4 znaki.",
"ServiceNameMaxLength": "Wprowadź maksymalnie 24 znaki.",
"ServiceNameCannotStartWithHyphen": "Łączników (-) nie można używać na żadnym końcu."
},
"ErrorBoundary": {
"title": "Wystąpił błąd.",
Expand Down
7 changes: 5 additions & 2 deletions resources/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@
"FormValidationFailed": "Falha na validação do formulário",
"StartNewServing": "Iniciar nova dose",
"ServiceName": "Nome do serviço",
"ServiceNameRule": "Só são permitidos 4 a 24 caracteres alfanuméricos, sublinhado(_), hífen(-) e ponto(.) e deve terminar com um carácter alfanumérico.",
"ServiceNameRule": "Permitir apenas alfanumérico, sublinhado (_) e hífen (-) e deve terminar com um caractere alfanumérico.",
"OpenToPublic": "Aberto ao público",
"DesiredRoutingCount": "Contagem de roteiros desejada",
"ServingRouteErrorModalTitle": "Erro de rota de serviço",
Expand Down Expand Up @@ -1645,7 +1645,10 @@
"UpdateService": "Serviço de atualização",
"StartNewService": "Iniciar novo serviço",
"RuntimeVariant": "Variante de tempo de execução de inferência",
"Chatting": "Conversando"
"Chatting": "Conversando",
"ServiceNameMinLength": "Por favor insira pelo menos 4 caracteres.",
"ServiceNameMaxLength": "Insira 24 caracteres ou menos.",
"ServiceNameCannotStartWithHyphen": "Hífens (-) não podem ser usados ​​em nenhuma das extremidades."
},
"totp": {
"TotpSetupCompleted": "Ativado 2FA",
Expand Down
Loading

0 comments on commit 92d5651

Please sign in to comment.