From d8deb5a1948bfa9beb3ab1f36c53eb893dc7a460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wabik?= <4rafal@gmail.com> Date: Sat, 16 Jul 2022 05:27:28 -0700 Subject: [PATCH] Up to 1.0.14-20220716 --- luci-app-modemband/Makefile | 2 +- .../luci-static/resources/view/modem/blte.js | 18 ++++++++++++++++-- .../resources/view/modem/blteconfig.js | 12 +++++++++--- luci-app-modemband/po/pl/modemband.po | 6 ++++++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/luci-app-modemband/Makefile b/luci-app-modemband/Makefile index a713bc8a..d974508a 100644 --- a/luci-app-modemband/Makefile +++ b/luci-app-modemband/Makefile @@ -7,7 +7,7 @@ PKG_NAME:=luci-app-modemband LUCI_TITLE:=LuCI panel for modemband LUCI_PKGARCH:=all LUCI_DEPENDS:=+sms-tool +modemband -PKG_VERSION:=1.0.13-20220701 +PKG_VERSION:=1.0.14-20220716 PKG_RELEASE:=1 define Package/$(PKG_NAME) diff --git a/luci-app-modemband/htdocs/luci-static/resources/view/modem/blte.js b/luci-app-modemband/htdocs/luci-static/resources/view/modem/blte.js index 0b0e009f..6e0a46fd 100644 --- a/luci-app-modemband/htdocs/luci-static/resources/view/modem/blte.js +++ b/luci-app-modemband/htdocs/luci-static/resources/view/modem/blte.js @@ -206,7 +206,16 @@ function handleAction(ev) { if (confirm(_('Do you really want to set up all possible bands for the modem?'))) { fs.exec_direct('/usr/bin/modemband.sh', [ 'setbands', 'default' ]); - ui.addNotification(null, E('p', _('The new bands settings have been sent to the modem. If the changes are not visible, a restart of the connection, modem or router may be required.')), 'info'); + + return uci.load('modemband').then(function() { + var nuser = (uci.get('modemband', '@modemband[0]', 'notify')); + + if (nuser == '0') { + ui.addNotification(null, E('p', _('The new bands settings have been sent to the modem. If the changes are not visible, a restart of the connection, modem or router may be required.')), 'info'); + } + + }); + } } if (ev === 'rebootdev') { @@ -442,7 +451,6 @@ return view.extend({ var ax = args.toString(); ax = ax.replace(/,/g, ' ') fs.exec_direct('/usr/bin/modemband.sh', [ 'setbands', ax ]); - ui.addNotification(null, E('p', _('The new bands settings have been sent to the modem. If the changes are not visible, a restart of the connection, modem or router may be required.') ), 'info'); return uci.load('modemband').then(function() { var wrestart = (uci.get('modemband', '@modemband[0]', 'wanrestart')); @@ -450,6 +458,12 @@ return view.extend({ var cmdrestart = (uci.get('modemband', '@modemband[0]', 'restartcmd')); var wname = (uci.get('modemband', '@modemband[0]', 'iface')); var sport = (uci.get('modemband', '@modemband[0]', 'set_port')); + + var nuser = (uci.get('modemband', '@modemband[0]', 'notify')); + + if (nuser == '0') { + ui.addNotification(null, E('p', _('The new bands settings have been sent to the modem. If the changes are not visible, a restart of the connection, modem or router may be required.')), 'info'); + } if (wrestart == '1') { diff --git a/luci-app-modemband/htdocs/luci-static/resources/view/modem/blteconfig.js b/luci-app-modemband/htdocs/luci-static/resources/view/modem/blteconfig.js index 5a93b474..a3cd6f03 100644 --- a/luci-app-modemband/htdocs/luci-static/resources/view/modem/blteconfig.js +++ b/luci-app-modemband/htdocs/luci-static/resources/view/modem/blteconfig.js @@ -34,9 +34,9 @@ return view.extend({ o = s.option(form.Value, 'set_port', _('Port for communication with the modem'), _("Select one of the available ttyUSBX ports.")); - devs.forEach(function(dev) { - o.value('/dev/' + dev.name); - }); + devs.sort((a, b) => a.name > b.name); + devs.forEach(dev => o.value('/dev/' + dev.name)); + o.placeholder = _('Please select a port'); o.rmempty = false; @@ -57,6 +57,12 @@ return view.extend({ o.depends("modemrestart", "1"); o.rmempty = false; + o = s.option(form.Flag, 'notify', _('Turn off notifications'), + _('Checking this option disables the notification that appears every time the bands are changed.') + ); + o.rmempty = false; + return m.render(); } }); + diff --git a/luci-app-modemband/po/pl/modemband.po b/luci-app-modemband/po/pl/modemband.po index 4aecec89..31054d67 100644 --- a/luci-app-modemband/po/pl/modemband.po +++ b/luci-app-modemband/po/pl/modemband.po @@ -153,3 +153,9 @@ msgstr "Wyłącz" msgid "Enable" msgstr "Włącz" + +msgid "Turn off notifications" +msgstr "Wyłącz powiadomienia" + +msgid "Checking this option disables the notification that appears every time the bands are changed." +msgstr "Zaznaczenie opcji wyłącza powiadomienie pojawiające się przy każdej zmianie pasm."