mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2025-12-18 05:28:15 +03:00
luci: Add showing CPU arch
This commit is contained in:
@@ -47,6 +47,7 @@ return view.extend({
|
|||||||
fs.exec('/bin/busybox', [ 'ps' ]), // process list
|
fs.exec('/bin/busybox', [ 'ps' ]), // process list
|
||||||
fs.exec(tools.packager.path, tools.packager.args), // installed packages
|
fs.exec(tools.packager.path, tools.packager.args), // installed packages
|
||||||
tools.getStratList(), // nfqws strategy list
|
tools.getStratList(), // nfqws strategy list
|
||||||
|
fs.exec('sh', [ '-c', '. /etc/openwrt_release && printf "%s" "$DISTRIB_ARCH"' ]), // CPU arch
|
||||||
uci.load(tools.appName), // config
|
uci.load(tools.appName), // config
|
||||||
]).catch(e => {
|
]).catch(e => {
|
||||||
ui.addNotification(null, E('p', _('Unable to execute or read contents')
|
ui.addNotification(null, E('p', _('Unable to execute or read contents')
|
||||||
@@ -60,7 +61,7 @@ return view.extend({
|
|||||||
let cfg = uci.get(tools.appName, 'config');
|
let cfg = uci.get(tools.appName, 'config');
|
||||||
if (!status_array || cfg == null || typeof(cfg) !== 'object') {
|
if (!status_array || cfg == null || typeof(cfg) !== 'object') {
|
||||||
let elem_status = elems.status || document.getElementById("status");
|
let elem_status = elems.status || document.getElementById("status");
|
||||||
elem_status.innerHTML = tools.makeStatusString(null);
|
elem_status.innerHTML = tools.makeStatusString(null, '', '');
|
||||||
ui.addNotification(null, E('p', _('Unable to read the contents') + ': setAppStatus()'));
|
ui.addNotification(null, E('p', _('Unable to read the contents') + ': setAppStatus()'));
|
||||||
this.disableButtons(true, -1, elems);
|
this.disableButtons(true, -1, elems);
|
||||||
return;
|
return;
|
||||||
@@ -71,6 +72,9 @@ return view.extend({
|
|||||||
let proc_list = status_array[3]; // stdout: multiline text
|
let proc_list = status_array[3]; // stdout: multiline text
|
||||||
let pkg_list = status_array[4]; // stdout: installed packages
|
let pkg_list = status_array[4]; // stdout: installed packages
|
||||||
this.nfqws_strat_list = status_array[5]; // array of strat names
|
this.nfqws_strat_list = status_array[5]; // array of strat names
|
||||||
|
let pkg_arch = status_array[6]; // stdout: CPU arch
|
||||||
|
|
||||||
|
this.pkg_arch = (pkg_arch.code == 0) ? pkg_arch.stdout.trim() : 'unknown';
|
||||||
|
|
||||||
//console.log('svc_en: ' + svc_en.code);
|
//console.log('svc_en: ' + svc_en.code);
|
||||||
svc_en = (svc_en.code == 0) ? true : false;
|
svc_en = (svc_en.code == 0) ? true : false;
|
||||||
@@ -117,7 +121,7 @@ return view.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
let elem_status = elems.status || document.getElementById("status");
|
let elem_status = elems.status || document.getElementById("status");
|
||||||
elem_status.innerHTML = tools.makeStatusString(svcinfo, cfg.FWTYPE, 'user_only');
|
elem_status.innerHTML = tools.makeStatusString(svcinfo, this.pkg_arch, '');
|
||||||
|
|
||||||
if (!poll.active()) {
|
if (!poll.active()) {
|
||||||
poll.start();
|
poll.start();
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ return baseclass.extend({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
makeStatusString: function(svcinfo, fwtype, bllist_preset) {
|
makeStatusString: function(svcinfo, pkg_arch, bllist_preset) {
|
||||||
let svc_autorun = _('Unknown');
|
let svc_autorun = _('Unknown');
|
||||||
let svc_daemons = _('Unknown');
|
let svc_daemons = _('Unknown');
|
||||||
|
|
||||||
@@ -299,6 +299,14 @@ return baseclass.extend({
|
|||||||
let td_name_style = `style="width: ${td_name_width}%; min-width:${td_name_width}%; max-width:${td_name_width}%;"`;
|
let td_name_style = `style="width: ${td_name_width}%; min-width:${td_name_width}%; max-width:${td_name_width}%;"`;
|
||||||
let out = `
|
let out = `
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
<tr class="tr">
|
||||||
|
<td class="td left" ${td_name_style}>
|
||||||
|
${_('CPU architecture')}:
|
||||||
|
</td>
|
||||||
|
<td class="td left">
|
||||||
|
${pkg_arch}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr class="tr">
|
<tr class="tr">
|
||||||
<td class="td left" ${td_name_style}>
|
<td class="td left" ${td_name_style}>
|
||||||
${_('Service autorun status')}:
|
${_('Service autorun status')}:
|
||||||
|
|||||||
Reference in New Issue
Block a user