luci-app-travelmate: sync with travelmate 2.0.6

* a few (visual) fixes reported in the forum
* emphasize normal uplinks in blue, vpn uplinks in green
* sync translations

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken 2021-08-21 22:04:50 +02:00
parent adbaa8ad5d
commit f1d1e752b8
No known key found for this signature in database
GPG key ID: 9D71CD547BFAE684
36 changed files with 8036 additions and 7875 deletions

View file

@ -14,8 +14,9 @@ function handleAction(ev) {
var ifaceValue;
if (ev === 'restart') {
ifaceValue = String(uci.get('travelmate', 'global', 'trm_iface') || 'trm_wwan');
return fs.exec('/sbin/ifup', [ifaceValue])
.then(fs.exec('/etc/init.d/travelmate', ['restart']))
return fs.exec('/etc/init.d/travelmate', ['stop'])
.then(fs.exec('/sbin/ifup', [ifaceValue]))
.then(fs.exec('/etc/init.d/travelmate', ['start']))
}
if (ev === 'setup') {
ifaceValue = String(uci.get('travelmate', 'global', 'trm_iface') || '');
@ -132,7 +133,6 @@ function handleAction(ev) {
])
]);
});
return;
}
}
@ -156,7 +156,7 @@ return view.extend({
pollData: poll.add(function () {
return L.resolveDefault(fs.stat('/tmp/trm_runtime.json'), null).then(function (res) {
var status = document.getElementById('status');
if (res) {
if (res && res.size > 0) {
L.resolveDefault(fs.read_direct('/tmp/trm_runtime.json'), null).then(function (res) {
if (res) {
var info = JSON.parse(res);
@ -207,6 +207,11 @@ return view.extend({
}
}
});
} else if (status) {
status.textContent = '-';
if (status.classList.contains("spinning")) {
status.classList.remove("spinning");
}
}
});
}, 1);

View file

@ -167,11 +167,11 @@ function handleStatus() {
if (res) {
var info = JSON.parse(res);
if (info) {
var t_device, t_ssid, t_bssid, oldUplinkView, newUplinkView,
var t_device, t_ssid, t_bssid, oldUplinkView, newUplinkView, uplinkColor,
uplinkId = info.data.station_id.trim().split('/'),
oldUplinkView = document.getElementsByName('uplinkStation'),
w_sections = uci.sections('wireless', 'wifi-iface');
w_sections = uci.sections('wireless', 'wifi-iface'),
vpnStatus = info.data.ext_hooks.substr(13, 1);
t_device = uplinkId[0];
t_bssid = uplinkId[uplinkId.length - 1];
for (var i = 1; i < uplinkId.length - 1; i++) {
@ -189,18 +189,22 @@ function handleStatus() {
}
}
else {
uplinkColor = (vpnStatus === "✔" ? 'rgb(68, 170, 68)' : 'rgb(51, 119, 204)');
for (var i = 0; i < w_sections.length; i++) {
newUplinkView = document.getElementById('cbi-wireless-' + w_sections[i]['.name']);
if (t_device === w_sections[i].device && t_ssid === w_sections[i].ssid && t_bssid === (w_sections[i].bssid || '-')) {
if (oldUplinkView.length === 0 && newUplinkView) {
newUplinkView.setAttribute('name', 'uplinkStation');
newUplinkView.setAttribute('style', 'text-align: left !important; color: #37c !important;font-weight: bold !important;');
newUplinkView.setAttribute('style', 'text-align: left !important; color: ' + uplinkColor + ' !important;font-weight: bold !important;');
}
else if (oldUplinkView.length > 0 && newUplinkView && oldUplinkView[0].getAttribute('id') !== newUplinkView.getAttribute('id')) {
oldUplinkView[0].removeAttribute('style');
oldUplinkView[0].removeAttribute('name', 'uplinkStation');
newUplinkView.setAttribute('name', 'uplinkStation');
newUplinkView.setAttribute('style', 'text-align: left !important; color: #37c !important;font-weight: bold !important;');
newUplinkView.setAttribute('style', 'text-align: left !important; color: ' + uplinkColor + ' !important;font-weight: bold !important;');
}
else if (newUplinkView && newUplinkView.style.color != uplinkColor) {
newUplinkView.setAttribute('style', 'text-align: left !important; color: ' + uplinkColor + ' !important;font-weight: bold !important;');
}
}
}
@ -228,8 +232,10 @@ return view.extend({
m = new form.Map('wireless');
m.chain('travelmate');
s = m.section(form.GridSection, 'wifi-iface', null, _('Overview of all configured uplinks for travelmate.<br /> \
You can edit, remove or prioritize existing uplinks by drag \&#38; drop and scan for new ones. The currently used uplink is emphasized in blue.'));
s = m.section(form.GridSection, 'wifi-iface', null, _('Overview of all configured uplinks for travelmate. \
You can edit, remove or prioritize existing uplinks by drag \&#38; drop and scan for new ones.<br /> \
The currently used uplink connection is emphasized in <span style="color:rgb(51, 119, 204);font-weight:bold">blue</span>, \
an encrypted VPN uplink connection is emphasized in <span style="color:rgb(68, 170, 68);font-weight:bold">green</span>.'));
s.anonymous = true;
s.sortable = true;
s.filter = function (section_id) {
@ -685,7 +691,7 @@ return view.extend({
radio = radios[i].sid;
if (radio) {
btns.push(E('button', {
'class': 'cbi-button cbi-button-positive',
'class': 'cbi-button cbi-button-apply',
'id': radio,
'click': ui.createHandlerFn(this, 'handleScan', radio)
}, [_('Scan on ' + radio + '...')]),

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -17,6 +17,8 @@
"/sbin/logread -e trm-": [ "exec" ],
"/usr/sbin/logread -e trm-": [ "exec" ],
"/usr/sbin/ifup *": [ "exec" ],
"/etc/init.d/travelmate start" : [ "exec" ],
"/etc/init.d/travelmate stop" : [ "exec" ],
"/etc/init.d/travelmate reload" : [ "exec" ],
"/etc/init.d/travelmate restart" : [ "exec" ],
"/etc/init.d/travelmate assoc" : [ "exec" ],