feat: add auth_index column to monitor request logs
- Add authIndex field to LogEntry interface - Display auth_index in request logs table - Shows which account/credential was used for each request
This commit is contained in:
@@ -41,6 +41,7 @@ interface LogEntry {
|
|||||||
inputTokens: number;
|
inputTokens: number;
|
||||||
outputTokens: number;
|
outputTokens: number;
|
||||||
totalTokens: number;
|
totalTokens: number;
|
||||||
|
authIndex: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ChannelModelRequest {
|
interface ChannelModelRequest {
|
||||||
@@ -283,6 +284,7 @@ export function RequestLogs({ data, loading: parentLoading, providerMap, provide
|
|||||||
inputTokens: detail.tokens.input_tokens || 0,
|
inputTokens: detail.tokens.input_tokens || 0,
|
||||||
outputTokens: detail.tokens.output_tokens || 0,
|
outputTokens: detail.tokens.output_tokens || 0,
|
||||||
totalTokens: detail.tokens.total_tokens || 0,
|
totalTokens: detail.tokens.total_tokens || 0,
|
||||||
|
authIndex: detail.auth_index || '',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -412,6 +414,9 @@ export function RequestLogs({ data, loading: parentLoading, providerMap, provide
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<td title={entry.authIndex || '-'}>
|
||||||
|
{entry.authIndex || '-'}
|
||||||
|
</td>
|
||||||
<td title={entry.apiKey}>
|
<td title={entry.apiKey}>
|
||||||
{maskSecret(entry.apiKey)}
|
{maskSecret(entry.apiKey)}
|
||||||
</td>
|
</td>
|
||||||
@@ -580,6 +585,7 @@ export function RequestLogs({ data, loading: parentLoading, providerMap, provide
|
|||||||
<table className={`${styles.table} ${styles.virtualTable}`}>
|
<table className={`${styles.table} ${styles.virtualTable}`}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>{t('monitor.logs.header_auth')}</th>
|
||||||
<th>{t('monitor.logs.header_api')}</th>
|
<th>{t('monitor.logs.header_api')}</th>
|
||||||
<th>{t('monitor.logs.header_request_type')}</th>
|
<th>{t('monitor.logs.header_request_type')}</th>
|
||||||
<th>{t('monitor.logs.header_model')}</th>
|
<th>{t('monitor.logs.header_model')}</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user