Add device charge-all route, last-charged column, and CSRF fix for quick-assign
This commit is contained in:
@@ -324,6 +324,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var CSRF_TOKEN = '{{ csrf_token() }}';
|
||||
var selectAll = document.getElementById('select-all');
|
||||
var toolbar = document.getElementById('bulk-toolbar');
|
||||
var countEl = document.getElementById('selected-count');
|
||||
@@ -471,9 +472,12 @@ function quickAssign(action, batteryId) {
|
||||
if (!sel.value) { sel.focus(); return; }
|
||||
var f = document.createElement('form');
|
||||
f.method = 'post'; f.action = action;
|
||||
var inp = document.createElement('input');
|
||||
inp.type = 'hidden'; inp.name = 'device_id'; inp.value = sel.value;
|
||||
f.appendChild(inp);
|
||||
var deviceInp = document.createElement('input');
|
||||
deviceInp.type = 'hidden'; deviceInp.name = 'device_id'; deviceInp.value = sel.value;
|
||||
f.appendChild(deviceInp);
|
||||
var csrfInp = document.createElement('input');
|
||||
csrfInp.type = 'hidden'; csrfInp.name = 'csrf_token'; csrfInp.value = CSRF_TOKEN;
|
||||
f.appendChild(csrfInp);
|
||||
document.body.appendChild(f);
|
||||
f.submit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user