luci-base: form.js: allow secondary configs to fail loading
Ref: https://forum.openwrt.org/t/luci-rpc-error/61760
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 17ffc84a29
)
This commit is contained in:
parent
6d072352b3
commit
561de16a5d
1 changed files with 10 additions and 2 deletions
|
@ -520,8 +520,16 @@ var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
|
|||
* an error.
|
||||
*/
|
||||
load: function() {
|
||||
return this.data.load(this.parsechain || [ this.config ])
|
||||
.then(this.loadChildren.bind(this));
|
||||
var loadTasks = [],
|
||||
configs = this.parsechain || [ this.config ];
|
||||
|
||||
loadTasks.push.apply(loadTasks, configs.map(L.bind(function(config, i) {
|
||||
return i ? L.resolveDefault(this.data.load(config)) : this.data.load(config);
|
||||
}, this)));
|
||||
|
||||
return Promise.all(loadTasks).then(L.bind(function(res) {
|
||||
return this.loadChildren();
|
||||
}, this));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue