@jeffusion/bungee-core 6.16.1 → 6.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +5700 -2198
- package/dist/observability-worker.js +3245 -1495
- package/dist/plugins/anthropic-request-sanitizer/index.js.map +2 -2
- package/dist/plugins/anthropic-tool-name-transformer/index.js.map +2 -2
- package/dist/plugins/chatgpt-oauth/index.js +37 -15
- package/dist/plugins/chatgpt-oauth/index.js.map +5 -5
- package/dist/plugins/codex-router/index.js +21 -3
- package/dist/plugins/codex-router/index.js.map +5 -5
- package/dist/plugins/deepseek-reasoning-fix/index.js.map +2 -2
- package/dist/plugins/key-access/index.js +1 -1
- package/dist/plugins/key-access/index.js.map +4 -4
- package/dist/plugins/key-access/ingress.js +1 -1
- package/dist/plugins/key-access/ingress.js.map +3 -3
- package/dist/plugins/key-rate-limit/index.js.map +2 -2
- package/dist/plugins/llm-protocol-adapter/control.js +1 -1
- package/dist/plugins/llm-protocol-adapter/control.js.map +3 -3
- package/dist/plugins/llm-protocol-adapter/index.js +1 -1
- package/dist/plugins/llm-protocol-adapter/index.js.map +5 -5
- package/dist/plugins/llm-tps/index.js.map +2 -2
- package/dist/plugins/model-mapping/index.js +1 -1
- package/dist/plugins/model-mapping/index.js.map +4 -4
- package/dist/plugins/models-dev/index.js.map +2 -2
- package/dist/plugins/request-logs/index.js +505 -118
- package/dist/plugins/request-logs/index.js.map +11 -10
- package/dist/plugins/request-logs/ingress.js +3 -23
- package/dist/plugins/request-logs/ingress.js.map +3 -3
- package/dist/plugins/request-logs/ui/RequestLogsPage.svelte +215 -130
- package/dist/plugins/signature-repair/index.js.map +2 -2
- package/dist/plugins/token-budget/index.js.map +2 -2
- package/dist/plugins/token-metering/index.js.map +2 -2
- package/dist/plugins/token-stats/control.js +257 -61
- package/dist/plugins/token-stats/control.js.map +7 -6
- package/dist/plugins/token-stats/index.js +271 -127
- package/dist/plugins/token-stats/index.js.map +8 -8
- package/dist/plugins/token-stats/manifest.json +2 -2
- package/dist/plugins/user-auth/index.js.map +2 -2
- package/package.json +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
let { pluginName = "request-logs" }: { pluginName?: string; apiBase?: string } = $props();
|
|
3
3
|
import { defaultLogFilters, countLogFilters } from '$components/domain/log/filter-state';
|
|
4
|
-
import { onMount, onDestroy, untrack } from 'svelte';
|
|
4
|
+
import { onMount, onDestroy, tick, untrack } from 'svelte';
|
|
5
5
|
import { _ } from '$i18n';
|
|
6
|
-
import { queryChains, exportLogs, type ChainEntry, type LogQueryParams, type
|
|
7
|
-
import {
|
|
6
|
+
import { queryChains, exportLogs, type ChainEntry, type LogQueryParams, type ResultState, type TransportType, type RequestLogScope } from '$api/logs';
|
|
7
|
+
import { RESULT_STATES, resultStateTone, listResultPresentation, transportTypeLabel, httpStatusLabel, parseStatusFilter } from '$components/domain/log/outcomes';
|
|
8
8
|
import ChainDetailModal from '$components/domain/log/ChainDetailModal.svelte';
|
|
9
9
|
import { BSwitch, LoadingIndicator, PanelCard, BDropdownAction } from '$components/industrial';
|
|
10
10
|
import { BSelect as Select } from '$components/industrial';
|
|
@@ -19,14 +19,19 @@ function onTransportTypeChange(value: string | string[]) {
|
|
|
19
19
|
transportTypeFilter = value === 'http' || value === 'websocket' ? value : undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
function onScopeChange(value: string | string[]) {
|
|
23
|
+
if (Array.isArray(value)) return;
|
|
24
|
+
scopeFilter = value === 'request' || value === 'connection' ? value : undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
const exportItems = [
|
|
23
28
|
{ value: 'json', label: 'JSON' },
|
|
24
29
|
{ value: 'csv', label: 'CSV' },
|
|
25
30
|
];
|
|
26
31
|
|
|
27
|
-
function
|
|
32
|
+
function onResultSelectChange(value: string | string[]) {
|
|
28
33
|
if (Array.isArray(value)) return;
|
|
29
|
-
|
|
34
|
+
resultStateFilter = RESULT_STATES.includes(value as ResultState) ? (value as ResultState) : undefined;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
function onExportSelect(format: string) {
|
|
@@ -39,10 +44,12 @@ function onExportSelect(format: string) {
|
|
|
39
44
|
let page = $state(1);
|
|
40
45
|
let limit = 50;
|
|
41
46
|
let searchTerm = $state('');
|
|
47
|
+
let searchInput: HTMLInputElement;
|
|
42
48
|
let method = $state('');
|
|
43
49
|
let statusFilter = $state('');
|
|
44
|
-
let
|
|
50
|
+
let resultStateFilter: ResultState | undefined = $state(undefined);
|
|
45
51
|
let transportTypeFilter: TransportType | undefined = $state(undefined);
|
|
52
|
+
let scopeFilter: RequestLogScope | undefined = $state(undefined);
|
|
46
53
|
let requestTypeFilter = $state('');
|
|
47
54
|
let sortBy: 'timestamp' | 'duration' | 'status' = $state('timestamp');
|
|
48
55
|
let sortOrder: 'asc' | 'desc' = $state('desc');
|
|
@@ -64,6 +71,7 @@ function onExportSelect(format: string) {
|
|
|
64
71
|
// 详情模态框
|
|
65
72
|
let selectedChain: ChainEntry | null = $state(null);
|
|
66
73
|
let showDetailModal = $state(false);
|
|
74
|
+
let detailTrigger: HTMLElement | null = null;
|
|
67
75
|
let mobileActionsOpen = $state(false);
|
|
68
76
|
|
|
69
77
|
// 自动刷新配置
|
|
@@ -71,7 +79,8 @@ function onExportSelect(format: string) {
|
|
|
71
79
|
let refreshInterval: '5s' | '10s' | '30s' | '60s' = $state('30s');
|
|
72
80
|
let refreshTimer: number | null = null;
|
|
73
81
|
let lastRefreshTime: number = $state(0);
|
|
74
|
-
let
|
|
82
|
+
let backgroundRefreshing = false;
|
|
83
|
+
let backgroundPageCorrection: number | null = null;
|
|
75
84
|
|
|
76
85
|
// 刷新间隔映射(毫秒)
|
|
77
86
|
const REFRESH_INTERVALS = {
|
|
@@ -87,11 +96,15 @@ function onExportSelect(format: string) {
|
|
|
87
96
|
let loadSerial = 0;
|
|
88
97
|
|
|
89
98
|
// 加载日志
|
|
90
|
-
async function loadLogs() {
|
|
99
|
+
async function loadLogs(background = false) {
|
|
100
|
+
if (background && (loading || backgroundRefreshing || !autoRefreshEnabled || document.visibilityState !== 'visible')) return;
|
|
101
|
+
if (background) backgroundRefreshing = true;
|
|
91
102
|
const serial = ++loadSerial;
|
|
92
103
|
try {
|
|
93
|
-
|
|
94
|
-
|
|
104
|
+
if (!background) {
|
|
105
|
+
loading = true;
|
|
106
|
+
error = null;
|
|
107
|
+
}
|
|
95
108
|
|
|
96
109
|
const params: LogQueryParams = {
|
|
97
110
|
page,
|
|
@@ -115,10 +128,11 @@ function onExportSelect(format: string) {
|
|
|
115
128
|
params.status = parseStatusFilter(statusFilter);
|
|
116
129
|
}
|
|
117
130
|
|
|
118
|
-
//
|
|
131
|
+
// 结果过滤
|
|
132
|
+
if (scopeFilter !== undefined) params.scope = scopeFilter;
|
|
119
133
|
if (transportTypeFilter !== undefined) params.transportType = transportTypeFilter;
|
|
120
|
-
if (
|
|
121
|
-
params.
|
|
134
|
+
if (resultStateFilter !== undefined) {
|
|
135
|
+
params.resultState = resultStateFilter;
|
|
122
136
|
}
|
|
123
137
|
|
|
124
138
|
// 请求类型过滤
|
|
@@ -146,14 +160,23 @@ function onExportSelect(format: string) {
|
|
|
146
160
|
|
|
147
161
|
const result = await queryChains(params);
|
|
148
162
|
if (serial !== loadSerial) return;
|
|
149
|
-
|
|
163
|
+
error = null;
|
|
150
164
|
total = result.total;
|
|
151
165
|
totalPages = result.totalPages;
|
|
166
|
+
lastRefreshTime = Date.now();
|
|
167
|
+
const lastPage = Math.max(1, totalPages);
|
|
168
|
+
if (page > lastPage) {
|
|
169
|
+
backgroundPageCorrection = background ? lastPage : null;
|
|
170
|
+
page = lastPage;
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
logs = result.data;
|
|
152
174
|
} catch (e: any) {
|
|
153
|
-
if (serial !== loadSerial) return;
|
|
175
|
+
if (serial !== loadSerial || background) return;
|
|
154
176
|
error = e.message === 'logs.invalidStatus' ? $_('logs.invalidStatus') : e.message;
|
|
155
177
|
} finally {
|
|
156
|
-
if (
|
|
178
|
+
if (background) backgroundRefreshing = false;
|
|
179
|
+
else if (serial === loadSerial) loading = false;
|
|
157
180
|
}
|
|
158
181
|
}
|
|
159
182
|
|
|
@@ -171,9 +194,10 @@ function onExportSelect(format: string) {
|
|
|
171
194
|
if (statusFilter) {
|
|
172
195
|
params.status = parseStatusFilter(statusFilter);
|
|
173
196
|
}
|
|
197
|
+
if (scopeFilter !== undefined) params.scope = scopeFilter;
|
|
174
198
|
if (transportTypeFilter !== undefined) params.transportType = transportTypeFilter;
|
|
175
|
-
if (
|
|
176
|
-
params.
|
|
199
|
+
if (resultStateFilter !== undefined) {
|
|
200
|
+
params.resultState = resultStateFilter;
|
|
177
201
|
}
|
|
178
202
|
if (requestTypeFilter) {
|
|
179
203
|
params.requestType = requestTypeFilter as 'final' | 'retry' | 'recovery';
|
|
@@ -207,7 +231,8 @@ function onExportSelect(format: string) {
|
|
|
207
231
|
}
|
|
208
232
|
|
|
209
233
|
// 查看详情
|
|
210
|
-
function viewDetail(chain: ChainEntry) {
|
|
234
|
+
function viewDetail(chain: ChainEntry, trigger: HTMLElement) {
|
|
235
|
+
detailTrigger = trigger;
|
|
211
236
|
selectedChain = chain;
|
|
212
237
|
showDetailModal = true;
|
|
213
238
|
}
|
|
@@ -225,22 +250,19 @@ function onExportSelect(format: string) {
|
|
|
225
250
|
|
|
226
251
|
// 清除所有筛选
|
|
227
252
|
function clearAllFilters() {
|
|
228
|
-
({ searchTerm, method, statusFilter,
|
|
253
|
+
({ searchTerm, method, statusFilter, resultStateFilter, transportTypeFilter, scopeFilter, requestTypeFilter,
|
|
229
254
|
hasRetryFilter, timeRangeType, recentHours, customStartTime, customEndTime,
|
|
230
255
|
sortBy, sortOrder, page } = defaultLogFilters());
|
|
256
|
+
if (mobileActionsOpen) {
|
|
257
|
+
mobileActionsOpen = false;
|
|
258
|
+
} else {
|
|
259
|
+
searchInput.focus({ preventScroll: true });
|
|
260
|
+
}
|
|
231
261
|
}
|
|
232
262
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
searchTerm ||
|
|
237
|
-
method ||
|
|
238
|
-
statusFilter ||
|
|
239
|
-
transportFilter !== undefined ||
|
|
240
|
-
transportTypeFilter !== undefined ||
|
|
241
|
-
requestTypeFilter ||
|
|
242
|
-
hasRetryFilter !== undefined
|
|
243
|
-
);
|
|
263
|
+
function clearFilter(reset: () => void) {
|
|
264
|
+
reset();
|
|
265
|
+
searchInput.focus({ preventScroll: true });
|
|
244
266
|
}
|
|
245
267
|
|
|
246
268
|
// 启动自动刷新
|
|
@@ -249,19 +271,10 @@ function onExportSelect(format: string) {
|
|
|
249
271
|
clearInterval(refreshTimer);
|
|
250
272
|
}
|
|
251
273
|
|
|
252
|
-
if (autoRefreshEnabled) {
|
|
274
|
+
if (autoRefreshEnabled && document.visibilityState === 'visible') {
|
|
253
275
|
const interval = REFRESH_INTERVALS[refreshInterval];
|
|
254
276
|
refreshTimer = window.setInterval(() => {
|
|
255
|
-
|
|
256
|
-
// 如果有过滤条件,不自动刷新,只显示提示
|
|
257
|
-
if (hasActiveFilters()) {
|
|
258
|
-
showRefreshHint = true;
|
|
259
|
-
} else {
|
|
260
|
-
loadLogs();
|
|
261
|
-
lastRefreshTime = Date.now();
|
|
262
|
-
showRefreshHint = false;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
277
|
+
void loadLogs(true);
|
|
265
278
|
}, interval);
|
|
266
279
|
}
|
|
267
280
|
}
|
|
@@ -277,8 +290,6 @@ function onExportSelect(format: string) {
|
|
|
277
290
|
// 手动刷新
|
|
278
291
|
async function manualRefresh() {
|
|
279
292
|
await loadLogs();
|
|
280
|
-
lastRefreshTime = Date.now();
|
|
281
|
-
showRefreshHint = false;
|
|
282
293
|
}
|
|
283
294
|
|
|
284
295
|
// 页面可见性变化处理
|
|
@@ -287,8 +298,8 @@ function onExportSelect(format: string) {
|
|
|
287
298
|
// 页面恢复可见时,如果距离上次刷新超过间隔,立即刷新
|
|
288
299
|
const elapsed = Date.now() - lastRefreshTime;
|
|
289
300
|
const interval = REFRESH_INTERVALS[refreshInterval];
|
|
290
|
-
if (elapsed >= interval) {
|
|
291
|
-
loadLogs();
|
|
301
|
+
if (autoRefreshEnabled && elapsed >= interval) {
|
|
302
|
+
void loadLogs(true);
|
|
292
303
|
}
|
|
293
304
|
if (autoRefreshEnabled) {
|
|
294
305
|
startAutoRefresh();
|
|
@@ -323,6 +334,12 @@ function onExportSelect(format: string) {
|
|
|
323
334
|
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
324
335
|
});
|
|
325
336
|
|
|
337
|
+
let scopeOptions = $derived($isLoading ? [] : [
|
|
338
|
+
{ value: '__all', label: $_('logs.scope.all') },
|
|
339
|
+
{ value: 'request', label: $_('logs.scope.request') },
|
|
340
|
+
{ value: 'connection', label: $_('logs.scope.connection') },
|
|
341
|
+
]);
|
|
342
|
+
let scopeSelectValue = $derived(scopeFilter ?? '__all');
|
|
326
343
|
let transportTypeOptions = $derived($isLoading ? [] : [
|
|
327
344
|
{ value: '__all', label: $_('logs.allTransportTypes') },
|
|
328
345
|
{ value: 'http', label: 'HTTP' },
|
|
@@ -337,9 +354,9 @@ let methodOptions = $derived($isLoading ? [] : [
|
|
|
337
354
|
{ value: 'DELETE', label: 'DELETE' },
|
|
338
355
|
{ value: 'PATCH', label: 'PATCH' },
|
|
339
356
|
]);
|
|
340
|
-
let
|
|
341
|
-
{ value: '__all', label: $_('logs.
|
|
342
|
-
...
|
|
357
|
+
let resultOptions = $derived($isLoading ? [] : [
|
|
358
|
+
{ value: '__all', label: $_('logs.resultStates.all') },
|
|
359
|
+
...RESULT_STATES.map(value => ({ value, label: $_(`logs.resultStates.${value}`) })),
|
|
343
360
|
]);
|
|
344
361
|
let methodQuickFilterItems = $derived($isLoading ? [] : [
|
|
345
362
|
{ value: '', label: $_('logs.allMethods') },
|
|
@@ -349,8 +366,8 @@ let methodQuickFilterItems = $derived($isLoading ? [] : [
|
|
|
349
366
|
{ value: 'DELETE', label: 'DELETE' },
|
|
350
367
|
{ value: 'PATCH', label: 'PATCH' },
|
|
351
368
|
]);
|
|
352
|
-
let resultQuickFilterItems = $derived(
|
|
353
|
-
let
|
|
369
|
+
let resultQuickFilterItems = $derived(resultOptions);
|
|
370
|
+
let resultSelectValue = $derived(resultStateFilter ?? '__all');
|
|
354
371
|
let requestTypeOptions = $derived($isLoading ? [] : [
|
|
355
372
|
{ value: '', label: $_('logs.requestType_all') },
|
|
356
373
|
{ value: 'final', label: $_('logs.requestType_final') },
|
|
@@ -389,22 +406,27 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
389
406
|
localStorage.setItem('logsAutoRefresh', String(autoRefreshEnabled));
|
|
390
407
|
});
|
|
391
408
|
// 计算激活的筛选条件数量
|
|
392
|
-
let activeFiltersCount = $derived(countLogFilters({ searchTerm, method, statusFilter,
|
|
409
|
+
let activeFiltersCount = $derived(countLogFilters({ searchTerm, method, statusFilter, resultStateFilter, transportTypeFilter, scopeFilter,
|
|
393
410
|
requestTypeFilter, hasRetryFilter, timeRangeType, recentHours, customStartTime, customEndTime,
|
|
394
411
|
sortBy, sortOrder, page }));
|
|
395
412
|
// Reset pagination before dispatch, so a changed filter never queries a stale page.
|
|
396
413
|
$effect(() => {
|
|
397
414
|
if (!mounted) return;
|
|
398
|
-
const filters = JSON.stringify({ limit, searchTerm, method, statusFilter,
|
|
415
|
+
const filters = JSON.stringify({ limit, searchTerm, method, statusFilter, resultStateFilter, transportTypeFilter, scopeFilter,
|
|
399
416
|
requestTypeFilter, hasRetryFilter, sortBy, sortOrder, timeRangeType, recentHours,
|
|
400
417
|
customStartTime: timeRangeType === 'custom' ? customStartTime : '',
|
|
401
418
|
customEndTime: timeRangeType === 'custom' ? customEndTime : '' });
|
|
402
419
|
const changed = lastFilters !== '' && lastFilters !== filters;
|
|
403
420
|
lastFilters = filters;
|
|
421
|
+
if (changed) backgroundPageCorrection = null;
|
|
404
422
|
if (changed && page !== 1) { page = 1; return; }
|
|
405
423
|
// Track page even when the filters did not change.
|
|
406
424
|
page;
|
|
407
|
-
untrack(() => {
|
|
425
|
+
untrack(() => {
|
|
426
|
+
const background = !changed && page === backgroundPageCorrection;
|
|
427
|
+
backgroundPageCorrection = null;
|
|
428
|
+
void loadLogs(background);
|
|
429
|
+
});
|
|
408
430
|
});
|
|
409
431
|
</script>
|
|
410
432
|
|
|
@@ -418,28 +440,17 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
418
440
|
</div>
|
|
419
441
|
</div>
|
|
420
442
|
|
|
421
|
-
<!-- New data hint -->
|
|
422
|
-
{#if showRefreshHint}
|
|
423
|
-
<div class="border-l-2 border-l-nexus-500 bg-nexus-500/5 px-3 py-2 flex items-center justify-between gap-3">
|
|
424
|
-
<div class="flex items-center gap-2">
|
|
425
|
-
<span class="nx-dot-accent"></span>
|
|
426
|
-
<span class="font-mono text-[11px] uppercase tracking-command text-nexus-200">{$_('logs.newDataAvailable')}</span>
|
|
427
|
-
</div>
|
|
428
|
-
<button class="nx-btn-ghost nx-btn-md" onclick={manualRefresh}>
|
|
429
|
-
{$_('common.refresh')}
|
|
430
|
-
</button>
|
|
431
|
-
</div>
|
|
432
|
-
{/if}
|
|
433
|
-
|
|
434
443
|
<!-- 统一操作栏(响应式设计) -->
|
|
435
444
|
<div class="mb-6">
|
|
436
445
|
<!-- 操作控制行 -->
|
|
437
|
-
<div class="flex items-
|
|
446
|
+
<div class="flex items-start gap-2 mb-3 md:flex-wrap">
|
|
438
447
|
<!-- 搜索框(弹性伸缩) -->
|
|
439
448
|
<div class="flex-1 min-w-0 md:flex-[1_1_16rem]">
|
|
440
449
|
<input
|
|
441
450
|
type="text"
|
|
451
|
+
bind:this={searchInput}
|
|
442
452
|
bind:value={searchTerm}
|
|
453
|
+
aria-label={$_('logs.searchTerm')}
|
|
443
454
|
placeholder={$_('logs.searchPlaceholder')}
|
|
444
455
|
class="nx-input w-full"
|
|
445
456
|
data-testid="logs-filter-path-input"
|
|
@@ -447,9 +458,20 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
447
458
|
</div>
|
|
448
459
|
|
|
449
460
|
<!-- 桌面布局(≥768px):控件按可用空间自然换行 -->
|
|
450
|
-
<div class="hidden md:flex min-w-0 items-
|
|
461
|
+
<div class="hidden md:flex min-w-0 items-start gap-2 flex-wrap flex-[2_1_36rem]">
|
|
451
462
|
<!-- 左侧:过滤按钮组 -->
|
|
452
463
|
<div class="flex items-center gap-2 flex-wrap">
|
|
464
|
+
<div data-testid="logs-filter-scope-select">
|
|
465
|
+
<BDropdownAction items={scopeOptions} onselect={onScopeChange}
|
|
466
|
+
triggerClass={`${scopeFilter ? 'nx-btn-primary' : 'nx-btn-ghost'} nx-btn-md`}>
|
|
467
|
+
{#snippet trigger()}
|
|
468
|
+
{$_('logs.scopeTitle')}{#if scopeFilter}: {$_(`logs.scope.${scopeFilter}`)}{/if}
|
|
469
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
|
|
470
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
|
471
|
+
</svg>
|
|
472
|
+
{/snippet}
|
|
473
|
+
</BDropdownAction>
|
|
474
|
+
</div>
|
|
453
475
|
<div data-testid="logs-filter-type-select">
|
|
454
476
|
<BDropdownAction items={transportTypeOptions} onselect={onTransportTypeChange}
|
|
455
477
|
triggerClass={`${transportTypeFilter ? 'nx-btn-primary' : 'nx-btn-ghost'} nx-btn-md`}>
|
|
@@ -513,12 +535,12 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
513
535
|
<!-- Result 下拉 -->
|
|
514
536
|
<BDropdownAction
|
|
515
537
|
items={resultQuickFilterItems}
|
|
516
|
-
onselect={
|
|
517
|
-
triggerClass={`${
|
|
538
|
+
onselect={onResultSelectChange}
|
|
539
|
+
triggerClass={`${resultStateFilter !== undefined ? 'nx-btn-primary' : 'nx-btn-ghost'} nx-btn-md`}
|
|
518
540
|
>
|
|
519
541
|
{#snippet trigger()}
|
|
520
|
-
{$_('logs.
|
|
521
|
-
{#if
|
|
542
|
+
{$_('logs.result')}
|
|
543
|
+
{#if resultStateFilter !== undefined}
|
|
522
544
|
<span class="nx-feature-tag">1</span>
|
|
523
545
|
{/if}
|
|
524
546
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -741,6 +763,11 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
741
763
|
<Sheet.Title class="shrink-0 border-b border-carbon-600 px-4 py-4 pr-14 font-mono text-sm font-semibold text-zinc-100">{$_('logs.actions')}</Sheet.Title>
|
|
742
764
|
<div class="min-h-0 overflow-y-auto overscroll-contain px-4 py-3" data-testid="logs-mobile-actions-scroll">
|
|
743
765
|
<div class="grid grid-cols-2 gap-x-3 gap-y-3">
|
|
766
|
+
<div class="min-w-0 space-y-1">
|
|
767
|
+
<span class="nx-field-label !text-xs !tracking-normal">{$_('logs.scopeTitle')}</span>
|
|
768
|
+
<Select options={scopeOptions} value={scopeSelectValue} onchange={onScopeChange}
|
|
769
|
+
placeholder={$_('logs.scope.all')} ariaLabel={$_('logs.scopeTitle')} />
|
|
770
|
+
</div>
|
|
744
771
|
<div class="min-w-0 space-y-1">
|
|
745
772
|
<span class="nx-field-label !text-xs !tracking-normal">{$_('logs.transportType')}</span>
|
|
746
773
|
<Select options={transportTypeOptions} value={transportTypeSelectValue} onchange={onTransportTypeChange}
|
|
@@ -755,8 +782,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
755
782
|
<input id="logs-mobile-status" type="text" bind:value={statusFilter} placeholder="200, 404, 5xx" class="nx-input w-full" />
|
|
756
783
|
</div>
|
|
757
784
|
<div class="min-w-0 space-y-1">
|
|
758
|
-
<span class="nx-field-label !text-xs !tracking-normal">{$_('logs.
|
|
759
|
-
<Select options={
|
|
785
|
+
<span class="nx-field-label !text-xs !tracking-normal">{$_('logs.result')}</span>
|
|
786
|
+
<Select options={resultOptions} value={resultSelectValue} onchange={onResultSelectChange} placeholder={$_('logs.resultStates.all')} ariaLabel={$_('logs.result')} />
|
|
760
787
|
</div>
|
|
761
788
|
<div class="min-w-0 space-y-1">
|
|
762
789
|
<span class="nx-field-label !text-xs !tracking-normal">{$_('logs.requestTypeFilter')}</span>
|
|
@@ -820,15 +847,31 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
820
847
|
|
|
821
848
|
<!-- Filter Chips 展示区 -->
|
|
822
849
|
{#if activeFiltersCount > 0}
|
|
823
|
-
<
|
|
850
|
+
<section aria-label={$_('logs.filters')} class="flex items-center gap-2 flex-wrap px-1">
|
|
851
|
+
{#if scopeFilter !== undefined}
|
|
852
|
+
<div class="inline-flex items-center gap-1.5 border border-nexus-500/60 bg-nexus-500/10 px-2.5 py-0.5 font-mono text-[11px] uppercase tracking-command text-nexus-300">
|
|
853
|
+
<span class="text-xs opacity-70">{$_('logs.scopeTitle')}:</span>
|
|
854
|
+
<span class="font-medium">{$_(`logs.scope.${scopeFilter}`)}</span>
|
|
855
|
+
<button
|
|
856
|
+
type="button"
|
|
857
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
858
|
+
onclick={() => clearFilter(() => scopeFilter = undefined)}
|
|
859
|
+
aria-label={$_('logs.clearFilters')}
|
|
860
|
+
>
|
|
861
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
862
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
863
|
+
</svg>
|
|
864
|
+
</button>
|
|
865
|
+
</div>
|
|
866
|
+
{/if}
|
|
824
867
|
{#if searchTerm.trim()}
|
|
825
|
-
<div class="inline-flex items-center gap-1.5 border border-carbon-500 bg-carbon-900 px-2.5 py-0.5 font-mono text-[11px]
|
|
826
|
-
<span class="text-xs opacity-70">{$_('logs.searchTerm')}:</span>
|
|
827
|
-
<span class="font-medium">{searchTerm}</span>
|
|
868
|
+
<div class="inline-flex items-center gap-1.5 border border-carbon-500 bg-carbon-900 px-2.5 py-0.5 font-mono text-[11px] tracking-command text-zinc-300">
|
|
869
|
+
<span class="text-xs uppercase opacity-70">{$_('logs.searchTerm')}:</span>
|
|
870
|
+
<span class="font-medium normal-case">{searchTerm}</span>
|
|
828
871
|
<button
|
|
829
872
|
type="button"
|
|
830
|
-
class="inline-flex items-center justify-center
|
|
831
|
-
onclick={() => searchTerm = ''}
|
|
873
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
874
|
+
onclick={() => clearFilter(() => searchTerm = '')}
|
|
832
875
|
aria-label={$_('logs.clearFilters')}
|
|
833
876
|
>
|
|
834
877
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -842,8 +885,12 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
842
885
|
<div class="inline-flex items-center gap-1.5 border border-nexus-500/60 bg-nexus-500/10 px-2.5 py-0.5 font-mono text-[11px] uppercase tracking-command text-nexus-300">
|
|
843
886
|
<span class="text-xs opacity-70">{$_('logs.transportType')}:</span>
|
|
844
887
|
<span class="font-medium">{transportTypeLabel(transportTypeFilter)}</span>
|
|
845
|
-
<button
|
|
846
|
-
|
|
888
|
+
<button
|
|
889
|
+
type="button"
|
|
890
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
891
|
+
onclick={() => clearFilter(() => transportTypeFilter = undefined)}
|
|
892
|
+
aria-label={$_('logs.clearTransportType')}
|
|
893
|
+
>
|
|
847
894
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
|
|
848
895
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
849
896
|
</svg>
|
|
@@ -856,8 +903,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
856
903
|
<span class="font-medium">{method}</span>
|
|
857
904
|
<button
|
|
858
905
|
type="button"
|
|
859
|
-
class="inline-flex items-center justify-center
|
|
860
|
-
onclick={() => method = ''}
|
|
906
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
907
|
+
onclick={() => clearFilter(() => method = '')}
|
|
861
908
|
aria-label={$_('logs.clearFilters')}
|
|
862
909
|
>
|
|
863
910
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -873,8 +920,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
873
920
|
<span class="font-medium">{statusFilter}</span>
|
|
874
921
|
<button
|
|
875
922
|
type="button"
|
|
876
|
-
class="inline-flex items-center justify-center
|
|
877
|
-
onclick={() => statusFilter = ''}
|
|
923
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
924
|
+
onclick={() => clearFilter(() => statusFilter = '')}
|
|
878
925
|
aria-label={$_('logs.clearFilters')}
|
|
879
926
|
>
|
|
880
927
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -884,14 +931,14 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
884
931
|
</div>
|
|
885
932
|
{/if}
|
|
886
933
|
|
|
887
|
-
{#if
|
|
934
|
+
{#if resultStateFilter !== undefined}
|
|
888
935
|
<div class="inline-flex items-center gap-1.5 border border-nexus-500/60 bg-nexus-500/10 px-2.5 py-0.5 font-mono text-[11px] uppercase tracking-command text-nexus-300">
|
|
889
|
-
<span class="text-xs opacity-70">{$_('logs.
|
|
890
|
-
<span class="font-medium">{$_(`logs.
|
|
936
|
+
<span class="text-xs opacity-70">{$_('logs.result')}:</span>
|
|
937
|
+
<span class="font-medium">{$_(`logs.resultStates.${resultStateFilter}`)}</span>
|
|
891
938
|
<button
|
|
892
939
|
type="button"
|
|
893
|
-
class="inline-flex items-center justify-center
|
|
894
|
-
onclick={() =>
|
|
940
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
941
|
+
onclick={() => clearFilter(() => resultStateFilter = undefined)}
|
|
895
942
|
aria-label={$_('logs.clearFilters')}
|
|
896
943
|
>
|
|
897
944
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -907,8 +954,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
907
954
|
<span class="font-medium">{$_(`logs.requestType_${requestTypeFilter}`)}</span>
|
|
908
955
|
<button
|
|
909
956
|
type="button"
|
|
910
|
-
class="inline-flex items-center justify-center
|
|
911
|
-
onclick={() => requestTypeFilter = ''}
|
|
957
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
958
|
+
onclick={() => clearFilter(() => requestTypeFilter = '')}
|
|
912
959
|
aria-label={$_('logs.clearFilters')}
|
|
913
960
|
>
|
|
914
961
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -924,8 +971,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
924
971
|
<span class="font-medium">{hasRetryFilter ? $_('common.yes') : $_('common.no')}</span>
|
|
925
972
|
<button
|
|
926
973
|
type="button"
|
|
927
|
-
class="inline-flex items-center justify-center
|
|
928
|
-
onclick={() => hasRetryFilter = undefined}
|
|
974
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
975
|
+
onclick={() => clearFilter(() => hasRetryFilter = undefined)}
|
|
929
976
|
aria-label={$_('logs.clearFilters')}
|
|
930
977
|
>
|
|
931
978
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -949,8 +996,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
949
996
|
<span class="font-medium">{$_('logs.recentTime')} {recentHours}h</span>
|
|
950
997
|
<button
|
|
951
998
|
type="button"
|
|
952
|
-
class="inline-flex items-center justify-center
|
|
953
|
-
onclick={() => recentHours = 1}
|
|
999
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
1000
|
+
onclick={() => clearFilter(() => recentHours = 1)}
|
|
954
1001
|
aria-label={$_('logs.clearFilters')}
|
|
955
1002
|
>
|
|
956
1003
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -966,8 +1013,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
966
1013
|
<span class="font-medium">{$_('logs.customTime')}</span>
|
|
967
1014
|
<button
|
|
968
1015
|
type="button"
|
|
969
|
-
class="inline-flex items-center justify-center
|
|
970
|
-
onclick={() => { timeRangeType = 'recent'; customStartTime = ''; customEndTime = ''; }}
|
|
1016
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
1017
|
+
onclick={() => clearFilter(() => { timeRangeType = 'recent'; customStartTime = ''; customEndTime = ''; })}
|
|
971
1018
|
aria-label={$_('logs.clearFilters')}
|
|
972
1019
|
>
|
|
973
1020
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -983,8 +1030,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
983
1030
|
<span class="font-medium">{$_('logs.allTime')}</span>
|
|
984
1031
|
<button
|
|
985
1032
|
type="button"
|
|
986
|
-
class="inline-flex items-center justify-center
|
|
987
|
-
onclick={() => timeRangeType = 'recent'}
|
|
1033
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
1034
|
+
onclick={() => clearFilter(() => timeRangeType = 'recent')}
|
|
988
1035
|
aria-label={$_('logs.clearFilters')}
|
|
989
1036
|
>
|
|
990
1037
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -1000,8 +1047,8 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
1000
1047
|
<span class="font-medium">{$_(`logs.sortBy${sortBy.charAt(0).toUpperCase() + sortBy.slice(1)}`)} {sortOrder === 'asc' ? '↑' : '↓'}</span>
|
|
1001
1048
|
<button
|
|
1002
1049
|
type="button"
|
|
1003
|
-
class="inline-flex items-center justify-center
|
|
1004
|
-
onclick={() => { sortBy = 'timestamp'; sortOrder = 'desc'; }}
|
|
1050
|
+
class="inline-flex h-6 w-6 items-center justify-center text-zinc-400 transition-colors hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
1051
|
+
onclick={() => clearFilter(() => { sortBy = 'timestamp'; sortOrder = 'desc'; })}
|
|
1005
1052
|
aria-label={$_('logs.clearFilters')}
|
|
1006
1053
|
>
|
|
1007
1054
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
@@ -1010,7 +1057,7 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
1010
1057
|
</button>
|
|
1011
1058
|
</div>
|
|
1012
1059
|
{/if}
|
|
1013
|
-
</
|
|
1060
|
+
</section>
|
|
1014
1061
|
{/if}
|
|
1015
1062
|
</div>
|
|
1016
1063
|
|
|
@@ -1024,36 +1071,55 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
1024
1071
|
<p class="font-mono text-[11px] uppercase tracking-command text-red-300">{error}</p>
|
|
1025
1072
|
</PanelCard>
|
|
1026
1073
|
{:else if logs.length === 0}
|
|
1027
|
-
|
|
1028
|
-
<
|
|
1029
|
-
<
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1074
|
+
{#if activeFiltersCount > 0}
|
|
1075
|
+
<PanelCard title={$_('logs.noMatchingData')} tag="EMPTY" stripe="zinc">
|
|
1076
|
+
<div class="py-6 flex flex-col items-center justify-center gap-3 text-center" data-testid="logs-empty-state">
|
|
1077
|
+
<span class="font-mono text-[11px] uppercase tracking-command text-zinc-500">
|
|
1078
|
+
{$_('logs.noMatchingData')}
|
|
1079
|
+
</span>
|
|
1080
|
+
<button
|
|
1081
|
+
type="button"
|
|
1082
|
+
class="nx-btn-ghost nx-btn-md focus-visible:ring-2 focus-visible:ring-nexus-500"
|
|
1083
|
+
onclick={clearAllFilters}
|
|
1084
|
+
>
|
|
1085
|
+
{$_('logs.resetFilters')}
|
|
1086
|
+
</button>
|
|
1087
|
+
</div>
|
|
1088
|
+
</PanelCard>
|
|
1089
|
+
{:else}
|
|
1090
|
+
<PanelCard title={$_('logs.noData')} tag="EMPTY" stripe="zinc">
|
|
1091
|
+
<div class="py-6 text-center" data-testid="logs-empty-state">
|
|
1092
|
+
<span class="font-mono text-[11px] uppercase tracking-command text-zinc-500">
|
|
1093
|
+
{$_('logs.noData')}
|
|
1094
|
+
</span>
|
|
1095
|
+
</div>
|
|
1096
|
+
</PanelCard>
|
|
1097
|
+
{/if}
|
|
1034
1098
|
{:else}
|
|
1035
1099
|
<PanelCard title="REQUEST LOG" tag={`N=${logs.length}/${total}`} flush>
|
|
1036
1100
|
<div class="w-full min-w-0 overflow-x-auto" data-testid="logs-table-scroll">
|
|
1037
|
-
<table class="w-full min-w-[1200px] whitespace-nowrap">
|
|
1101
|
+
<table class="w-full min-w-[1200px] table-fixed whitespace-nowrap">
|
|
1038
1102
|
<colgroup>
|
|
1039
|
-
<col class="w-
|
|
1103
|
+
<col class="w-48" />
|
|
1104
|
+
<col class="w-32" />
|
|
1105
|
+
<col class="w-28" />
|
|
1040
1106
|
<col class="w-20" />
|
|
1041
|
-
<col class="w-
|
|
1042
|
-
<col class="w-
|
|
1043
|
-
<col class="w-[100px]" />
|
|
1107
|
+
<col class="w-48" />
|
|
1108
|
+
<col class="w-36" />
|
|
1044
1109
|
<col class="w-[100px]" />
|
|
1045
1110
|
<col class="w-24" />
|
|
1046
|
-
<col class="w-
|
|
1111
|
+
<col class="w-44" />
|
|
1047
1112
|
<col class="w-28" />
|
|
1048
1113
|
</colgroup>
|
|
1049
|
-
<thead class="border-b border-carbon-600 bg-carbon-900/60">
|
|
1114
|
+
<thead class="whitespace-normal border-b border-carbon-600 bg-carbon-900/60">
|
|
1050
1115
|
<tr>
|
|
1051
1116
|
<th class="text-left nx-label py-2.5 px-4">{$_('logs.time')}</th>
|
|
1117
|
+
<th class="text-left nx-label py-2.5 px-4">{$_('logs.scopeTitle')}</th>
|
|
1052
1118
|
<th class="text-left nx-label py-2.5 px-4">{$_('logs.transportType')}</th>
|
|
1053
1119
|
<th class="text-left nx-label py-2.5 px-4">{$_('logs.method')}</th>
|
|
1054
1120
|
<th class="text-left nx-label py-2.5 px-4">{$_('logs.path')}</th>
|
|
1055
1121
|
<th class="text-left nx-label py-2.5 px-4">{$_('logs.status')}</th>
|
|
1056
|
-
<th class="text-left nx-label py-2.5 px-4">{$_('logs.
|
|
1122
|
+
<th class="text-left nx-label py-2.5 px-4">{$_('logs.result')}</th>
|
|
1057
1123
|
<th class="text-right nx-label py-2.5 px-4">{$_('logs.duration')}</th>
|
|
1058
1124
|
<th class="text-left nx-label py-2.5 px-4">{$_('logs.upstream')}</th>
|
|
1059
1125
|
<th class="text-right nx-label py-2.5 px-4">{$_('logs.actions')}</th>
|
|
@@ -1061,17 +1127,31 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
1061
1127
|
</thead>
|
|
1062
1128
|
<tbody>
|
|
1063
1129
|
{#each logs as log, index (log.chainId)}
|
|
1064
|
-
{@const
|
|
1130
|
+
{@const presentation = listResultPresentation(log, $_)}
|
|
1065
1131
|
<tr class="group border-b border-carbon-600/60 hover:bg-carbon-700/40 transition-colors" data-testid={index === 0 ? 'logs-row-first' : undefined}>
|
|
1066
|
-
<td class="py-2.5 px-4 font-mono text-[11px] text-zinc-400">{formatTime(log.chainStartTs)}</td>
|
|
1067
|
-
<td class="py-2.5 px-4"
|
|
1068
|
-
|
|
1132
|
+
<td class="py-2.5 px-4 font-mono text-[11px] text-zinc-400">{formatTime(log.startedAt || log.chainStartTs || log.timestamp)}</td>
|
|
1133
|
+
<td class="py-2.5 px-4">
|
|
1134
|
+
<span class="nx-feature-tag">{$_(`logs.scope.${log.scope}`)}</span>
|
|
1135
|
+
</td>
|
|
1136
|
+
<td class="py-2.5 px-4">
|
|
1137
|
+
<span class="nx-feature-tag" title={log.transportType === null ? $_('logs.transportTypeUnrecorded') : undefined}>{transportTypeLabel(log.transportType)}</span>
|
|
1138
|
+
</td>
|
|
1139
|
+
<td class="py-2.5 px-4"><span class="nx-feature-tag">{log.method || log.operation || '—'}</span></td>
|
|
1069
1140
|
<td class="py-2.5 px-4 font-mono text-[12px] text-zinc-200 truncate max-w-xs" title={log.path}>
|
|
1070
1141
|
{log.path}
|
|
1071
1142
|
</td>
|
|
1072
|
-
<td class="py-2.5 px-4"><span class="nx-feature-tag">{httpStatusLabel(log.chainStatus)}</span></td>
|
|
1073
|
-
<td class="py-2.5 px-4"
|
|
1074
|
-
|
|
1143
|
+
<td class="py-2.5 px-4"><span class="nx-feature-tag">{httpStatusLabel(log.chainStatus ?? log.status)}</span></td>
|
|
1144
|
+
<td class="py-2.5 px-4">
|
|
1145
|
+
<span
|
|
1146
|
+
class={`inline-flex border px-2 py-0.5 font-mono text-[11px] ${resultStateTone(log.result.state)}`}
|
|
1147
|
+
title={presentation.title || undefined}
|
|
1148
|
+
>
|
|
1149
|
+
{presentation.text}
|
|
1150
|
+
</span>
|
|
1151
|
+
</td>
|
|
1152
|
+
<td class="py-2.5 px-4 text-right font-mono text-[11px] text-zinc-300 tabular-nums">
|
|
1153
|
+
{log.result.state === 'running' ? '—' : formatDuration(log.chainDurationMs ?? log.duration)}
|
|
1154
|
+
</td>
|
|
1075
1155
|
<td class="py-2.5 px-4 font-mono text-[11px] text-zinc-400 truncate max-w-xs" title={log.upstream || '-'}>
|
|
1076
1156
|
{log.upstream || '—'}
|
|
1077
1157
|
{#if log.chainAttempts > 1}
|
|
@@ -1081,8 +1161,7 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
1081
1161
|
<td class="py-2.5 px-4 text-right">
|
|
1082
1162
|
<button
|
|
1083
1163
|
class="nx-btn-ghost nx-btn-sm"
|
|
1084
|
-
|
|
1085
|
-
onclick={() => viewDetail(log)}
|
|
1164
|
+
onclick={(event) => viewDetail(log, event.currentTarget)}
|
|
1086
1165
|
>
|
|
1087
1166
|
{$_('logs.viewDetail')}
|
|
1088
1167
|
</button>
|
|
@@ -1122,9 +1201,15 @@ let refreshIntervalOptions = $derived($isLoading ? [] : [
|
|
|
1122
1201
|
{#if showDetailModal && selectedChain}
|
|
1123
1202
|
<ChainDetailModal
|
|
1124
1203
|
chain={selectedChain}
|
|
1125
|
-
onClose={() => {
|
|
1204
|
+
onClose={async () => {
|
|
1205
|
+
const trigger = detailTrigger;
|
|
1126
1206
|
showDetailModal = false;
|
|
1127
1207
|
selectedChain = null;
|
|
1208
|
+
detailTrigger = null;
|
|
1209
|
+
await tick();
|
|
1210
|
+
if (!showDetailModal && trigger?.isConnected) {
|
|
1211
|
+
trigger.focus({ preventScroll: true });
|
|
1212
|
+
}
|
|
1128
1213
|
}}
|
|
1129
1214
|
/>
|
|
1130
1215
|
{/if}
|