refac
This commit is contained in:
@@ -180,7 +180,7 @@
|
||||
{#if model}
|
||||
<div class="flex justify-between dark:text-gray-300 px-5 pt-4 pb-2">
|
||||
<Tooltip content={`${model.name} (${model.id})`} placement="top-start">
|
||||
<div class="text-lg font-medium self-center line-clamp-1">
|
||||
<div class="text-lg font-normal self-center line-clamp-1">
|
||||
{model.name}
|
||||
</div>
|
||||
</Tooltip>
|
||||
@@ -193,7 +193,7 @@
|
||||
<div class="px-5 border-b border-gray-100 dark:border-gray-850">
|
||||
<div class="flex gap-4">
|
||||
<button
|
||||
class="py-2 text-sm font-medium border-b-2 transition-colors {selectedTab === 'overview'
|
||||
class="py-2 text-sm font-normal border-b-2 transition-colors {selectedTab === 'overview'
|
||||
? 'border-black dark:border-white text-gray-900 dark:text-white'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'}"
|
||||
on:click={() => selectTab('overview')}
|
||||
@@ -202,7 +202,7 @@
|
||||
</button>
|
||||
{#if $config?.features?.enable_admin_chat_access}
|
||||
<button
|
||||
class="py-2 text-sm font-medium border-b-2 transition-colors {selectedTab === 'chats'
|
||||
class="py-2 text-sm font-normal border-b-2 transition-colors {selectedTab === 'chats'
|
||||
? 'border-black dark:border-white text-gray-900 dark:text-white'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'}"
|
||||
on:click={() => selectTab('chats')}
|
||||
@@ -219,7 +219,7 @@
|
||||
<div class="mb-4 mt-3">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<Tooltip content={$i18n.t('Thumbs up/down ratings from users on model responses')}>
|
||||
<div class="text-xs text-gray-500 font-medium uppercase tracking-wide cursor-help">
|
||||
<div class="text-xs text-gray-500 font-normal uppercase tracking-wide cursor-help">
|
||||
{$i18n.t('Feedback Activity')}
|
||||
</div>
|
||||
</Tooltip>
|
||||
@@ -229,7 +229,7 @@
|
||||
{#each TIME_RANGES as range}
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-full transition-all duration-200 px-2.5 py-0.5 text-xs font-medium {selectedRange ===
|
||||
class="rounded-full transition-all duration-200 px-2.5 py-0.5 text-xs font-normal {selectedRange ===
|
||||
range.key
|
||||
? 'bg-white text-gray-900 shadow-sm dark:bg-gray-700 dark:text-white'
|
||||
: 'text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200'}"
|
||||
@@ -249,14 +249,14 @@
|
||||
|
||||
<!-- Tags -->
|
||||
<div class="mb-4">
|
||||
<div class="text-xs text-gray-500 mb-2 font-medium uppercase tracking-wide">
|
||||
<div class="text-xs text-gray-500 mb-2 font-normal uppercase tracking-wide">
|
||||
{$i18n.t('Tags')}
|
||||
</div>
|
||||
{#if tags.length}
|
||||
<div class="flex flex-wrap gap-1 -mx-1">
|
||||
{#each tags as tagInfo}
|
||||
<span class="px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-850 text-xs">
|
||||
{tagInfo.tag} <span class="text-gray-500 font-medium">{tagInfo.count}</span>
|
||||
{tagInfo.tag} <span class="text-gray-500 font-normal">{tagInfo.count}</span>
|
||||
</span>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -283,7 +283,7 @@
|
||||
|
||||
<div class="flex justify-end pt-4">
|
||||
<button
|
||||
class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"
|
||||
class="px-3.5 py-1.5 text-sm font-normal bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"
|
||||
type="button"
|
||||
on:click={close}
|
||||
>
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
<div
|
||||
class="pt-0.5 pb-1 gap-1 flex flex-row justify-between items-center sticky top-0 z-10 bg-white dark:bg-gray-900"
|
||||
>
|
||||
<div class="text-lg font-medium px-0.5 shrink-0">
|
||||
<div class="text-lg font-normal px-0.5 shrink-0">
|
||||
{$i18n.t('Analytics')}
|
||||
</div>
|
||||
<div class="flex items-center gap-2 flex-wrap justify-end min-w-0">
|
||||
@@ -287,27 +287,27 @@
|
||||
{#if !loading}
|
||||
<div class="flex gap-3 text-xs text-gray-500 dark:text-gray-400 px-0.5 pb-2">
|
||||
<span
|
||||
><span class="font-medium text-gray-900 dark:text-gray-300"
|
||||
><span class="font-normal text-gray-900 dark:text-gray-300"
|
||||
>{summary.total_messages.toLocaleString()}</span
|
||||
>
|
||||
{$i18n.t('messages')}</span
|
||||
>
|
||||
<Tooltip content={$i18n.t('Token counts are estimates and may not reflect actual API usage')}>
|
||||
<span class="cursor-help"
|
||||
><span class="font-medium text-gray-900 dark:text-gray-300"
|
||||
><span class="font-normal text-gray-900 dark:text-gray-300"
|
||||
>{formatNumber(totalTokens.total)}</span
|
||||
>
|
||||
{$i18n.t('tokens')}</span
|
||||
>
|
||||
</Tooltip>
|
||||
<span
|
||||
><span class="font-medium text-gray-900 dark:text-gray-300"
|
||||
><span class="font-normal text-gray-900 dark:text-gray-300"
|
||||
>{summary.total_chats.toLocaleString()}</span
|
||||
>
|
||||
{$i18n.t('chats')}</span
|
||||
>
|
||||
<span
|
||||
><span class="font-medium text-gray-900 dark:text-gray-300">{summary.total_users}</span>
|
||||
><span class="font-normal text-gray-900 dark:text-gray-300">{summary.total_users}</span>
|
||||
{$i18n.t('users')}</span
|
||||
>
|
||||
</div>
|
||||
@@ -328,7 +328,7 @@
|
||||
]}
|
||||
{@const periodMap = { '24h': 'hour', '7d': 'week', '30d': 'month', '90d': 'year', all: 'all' }}
|
||||
<div class="mb-4">
|
||||
<div class="text-xs font-medium text-gray-600 dark:text-gray-400 mb-2 px-0.5">
|
||||
<div class="text-xs font-normal text-gray-600 dark:text-gray-400 mb-2 px-0.5">
|
||||
{selectedPeriod === '24h' ? $i18n.t('Hourly Messages') : $i18n.t('Daily Messages')}
|
||||
</div>
|
||||
<ChartLine
|
||||
@@ -350,7 +350,7 @@
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
<!-- Model Usage Table -->
|
||||
<div>
|
||||
<div class="text-xs font-medium text-gray-700 dark:text-gray-300 mb-1 px-0.5">
|
||||
<div class="text-xs font-normal text-gray-700 dark:text-gray-300 mb-1 px-0.5">
|
||||
{$i18n.t('Model Usage')}
|
||||
</div>
|
||||
<div class="scrollbar-hidden relative whitespace-nowrap overflow-x-auto max-w-full">
|
||||
@@ -478,7 +478,7 @@
|
||||
}}
|
||||
>
|
||||
<td class="px-3 py-1 text-gray-400">{idx + 1}</td>
|
||||
<td class="px-3 py-1 font-medium text-gray-900 dark:text-white">
|
||||
<td class="px-3 py-1 font-normal text-gray-900 dark:text-white">
|
||||
<div class="flex items-center gap-2">
|
||||
<img
|
||||
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.model_id}"
|
||||
@@ -518,7 +518,7 @@
|
||||
|
||||
<!-- User Activity Table -->
|
||||
<div>
|
||||
<div class="text-xs font-medium text-gray-700 dark:text-gray-300 mb-1 px-0.5">
|
||||
<div class="text-xs font-normal text-gray-700 dark:text-gray-300 mb-1 px-0.5">
|
||||
{$i18n.t('User Activity')}
|
||||
</div>
|
||||
<div class="scrollbar-hidden relative whitespace-nowrap overflow-x-auto max-w-full">
|
||||
@@ -586,7 +586,7 @@
|
||||
{#each sortedUsers as user, idx (user.user_id)}
|
||||
<tr class="bg-white dark:bg-gray-900 dark:border-gray-850 text-xs">
|
||||
<td class="px-3 py-1 text-gray-400">{idx + 1}</td>
|
||||
<td class="px-3 py-1 font-medium text-gray-900 dark:text-white">
|
||||
<td class="px-3 py-1 font-normal text-gray-900 dark:text-white">
|
||||
<div class="flex items-center gap-2">
|
||||
<img
|
||||
src="{WEBUI_API_BASE_URL}/users/{user.user_id}/profile/image"
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<div
|
||||
class="pt-0.5 pb-1 gap-1 flex flex-col md:flex-row justify-between sticky top-0 z-10 bg-white dark:bg-gray-900"
|
||||
>
|
||||
<div class="flex items-center text-xl font-medium px-0.5 gap-2 shrink-0">
|
||||
<div class="flex items-center text-xl font-normal px-0.5 gap-2 shrink-0">
|
||||
{$i18n.t('Model Usage')}
|
||||
<span class="text-lg text-gray-500">{totalMessages} {$i18n.t('messages')}</span>
|
||||
</div>
|
||||
@@ -137,7 +137,7 @@
|
||||
<tr
|
||||
class="bg-white dark:bg-gray-900 text-xs hover:bg-gray-50 dark:hover:bg-gray-850/50 transition"
|
||||
>
|
||||
<td class="px-3 py-1.5 font-medium text-gray-900 dark:text-white">
|
||||
<td class="px-3 py-1.5 font-normal text-gray-900 dark:text-white">
|
||||
{idx + 1}
|
||||
</td>
|
||||
<td class="px-3 py-1.5">
|
||||
@@ -150,13 +150,13 @@
|
||||
e.target.src = '/favicon.png';
|
||||
}}
|
||||
/>
|
||||
<span class="font-medium text-gray-800 dark:text-gray-200">{model.name}</span>
|
||||
<span class="font-normal text-gray-800 dark:text-gray-200">{model.name}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-3 py-1.5 text-right font-medium text-gray-900 dark:text-white">
|
||||
<td class="px-3 py-1.5 text-right font-normal text-gray-900 dark:text-white">
|
||||
{model.count.toLocaleString()}
|
||||
</td>
|
||||
<td class="px-3 py-1.5 text-right font-medium text-blue-500">
|
||||
<td class="px-3 py-1.5 text-right font-normal text-blue-500">
|
||||
{((model.count / totalMessages) * 100).toFixed(1)}%
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<div
|
||||
class="pt-0.5 pb-1 gap-1 flex flex-col md:flex-row justify-between sticky top-0 z-10 bg-white dark:bg-gray-900"
|
||||
>
|
||||
<div class="flex items-center text-xl font-medium px-0.5 gap-2 shrink-0">
|
||||
<div class="flex items-center text-xl font-normal px-0.5 gap-2 shrink-0">
|
||||
{$i18n.t('User Activity')}
|
||||
<span class="text-lg text-gray-500">{userStats.length} {$i18n.t('users')}</span>
|
||||
</div>
|
||||
@@ -132,18 +132,18 @@
|
||||
<tr
|
||||
class="bg-white dark:bg-gray-900 text-xs hover:bg-gray-50 dark:hover:bg-gray-850/50 transition"
|
||||
>
|
||||
<td class="px-3 py-1.5 font-medium text-gray-900 dark:text-white">
|
||||
<td class="px-3 py-1.5 font-normal text-gray-900 dark:text-white">
|
||||
{idx + 1}
|
||||
</td>
|
||||
<td class="px-3 py-1.5">
|
||||
<span class="font-medium text-gray-800 dark:text-gray-200 font-mono text-xs">
|
||||
<span class="font-normal text-gray-800 dark:text-gray-200 font-mono text-xs">
|
||||
{user.user_id.substring(0, 8)}...
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-3 py-1.5 text-right font-medium text-gray-900 dark:text-white">
|
||||
<td class="px-3 py-1.5 text-right font-normal text-gray-900 dark:text-white">
|
||||
{user.count.toLocaleString()}
|
||||
</td>
|
||||
<td class="px-3 py-1.5 text-right font-medium text-blue-500">
|
||||
<td class="px-3 py-1.5 text-right font-normal text-blue-500">
|
||||
{((user.count / totalMessages) * 100).toFixed(1)}%
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user