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
}
- <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">
// 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>
- <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>