選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

115 行
4.6KB

  1. {{define "settings"}}
  2. <!doctype html>
  3. <html lang="en">
  4. <head>
  5. <title>{{.Title}}</title>
  6. {{template "head" .}}
  7. </head>
  8. <body>
  9. {{template "nav" .}}
  10. {{if .Msg}}<div class="flash flash-ok">{{.Msg}}</div>{{end}}
  11. {{if .Err}}<div class="flash flash-err">{{.Err}}</div>{{end}}
  12. <h1>Settings</h1>
  13. <p>QC-Settings plus LLM- und globale Prompt-/Systemsteuerung fuer den spaeteren LLM-Flow.</p>
  14. <table>
  15. <tr><th>QC Base URL</th><td class="mono">{{.QCBaseURL}}</td></tr>
  16. <tr><th>Bearer token configured</th><td>{{if .TokenConfigured}}yes{{else}}no{{end}}</td></tr>
  17. <tr><th>Poll interval (seconds)</th><td>{{.PollIntervalSeconds}}</td></tr>
  18. <tr><th>Poll timeout (seconds)</th><td>{{.PollTimeoutSeconds}}</td></tr>
  19. <tr><th>Poll max concurrent</th><td>{{.PollMaxConcurrent}}</td></tr>
  20. <tr><th>Language output mode</th><td>{{.LanguageOutputMode}}</td></tr>
  21. </table>
  22. <h2>LLM Provider / Modell</h2>
  23. <p><small>Phase-A-Grundlage: Provider, Modell, optionale Base URL (Ollama/kompatibel) und provider-spezifische API-Keys.</small></p>
  24. <form method="post" action="/settings/llm">
  25. <div>
  26. <label>Provider
  27. <select id="llm-provider" name="llm_provider">
  28. {{range .LLMProviderOptions}}
  29. <option value="{{.Value}}" {{if eq $.LLMActiveProvider .Value}}selected{{end}}>{{.Label}}</option>
  30. {{end}}
  31. </select>
  32. </label>
  33. </div>
  34. <div>
  35. <label>Model
  36. <select name="llm_model">
  37. {{range .LLMModelOptions}}
  38. <option value="{{.Value}}" {{if eq $.LLMActiveModel .Value}}selected{{end}}>{{.Label}}</option>
  39. {{end}}
  40. </select>
  41. </label>
  42. </div>
  43. <div id="llm-base-url-wrap" {{if ne .LLMActiveProvider "ollama"}}style="display:none;"{{end}}>
  44. <label>Base URL (nur Ollama / kompatible Endpoints)
  45. <input type="url" name="llm_base_url" placeholder="http://localhost:11434/v1" value="{{.LLMBaseURL}}">
  46. </label>
  47. </div>
  48. <div>
  49. <label>OpenAI API Key ({{if .OpenAIKeyConfigured}}configured{{else}}not configured{{end}})
  50. <input type="password" name="llm_api_key_openai" placeholder="leer lassen = unveraendert">
  51. </label>
  52. </div>
  53. <div>
  54. <label>Anthropic API Key ({{if .AnthropicKeyConfigured}}configured{{else}}not configured{{end}})
  55. <input type="password" name="llm_api_key_anthropic" placeholder="leer lassen = unveraendert">
  56. </label>
  57. </div>
  58. <div>
  59. <label>Google API Key ({{if .GoogleKeyConfigured}}configured{{else}}not configured{{end}})
  60. <input type="password" name="llm_api_key_google" placeholder="leer lassen = unveraendert">
  61. </label>
  62. </div>
  63. <div>
  64. <label>xAI API Key ({{if .XAIKeyConfigured}}configured{{else}}not configured{{end}})
  65. <input type="password" name="llm_api_key_xai" placeholder="leer lassen = unveraendert">
  66. </label>
  67. </div>
  68. <div>
  69. <label>Ollama API Key (optional; {{if .OllamaKeyConfigured}}configured{{else}}not configured{{end}})
  70. <input type="password" name="llm_api_key_ollama" placeholder="leer lassen = unveraendert">
  71. </label>
  72. </div>
  73. <button type="submit">LLM-Settings speichern</button>
  74. </form>
  75. <h2>Globaler Master Prompt</h2>
  76. <p><small>Diese Einstellungen gelten systemweit und werden im normalen Build-/Review-Formular nicht mehr direkt editiert.</small></p>
  77. <form method="post" action="/settings/prompt">
  78. <input type="hidden" name="prompt_block_count" value="{{len .PromptBlocks}}">
  79. <div>
  80. <label>Master Prompt
  81. <textarea name="master_prompt">{{.MasterPrompt}}</textarea>
  82. </label>
  83. </div>
  84. <h3>Prompt-Bloecke (Standard)</h3>
  85. {{range $i, $block := .PromptBlocks}}
  86. <input type="hidden" name="prompt_block_id_{{$i}}" value="{{$block.ID}}">
  87. <div>
  88. <label>
  89. <input type="checkbox" name="prompt_block_enabled_{{$i}}" {{if $block.Enabled}}checked{{end}}>
  90. {{$block.Label}}
  91. </label>
  92. <input type="hidden" name="prompt_block_label_{{$i}}" value="{{$block.Label}}">
  93. <textarea name="prompt_block_instruction_{{$i}}">{{$block.Instruction}}</textarea>
  94. </div>
  95. {{end}}
  96. <button type="submit">Prompt-Settings speichern</button>
  97. </form>
  98. <script>
  99. (function () {
  100. var provider = document.getElementById('llm-provider');
  101. var baseUrlWrap = document.getElementById('llm-base-url-wrap');
  102. if (!provider || !baseUrlWrap) return;
  103. var syncBaseURLVisibility = function () {
  104. baseUrlWrap.style.display = provider.value === 'ollama' ? '' : 'none';
  105. };
  106. provider.addEventListener('change', syncBaseURLVisibility);
  107. syncBaseURLVisibility();
  108. })();
  109. </script>
  110. </body>
  111. </html>
  112. {{end}}