feat: Avatar Scale (0.5×–3×) + Krea AI Bildgenerierung für Avatare

Backend:
- SessionRecord + AgentRecord: neues Feld AvatarScale (double, Default 1.0)
- DatabaseService: avatar_scale Migration, in Create/Update/GetWithStats
- SessionEndpoint + AgentEndpoint: avatarScale in Create/Update
- api.js: apiKreaStatus(), apiKreaGenerate()

Frontend:
- Session + Agent Templates: Range-Slider (0.5×–3×) in Avatar-Section
- Krea AI Generate: Prompt-Input + Magic-Button (nur wenn KreaToken konfiguriert)
- Live-Preview: transform: scale() auf Avatar-Vorschau
- Dashboard: scale() auf Session- und Agent-Card-Images
- form.css: avatar-scale-row + avatar-ai-section Styling
This commit is contained in:
Meleki committed 2026-03-06 10:59:09 +01:00
1 parent 4ebbeaa818
commit 057d37d76f
11 files changed
+221 -16

No files matched your search

+3 -1
View File
@@ -64,7 +64,8 @@ public static class AgentEndpoint
UseUserInfo = !body.TryGetProperty("useUserInfo", out var uu) || uu.GetBoolean(),
UseMemory = !body.TryGetProperty("useMemory", out var um) || um.GetBoolean(),
UseWebSearch = body.TryGetProperty("webSearchVersion", out var wsv) && !string.IsNullOrEmpty(wsv.GetString()),
WebSearchVersion = body.TryGetProperty("webSearchVersion", out var wsv2) ? wsv2.GetString() ?? "" : ""
WebSearchVersion = body.TryGetProperty("webSearchVersion", out var wsv2) ? wsv2.GetString() ?? "" : "",
AvatarScale = body.TryGetProperty("avatarScale", out var asc) ? asc.GetDouble() : 1.0
};
agent = await db.CreateAgent(agent);
@@ -100,6 +101,7 @@ public static class AgentEndpoint
agent.WebSearchVersion = wsv.GetString() ?? "";
agent.UseWebSearch = !string.IsNullOrEmpty(agent.WebSearchVersion);
}
if (body.TryGetProperty("avatarScale", out var asc)) agent.AvatarScale = asc.GetDouble();
await db.UpdateAgent(agent);
memoryService.InitializeAgentFiles(agentId, agent.Name);
+2 -1
View File
@@ -76,8 +76,9 @@ public static class SessionEndpoint
}
var context = body.TryGetProperty("context", out var ctxEl) ? ctxEl.GetString() : null;
var customCommands = body.TryGetProperty("customCommands", out var cc) && cc.ValueKind != JsonValueKind.Null ? cc.GetRawText() : null;
var avatarScale = body.TryGetProperty("avatarScale", out var asc) ? asc.GetDouble() : 1.0;
var session = await db.CreateSession(userId, name, description, image, agentId, workspace, context, customCommands);
var session = await db.CreateSession(userId, name, description, image, agentId, workspace, context, customCommands, avatarScale);
await ctx.Response.WriteAsJsonAsync(session);
}