src/de/uhilger/mediaz/api/StorageHandler.java | ●●●●● patch | view | raw | blame | history | |
www/ui/app.css | ●●●●● patch | view | raw | blame | history | |
www/ui/data/tpl/geraet_schalt_liste.txt | ●●●●● patch | view | raw | blame | history | |
www/ui/js/app.js | ●●●●● patch | view | raw | blame | history |
src/de/uhilger/mediaz/api/StorageHandler.java
@@ -140,7 +140,10 @@ newList.add(g); } } list = newList; //list = newList; Gson gson = new Gson(); Object o = gson.fromJson(bodyLesen(e), fs.typeFromName(type).getType()); return gson.toJson(newList); } else { list = fs.list(type); } www/ui/app.css
@@ -175,6 +175,42 @@ .schalt-geraet-name { / * background-color: red; */ } .schalt-geraet-false { color: red; } .schalt-geraet-true { color: green; font-weight: bold; } .schalt-btn { display: inline-block; height: 38px; /* padding: 0 30px; */ text-align: center; font-size: 11px; font-weight: 600; line-height: 38px; letter-spacing: .1rem; text-transform: uppercase; text-decoration: none; white-space: nowrap; /* background-color: transparent;*/ border-radius: 4px; border: 1px solid #bbb; cursor: pointer; box-sizing: border-box; } .schalt-btn-ein { color: green; } .schalt-btn-aus { color: red; } .entity-liste-kopf { www/ui/data/tpl/geraet_schalt_liste.txt
@@ -1,9 +1,9 @@ <div class='entity-formular'> {{#ArrayList}} {{#.}} <div class='geraet-schalt-eintrag'> <button class="button schalt-btn" id="ein-btn" gname="{{.}}">Ein</button> <button class="button schalt-btn" id="aus-btn" gname="{{.}}">Aus</button> <div class='schalt-geraet-name entity-eintrag'>{{.}}</div> <button class="schalt-btn schalt-btn-ein" id="ein-btn" gname="{{name}}">Ein</button> <button class="schalt-btn schalt-btn-aus" id="aus-btn" gname="{{name}}">Aus</button> <div class='schalt-geraet-name schalt-geraet-{{status}} entity-eintrag'>{{name}}</div> </div> {{/ArrayList}} {{/.}} </div> www/ui/js/app.js
@@ -166,14 +166,16 @@ var geraetName = event.target.attributes.gname.nodeValue; //var geraetName = document.querySelector('.schalt-geraet-name').textContent; self.http_get('../api/gstrg/geraet/' + geraetName + "/ein", function(responseText) { console.log(responseText); // console.log(responseText); self.geraet_schalt_liste(); }); }); self.addEvtListener('#aus-btn', 'click', function (event) { var geraetName = event.target.attributes.gname.nodeValue; //var geraetName = document.querySelector('.schalt-geraet-name').textContent; self.http_get('../api/gstrg/geraet/' + geraetName + "/aus", function(responseText) { console.log(responseText); // console.log(responseText); self.geraet_schalt_liste(); }); }); });