mirror of https://github.com/immortalwrt/luci.git
luci-app-vlmcsd: use load to render configuration file
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
334d08830a
commit
9e60a47c0d
|
@ -13,7 +13,7 @@ const callServiceList = rpc.declare({
|
||||||
});
|
});
|
||||||
|
|
||||||
function getServiceStatus() {
|
function getServiceStatus() {
|
||||||
return L.resolveDefault(callServiceList('vlmcsd'), {}).then(res =>
|
return L.resolveDefault(callServiceList('vlmcsd'), {}).then(res =>
|
||||||
res?.['vlmcsd']?.['instances']?.['vlmcsd']?.['running']
|
res?.['vlmcsd']?.['instances']?.['vlmcsd']?.['running']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,8 @@ return view.extend({
|
||||||
null,
|
null,
|
||||||
_("This is the content of the file '/etc/vlmcsd.ini', you can edit it here, usually no modification is needed."));
|
_("This is the content of the file '/etc/vlmcsd.ini', you can edit it here, usually no modification is needed."));
|
||||||
o.rows = 20;
|
o.rows = 20;
|
||||||
o.cfgvalue = () => fs.trimmed('/etc/vlmcsd.ini');
|
o.monospace = true;
|
||||||
|
o.load = () => fs.trimmed('/etc/vlmcsd.ini');
|
||||||
o.write = (_, value) => fs.write('/etc/vlmcsd.ini', value.trim().replace(/\r\n/g, '\n') + '\n');
|
o.write = (_, value) => fs.write('/etc/vlmcsd.ini', value.trim().replace(/\r\n/g, '\n') + '\n');
|
||||||
|
|
||||||
return m.render();
|
return m.render();
|
||||||
|
|
Loading…
Reference in New Issue