fix(log): input text visibility + space-in-date 502

- UnifiedQueryPanel: fix JS operator precedence — .replace(' ','T') was
  called on '.000Z' suffix instead of concatenated string, resulting in
  '2026-06-27 12:46:28.000Z' (space not replaced) → ES 502
- normalizeTime: add space→T fallback for backward compat
- SyntaxHighlightInput: fix z-index layering (textarea z=2 was covering
  pre z=1, making highlighted text invisible). Move bg/border to parent,
  textarea bg→transparent, pre above textarea
This commit is contained in:
attacker committed 2026-06-27 12:54:31 +00:00
1 parent d40042d86e
commit 7af10097c9
3 files changed
+9 -6

No files matched your search

@@ -113,13 +113,13 @@ function SyntaxHighlightInput({ value, onChange, engine, placeholder }: {
};
const html = useMemo(() => highlightSyntax(value, engine), [value, engine]);
return (
<div className="relative flex-1 min-w-[120px]" style={{ height: '40px' }}>
<pre ref={preRef} className="absolute inset-0 m-0 font-mono text-xs rounded pointer-events-none overflow-hidden whitespace-pre-wrap break-all px-3 py-2.5" style={{ background: 'transparent', border: '1px solid transparent', lineHeight: '20px', color: 'var(--dg-text-primary)', zIndex: 1 }} dangerouslySetInnerHTML={{ __html: html }} />
<div className="relative flex-1 min-w-[120px]" style={{ height: '40px', background: 'var(--dg-bg-tertiary)', border: '1px solid var(--dg-border)', borderRadius: '0.25rem' }}>
<textarea ref={taRef} value={value} onChange={e => onChange(e.target.value)} onScroll={sync} onKeyDown={onKey} spellCheck={false} autoComplete="off" rows={1}
className="absolute inset-0 w-full h-full font-mono text-xs rounded resize-none outline-none overflow-auto whitespace-pre-wrap break-all px-3 py-2.5"
style={{ background: 'var(--dg-bg-tertiary)', border: '1px solid var(--dg-border)', color: 'transparent', caretColor: 'var(--dg-text-primary)', lineHeight: '20px', zIndex: 2 }}
style={{ background: 'transparent', color: 'transparent', caretColor: 'var(--dg-text-primary)', lineHeight: '20px', zIndex: 1 }}
placeholder={placeholder} />
{!value && <div className="absolute inset-0 flex items-center px-3 pointer-events-none" style={{ zIndex: 1 }}><span className="text-xs font-mono" style={{ color: 'var(--dg-text-muted)' }}>{placeholder}</span></div>}
<pre ref={preRef} className="absolute inset-0 m-0 font-mono text-xs rounded pointer-events-none overflow-hidden whitespace-pre-wrap break-all px-3 py-2.5" style={{ background: 'transparent', lineHeight: '20px', color: 'var(--dg-text-primary)', zIndex: 2 }} dangerouslySetInnerHTML={{ __html: html }} />
{!value && <div className="absolute inset-0 flex items-center px-3 pointer-events-none" style={{ zIndex: 3 }}><span className="text-xs font-mono" style={{ color: 'var(--dg-text-muted)' }}>{placeholder}</span></div>}
</div>
);
}
@@ -203,8 +203,8 @@ export function UnifiedQueryPanel({ engine, onRuleCreated }: Props) {
// 真实 API 查询
try {
const startISO = timeRange.start + (timeRange.start.includes('T') ? '' : '.000Z').replace(' ', 'T');
const endISO = timeRange.end + (timeRange.end.includes('T') ? '' : '.000Z').replace(' ', 'T');
const startISO = (timeRange.start + (timeRange.start.includes('T') ? '' : '.000Z')).replace(' ', 'T');
const endISO = (timeRange.end + (timeRange.end.includes('T') ? '' : '.000Z')).replace(' ', 'T');
let result: any;
if (effEngine === 'loki') {