luci: Using new function promiseAllDict

This commit is contained in:
remittor
2026-01-28 09:27:34 +03:00
parent 74836c93af
commit 7a6de4434f
2 changed files with 39 additions and 33 deletions

View File

@@ -193,6 +193,20 @@ return baseclass.extend({
}
}
},
promiseAllDict: function(promisesDict)
{
const keys = Object.keys(promisesDict);
const promises = keys.map(key => promisesDict[key]);
return Promise.all(promises)
.then(results => {
const resultDict = { };
keys.forEach((key, index) => {
resultDict[key] = results[index];
});
return resultDict;
});
},
baseLoad: function(ctx, callback)
{