feat(infrastructure): add helper text to capture endpoint and secret fields

Two real users hit the same confusion: the Capture endpoint URL needs
the full path /api/v1/metrics, and the authorization secret should not
include a "Bearer" prefix. The form previously gave no guidance on
either — same generic placeholder as HTTP monitors and no helper text.

- Replace the URL field's generic label/placeholder with hardware-
  specific copy ("Capture endpoint", realistic 192.168.1.10:5001/...
  example) and add helper text under the field.
- Add helper text under the authorization secret field clarifying that
  only the raw token belongs there — Bearer is added automatically.
- Wire optional urlHelperText / secretHelperText through
  GeneralSettingsConfig so other monitor types are unaffected.
- Add three new i18n keys (captureUrl.label/placeholder/helperText)
  and one (secret.helperText) to all 16 locales. Non-English locales
  carry the English copy as a placeholder until translators pick the
  keys up via the existing PoEditor pipeline.
This commit is contained in:
gorkem-bwl committed 2026-05-01 16:46:46 -04:00
1 parent 5b25666054
commit d5cd957bbd
17 files changed
+128 -20

No files matched your search

+16 -4
View File
@@ -44,11 +44,13 @@ import type { MonitorFormData } from "@/Validation/monitor";
interface GeneralSettingsConfig { interface GeneralSettingsConfig {
urlLabel: string; urlLabel: string;
urlPlaceholder: string; urlPlaceholder: string;
urlHelperText?: string;
namePlaceholder: string; namePlaceholder: string;
showUrl: boolean; showUrl: boolean;
showPort: boolean; showPort: boolean;
showGameSelect: boolean; showGameSelect: boolean;
showSecret: boolean; showSecret: boolean;
secretHelperText?: string;
showGrpcServiceName: boolean; showGrpcServiceName: boolean;
showIgnoreTls: boolean; showIgnoreTls: boolean;
} }
@@ -136,13 +138,15 @@ const getGeneralSettingsConfig = (
showIgnoreTls: false, showIgnoreTls: false,
}, },
hardware: { hardware: {
urlLabel: t("pages.createMonitor.form.general.option.url.label"), urlLabel: t("pages.createMonitor.form.general.option.captureUrl.label"),
urlPlaceholder: t("pages.createMonitor.form.general.option.url.placeholder"), urlPlaceholder: t("pages.createMonitor.form.general.option.captureUrl.placeholder"),
urlHelperText: t("pages.createMonitor.form.general.option.captureUrl.helperText"),
namePlaceholder: t("pages.createMonitor.form.general.option.name.placeholder"), namePlaceholder: t("pages.createMonitor.form.general.option.name.placeholder"),
showUrl: true, showUrl: true,
showPort: false, showPort: false,
showGameSelect: false, showGameSelect: false,
showSecret: true, showSecret: true,
secretHelperText: t("pages.createMonitor.form.general.option.secret.helperText"),
showGrpcServiceName: false, showGrpcServiceName: false,
showIgnoreTls: false, showIgnoreTls: false,
}, },
@@ -389,7 +393,11 @@ const CreateMonitorPage = () => {
fullWidth fullWidth
disabled={isEditMode} disabled={isEditMode}
error={!!fieldState.error} error={!!fieldState.error}
helperText={fieldState.error?.message ?? ""} helperText={
fieldState.error?.message ??
generalSettingsConfig.urlHelperText ??
""
}
/> />
)} )}
/> />
@@ -490,7 +498,11 @@ const CreateMonitorPage = () => {
)} )}
fullWidth fullWidth
error={!!fieldState.error} error={!!fieldState.error}
helperText={fieldState.error?.message ?? ""} helperText={
fieldState.error?.message ??
generalSettingsConfig.secretHelperText ??
""
}
/> />
)} )}
/> />
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "مفتاح التفويض", "label": "مفتاح التفويض",
"placeholder": "أدخل مفتاحك السري" "placeholder": "أدخل مفتاحك السري",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "رابط WebSocket", "label": "رابط WebSocket",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "الإعدادات العامة", "title": "الإعدادات العامة",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Autorizační tajný klíč", "label": "Autorizační tajný klíč",
"placeholder": "Zadejte svůj tajný klíč" "placeholder": "Zadejte svůj tajný klíč",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Obecná nastavení", "title": "Obecná nastavení",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Autorisierungsschlüssel", "label": "Autorisierungsschlüssel",
"placeholder": "Geben Sie Ihren geheimen Schlüssel ein" "placeholder": "Geben Sie Ihren geheimen Schlüssel ein",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket-URL", "label": "WebSocket-URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Allgemeine Einstellungen", "title": "Allgemeine Einstellungen",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Authorization secret", "label": "Authorization secret",
"placeholder": "Enter your secret key" "placeholder": "Enter your secret key",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "General settings", "title": "General settings",
+7 -1
View File
@@ -520,7 +520,8 @@
}, },
"secret": { "secret": {
"label": "Secreto de autorización", "label": "Secreto de autorización",
"placeholder": "Ingrese su clave secreta" "placeholder": "Ingrese su clave secreta",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -541,6 +542,11 @@
"wsUrl": { "wsUrl": {
"label": "URL de WebSocket", "label": "URL de WebSocket",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Configuración general", "title": "Configuración general",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Valtuutusavain", "label": "Valtuutusavain",
"placeholder": "Syötä salausavaimesi" "placeholder": "Syötä salausavaimesi",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Yleiset asetukset", "title": "Yleiset asetukset",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Secret d'autorisation", "label": "Secret d'autorisation",
"placeholder": "Saisissez votre clé secrète" "placeholder": "Saisissez votre clé secrète",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "URL WebSocket", "label": "URL WebSocket",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Paramètres généraux", "title": "Paramètres généraux",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "認証シークレット", "label": "認証シークレット",
"placeholder": "シークレットキーを入力" "placeholder": "シークレットキーを入力",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "一般設定", "title": "一般設定",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Chave de autorização", "label": "Chave de autorização",
"placeholder": "Digite sua chave secreta" "placeholder": "Digite sua chave secreta",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "URL do WebSocket", "label": "URL do WebSocket",
"placeholder": "wss://exemplo.com/socket" "placeholder": "wss://exemplo.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Configurações gerais", "title": "Configurações gerais",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Секрет авторизации", "label": "Секрет авторизации",
"placeholder": "Введите Ваш секретный ключ" "placeholder": "Введите Ваш секретный ключ",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Основные настройки", "title": "Основные настройки",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "รหัสลับสำหรับยืนยันตัวตน", "label": "รหัสลับสำหรับยืนยันตัวตน",
"placeholder": "กรอกรหัสลับของคุณ" "placeholder": "กรอกรหัสลับของคุณ",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "URL ของ WebSocket", "label": "URL ของ WebSocket",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "ตั้งค่าทั่วไป", "title": "ตั้งค่าทั่วไป",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Yetkilendirme anahtarı", "label": "Yetkilendirme anahtarı",
"placeholder": "Gizli anahtarınızı girin" "placeholder": "Gizli anahtarınızı girin",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Genel ayarlar", "title": "Genel ayarlar",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Секрет авторизації", "label": "Секрет авторизації",
"placeholder": "Введіть Ваш секретний ключ" "placeholder": "Введіть Ваш секретний ключ",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Загальні налаштування", "title": "Загальні налаштування",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "Khóa xác thực", "label": "Khóa xác thực",
"placeholder": "Nhập khóa bí mật của bạn" "placeholder": "Nhập khóa bí mật của bạn",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "URL WebSocket", "label": "URL WebSocket",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "Cài đặt chung", "title": "Cài đặt chung",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "授权密钥", "label": "授权密钥",
"placeholder": "输入您的密钥" "placeholder": "输入您的密钥",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "常规设置", "title": "常规设置",
+7 -1
View File
@@ -513,7 +513,8 @@
}, },
"secret": { "secret": {
"label": "授權密鑰", "label": "授權密鑰",
"placeholder": "輸入您的密鑰" "placeholder": "輸入您的密鑰",
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
}, },
"url": { "url": {
"label": "URL", "label": "URL",
@@ -534,6 +535,11 @@
"wsUrl": { "wsUrl": {
"label": "WebSocket URL", "label": "WebSocket URL",
"placeholder": "wss://example.com/socket" "placeholder": "wss://example.com/socket"
},
"captureUrl": {
"label": "Capture endpoint",
"placeholder": "http://192.168.1.10:5001/api/v1/metrics",
"helperText": "The full Capture metrics endpoint, including the path. Example: http://192.168.1.10:5001/api/v1/metrics"
} }
}, },
"title": "一般設定", "title": "一般設定",