|
1 | 1 | <script lang="ts">
|
2 | 2 | import { onMount } from 'svelte';
|
3 |
| - import { cssVariables } from '$lib/stores/theme.js'; |
| 3 | + import { cssVariables } from '$lib/stores/theme'; |
4 | 4 | import GuardianPanel from './panels/GuardianPanel.svelte';
|
5 | 5 | import PetPanel from './panels/PetPanel.svelte';
|
6 | 6 | import Viewport from './panels/Viewport.svelte';
|
| 7 | + import { guardianStore } from '$lib/stores/guardian'; |
| 8 | + import { ruixen } from '$lib/stores/ruixen'; |
7 | 9 |
|
8 | 10 | let layoutRef: HTMLDivElement;
|
9 | 11 | let currentTime = '';
|
10 | 12 |
|
| 13 | + // Ruixen status stores |
| 14 | + const ruixenQueue = ruixen.queueSize; |
| 15 | + const ruixenDaily = ruixen.dailyUsage; |
| 16 | +
|
| 17 | + // Compute Ruixen state label and color |
| 18 | + $: ruixenState = (() => { |
| 19 | + const hasKey = Boolean($guardianStore?.apiKey) && Boolean($guardianStore?.apiKeyValid); |
| 20 | + if (!hasKey) return { label: 'Needs API key', color: '--petalytics-love' }; |
| 21 | + const model = ($guardianStore as any)?.model || 'openai/gpt-oss-20b:free'; |
| 22 | + const isFree = /:free$/i.test(model); |
| 23 | + const daily = Number($ruixenDaily || 0); |
| 24 | + const q = Number($ruixenQueue || 0); |
| 25 | + if (isFree && daily >= 45) return { label: 'Daily cap reached', color: '--petalytics-gold' }; |
| 26 | + if (q > 0) return { label: `Queued ${q}`, color: '--petalytics-gold' }; |
| 27 | + return { label: 'Ready', color: '--petalytics-pine' }; |
| 28 | + })(); |
| 29 | +
|
11 | 30 | function updateTime() {
|
12 | 31 | const now = new Date();
|
13 | 32 | const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
70 | 89 | >
|
71 | 90 | <!-- Left: Workspaces / Logo -->
|
72 | 91 | <div class="flex items-center space-x-4">
|
73 |
| - <div |
74 |
| - class="px-2 h-5 flex items-center justify-center text-xs font-mono" |
75 |
| - style="background: var(--petalytics-pine); color: var(--petalytics-bg);" |
76 |
| - > |
77 |
| - 🐾 |
78 |
| - </div> |
79 |
| - <span class="font-mono" style="color: var(--petalytics-foam);">petalytics@desktop</span> |
| 92 | + <img src="/favicon.svg" alt="Petalytics" class="h-5 w-5" /> |
| 93 | + <span class="font-mono" style="color: var(--petalytics-foam);">petalytics@ruixenOS</span> |
80 | 94 | </div>
|
81 | 95 |
|
82 | 96 | <!-- Center: Current Time -->
|
83 | 97 | <div class="font-mono font-medium" style="color: var(--petalytics-subtle);">
|
84 | 98 | {currentTime}
|
85 | 99 | </div>
|
86 | 100 |
|
87 |
| - <!-- Right: System Status --> |
| 101 | + <!-- Right: System Status (Ruixen) --> |
88 | 102 | <div class="flex items-center space-x-3 text-xs font-mono">
|
89 |
| - <div class="flex items-center space-x-1"> |
90 |
| - <span style="color: var(--petalytics-foam);">●</span> |
91 |
| - <span style="color: var(--petalytics-subtle);">journal</span> |
92 |
| - </div> |
93 |
| - <div class="flex items-center space-x-1"> |
94 |
| - <span style="color: var(--petalytics-gold);">●</span> |
95 |
| - <span style="color: var(--petalytics-subtle);">ai</span> |
| 103 | + <div class="flex items-center space-x-2"> |
| 104 | + <span style={`color: var(${ruixenState.color});`}>●</span> |
| 105 | + <span style="color: var(--petalytics-subtle);">Ruixen: {ruixenState.label}</span> |
96 | 106 | </div>
|
97 | 107 | </div>
|
98 | 108 | </div>
|
|
0 commit comments