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 {
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 ??
""
}
/>
)}
/>