From 7b216caf262c3a0adffe279258971803f3d9edbd Mon Sep 17 00:00:00 2001 From: hanwckf Date: Sun, 13 Nov 2022 00:52:16 +0800 Subject: [PATCH] luci-app-mtk: fix stainfo --- .../luasrc/controller/mtkwifi.lua | 3 + .../view/admin_mtk/mtk_wifi_overview.htm | 120 ++++- .../view/admin_mtk/mtk_wifi_vif_cfg.htm | 116 ----- .../applications/luci-app-mtk/src/Makefile | 2 +- .../luci-app-mtk/src/ioctl_helper.c | 188 +++---- .../applications/luci-app-mtk/src/mtwifi.h | 127 +++++ .../applications/luci-app-mtk/src/rate_calc.c | 459 ++++++++++++++++++ 7 files changed, 796 insertions(+), 219 deletions(-) create mode 100644 package/mtk/applications/luci-app-mtk/src/mtwifi.h create mode 100644 package/mtk/applications/luci-app-mtk/src/rate_calc.c diff --git a/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua b/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua index b36bff4164..fd2f756c46 100644 --- a/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua +++ b/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua @@ -940,6 +940,9 @@ function sta_info(ifname) local output = {} local stalist = c_StaInfo(ifname) + local ifname_t = {["ifname"] = ifname} + table.insert(output, ifname_t) + local count = 0 for _ in pairs(stalist) do count = count + 1 end diff --git a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm index 319c601b8f..d683223760 100644 --- a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm +++ b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm @@ -204,20 +204,18 @@ local chipname <% end %> <% end %> - + Signal (dBm) + TX Rate + RX Rate + Connected Time @@ -226,9 +224,58 @@ local chipname ---> <%+footer%> diff --git a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm index c4b98d9bea..dbd47f70fe 100644 --- a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm +++ b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm @@ -59,18 +59,11 @@ function hi(to, devname, vifname) <% end %> tables.push("vif-cfg-basic-AC"); - <% if request[4] == "vif_cfg_view" then%> - tables.push("vif-cfg-station"); - <% end %> - var tabs = new Array(); tabs.push("vif-cfg-tab-basic"); <% if string.split(cfgs.WirelessMode,";")[1] == "16" or string.split(cfgs.WirelessMode,";")[1] == "17" or string.split(cfgs.WirelessMode,";")[1] == "18" then %> tabs.push("vif-cfg-tab-he_mu"); <% end %> - <% if request[4] == "vif_cfg_view" then%> - tabs.push("vif-cfg-tab-station"); - <% end %> document.getElementById("__activeTab").value = to; @@ -98,14 +91,6 @@ function hi(to, devname, vifname) a.className = "cbi-tab"; } } - - <% if request[4] == "vif_cfg_view" then%> - //Clear station list timer - XHR.halt(); - if(to == "station"){ - InitStaList(devname, vifname); - } - <% end %> } @@ -143,11 +128,6 @@ function hi(to, devname, vifname) );this.blur(); ">HE_MU <% end %> - <% if request[4] == "vif_cfg_view" then%> -
  • - );this.blur(); ">Stations -
  • - <% end %> @@ -673,25 +653,6 @@ function hi(to, devname, vifname)
    <% end %> - <% if request[4] == "vif_cfg_view" then%> - - - - - - - - - - - - - - - - <% end %> - -
    Access Control - <%=vifname and devname.."@"..vifname or devname%> @@ -732,7 +693,6 @@ AA:BB:CC:DD:EE:FF