Start & unblock all buttons

This commit is contained in:
Ruben van de Ven 2019-11-13 12:20:32 +01:00
parent a264ceee51
commit 163b4821f3
2 changed files with 24 additions and 1 deletions

View file

@ -32,6 +32,11 @@
<span :id="'change-lang-' + lang.code" class='switch btn lang--btn' @click="changeLanguageForAvailable(lang.code)">Switch free</span> <span :id="'change-lang-' + lang.code" class='switch btn lang--btn' @click="changeLanguageForAvailable(lang.code)">Switch free</span>
</li> </li>
</ul> </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>
<div class='hugvey' v-for="hv in hugveys" <div class='hugvey' v-for="hv in hugveys"

View file

@ -86,7 +86,25 @@ class Panopticon {
panopticon.hugveys.logbook = []; panopticon.hugveys.logbook = [];
panopticon.hugveys.logbookId = null; panopticon.hugveys.logbookId = null;
panopticon.updateSelectedHugvey(); 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)
}
}
},
} }
} ); } );