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:
1 parent
5b25666054
commit
d5cd957bbd
17 files changed
+128
-20
No files matched your search
@@ -44,11 +44,13 @@ import type { MonitorFormData } from "@/Validation/monitor";
|
||||
interface GeneralSettingsConfig {
|
||||
urlLabel: string;
|
||||
urlPlaceholder: string;
|
||||
urlHelperText?: string;
|
||||
namePlaceholder: string;
|
||||
showUrl: boolean;
|
||||
showPort: boolean;
|
||||
showGameSelect: boolean;
|
||||
showSecret: boolean;
|
||||
secretHelperText?: string;
|
||||
showGrpcServiceName: boolean;
|
||||
showIgnoreTls: boolean;
|
||||
}
|
||||
@@ -136,13 +138,15 @@ const getGeneralSettingsConfig = (
|
||||
showIgnoreTls: false,
|
||||
},
|
||||
hardware: {
|
||||
urlLabel: t("pages.createMonitor.form.general.option.url.label"),
|
||||
urlPlaceholder: t("pages.createMonitor.form.general.option.url.placeholder"),
|
||||
urlLabel: t("pages.createMonitor.form.general.option.captureUrl.label"),
|
||||
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"),
|
||||
showUrl: true,
|
||||
showPort: false,
|
||||
showGameSelect: false,
|
||||
showSecret: true,
|
||||
secretHelperText: t("pages.createMonitor.form.general.option.secret.helperText"),
|
||||
showGrpcServiceName: false,
|
||||
showIgnoreTls: false,
|
||||
},
|
||||
@@ -389,7 +393,11 @@ const CreateMonitorPage = () => {
|
||||
fullWidth
|
||||
disabled={isEditMode}
|
||||
error={!!fieldState.error}
|
||||
helperText={fieldState.error?.message ?? ""}
|
||||
helperText={
|
||||
fieldState.error?.message ??
|
||||
generalSettingsConfig.urlHelperText ??
|
||||
""
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
@@ -490,7 +498,11 @@ const CreateMonitorPage = () => {
|
||||
)}
|
||||
fullWidth
|
||||
error={!!fieldState.error}
|
||||
helperText={fieldState.error?.message ?? ""}
|
||||
helperText={
|
||||
fieldState.error?.message ??
|
||||
generalSettingsConfig.secretHelperText ??
|
||||
""
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"label": "مفتاح التفويض",
|
||||
"placeholder": "أدخل مفتاحك السري"
|
||||
"placeholder": "أدخل مفتاحك السري",
|
||||
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
|
||||
},
|
||||
"url": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "رابط WebSocket",
|
||||
"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": "الإعدادات العامة",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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í",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket-URL",
|
||||
"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",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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",
|
||||
|
||||
@@ -520,7 +520,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -541,6 +542,11 @@
|
||||
"wsUrl": {
|
||||
"label": "URL de WebSocket",
|
||||
"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",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "URL WebSocket",
|
||||
"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",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"label": "認証シークレット",
|
||||
"placeholder": "シークレットキーを入力"
|
||||
"placeholder": "シークレットキーを入力",
|
||||
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
|
||||
},
|
||||
"url": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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": "一般設定",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "URL do WebSocket",
|
||||
"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",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"label": "Секрет авторизации",
|
||||
"placeholder": "Введите Ваш секретный ключ"
|
||||
"placeholder": "Введите Ваш секретный ключ",
|
||||
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
|
||||
},
|
||||
"url": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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": "Основные настройки",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"label": "รหัสลับสำหรับยืนยันตัวตน",
|
||||
"placeholder": "กรอกรหัสลับของคุณ"
|
||||
"placeholder": "กรอกรหัสลับของคุณ",
|
||||
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
|
||||
},
|
||||
"url": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "URL ของ WebSocket",
|
||||
"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": "ตั้งค่าทั่วไป",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"label": "Секрет авторизації",
|
||||
"placeholder": "Введіть Ваш секретний ключ"
|
||||
"placeholder": "Введіть Ваш секретний ключ",
|
||||
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
|
||||
},
|
||||
"url": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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": "Загальні налаштування",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"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": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "URL WebSocket",
|
||||
"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",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"label": "授权密钥",
|
||||
"placeholder": "输入您的密钥"
|
||||
"placeholder": "输入您的密钥",
|
||||
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
|
||||
},
|
||||
"url": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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": "常规设置",
|
||||
|
||||
@@ -513,7 +513,8 @@
|
||||
},
|
||||
"secret": {
|
||||
"label": "授權密鑰",
|
||||
"placeholder": "輸入您的密鑰"
|
||||
"placeholder": "輸入您的密鑰",
|
||||
"helperText": "Paste only the token string. Don't include 'Bearer' — it's added automatically."
|
||||
},
|
||||
"url": {
|
||||
"label": "URL",
|
||||
@@ -534,6 +535,11 @@
|
||||
"wsUrl": {
|
||||
"label": "WebSocket URL",
|
||||
"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": "一般設定",
|
||||
|
||||
Reference in new issue
Block a user