]> git.example.dev Git - binbsis50-sm.git/commitdiff
updated: some basic style elements
author2weiEmu <saalbach.robert@outlook.de>
Mon, 15 Jun 2026 13:52:10 +0000 (15:52 +0200)
committer2weiEmu <saalbach.robert@outlook.de>
Mon, 15 Jun 2026 13:52:10 +0000 (15:52 +0200)
pkg/dbhandling/songsapi.go
public/css/index.css
public/index.html
public/js/index.js
public/js/room.js
public/rooms.html
songmanager

index 4022a4bace2fa85e11983850bfb8ad158202e2dc..5489e0f403852cf4e28de9b3c27837479d5590d7 100644 (file)
@@ -233,6 +233,7 @@ func (dbw *DBWrapper) SongsRestart(w http.ResponseWriter, r *http.Request) {
        out, err := exec.Command("/bin/sh", "-c", "sudo docker ps -aqf ancestor=sis50binb:latest").Output()
        if err != nil {
                w.WriteHeader(http.StatusInternalServerError)
+               w.Write([]byte("Failed to find the id of the docker container that is running: " + err.Error()))
                return
        }
 
@@ -240,17 +241,20 @@ func (dbw *DBWrapper) SongsRestart(w http.ResponseWriter, r *http.Request) {
        err = exec.Command("/bin/sh", "-c", "sudo docker stop", id).Run()
        if err != nil {
                w.WriteHeader(http.StatusInternalServerError)
+               w.Write([]byte("Failed to stop the docker container that is running sis50binb: " + err.Error()))
                return
        }
        err = exec.Command("/bin/sh", "-c", "sudo docker rm", id).Run()
        if err != nil {
                w.WriteHeader(http.StatusInternalServerError)
+               w.Write([]byte("Failed to delete dockere container that is running sis50binb: " + err.Error()))
                return
        }
 
        err = exec.Command("/bin/sh", "-c", "sudo", dbw.BinbLocation + "./launch.sh").Run()
        if err != nil {
                w.WriteHeader(http.StatusInternalServerError)
+               w.Write([]byte("Failed to launch sis50binb at the given Binblocation: " + err.Error()))
                return
        }
 
index f52d6c74f8ded47613b91a933f877610da47d51e..2ee1b137debd9f765484745d8e766b9c13138e70 100644 (file)
@@ -2,15 +2,34 @@
        font-family: sans-serif;
 }
 
+button {
+       padding: 5px;
+       border: none;
+       border-radius: 6px;
+       background-color: #bcdee0;
+}
+
+button:hover {
+       background-color: #4be8f2;
+}
+
 #innerSongList, #innerSongFileList {
-       max-height: 50vh;
        overflow-y: scroll;
+       height: 50vh;
+       max-width: 50vw;
+       border: 1px solid grey;
+       border-radius: 10px;
 }
 
 
 .songElement {
        display: flex;
        margin: 10px;
+       max-width: 40vw;
+       border-radius: 5px;
+       box-shadow: grey 3px 3px 2px;
+       border: 1px solid grey;
+       padding: 4px;
 
        * {
                margin: auto 10px auto 10px;
 
 .songFileElement {
        display: flex;
+       margin: 10px;
+       max-width: 40vw;
+       border-radius: 5px;
+       box-shadow: grey 3px 3px 2px;
+       border: 1px solid grey;
+       padding: 4px;
 }
 
 .success {
index b1ec508d394da3fbab6c11a445a4dd696b6515a0..224c9e12198747ce5e2957e4cce497f732b1c0f6 100644 (file)
@@ -18,6 +18,7 @@
                                <input placeholder="Name of a song..." id="songFilterName"></input>
                                <input placeholder="Name of an artist..." id="songFilterArtist"></input>
                                <input id="songFilterInDB" type="checkbox">In DB</input>
+                               <input id="songFilterNotInDB" type="checkbox">Not In DB</input>
                                <button id="" onclick="getSongList()">Update Songs</button>
                        </div>
 
                        </div>
 
                </div>
-               <div id="songFileFilterInputs">
-                       <input placeholder="File name..." id="songFileFilterName"></input>
-               </div>
-               <div id="innerSongFileList">
+               <hr>
+               <div>
+                       <h1><u>File List</u></h1>
+                       <div id="songFileFilterInputs">
+                               <input placeholder="File name..." id="songFileFilterName"></input>
+                       </div>
+                       <div id="innerSongFileList">
+                       </div>
                </div>
        </body>
 
index 76825fa95374eef25ed488bc8f1a26e14a0eb5db..f5f4da16370813074b980e76bd10119374ddca90 100644 (file)
@@ -216,6 +216,7 @@ let songFilterInput = document.getElementById("songFilterInput")
 let songFilterName = document.getElementById("songFilterName")
 let songFilterArtist = document.getElementById("songFilterArtist")
 let songFilterInDB = document.getElementById("songFilterInDB")
+let songFilterNotInDB = document.getElementById("songFilterNotInDB")
 
 /**
  * Get the current state of filters, with fields NameFilter, ArtistFilter, DBFilter
@@ -227,6 +228,7 @@ function getFilterStates() {
        filterStates.NameFilter = songFilterName.value.toLowerCase()
        filterStates.ArtistFilter = songFilterArtist.value.toLowerCase()
        filterStates.DBFilter = songFilterInDB.checked
+       filterStates.NotDBFilter = songFilterNotInDB.checked
 
        return filterStates
 }
@@ -235,6 +237,11 @@ function updateSongListWithFilter(_) {
        // get the filter states
        let filters = getFilterStates()
 
+       if (filters.DBFilter && filters.NotDBFilter) {
+               alert("Contradicting filters.")
+               return
+       }
+
        // deep copy
        let filteredList = [...songList]
 
@@ -243,6 +250,10 @@ function updateSongListWithFilter(_) {
                filteredList = filteredList.filter((v, _1, _2) => { return SongURLExists(v.PreviewURL)})
        }
 
+       if (filters.NotDBFilter) {
+               filteredList = filteredList.filter((v, _1, _2) => { return !SongURLExists(v.PreviewURL)})
+       }
+
        if (filters.NameFilter != "") {
                filteredList = filteredList.filter((v, _1, _2) => {
                        return v.TrackName.toLowerCase().includes(filters.NameFilter.toLowerCase())
@@ -263,6 +274,7 @@ function updateSongListWithFilter(_) {
 songFilterName.oninput = (event) => {updateSongListWithFilter(event)}
 songFilterArtist.oninput = (event) => {updateSongListWithFilter(event)}
 songFilterInDB.oninput = (event) => {updateSongListWithFilter(event)}
+songFilterNotInDB.oninput = (event) => {updateSongListWithFilter(event)}
 
 /**
  * EDIT MENU FOR SONGS
index e32b555a6a7ebded084d9c6b88e75b75632af482..f73ffa4db0a736f65e5166dc030b0b80cf84fcc1 100644 (file)
@@ -1,3 +1,19 @@
+/**
+ * RESTART
+ **/
+let restartButton = document.getElementById("restartButton")
+
+restartButton.addEventListener("click", async (_) => {
+       let response = await fetch("/rebootapp")
+       if (response.status != 200) {
+               alert(await response.text())
+               return
+       }
+
+       alert("Rebooted the app.")
+})
+
+
 /**
  * ROOM CREATION
  **/
index 8191ea7d4327fd0ef67a591c0c070b5eb0bdaf13..9084726049d1eb3b44e11e9bba80460a54a7fdab 100644 (file)
@@ -8,6 +8,7 @@
 
        <body>
                <a href="/">Home</a>
+               <button id="restartButton">Restart (should update rooms)</button>
                <button id="createRoomButton">Make a New Room</button>
                <label for="rooms">Select a Room to View</label>
                <select name="rooms" id="roomSelect">
index 36a3040f94137519c60db752d227d64f23805069..f75e0335c4e3fae45670a3668712d740c980f1a9 100755 (executable)
Binary files a/songmanager and b/songmanager differ