Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export function RuleDrawer({
{showTestModal && (
<TestPlaygroundModal
mode="rule"
titleKey="playground.titleRule"
dataTypeOptions={form.dataTypes}
draftContent={ruleFormToYaml(form)}
onClose={() => setShowTestModal(false)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export function AlertingRulesPage() {
{open && <RuleDrawer rule={open} dataTypeOptions={dataTypeOptions} onClose={() => setOpen(null)} onToggle={toggleActive} onDelete={remove} onSaved={() => { setOpen(null); refresh() }} t={t} />}
{creating && <RuleDrawer create dataTypeOptions={dataTypeOptions} onClose={() => setCreating(false)} onSaved={() => { setCreating(false); refresh() }} t={t} />}
{importResults && <ImportResultsDialog res={importResults} onClose={() => setImportResults(null)} t={t} />}
{showTestModal && <TestPlaygroundModal mode="rule" dataTypeOptions={testDataTypes} onClose={() => setShowTestModal(false)} />}
{showTestModal && <TestPlaygroundModal mode="rule" titleKey="playground.titleRule" dataTypeOptions={testDataTypes} onClose={() => setShowTestModal(false)} />}
<ConfirmDialog
open={pendingDelete != null}
title={t('alertingRules.editor.delete') ?? 'Delete'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export function FilterFormDrawer({ filter, creating, onClose, onSaved }: Props)
{showTestModal && (
<TestPlaygroundModal
mode="filter"
titleKey="playground.titleFilter"
dataTypeOptions={model.dataTypes}
draftContent={content}
onClose={() => setShowTestModal(false)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export function ParsingFiltersPage() {
)}

{showTestModal && (
<TestPlaygroundModal mode="filter" dataTypeOptions={dataTypeOptions} onClose={() => setShowTestModal(false)} />
<TestPlaygroundModal mode="filter" titleKey="playground.titleFilter" dataTypeOptions={dataTypeOptions} onClose={() => setShowTestModal(false)} />
)}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ const MAX_BYTES = 1024 * 1024

interface Props {
mode: PlaygroundMode
/** i18n key for the modal header, e.g. `playground.titleFilter` or `playground.titleRule`. */
titleKey: string
/** Entry A: active dataTypes from the catalog. Entry B: `model.dataTypes` of the draft. */
dataTypeOptions: string[]
/** Present only for Entry B (unsaved draft content); omitted tests the live pipeline. */
draftContent?: string
onClose: () => void
}

export function TestPlaygroundModal({ mode, dataTypeOptions, draftContent, onClose }: Props) {
export function TestPlaygroundModal({ mode, titleKey, dataTypeOptions, draftContent, onClose }: Props) {
const { t } = useTranslation()
const [selectedDataType, setSelectedDataType] = useState(dataTypeOptions[0] ?? '')
const [rawLog, setRawLog] = useState('')
Expand Down Expand Up @@ -87,7 +89,7 @@ export function TestPlaygroundModal({ mode, dataTypeOptions, draftContent, onClo
>
<header className="flex items-center justify-between gap-4 border-b border-border px-6 py-4">
<h2 className="flex items-center gap-2 text-lg font-semibold">
<PlayCircle size={16} className="text-primary" /> {t('playground.title')}
<PlayCircle size={16} className="text-primary" /> {t(titleKey)}
</h2>
<button
type="button"
Expand Down
47 changes: 47 additions & 0 deletions frontend/src/shared/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -5178,5 +5178,52 @@
"level2": "Stufe 2",
"level3": "Stufe 3"
}
},
"playground": {
"titleFilter": "Pipeline testen",
"titleRule": "Regel testen",
"noDataTypes": "Dieser Pipeline sind noch keine Datentypen zugewiesen — füge einen hinzu, um sie zu testen.",
"dataTypeLabel": "Datentyp",
"dataTypePlaceholder": "Keine Datentypen verfügbar",
"dataTypeSingleHint": "Diese Pipeline hat nur einen Datentyp — füge weitere hinzu, um zwischen ihnen zu wählen.",
"rawLogLabel": "Rohprotokoll",
"rawLogPlaceholder": "Füge eine Beispielprotokollzeile ein…",
"rawLogCounter": "{{chars}} Zeichen · {{kb}} KB",
"rawLogTooLarge": "Dieses Protokoll überschreitet das 1-MB-Limit — kürze es vor dem Test.",
"run": {
"label": "Ausführen",
"running": "Wird getestet…",
"waitHint": "Dies kann bis zu 15 Sekunden dauern, während die Pipeline das Protokoll verarbeitet."
},
"errors": {
"busy": "Der Playground führt bereits einen anderen Test aus — bitte versuche es gleich erneut.",
"timeout": "Der Test hat das Zeitlimit überschritten — meist passt der gewählte Datentyp nicht zum Protokollformat.",
"validation": "Die Anfrage war ungültig — prüfe das Rohprotokoll und den Pipeline-Inhalt.",
"server": "Der Playground konnte den Test nicht abschließen — bitte erneut versuchen."
},
"result": {
"label": "Verarbeitetes Ergebnis",
"empty": "Führe einen Test aus, um das verarbeitete Ereignis hier zu sehen.",
"loading": "Warte auf das verarbeitete Ereignis…",
"tabs": {
"fields": "Felder",
"json": "JSON"
},
"fieldsCount_one": "{{count}} Feld",
"fieldsCount_other": "{{count}} Felder",
"copy": "Kopieren",
"copied": "Kopiert",
"elapsed": "Verarbeitet in {{time}}",
"elapsedHint": "Zeit von „Ausführen“ bis zum verarbeiteten Ergebnis",
"searchPlaceholder": "Felder suchen…",
"noMatch": "Keine Felder entsprechen deiner Suche."
},
"alerts": {
"label": "Alarme",
"empty": "Führe einen Test aus, um hier ausgelöste Alarme zu sehen.",
"none": "Es wurden keine Alarme ausgelöst.",
"count_one": "{{count}} Alarm",
"count_other": "{{count}} Alarme"
}
}
}
3 changes: 2 additions & 1 deletion frontend/src/shared/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4589,7 +4589,8 @@
"testPipeline": "Test pipeline"
},
"playground": {
"title": "Test pipeline",
"titleFilter": "Test pipeline",
"titleRule": "Test rule",
"noDataTypes": "This pipeline has no data types assigned yet — add one to test it.",
"dataTypeLabel": "Data type",
"dataTypePlaceholder": "No data types available",
Expand Down
47 changes: 47 additions & 0 deletions frontend/src/shared/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -5140,5 +5140,52 @@
"level2": "Nivel 2",
"level3": "Nivel 3"
}
},
"playground": {
"titleFilter": "Probar pipeline",
"titleRule": "Probar regla",
"noDataTypes": "Este pipeline aún no tiene tipos de datos asignados — añade uno para probarlo.",
"dataTypeLabel": "Tipo de dato",
"dataTypePlaceholder": "No hay tipos de datos disponibles",
"dataTypeSingleHint": "Este pipeline solo tiene un tipo de dato — añade más para poder elegir.",
"rawLogLabel": "Log en crudo",
"rawLogPlaceholder": "Pega una línea de log de ejemplo…",
"rawLogCounter": "{{chars}} caracteres · {{kb}} KB",
"rawLogTooLarge": "Este log supera el límite de 1 MB — recórtalo antes de ejecutar la prueba.",
"run": {
"label": "Ejecutar",
"running": "Probando…",
"waitHint": "Esto puede tardar hasta 15 segundos mientras el pipeline procesa el log."
},
"errors": {
"busy": "El playground está ocupado con otra prueba — inténtalo de nuevo en un momento.",
"timeout": "La prueba agotó el tiempo — normalmente significa que el tipo de dato seleccionado no coincide con el formato del log.",
"validation": "La solicitud no era válida — revisa el log en crudo y el contenido del pipeline.",
"server": "El playground no pudo completar la prueba — inténtalo de nuevo."
},
"result": {
"label": "Resultado procesado",
"empty": "Ejecuta una prueba para ver aquí el evento procesado.",
"loading": "Esperando el evento procesado…",
"tabs": {
"fields": "Campos",
"json": "JSON"
},
"fieldsCount_one": "{{count}} campo",
"fieldsCount_other": "{{count}} campos",
"copy": "Copiar",
"copied": "Copiado",
"elapsed": "Procesado en {{time}}",
"elapsedHint": "Tiempo desde Ejecutar hasta el resultado procesado",
"searchPlaceholder": "Buscar campos…",
"noMatch": "Ningún campo coincide con tu búsqueda."
},
"alerts": {
"label": "Alertas",
"empty": "Ejecuta una prueba para ver aquí las alertas resultantes.",
"none": "No se activó ninguna alerta.",
"count_one": "{{count}} alerta",
"count_other": "{{count}} alertas"
}
}
}
47 changes: 47 additions & 0 deletions frontend/src/shared/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -5178,5 +5178,52 @@
"level2": "Niveau 2",
"level3": "Niveau 3"
}
},
"playground": {
"titleFilter": "Tester le pipeline",
"titleRule": "Tester la règle",
"noDataTypes": "Aucun type de données n'est encore attribué à ce pipeline — ajoutez-en un pour le tester.",
"dataTypeLabel": "Type de données",
"dataTypePlaceholder": "Aucun type de données disponible",
"dataTypeSingleHint": "Ce pipeline n'a qu'un seul type de données — ajoutez-en d'autres pour pouvoir choisir.",
"rawLogLabel": "Journal brut",
"rawLogPlaceholder": "Collez une ligne de journal d'exemple…",
"rawLogCounter": "{{chars}} car. · {{kb}} Ko",
"rawLogTooLarge": "Ce journal dépasse la limite de 1 Mo — réduisez-le avant d'exécuter le test.",
"run": {
"label": "Exécuter",
"running": "Test en cours…",
"waitHint": "Cela peut prendre jusqu'à 15 secondes pendant que le pipeline traite le journal."
},
"errors": {
"busy": "Le playground exécute déjà un autre test — veuillez réessayer sous peu.",
"timeout": "Le test a expiré — cela signifie généralement que le type de données sélectionné ne correspond pas au format du journal.",
"validation": "La requête est invalide — vérifiez le journal brut et le contenu du pipeline.",
"server": "Le playground n'a pas pu terminer le test — veuillez réessayer."
},
"result": {
"label": "Résultat analysé",
"empty": "Exécutez un test pour voir ici l'événement analysé.",
"loading": "En attente de l'événement analysé…",
"tabs": {
"fields": "Champs",
"json": "JSON"
},
"fieldsCount_one": "{{count}} champ",
"fieldsCount_other": "{{count}} champs",
"copy": "Copier",
"copied": "Copié",
"elapsed": "Analysé en {{time}}",
"elapsedHint": "Temps entre Exécuter et le résultat analysé",
"searchPlaceholder": "Rechercher des champs…",
"noMatch": "Aucun champ ne correspond à votre recherche."
},
"alerts": {
"label": "Alertes",
"empty": "Exécutez un test pour voir ici les alertes déclenchées.",
"none": "Aucune alerte n'a été déclenchée.",
"count_one": "{{count}} alerte",
"count_other": "{{count}} alertes"
}
}
}
47 changes: 47 additions & 0 deletions frontend/src/shared/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -5178,5 +5178,52 @@
"level2": "Livello 2",
"level3": "Livello 3"
}
},
"playground": {
"titleFilter": "Prova pipeline",
"titleRule": "Prova regola",
"noDataTypes": "A questa pipeline non è ancora assegnato alcun tipo di dato — aggiungine uno per provarla.",
"dataTypeLabel": "Tipo di dato",
"dataTypePlaceholder": "Nessun tipo di dato disponibile",
"dataTypeSingleHint": "Questa pipeline ha un solo tipo di dato — aggiungine altri per poter scegliere.",
"rawLogLabel": "Log grezzo",
"rawLogPlaceholder": "Incolla una riga di log di esempio…",
"rawLogCounter": "{{chars}} caratteri · {{kb}} KB",
"rawLogTooLarge": "Questo log supera il limite di 1 MB — riducilo prima di eseguire il test.",
"run": {
"label": "Esegui",
"running": "Test in corso…",
"waitHint": "Può richiedere fino a 15 secondi mentre la pipeline elabora il log."
},
"errors": {
"busy": "Il playground sta eseguendo un altro test — riprova a breve.",
"timeout": "Il test è scaduto — di solito significa che il tipo di dato selezionato non corrisponde al formato del log.",
"validation": "La richiesta non è valida — controlla il log grezzo e il contenuto della pipeline.",
"server": "Il playground non è riuscito a completare il test — riprova."
},
"result": {
"label": "Risultato elaborato",
"empty": "Esegui un test per vedere qui l'evento elaborato.",
"loading": "In attesa dell'evento elaborato…",
"tabs": {
"fields": "Campi",
"json": "JSON"
},
"fieldsCount_one": "{{count}} campo",
"fieldsCount_other": "{{count}} campi",
"copy": "Copia",
"copied": "Copiato",
"elapsed": "Elaborato in {{time}}",
"elapsedHint": "Tempo tra Esegui e il risultato elaborato",
"searchPlaceholder": "Cerca campi…",
"noMatch": "Nessun campo corrisponde alla tua ricerca."
},
"alerts": {
"label": "Avvisi",
"empty": "Esegui un test per vedere qui gli avvisi generati.",
"none": "Nessun avviso è stato generato.",
"count_one": "{{count}} avviso",
"count_other": "{{count}} avvisi"
}
}
}
47 changes: 47 additions & 0 deletions frontend/src/shared/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -5140,5 +5140,52 @@
"level2": "Nível 2",
"level3": "Nível 3"
}
},
"playground": {
"titleFilter": "Testar pipeline",
"titleRule": "Testar regra",
"noDataTypes": "Este pipeline ainda não tem tipos de dados atribuídos — adicione um para testá-lo.",
"dataTypeLabel": "Tipo de dado",
"dataTypePlaceholder": "Nenhum tipo de dado disponível",
"dataTypeSingleHint": "Este pipeline só tem um tipo de dado — adicione mais para poder escolher.",
"rawLogLabel": "Log bruto",
"rawLogPlaceholder": "Cole uma linha de log de exemplo…",
"rawLogCounter": "{{chars}} caracteres · {{kb}} KB",
"rawLogTooLarge": "Este log excede o limite de 1 MB — reduza-o antes de executar o teste.",
"run": {
"label": "Executar",
"running": "Testando…",
"waitHint": "Isso pode levar até 15 segundos enquanto o pipeline processa o log."
},
"errors": {
"busy": "O playground está ocupado com outro teste — tente novamente em instantes.",
"timeout": "O teste expirou — normalmente significa que o tipo de dado selecionado não corresponde ao formato do log.",
"validation": "A requisição foi inválida — verifique o log bruto e o conteúdo do pipeline.",
"server": "O playground não conseguiu concluir o teste — tente novamente."
},
"result": {
"label": "Resultado processado",
"empty": "Execute um teste para ver aqui o evento processado.",
"loading": "Aguardando o evento processado…",
"tabs": {
"fields": "Campos",
"json": "JSON"
},
"fieldsCount_one": "{{count}} campo",
"fieldsCount_other": "{{count}} campos",
"copy": "Copiar",
"copied": "Copiado",
"elapsed": "Processado em {{time}}",
"elapsedHint": "Tempo entre Executar e o resultado processado",
"searchPlaceholder": "Buscar campos…",
"noMatch": "Nenhum campo corresponde à sua busca."
},
"alerts": {
"label": "Alertas",
"empty": "Execute um teste para ver aqui os alertas gerados.",
"none": "Nenhum alerta foi disparado.",
"count_one": "{{count}} alerta",
"count_other": "{{count}} alertas"
}
}
}
47 changes: 47 additions & 0 deletions frontend/src/shared/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -5204,5 +5204,52 @@
"level2": "Уровень 2",
"level3": "Уровень 3"
}
},
"playground": {
"titleFilter": "Тест конвейера",
"titleRule": "Тест правила",
"noDataTypes": "У этого конвейера пока нет назначенных типов данных — добавьте один, чтобы протестировать.",
"dataTypeLabel": "Тип данных",
"dataTypePlaceholder": "Нет доступных типов данных",
"dataTypeSingleHint": "У этого конвейера только один тип данных — добавьте больше, чтобы выбирать.",
"rawLogLabel": "Исходный лог",
"rawLogPlaceholder": "Вставьте пример строки лога…",
"rawLogCounter": "{{chars}} симв. · {{kb}} КБ",
"rawLogTooLarge": "Этот лог превышает лимит 1 МБ — сократите его перед запуском теста.",
"run": {
"label": "Запустить",
"running": "Тестирование…",
"waitHint": "Это может занять до 15 секунд, пока конвейер обрабатывает лог."
},
"errors": {
"busy": "Playground сейчас выполняет другой тест — попробуйте ещё раз чуть позже.",
"timeout": "Время теста истекло — обычно это значит, что выбранный тип данных не соответствует формату лога.",
"validation": "Некорректный запрос — проверьте исходный лог и содержимое конвейера.",
"server": "Playground не смог завершить тест — попробуйте снова."
},
"result": {
"label": "Обработанный результат",
"empty": "Запустите тест, чтобы увидеть здесь обработанное событие.",
"loading": "Ожидание обработанного события…",
"tabs": {
"fields": "Поля",
"json": "JSON"
},
"fieldsCount_one": "{{count}} поле",
"fieldsCount_other": "{{count}} полей",
"copy": "Копировать",
"copied": "Скопировано",
"elapsed": "Обработано за {{time}}",
"elapsedHint": "Время от запуска до обработанного результата",
"searchPlaceholder": "Поиск полей…",
"noMatch": "Ни одно поле не соответствует запросу."
},
"alerts": {
"label": "Оповещения",
"empty": "Запустите тест, чтобы увидеть здесь появившиеся оповещения.",
"none": "Оповещения не сработали.",
"count_one": "{{count}} оповещение",
"count_other": "{{count}} оповещений"
}
}
}
Loading