Improve settings hierarchy conciseness

This commit is contained in:
2026-03-07 16:32:24 +00:00
parent 611de57bf8
commit 10588a18b9
21 changed files with 846 additions and 80 deletions

View File

@@ -482,12 +482,55 @@ class AIExecutionLogSettings(LoginRequiredMixin, View):
"runs": runs,
"operation_breakdown": operation_breakdown,
"model_breakdown": model_breakdown,
"settings_nav": {
"title": "AI",
"tabs": [
{
"label": "Models",
"href": reverse("ai_models"),
"active": str(getattr(request, "path", "") or "")
== reverse("ai_models"),
},
{
"label": "Traces",
"href": reverse("ai_execution_log"),
"active": str(getattr(request, "path", "") or "")
== reverse("ai_execution_log"),
},
],
},
}
def get(self, request):
return render(request, self.template_name, self._context(request))
class AIExecutionRunDetailView(LoginRequiredMixin, View):
template_name = "partials/ai-execution-run-detail.html"
def get(self, request, run_id):
run = get_object_or_404(AIRunLog, id=run_id, user=request.user)
return render(request, self.template_name, {"run": run})
class AIExecutionRunDetailTabView(LoginRequiredMixin, View):
template_name = "partials/ai-execution-run-detail-tab.html"
def get(self, request, run_id, tab_slug):
run = get_object_or_404(AIRunLog, id=run_id, user=request.user)
slug = str(tab_slug or "").strip().lower()
if slug not in {"error"}:
return JsonResponse({"ok": False, "error": "unknown_tab"}, status=404)
return render(
request,
self.template_name,
{
"run": run,
"tab_slug": slug,
},
)
class BusinessPlanEditor(LoginRequiredMixin, View):
template_name = "pages/business-plan-editor.html"