feat: Public-Flag für Agents + verfügbare Agents/Bots Endpoints erweitert

- AgentRecord: neues IsPublic-Feld mit DB-Migration
- GET /api/agents/available: eigene + public Agents (alle Properties + isOwner)
- GET /api/telegram/bots/available: alle Properties außer Token/Secret + sessionCount
- Agent-Page: Public-Checkbox (andere User können Agent in Sessions verwenden)
- Dashboard: agentMap aus availableAgents gebaut (public Agents fremder User auflösbar)
- Session-Page + Cronjob-Page: Agent-Picker nutzt /available statt /agents
- Agent-Cards: Public- und Fremd-Badges
- Fix: Chat-Button bei Sessions mit public Agent eines anderen Users nicht mehr disabled
This commit is contained in:
Meleki committed 2026-03-08 20:25:52 +01:00
1 parent ec73ccd71e
commit b0d8bef5ea
11 files changed
+90 -10

No files matched your search

+3 -2
View File
@@ -250,15 +250,16 @@ public static class TelegramEndpoint
foreach (var bot in bots)
{
var isOwner = bot.UserId == userId;
var sessionCount = await db.GetTelegramBotSessionCount(bot.BotId);
result.Add(new
{
botId = bot.BotId,
name = bot.Name,
isOwner,
isPublic = bot.IsPublic,
sessionCount,
createdAt = bot.CreatedAt,
// Token nur für eigene Bots anzeigen
botToken = isOwner ? bot.BotToken : null
updatedAt = bot.UpdatedAt
});
}
await res.WriteAsJsonAsync(result);