Because the menu JSON can have 'depends' in them, uci changes
should force the menu to regenerate.
Closes #6423
Signed-off-by: James Haggerty <james.haggerty@morsemicro.com>
Signed-off-by: Paul Donald <newtwen@gmail.com>
window.setTimeout(try_confirm, 250);
else
return Promise.reject(rv);
+ } else {
+ document.dispatchEvent(new CustomEvent('uci-applied'));
}
return rv;
}
});
+// Because the menu can depend on uci values, we need to flush the cache
+// after uci mutations.
+document.addEventListener('uci-applied', () => UIMenu.flushCache());
+
/**
* @class ui
* @memberof LuCI
firstchild_ineligible: 'bool'
};
- let files = glob('/usr/share/luci/menu.d/*.json', '/usr/lib/lua/luci/controller/*.lua', '/usr/lib/lua/luci/controller/*/*.lua');
+ let files = glob('/usr/share/luci/menu.d/*.json', '/etc/config/*', '/usr/lib/lua/luci/controller/*.lua', '/usr/lib/lua/luci/controller/*/*.lua');
let cachefile;
if (indexcache) {