]> code.octet-stream.net Git - broadcaster/commitdiff
Various UI improvements
authorThomas Karpiniec <tom.karpiniec@outlook.com>
Mon, 28 Oct 2024 10:36:06 +0000 (21:36 +1100)
committerThomas Karpiniec <tom.karpiniec@outlook.com>
Mon, 28 Oct 2024 10:36:06 +0000 (21:36 +1100)
server/database.go
server/templates/files.html
server/templates/index.html
server/templates/playlists.html

index 5b1361cb8f11a448fab46a0bd0995a3018c03be4..c41b1ad0dcff11eac143e8559893b84babc7dc03 100644 (file)
@@ -157,7 +157,7 @@ func (d *Database) DeletePlaylist(playlistId int) {
 
 func (d *Database) GetPlaylists() []Playlist {
        ret := make([]Playlist, 0)
-       rows, err := d.sqldb.Query("SELECT id, enabled, name, start_time FROM playlists ORDER BY id ASC")
+       rows, err := d.sqldb.Query("SELECT id, enabled, name, start_time FROM playlists ORDER BY start_time DESC")
        if err != nil {
                return ret
        }
index c86c6ceb7cead75331175ba552e6067a0abb81f1..e2054720fc7fee44b98bf653d3938e067af7fa9e 100644 (file)
@@ -1,11 +1,14 @@
 
-      <h1>Files! List</h1>
+      <h1>Audio File Management</h1>
       <p>All files can be downloaded from the <a href="/file-downloads/">public file listing</a>.</p>
-      <ul>
+      <table>
       {{range .Files}}
-        <li><b>{{.Name}}</b><form action="/files/delete" method="POST"><input type="hidden" name="filename" value="{{.Name}}"><input type="submit" value="Delete"></form></li>
+        <tr>
+        <td><b>{{.Name}}</b></td>
+        <td><form action="/files/delete" method="POST"><input type="hidden" name="filename" value="{{.Name}}"><input type="submit" value="Delete"></form></td>
+        </tr>
       {{end}}
-      </ul>
+      </table>
       <h2>Upload New File</h2>
       <p>
       <form action="/files/upload" method="post" enctype="multipart/form-data">
index b688947499a864f36cbecca80beba0839bba4d75..7e870fb9d54772a6172f8d42bbb4cf07952c1db8 100644 (file)
       // initial connection on page load
       connectWebsocket();
     </script>
-
-      <h1>Welcome!</h1>
-      {{if .LoggedIn}}
-      <p>Your username is: {{.Username}}.</p>
-      <p><a href="/logout">Log Out</a></p>
-      {{else}}
-      <p><a href="/login">Log In</a></p>
-      {{end}}
-      <p><a href="/files/">File Management</a></p>
-      <p><a href="/playlists/">Playlist Management</a></p>
-      <p><a href="/radios/">Radio Management</a></p>
-      <h2>Connected Radios</h2>
+      <h1>Connected Radios</h1>
       <div id="connected-radios">
         <i>Loading...</i>
       </div>
index e1ba60f1085c1a1b9322fd38b3967d78b345d73d..e6b6a5a37c560a6037a1938df888eb5423483fc8 100644 (file)
@@ -1,8 +1,9 @@
 
-      <h1>Playlists!</h1>
-      <ul>
+      <h1>Playlist Management</h1>
+      <table>
+      <tr><th>Name</th><th>Enabled?</th><th>Start Time</th><th></th></tr>
       {{range .Playlists}}
-        <li><b>{{.Name}}</b> {{.StartTime}} <a href="/playlists/{{.Id}}">(Edit)</a></li>
+      <tr><td>{{.Name}}</td><td>{{if .Enabled}}✅{{else}}❌{{end}}</td><td>{{.StartTime}}</td><td><a href="/playlists/{{.Id}}">(Edit)</a></td></tr>
       {{end}}
-      </ul>
+      </table>
       <p><a href="/playlists/new">Add New Playlist</a></p>