Add device charge-all route, last-charged column, and CSRF fix for quick-assign

This commit is contained in:
2026-06-05 20:08:19 -05:00
parent de986a9305
commit 55ce963d79
4 changed files with 135 additions and 19 deletions
+7 -3
View File
@@ -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();
}