Skip to content

Commit ac0b263

Browse files
Merge branch 'release/v12.0.0' into backlog/v12_instance_setup
2 parents d5fe2dc + 0cf18c1 commit ac0b263

6 files changed

Lines changed: 101 additions & 6 deletions

File tree

‎frontend/src/features/soar/components/ExecutionsView.tsx‎

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ import { cn } from '@/shared/lib/utils'
55
import { Button } from '@/shared/components/ui/button'
66
import { Input } from '@/shared/components/ui/input'
77
import { InfiniteScrollSentinel } from '@/shared/components/ui/infinite-scroll'
8+
import { presetRange, resolveRange, TimeRangePicker, type TimeRange } from '@/shared/components/ui/time-range-picker'
89
import { useDateFormat } from '@/shared/lib/datetime'
10+
import { datasourcesHttpService } from '@/features/datasources/services/datasources-http.service'
911
import { soarExecutionsService } from '../services/soar-executions.service'
10-
import type { Execution, ExecutionStatus, ExecutionListQuery } from '../types/soar.types'
12+
import type { Execution, ExecutionOrigin, ExecutionStatus, ExecutionListQuery } from '../types/soar.types'
1113

1214
const STATUSES: (ExecutionStatus | 'all')[] = ['all', 'EXECUTED', 'PENDING', 'FAILED']
15+
const ORIGINS: (ExecutionOrigin | 'all')[] = ['all', 'FLOW', 'MANUAL']
1316
const COLS = '90px minmax(160px,1.2fr) minmax(180px,1.6fr) 120px 150px 60px'
1417

