Counters for buttons
This commit is contained in:
parent
163b4821f3
commit
b3f3bc9ca2
2 changed files with 16 additions and 2 deletions
|
@ -34,8 +34,8 @@
|
|||
</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>
|
||||
<span class='btn' id='unblock-all' @click="unblockAll">Unblock all ({{blockedHugveys}})</span>
|
||||
<span class='btn' id='start-all' @click="startAll">Start all ({{availableHugveys}})</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -17,6 +17,8 @@ class Panopticon {
|
|||
logbook: "",
|
||||
logbookId: null,
|
||||
selectedLang: null,
|
||||
blockedHugveys: 0,
|
||||
availableHugveys: 0,
|
||||
},
|
||||
methods: {
|
||||
time_passed: function( hugvey, property ) {
|
||||
|
@ -161,6 +163,18 @@ class Panopticon {
|
|||
if(this.hugveys.selectedId) {
|
||||
this.updateSelectedHugvey();
|
||||
}
|
||||
|
||||
let avail = 0;
|
||||
let blocked = 0;
|
||||
for(let hv of this.hugveys.hugveys) {
|
||||
if(hv.status =='available') avail ++;
|
||||
if(hv.status =='blocked') blocked ++;
|
||||
}
|
||||
|
||||
this.hugveys.blockedHugveys = blocked;
|
||||
this.hugveys.availableHugveys = avail;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'log':
|
||||
|
|
Loading…
Reference in a new issue