mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-31 06:40:42 +03:00
luci: Using new function promiseAllDict
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user