FE: add clear sources functionality in multi-edit

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-02-02 15:59:53 +11:00
parent 6d03d58c78
commit b45804f177
21 changed files with 92 additions and 11 deletions

View File

@@ -478,9 +478,14 @@ function deleteEvents30()
function askUnlockFields () {
// Ask
showModalWarning('<?= lang('Maintenance_Tool_UnlockFields_noti');?>', '<?= lang('Maintenance_Tool_UnlockFields_noti_text');?>',
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'unlockFields');
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', () => unlockFields(true));
}
function unlockFields() {
function unlockFields(clearAllFields) {
console.log("clearAllFields");
console.log(clearAllFields);
const apiBase = getApiBase();
const apiToken = getSetting("API_TOKEN");
const url = `${apiBase}/devices/fields/unlock`;
@@ -489,7 +494,7 @@ function unlockFields() {
const payload = {
mac: null, // null = all devices
fields: null, // null = all tracked fields
clearAll: true // clear all source values
clearAll: clearAllFields // clear all source values
};
$.ajax({