From 8295f2dacc40d1fb04f69b9e368c8b5f4c7f6772 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:35:08 -0400 Subject: [PATCH] chore: remove dead admin Analytics ModelUsage and UserUsage components (#27574) Nothing in the tree imports either component; the admin Analytics tab renders its own inline copies of both tables directly from Dashboard.svelte. Both files landed with the dashboard in a4ad34841 (feat: analytics frontend dashboard) but were never wired into it. The remaining name matches elsewhere (the getUserUsage API and UserUsage* types in src/lib/apis/users/index.ts, consumed by chat/Settings/Usage.svelte, plus the backend usage endpoints) belong to the unrelated per-user usage feature and are untouched. --- .../admin/Analytics/ModelUsage.svelte | 173 ------------------ .../admin/Analytics/UserUsage.svelte | 160 ---------------- 2 files changed, 333 deletions(-) delete mode 100644 src/lib/components/admin/Analytics/ModelUsage.svelte delete mode 100644 src/lib/components/admin/Analytics/UserUsage.svelte diff --git a/src/lib/components/admin/Analytics/ModelUsage.svelte b/src/lib/components/admin/Analytics/ModelUsage.svelte deleted file mode 100644 index e904f70939..0000000000 --- a/src/lib/components/admin/Analytics/ModelUsage.svelte +++ /dev/null @@ -1,173 +0,0 @@ - - -
-
- {$i18n.t('Model Usage')} - {totalMessages} {$i18n.t('messages')} -
-
- -
- {#if loading} -
- -
- {/if} - - {#if !modelStats.length && !loading} -
{$i18n.t('No data found')}
- {:else if modelStats.length} - - - - - - - - - - - {#each sortedModels as model, idx (model.model_id)} - - - - - - - {/each} - -
# toggleSort('name')} - > -
- {$i18n.t('Model')} - {#if orderBy === 'name'} - {#if direction === 'asc'}{:else}{/if} - {:else} - - {/if} -
-
toggleSort('count')} - > -
- {$i18n.t('Messages')} - {#if orderBy === 'count'} - {#if direction === 'asc'}{:else}{/if} - {:else} - - {/if} -
-
toggleSort('percentage')} - > -
- {$i18n.t('Share')} - {#if orderBy === 'percentage'} - {#if direction === 'asc'}{:else}{/if} - {:else} - - {/if} -
-
- {idx + 1} - -
- {model.name} { - e.target.src = '/favicon.png'; - }} - /> - {model.name} -
-
- {model.count.toLocaleString()} - - {((model.count / totalMessages) * 100).toFixed(1)}% -
- {/if} -
- -
-
- ⓘ {$i18n.t('Message counts are based on assistant responses.')} -
-
diff --git a/src/lib/components/admin/Analytics/UserUsage.svelte b/src/lib/components/admin/Analytics/UserUsage.svelte deleted file mode 100644 index 6dee58844f..0000000000 --- a/src/lib/components/admin/Analytics/UserUsage.svelte +++ /dev/null @@ -1,160 +0,0 @@ - - -
-
- {$i18n.t('User Activity')} - {userStats.length} {$i18n.t('users')} -
-
- -
- {#if loading} -
- -
- {/if} - - {#if !userStats.length && !loading} -
{$i18n.t('No data found')}
- {:else if userStats.length} - - - - - - - - - - - {#each sortedUsers as user, idx (user.user_id)} - - - - - - - {/each} - -
# toggleSort('user_id')} - > -
- {$i18n.t('User')} - {#if orderBy === 'user_id'} - {#if direction === 'asc'}{:else}{/if} - {:else} - - {/if} -
-
toggleSort('count')} - > -
- {$i18n.t('Messages')} - {#if orderBy === 'count'} - {#if direction === 'asc'}{:else}{/if} - {:else} - - {/if} -
-
toggleSort('percentage')} - > -
- {$i18n.t('Share')} - {#if orderBy === 'percentage'} - {#if direction === 'asc'}{:else}{/if} - {:else} - - {/if} -
-
- {idx + 1} - - - {user.user_id.substring(0, 8)}... - - - {user.count.toLocaleString()} - - {((user.count / totalMessages) * 100).toFixed(1)}% -
- {/if} -
- -
-
- ⓘ {$i18n.t('Showing all messages (user + assistant) per user.')} -
-