fix(logs): 域名筛选与残余原生 select 统一为可搜索/Radix Select
通病:/logs 域名筛选仍用 Input+datalist(与已修的快捷模板同类);策略组数据源、数据源弹窗集群/鉴权仍为原生 select。改为 SearchableValueSelect / ui/select,并顺带理顺策略组列表空标签与用户勾选交互。采集器编辑里 app 预设 datalist 仍保留(自由输入场景)。
This commit is contained in:
1 parent
016d3ecdfd
commit
8c9f5a95f8
5 files changed
+77
-18
No files matched your search
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from 'react'
|
||||
import { Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { SearchableValueSelect } from '@/components/SearchableValueSelect'
|
||||
import type { LogEntry } from '@/api/logs'
|
||||
import { parseIngressAccessLog } from '@/lib/ingress-access-log'
|
||||
import { applyLabelFilter } from '../query-utils'
|
||||
@@ -50,9 +50,19 @@ export function LogResultsPanel({ entries, searched, hasSource, pageIndex, hasNe
|
||||
</div>}
|
||||
{pageIndex > 0 && <p className="mb-2 text-xs text-muted-foreground">{t('results.pagingHint')}</p>}
|
||||
{domains.length > 0 && <div className="mb-3 flex flex-wrap items-center gap-2 text-xs">
|
||||
<label htmlFor="log-domain-filter" className="shrink-0 text-muted-foreground">{t('results.domainFilter')}</label>
|
||||
<Input id="log-domain-filter" list="log-domain-options" type="search" className="h-8 w-60" value={domainFilter} onChange={event => setDomainFilter(event.target.value)} placeholder={t('results.domainPlaceholder')} />
|
||||
<datalist id="log-domain-options">{domains.map(domain => <option key={domain} value={domain} />)}</datalist>
|
||||
<span className="shrink-0 text-muted-foreground">{t('results.domainFilter')}</span>
|
||||
<SearchableValueSelect
|
||||
hideLabel
|
||||
ariaLabel={t('results.domainFilter')}
|
||||
values={domains}
|
||||
value={domainFilter}
|
||||
onChange={setDomainFilter}
|
||||
allowEmpty
|
||||
emptyLabel={t('results.domainAll')}
|
||||
placeholder={t('results.domainPlaceholder')}
|
||||
className="min-w-60"
|
||||
triggerClassName="h-8"
|
||||
/>
|
||||
<Button type="button" size="sm" variant="outline" disabled={!domainFilter.trim() || loading} onClick={() => onApplyDomain(domainFilter.trim())}>{t('results.domainQuery')}</Button>
|
||||
<span className="text-muted-foreground">{t('results.domainHint', { shown: visibleEntries.length, total: entries.length })}</span>
|
||||
</div>}
|
||||
|
||||
Reference in new issue
Block a user