summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status/htdocs/luci-static
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-12-17 15:00:24 +0100
committerJo-Philipp Wich <jo@mein.io>2022-12-17 15:01:46 +0100
commita27d2dbc32785c3389ea77a26714e7f6c67c9185 (patch)
tree578eed51469131c4ca9bdfe16894f964fc636453 /modules/luci-mod-status/htdocs/luci-static
parent05194712bb2119b79041f256c44e35a044594f75 (diff)
luci-base, luci-mod-status: expose LuCI version via ubus
Instead of scraping the LuCI version from Lua sources, fetch it via ubus in order to be independent from the Lua runtime. Fixes: #6154 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-status/htdocs/luci-static')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
index ae7efa3e75..45f7b4acae 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
@@ -3,6 +3,11 @@
'require fs';
'require rpc';
+var callLuciVersion = rpc.declare({
+ object: 'luci',
+ method: 'getVersion'
+});
+
var callSystemBoard = rpc.declare({
object: 'system',
method: 'board'
@@ -20,7 +25,7 @@ return baseclass.extend({
return Promise.all([
L.resolveDefault(callSystemBoard(), {}),
L.resolveDefault(callSystemInfo(), {}),
- fs.lines('/usr/lib/lua/luci/version.lua')
+ L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' })
]);
},
@@ -29,11 +34,7 @@ return baseclass.extend({
systeminfo = data[1],
luciversion = data[2];
- luciversion = luciversion.filter(function(l) {
- return l.match(/^\s*(luciname|luciversion)\s*=/);
- }).map(function(l) {
- return l.replace(/^\s*\w+\s*=\s*['"]([^'"]+)['"].*$/, '$1');
- }).join(' ');
+ luciversion = luciversion.branch + ' ' + luciversion.revision;
var datestr = null;