feat: show current running models

This commit is contained in:
Timothy J. Baek
2024-06-04 11:13:43 -07:00
parent 56fda46215
commit 2be9c25ba7
6 changed files with 129 additions and 20 deletions

View File

@@ -2,7 +2,16 @@
import { io } from 'socket.io-client';
import { onMount, tick, setContext } from 'svelte';
import { config, user, theme, WEBUI_NAME, mobile, socket, activeUserCount } from '$lib/stores';
import {
config,
user,
theme,
WEBUI_NAME,
mobile,
socket,
activeUserCount,
USAGE_POOL
} from '$lib/stores';
import { goto } from '$app/navigation';
import { Toaster, toast } from 'svelte-sonner';
@@ -76,6 +85,11 @@
activeUserCount.set(data.count);
});
_socket.on('usage', (data) => {
console.log('usage', data);
USAGE_POOL.set(data['models']);
});
if (localStorage.token) {
// Get Session User Info
const sessionUser = await getSessionUser(localStorage.token).catch((error) => {