diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-05-21 20:05:01 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-05-21 20:05:01 +0200 |
| commit | 5ee0fb4aa53e02a4b6c2ffb3d5bfa3a6153c9a06 (patch) | |
| tree | 5268e39568e6146521e4be9e0c1b70d3afca538c /web | |
| parent | ead811a4ebd0074cc4d42da53daacbb358229fac (diff) | |
| download | WRMS-5ee0fb4aa53e02a4b6c2ffb3d5bfa3a6153c9a06.tar.gz WRMS-5ee0fb4aa53e02a4b6c2ffb3d5bfa3a6153c9a06.zip | |
implement YAML config and admin connections
Diffstat (limited to 'web')
| -rw-r--r-- | web/client.html | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/web/client.html b/web/client.html index 1d82b45..a371c43 100644 --- a/web/client.html +++ b/web/client.html @@ -72,6 +72,7 @@ } } + let isAdmin = false; let songs = []; let playing = {}; let votes = new Map(); @@ -165,16 +166,16 @@ } function handlePause() { - document.getElementById("ppbutton").innerHTML = 'Play'; + {{if .IsAdmin}} document.getElementById("ppbutton").innerHTML = 'Play'; {{end}} } function handleStop() { - document.getElementById("ppbutton").innerHTML = 'Play'; + {{if .IsAdmin}} document.getElementById("ppbutton").innerHTML = 'Play'; {{end}} playing = document.getElementById("playing").innerHTML = ""; } function handlePlay(currentSong) { - document.getElementById("ppbutton").innerHTML = 'Pause'; + {{if .IsAdmin}} document.getElementById("ppbutton").innerHTML = 'Pause'; {{end}} idx = -1; songs.forEach(function(s, i, a) { if (s.uri == currentSong.uri) idx = i; }); @@ -256,7 +257,7 @@ return false; } - {{if .HasUpload}} + {{if .Config.HasUpload}} function submitUpload() { const form = new FormData(document.getElementById("uploadForm")); const file = form.get("song"); @@ -314,7 +315,7 @@ <button id="searchButton">Search</button> </form> - {{if .HasUpload}} + {{if .Config.HasUpload}} <form id="uploadForm" onsubmit="return submitUpload()"> <input id="uploadInput" name="song" type="file"> <button id="uploadButton", type="submit">Upload</button> @@ -333,9 +334,11 @@ <h2>Playing</h2> <p id='playing'></p> + {{if .IsAdmin}} <div id='controls'> <button id="ppbutton">Play</button> </div> + {{end}} <h2>Playlist</h2> <ul id='playlist'></ul> |
