Weboberfläche (erste Version) mit Anmeldung per Passwort zum Testen

- SPA unter /omega/ ohne Bibliotheken; HTML, CSS, JS und IBM-Plex-Schriften
  eingebettet, Content-Security-Policy nur für den Proxy selbst
- Browser auf / werden nach /omega/ umgeleitet, Ollama-Clients nicht
- Anmeldung mit Passwort (Argon2) nur mit ui.password_login; Sitzung im
  HttpOnly-Cookie (SameSite=Strict), Änderungen nur mit X-Omega-CSRF
- Seiten nach den Mockups: Übersicht, API-Keys mit Aufzeichnung, Konto,
  Gruppen & Kontingente, Sparks & Modelle, Zeitplan, Benutzer, Audit-Log,
  öffentliches Dashboard
- tests/multispark/demo.sh (admin, dozent, student; Passwort 1234), ui_test.py

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Stephan RehfeldandClaude Opus 5.5 committed 2026-11-20 14:42:43 +01:00
1 parent 2c66f7fd0d
commit 7aeb6f9d44
25 files changed
+1581 -6

No files matched your search

+9
View File
@@ -28,6 +28,7 @@ use crate::{
#[derive(Clone)]
pub struct AppState {
pub db: Arc<Db>,
pub ui: Arc<crate::config::UiConfig>,
pub recorder: Arc<Recorder>,
pub sched: Arc<Scheduler>,
/// Ohne Gesamt-Timeout, weil Antworten lange streamen können
@@ -44,6 +45,7 @@ pub fn router(state: AppState) -> Router {
.layer(middleware::from_fn_with_state(state.clone(), auth));
Router::new()
.nest("/omega/api", crate::api::router(state.clone()))
.merge(crate::ui::router())
.merge(proxy)
.layer(DefaultBodyLimit::max(256 * 1024 * 1024))
.with_state(state)
@@ -150,6 +152,13 @@ async fn ollama(
body: Bytes,
) -> Response {
let path = uri.path().to_string();
// Ein Browser auf der Wurzel bekommt die Oberfläche; Ollama-Clients erwarten hier die API.
if path == "/"
&& method == Method::GET
&& headers.get(header::ACCEPT).and_then(|v| v.to_str().ok()).is_some_and(|a| a.contains("text/html"))
{
return axum::response::Redirect::temporary("/omega/").into_response();
}
if path.starts_with("/api/blobs")
|| matches!(path.as_str(), "/api/pull" | "/api/push" | "/api/delete" | "/api/copy" | "/api/create")
{