1518
const STATUS_META: Record<ExecutionStatus, { icon: typeof CheckCircle2; cls: string }> = {
@@ -24,6 +27,10 @@ export function ExecutionsView() {
2427
const [search, setSearch] = useState('')
2528
const [debounced, setDebounced] = useState('')
2629
const [status, setStatus] = useState<ExecutionStatus | 'all'>('all')
30+
const [origin, setOrigin] = useState<ExecutionOrigin | 'all'>('FLOW')
31+
const [agent, setAgent] = useState<string>('')
32+
const [agents, setAgents] = useState<string[]>([])
33+
const [range, setRange] = useState<TimeRange>(presetRange('7d'))
2734
const [items, setItems] = useState<Execution[]>([])
2835
const [total, setTotal] = useState(0)
2936
const [page, setPage] = useState(0)
@@ -39,15 +46,27 @@ export function ExecutionsView() {
3946
return () => clearTimeout(h)
4047
}, [search])
4148

42-
const query = useMemo<ExecutionListQuery>(
43-
() => ({
49+
// Same source as FlowEditor / InteractiveConsole — Execution.agent stores the datasource name.
50+
useEffect(() => {
51+
datasourcesHttpService
52+
.list({ page: 1, size: 1000, kind: 'agent', sort: 'asset_name.asc' })
53+
.then((r) => setAgents((r.items ?? []).map((d) => d.name).filter(Boolean)))
54+
.catch(() => {})
55+
}, [])
56+
57+
const query = useMemo<ExecutionListQuery>(() => {
58+
const { from, to } = resolveRange(range)
59+
return {
4460
alertId: debounced || undefined,
4561
status: status === 'all' ? undefined : status,
62+
origin: origin === 'all' ? undefined : origin,
63+
agent: agent || undefined,
64+
startedAtFrom: from ?? undefined,
65+
startedAtTo: to,
4666
page,
4767
size: pageSize,
48-
}),
49-
[debounced, status, page, pageSize],
50-
)
68+
}
69+
}, [debounced, status, origin, agent, range, page, pageSize])
5170

5271
const load = useCallback(() => {
5372
setLoading(true)
@@ -86,6 +105,42 @@ export function ExecutionsView() {
86105
</button>
87106
))}
88107
</div>
108+
<div className="inline-flex rounded-md border border-border p-0.5">
109+
{ORIGINS.map((o) => (
110+
<button
111+
key={o}
112+
onClick={() => {
113+
setOrigin(o)
114+
setPage(0)
115+
}}
116+
className={cn('rounded px-2.5 py-1 text-xs transition-colors', origin === o ? 'bg-muted font-medium text-foreground' : 'text-muted-foreground hover:text-foreground')}
117+
>
118+
{o === 'all' ? t('soar.executions.all') : t(`soar.executionOrigin.${o}`)}
119+
</button>
120+
))}
121+
</div>
122+
<select
123+
value={agent}
124+
onChange={(e) => {
125+
setAgent(e.target.value)
126+
setPage(0)
127+
}}
128+
className="h-9 cursor-pointer rounded-md border border-input bg-popover px-2 text-xs text-foreground"
129+
title={t('soar.executions.filters.source')}
130+
>
131+
<option value="">{t('soar.executions.filters.allSources')}</option>
132+
{agents.map((a) => (
133+
<option key={a} value={a}>{a}</option>
134+
))}
135+
</select>
136+
<TimeRangePicker
137+
value={range}
138+
onChange={(r) => {
139+
setRange(r)
140+
setPage(0)
141+
}}
142+
align="right"
143+
/>
89144
<Button variant="outline" size="sm" onClick={load} disabled={loading} title={t('soar.refresh')}>
90145
<RefreshCw size={14} className={cn(loading && 'animate-spin')} />
91146
</Button>

‎frontend/src/shared/i18n/locales/en.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5134,13 +5134,21 @@
51345134
"date": "Date",
51355135
"retries": "Retries"
51365136
},
5137+
"filters": {
5138+
"source": "Source",
5139+
"allSources": "All sources"
5140+
},
51375141
"manual": "Interactive console"
51385142
},
51395143
"executionStatus": {
51405144
"EXECUTED": "Executed",
51415145
"PENDING": "Pending",
51425146
"FAILED": "Failed"
51435147
},
5148+
"executionOrigin": {
5149+
"FLOW": "Flow",
5150+
"MANUAL": "Manual"
5151+
},
51445152
"nonExecutionCause": {
51455153
"AGENT_OFFLINE": "Agent offline",
51465154
"AGENT_NOT_FOUND": "Agent not found",

‎frontend/src/shared/i18n/locales/es.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4870,13 +4870,21 @@
48704870
"date": "Fecha",
48714871
"retries": "Reintentos"
48724872
},
4873+
"filters": {
4874+
"source": "Origen",
4875+
"allSources": "Todos los orígenes"
4876+
},
48734877
"manual": "Consola interactiva"
48744878
},
48754879
"executionStatus": {
48764880
"EXECUTED": "Ejecutado",
48774881
"PENDING": "Pendiente",
48784882
"FAILED": "Fallido"
48794883
},
4884+
"executionOrigin": {
4885+
"FLOW": "Flujo",
4886+
"MANUAL": "Manual"
4887+
},
48804888
"nonExecutionCause": {
48814889
"AGENT_OFFLINE": "Agente offline",
48824890
"AGENT_NOT_FOUND": "Agente no encontrado",

‎frontend/src/shared/i18n/locales/fr.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4748,13 +4748,21 @@
47484748
"date": "Date",
47494749
"retries": "Tentatives"
47504750
},
4751+
"filters": {
4752+
"source": "Source",
4753+
"allSources": "Toutes les sources"
4754+
},
47514755
"manual": "Console interactive"
47524756
},
47534757
"executionStatus": {
47544758
"EXECUTED": "Exécuté",
47554759
"PENDING": "En attente",
47564760
"FAILED": "Échoué"
47574761
},
4762+
"executionOrigin": {
4763+
"FLOW": "Flux",
4764+
"MANUAL": "Manuel"
4765+
},
47584766
"nonExecutionCause": {
47594767
"AGENT_OFFLINE": "Agent hors ligne",
47604768
"AGENT_NOT_FOUND": "Agent introuvable",

‎frontend/src/shared/i18n/locales/it.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4748,13 +4748,21 @@
47484748
"date": "Data",
47494749
"retries": "Tentativi"
47504750
},
4751+
"filters": {
4752+
"source": "Origine",
4753+
"allSources": "Tutte le origini"
4754+
},
47514755
"manual": "Console interattiva"
47524756
},
47534757
"executionStatus": {
47544758
"EXECUTED": "Eseguito",
47554759
"PENDING": "In attesa",
47564760
"FAILED": "Fallito"
47574761
},
4762+
"executionOrigin": {
4763+
"FLOW": "Flusso",
4764+
"MANUAL": "Manuale"
4765+
},
47584766
"nonExecutionCause": {
47594767
"AGENT_OFFLINE": "Agente offline",
47604768
"AGENT_NOT_FOUND": "Agente non trovato",

‎frontend/src/shared/i18n/locales/pt.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4870,13 +4870,21 @@
48704870
"date": "Data",
48714871
"retries": "Tentativas"
48724872
},
4873+
"filters": {
4874+
"source": "Origem",
4875+
"allSources": "Todas as origens"
4876+
},
48734877
"manual": "Consola interativa"
48744878
},
48754879
"executionStatus": {
48764880
"EXECUTED": "Executado",
48774881
"PENDING": "Pendente",
48784882
"FAILED": "Falhou"
48794883
},
4884+
"executionOrigin": {
4885+
"FLOW": "Fluxo",
4886+
"MANUAL": "Manual"
4887+
},
48804888
"nonExecutionCause": {
48814889
"AGENT_OFFLINE": "Agente offline",
48824890
"AGENT_NOT_FOUND": "Agente não encontrado",

0 commit comments

Comments
 (0)