chore(webui): refactored states and versions routes

This commit is contained in:
Julien Dessaux 2025-02-23 22:06:46 +01:00
parent 6fd1663d8c
commit fb98b4fffe
Signed by: adyxax
GPG key ID: F92E51B86E07177E
8 changed files with 78 additions and 75 deletions

View file

@ -17,10 +17,10 @@
<tbody>
{{ range .States }}
<tr>
<td><a href="/state/{{ .Id }}">{{ .Path }}</a></td>
<td><a href="/state/{{ .Id }}">{{ .Updated }}</a></td>
<td><a href="/states/{{ .Id }}">{{ .Path }}</a></td>
<td><a href="/states/{{ .Id }}">{{ .Updated }}</a></td>
<td>
<a href="/state/{{ .Id }}">
<a href="/states/{{ .Id }}">
{{ if eq .Lock nil }}no{{ else }}
<span>yes</span>
<div class="tooltip left max">

View file

@ -20,8 +20,8 @@
<tbody>
{{ range .Versions }}
<tr>
<td><a href="/version/{{ .Id }}">{{ index $.Usernames .AccountId }}</a></td>
<td><a href="/version/{{ .Id }}">{{ .Created }}</a></td>
<td><a href="/versions/{{ .Id }}">{{ index $.Usernames .AccountId }}</a></td>
<td><a href="/versions/{{ .Id }}">{{ .Created }}</a></td>
</tr>
{{ end }}
</tbody>

View file

@ -1,10 +0,0 @@
{{ define "main" }}
<main class="responsive" id="main">
<p>
Created by
<a href="/users/{{ .Account.Id }}">{{ .Account.Username }}</a>
at {{ .Version.Created }}
</p>
<pre>{{ .VersionData }}</pre>
</main>
{{ end }}

View file

@ -0,0 +1,23 @@
{{ define "main" }}
<main class="responsive" id="main">
<p>
Created by
<a href="/users/{{ .Account.Id }}">{{ .Account.Username }}</a>
at {{ .Version.Created }}
</p>
<div>
<div class="tabs">
<a data-ui="#explorer" class="active">Explorer</a>
<a data-ui="#raw">Raw</a>
</div>
<div id="explorer" class="page padding active">
<article class="border medium no-padding center-align middle-align">
<progress class="circle large"></progress>
</article>
</div>
<div id="raw" class="page padding">
<pre><code id="raw-state">{{ .VersionData }}</code></pre>
</div>
</div>
</main>
{{ end }}