Skip to content

Commit

Permalink
Cosmetic code fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
4IceG authored Mar 25, 2022
1 parent ed0a12f commit 8447ff8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
14 changes: 13 additions & 1 deletion luci-app-modemband/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ LUCI_DEPENDS:=+sms-tool +modemband
PKG_VERSION:=1.0.12-20220315
PKG_RELEASE:=1

include $(TOPDIR)/feeds/luci/luci.mk
define Package/$(PKG_NAME)
$(call Package/luci/webtemplate)
TITLE:=$(LUCI_TITLE)
DEPENDS:=$(LUCI_DEPENDS)
endef

define Package/$(PKG_NAME)/description
LuCI panel for modemband.
endef

define Package/luci-app-modemband/postinst
#!/bin/sh
Expand All @@ -20,4 +28,8 @@ rm -rf /tmp/luci-modulecache/
exit 0
endef

include $(TOPDIR)/feeds/luci/luci.mk

$(eval $(call BuildPackage,$(PKG_NAME)))

# call BuildPackage - OpenWrt buildroot signature
19 changes: 14 additions & 5 deletions luci-app-modemband/htdocs/luci-static/resources/view/modem/blte.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,21 @@ return view.extend({
var modem = json.modem;
for (var i = 0; i < json.enabled.length; i++)
{
modemen += 'B' + json.enabled[i] + ' ';
var txtband = json.enabled[i].toString();
var numb = txtband.match(/\d+$/);
modemen += 'B' + numb + ' ';
modemen = modemen.replace('undefined', '');
}
modemen = modemen.trim();

for (var i = 0; i < json.supported.length; i++)
{
sbands += 'B' + json.supported[i].band + ' ';
var txtband = json.supported[i].band.toString();
var numb = txtband.match(/\d+$/);
sbands += 'B' + numb + ' ';
sbands = sbands.replace('undefined', '');
}
sbands = sbands.trim();

pollData: poll.add(function() {
return L.resolveDefault(fs.exec_direct('/usr/bin/modemband.sh', ['json']))
Expand All @@ -284,9 +291,11 @@ return view.extend({
for (var i = 0; i < json.enabled.length; i++)
{
//renderHTML += 'B' + String.format(strongband, _(""), _(json.enabled[i]))+' ';
renderHTML += 'B' +json.enabled[i] + ' ';
var txtband = json.enabled[i].toString();
var numb = txtband.match(/\d+$/);
renderHTML += 'B' + numb + ' ';
view.innerHTML = '';
view.innerHTML = renderHTML;
view.innerHTML = renderHTML.trim();
}

}
Expand Down Expand Up @@ -440,7 +449,7 @@ return view.extend({

if (mrestart == '1') {

fs.exec('sleep 15');
fs.exec('sleep 20');
//sms_tool -d $_DEVICE at "cmd"
fs.exec_direct('/usr/bin/sms_tool', [ '-d' , sport , 'at' , cmdrestart ]);
}
Expand Down

0 comments on commit 8447ff8

Please sign in to comment.