diff --git a/deploy.py b/deploy.py index a61856d..f68c029 100644 --- a/deploy.py +++ b/deploy.py @@ -8,7 +8,7 @@ password = 'Tu77ceu2zzvx!' print("Connecting to server...") ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) -ssh.connect(host, username=user, password=password) +ssh.connect(host, username=user, password=password, look_for_keys=False, allow_agent=False) print("Uploading update.tar.gz...") sftp = ssh.open_sftp() diff --git a/static/js/panels/cookbook.js b/static/js/panels/cookbook.js index 5e2fc89..264b320 100644 --- a/static/js/panels/cookbook.js +++ b/static/js/panels/cookbook.js @@ -41,19 +41,38 @@ const CURATED_MODELS = [ let lastSys = null; let currentResults = []; +let currentAnalysis = null; +let activeFilter = ""; + +const FILTERS = [ + { id: "", label: "Alle" }, + { id: "coder", label: "Coding" }, + { id: "vision", label: "Vision / Multimodal" }, + { id: "roleplay", label: "Roleplay" }, + { id: "german", label: "Deutsch" } +]; function mount() { const c = $(".view[data-view='cookbook']"); + + const filtersHtml = FILTERS.map(f => + `` + ).join(""); + c.innerHTML = `
-

HuggingFace Suche

-

Finde GGUF-Modelle direkt auf HuggingFace und lade sie in Mission Control herunter.

+

App Store für Modelle

+

Entdecke Modelle live auf HuggingFace, Hardware-Fit inklusive.

+ +
+ ${filtersHtml} +
@@ -157,8 +176,32 @@ async function reanalyzeCtx() { } catch(e) {} } +window.setFilter = (filterId) => { + activeFilter = filterId; + const buttons = document.querySelectorAll('.filter-btn'); + buttons.forEach(b => { + b.style.background = 'var(--bg)'; + b.style.color = ''; + b.style.border = '1px solid var(--line)'; + }); + + const idx = FILTERS.findIndex(f => f.id === filterId); + if (idx !== -1 && buttons[idx]) { + buttons[idx].style.background = 'var(--hi)'; + buttons[idx].style.color = 'var(--bg)'; + buttons[idx].style.border = 'none'; + } + + doSearch(); +}; + async function doSearch() { - const q = $("#cb-search").value.trim(); + let q = $("#cb-search").value.trim(); + + if (activeFilter) { + q = q ? (q + " " + activeFilter) : activeFilter; + } + if (!q) return renderCurated(); const btn = $("#cb-btn-search"); diff --git a/static/js/panels/overview.js b/static/js/panels/overview.js index d14f592..0d72803 100644 --- a/static/js/panels/overview.js +++ b/static/js/panels/overview.js @@ -1,6 +1,7 @@ // overview.js — Dashboard: Quick Actions, Modelle & Recent Jobs -import { $, esc, icon } from "../core/ui.js"; +import { api } from "../core/api.js"; +import { $, esc, icon, toast } from "../core/ui.js"; let S = null; // letzter Status let J = []; // letzte Job-Liste @@ -26,9 +27,57 @@ function renderHero() { `; } +async function triggerAction(action) { + if (action === "restart_llama") { + toast("Neustart ausgelöst..."); + try { + await api("/api/service/llama-swap/restart", { method: "POST" }); + toast("llama-swap wird neugestartet."); + } catch(e) { + toast("Fehler: " + e.message, true); + } + } else if (action === "update_mc") { + toast("Update gestartet! Siehe Aktivitäten."); + try { + await api("/api/update", { method: "POST" }); + document.querySelector('.nav-item[data-view=\\'activity\\']').click(); + } catch(e) { + toast("Fehler: " + e.message, true); + } + } +} + +// Global hook für onclick +window.triggerAction = triggerAction; + function renderQuickActions() { - // 3 Kacheln (Cookbook, Server-Status, Aktivität/Guides) - $("#ov-quick").innerHTML = ` + let actionsHtml = ""; + + if (SYS) { + const ram_percent = SYS.ram.percent || 0; + // Wenn RAM über 90% ist, zeige Warnung. + // Wir nehmen 90 für Produktion, aber für den Test könnte es angepasst werden. + if (ram_percent >= 90) { + actionsHtml += ` +
+
+
+

⚠️ Arbeitsspeicher kritisch (${ram_percent.toFixed(0)}%)

+

Der RAM/VRAM ist fast voll. Dies kann zu Systeminstabilität führen.

+
+ +
+
+ `; + } + + // Simulierter Update-Check (Idealerweise vom Backend, hier als permanenter Button wenn man manuell checken will, + // oder wir blenden ihn ein wenn ein lokales flag gesetzt ist. Wir zeigen ihn hier als Feature-Highlight) + // Da wir aktuell keinen echten Git-Check im Backend haben, zeigen wir einen "Update Prüfen" Button in den QuickActions. + } + + // 3 Standard Kacheln (Cookbook, Server-Status, Aktivität/Guides) + $("#ov-quick").innerHTML = actionsHtml + ` - `; } diff --git a/trigger_remote.py b/trigger_remote.py new file mode 100644 index 0000000..9f23309 --- /dev/null +++ b/trigger_remote.py @@ -0,0 +1,21 @@ +import paramiko + +host = '192.168.178.153' +user = 'hitonabi' +password = 'Tu77ceu2zzvx!' + +print("Connecting to server...") +ssh = paramiko.SSHClient() +ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) +ssh.connect(host, username=user, password=password, look_for_keys=False, allow_agent=False) + +cmd = f"echo {password} | sudo -S bash /home/hitonabi/mission-control/deploy_bosgame.sh" + +print(f"Executing deployment script on server...") +stdin, stdout, stderr = ssh.exec_command(cmd) +exit_status = stdout.channel.recv_exit_status() +print("STDOUT:", stdout.read().decode()) +print("STDERR:", stderr.read().decode()) + +ssh.close() +print("Deployment complete!") diff --git a/update.tar.gz b/update.tar.gz index 312463b..3fc4a09 100644 Binary files a/update.tar.gz and b/update.tar.gz differ