Add an option to accept/reject a group of services

This commit is contained in:
Amauri CHAMPEAUX 2021-02-16 10:35:58 +01:00
parent 14f245ee0c
commit 054dba819b
1 changed files with 6 additions and 1 deletions

View File

@ -864,7 +864,7 @@ var tarteaucitron = {
document.getElementById(id).classList.remove(className); document.getElementById(id).classList.remove(className);
} }
}, },
"respondAll": function (status) { "respondAll": function (status, type) {
"use strict"; "use strict";
var s = tarteaucitron.services, var s = tarteaucitron.services,
service, service,
@ -872,6 +872,11 @@ var tarteaucitron = {
index = 0; index = 0;
for (index = 0; index < tarteaucitron.job.length; index += 1) { for (index = 0; index < tarteaucitron.job.length; index += 1) {
if (typeof type !== 'undefined' && s[tarteaucitron.job[index]].type !== type) {
continue;
}
service = s[tarteaucitron.job[index]]; service = s[tarteaucitron.job[index]];
key = service.key; key = service.key;
if (tarteaucitron.state[key] !== status) { if (tarteaucitron.state[key] !== status) {