| <!-- |
| Copyright 2024 The Go Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style |
| license that can be found in the LICENSE file. |
| --> |
| <!doctype html> |
| <html> |
| {{template "head" .}} |
| <body> |
| {{template "header" .}} |
| {{template "overview-result" .}} |
| </body> |
| </html> |
| |
| {{define "show-rawoutput"}} |
| <div class="toggle" onclick="toggleRawOutput()">[show raw LLM output]</div> |
| <div id="rawoutput" class="start-hidden"> |
| <pre>{{.Raw.Response}}</pre> |
| </div> |
| <script> |
| function toggleRawOutput() { |
| var x = document.getElementById("rawoutput"); |
| toggle(x) |
| } |
| </script> |
| {{end}} |
| |
| |
| {{define "show-prompt"}} |
| <div class="toggle" onclick="togglePrompt()">[show prompt]</div> |
| <div id="prompt" class="start-hidden"> |
| <ul> |
| {{- range .Raw.Prompt -}} |
| <li> |
| <pre>{{.}}</pre> |
| </li> |
| {{- end -}} |
| </ul> |
| </div> |
| <script> |
| function togglePrompt() { |
| var x = document.getElementById("prompt"); |
| toggle(x) |
| } |
| </script> |
| {{end}} |
| |
| {{define "show-policy"}} |
| {{with .Raw.PolicyEvaluation}} |
| <div class="toggle" onclick="togglePolicy()">[show policy evaluation]</div> |
| <div id="policy" class="start-hidden"> |
| <pre>{{.Display}}</pre> |
| </div> |
| {{end}} |
| <script> |
| function togglePolicy() { |
| var x = document.getElementById("policy"); |
| toggle(x) |
| } |
| </script> |
| {{end}} |
| |
| {{define "overview-result"}} |
| <div class="section" id="result"> |
| {{- with .Error -}} |
| <p>Error: {{.Error}}</p> |
| {{- else with .Result -}} |
| <div class="result"> |
| <p><a href="{{.Issue.HTMLURL}}" target="_blank">{{.Issue.HTMLURL}}</a></p> |
| <p><strong>{{.Issue.Title}}</strong></p> |
| <p>author: {{.Issue.User.Login}} | state: {{.Issue.State}} | created: {{fmttime .Issue.CreatedAt}} | updated: {{fmttime .Issue.UpdatedAt}}{{with .TotalComments}} | total comments: {{.}}{{end}}</p> |
| <p><a href="{{.Related}}" target="_blank">[Search for related issues]</a></p> |
| <p>AI-generated overview of {{.Desc}}{{if .Raw.Cached}} (cached){{end}}:</p> |
| <div id="overview">{{.Display}}</div> |
| </div> |
| {{template "show-rawoutput" .}} |
| {{template "show-prompt" .}} |
| {{template "show-policy" .}} |
| {{- else }} |
| {{if .Params.Query}}<p>No result.</p>{{end}} |
| {{- end}} |
| </div> |
| {{end}} |