Start & unblock all buttons
This commit is contained in:
parent
a264ceee51
commit
163b4821f3
2 changed files with 24 additions and 1 deletions
|
@ -33,6 +33,11 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<div class='hvactions'>
|
||||
<span class='btn' id='unblock-all' @click="unblockAll">Unblock all</span>
|
||||
<span class='btn' id='start-all' @click="startAll">Start all</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class='hugvey' v-for="hv in hugveys"
|
||||
:class="[{'hugvey--on': hv.status != 'off'},'hugvey--' + hv.status, 'hugvey--light-' + hv.light_on]"
|
||||
|
|
|
@ -86,8 +86,26 @@ class Panopticon {
|
|||
panopticon.hugveys.logbook = [];
|
||||
panopticon.hugveys.logbookId = null;
|
||||
panopticon.updateSelectedHugvey();
|
||||
},
|
||||
unblockAll: function(){
|
||||
for(let hv of panopticon.hugveys.hugveys) {
|
||||
console.log(hv, this);
|
||||
if(hv.status == 'blocked') {
|
||||
hv.status = "loading";
|
||||
return panopticon.unblock(hv.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
startAll: function(){
|
||||
for(let hv of panopticon.hugveys.hugveys) {
|
||||
console.log(hv, this);
|
||||
if(hv.status == 'available') {
|
||||
hv.status = "loading";
|
||||
return panopticon.restart(hv.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue