Commit graph

241 commits

Author SHA1 Message Date
Jo-Philipp Wich
7b43e67219 luci-mod-admin-full: improve Y-axis scaling in bandwidth graph
Calculate a peak that causes the vertical scale to use even values.

Fixes #1424.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-03 10:58:14 +02:00
Jo-Philipp Wich
4097a63330 luci-mod-admin-full: fix uci revert success message
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-02 09:43:08 +02:00
Jo-Philipp Wich
30eaba02f1 luci-mod-admin-full: cleanup markup on flashops page
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-02 08:46:26 +02:00
Jo-Philipp Wich
b693baaa6e luci-mod-admin-full: rework wireless network status indicator
Rework markup and logic of the wireless network status indicator to match
that of the interface status widget.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-02 08:46:26 +02:00
Jo-Philipp Wich
c405b23abd luci-mod-admin-full: unify DHCP lease status code
Merge the DHCP lease status code of the status overview and DHCP/DNS pages
into a single shared partial template.

Also remove some redundant markup on the index page and wireless assoc list
templates.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-28 09:42:17 +02:00
Jo-Philipp Wich
8d7869f672 luci-mod-admin-full: properly remap ports in switch status display
Fixes: 60c5d15e9 ("luci-mod-admin-full: fix possible switch status layout bug")
Fixes: bbf096c79 ("luci-mod-admin-full: cleanup markup")
Reported-at: https://forum.lede-project.org/t/x/15897/19
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-26 19:51:36 +02:00
Jo-Philipp Wich
60c5d15e9e luci-mod-admin-full: fix possible switch status layout bug
In some cases we might get status information for more ports than which are
actually usable, prevent overflowing the port status row in this case.

Reported-at: https://forum.lede-project.org/t/x/15897/14
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-26 15:24:16 +02:00
Jo-Philipp Wich
62f5c22f8c
Merge pull request #1912 from Ansuel/fixassoci
luci-mod-admin-full: fix missing wifi_assoclist
2018-06-26 14:34:58 +02:00
Ansuel Smith
5818a90dfd
luci-mod-admin-full: fix missing wifi_assoclist
With #e5ba594d77eed77d31d4b9b8c0e86026eb5a5fac the list of the connected device broke up. This fix this problem by creating a proper request link.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-06-26 14:30:36 +02:00
Jo-Philipp Wich
0d9a64b3b4
Merge pull request #1881 from TDT-AG/pr/20180614-luci-mod-admin-full-fix-ssh-key-textarea
luci-mod-admin-full: fix empty SSH-Keys textarea issue
2018-06-25 11:41:41 +02:00
zjw
6ff7f34ee8 luci-mod-admin-full: report SNR unit as dB, not dBm
Fixes: #1880
Reported-by: "zjw"
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-25 11:39:24 +02:00
Jo-Philipp Wich
b79982e5df luci-mod-admin-full: fix average traffic calculation in realtime bandwidth
Fixes #1908.
Suggested-by: "mgalyean"
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-25 09:33:07 +02:00
Jo-Philipp Wich
ff55e7f6b5 luci-mod-admin-full: fix initializing realtime graphs
Commit 69782ccbc ("luci-base: xhr.js: defer starting poll queue") changed
the way XHR poll queues are started which broke the timing on the realtime
graph pages.

Fix the problem by manually starting the poller after registering the request
handlers.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-25 09:19:59 +02:00
Jo-Philipp Wich
e5ba594d77 luci-base, luci-mod-admin-full: unify wifi assoclist code
Merge the assoclist code of the status overview and wireless overview pages
into a single shared partial template.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-25 09:01:33 +02:00
Jo-Philipp Wich
86c6c60a0d luci-mod-admin-full: replace status page legend tags with h3 (#1907)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-25 09:00:07 +02:00
Jo-Philipp Wich
b4d78d2042 luci-mod-admin-full: packages: display available packages by default
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-23 18:01:43 +02:00
Jo-Philipp Wich
bbf096c79e luci-mod-admin-full: cleanup markup
Globally cleanup template markup to support responsive design changes in
OpenWrt theme.

Rework handling of dynamic status tables, consolidate hand-written markup,
fix small render bugs in various places and annotate tables where needed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-23 18:01:39 +02:00
Florian Eckert
0251603f0a luci-mod-admin-full: fix empty SSH-Keys issue
If you delete all ssh keys in the textarea then LuCI will rais an error.
So if you added one ssh-key to the textarea and then you want to delete them
again that is not possbile in LuCI.
To fix this remove "rmempty" attribute and add a remove function which will
called if the textarea is empty.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-06-14 11:50:55 +02:00
Jo-Philipp Wich
e7866c7dcc luci-mod-admin-full: add suggested italian translations
Merge two italian translations suggested in #1870 and add back two missing
dots accidentially removed from the translations in a previous commit.

Fixes: 588c8618b ("luci-mod-admin-full: fix translation interpolation in JS confirm() calls")
Suggested-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 16:05:48 +02:00
Jo-Philipp Wich
588c8618b6 luci-mod-admin-full: fix translation interpolation in JS confirm() calls
Use luci.http.write_json() in conjunction with translate() to write out
unescaped translation strings in a manner suitable for interpolation inside
JavaScript.

Fixes #1870
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 15:48:26 +02:00
Jo-Philipp Wich
0e0ee2fed5 luci-mod-admin-full: git rid of embedded newlines in translation strings
Also switch one usage of raw '<%_ ... %>' interpolation to '<%: ... %>' in
order to avoid issues with translations using apostrophes.

Globally resnyc translations after the fix.

Fixes #1866.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 13:50:14 +02:00
Jo-Philipp Wich
74be6f3974 treewide: switch firewall zone, network and iface lists to dropdown code
Also switch the weekday and monthday lists in the firewall rule details to
cbi dropdowns, vastly uncluttering the form.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-06-08 08:19:20 +02:00
Jo-Philipp Wich
724cc29978 luci-mod-admin-full: use common alert message markup
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-31 19:00:56 +02:00
Jo-Philipp Wich
7bd1bcaf30 luci-mod-admin-full: fix status page render glitch on Chrome
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-31 07:38:40 +02:00
Jo-Philipp Wich
0d2ae8d653 luci-mod-admin-full: rework network and wifi status displays
Use a more compact flex layout instead of the tabular display.
Also rename "WAN status" to "Upstream" to avoid future confusion about
wan interfaces vs. defaultroute interfaces.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-30 14:59:24 +02:00
Ansuel Smith
f0094cc06e luci-mod-admin-full: fix revert page
This fix the strange redirect link, a bug with uwsgi where the controller
is empty and a bug with the revert page showing the apply content empty.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[drop unrelated revert.html template change]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-30 14:59:24 +02:00
Ansuel Smith
b8f32b6da7
luci-admin-full: add architecture info
Referring to this, #1698 , we add architecture info and we show Unknown instead of ?. This is usefull if someone needs to install opkg packages manually.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2018-05-28 15:38:57 +02:00
Jo-Philipp Wich
067d7dc9f7 treewide: convert HTML tables to div
Mostly convert HTML tables to div based markup to allow for easier styling
in the future. Also change JS accessor code accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-28 15:18:45 +02:00
Jo-Philipp Wich
37a4a1c070 luci-mod-admin-full: fix crash on wireless when no networks are declared
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-19 23:28:14 +02:00
Jo-Philipp Wich
fdbb417abe luci-mod-admin-full: do not override iface section in wireless cbi map
Do override the iface section id upon commit to avoid clobbering the resulting
configuration. The manual config sync is not needed anymore after switching
to uncached ubus uci operations.

Fixes #1770.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-19 23:26:34 +02:00
Jo-Philipp Wich
828202ef52
Merge pull request #1769 from jow-/master
UCI apply/rollback workflow
2018-05-18 16:44:33 +02:00
Yousong Zhou
c91ba4babc luci-mod-admin-full: use fs.glob instead nixio.fs.glob
It's how the module was named when "require"d and used by other code in
the same function

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-05-07 21:19:35 +08:00
Florian Eckert
690ae5c211 luci-mod-admin-full: no menu entry for leds if "/sys/class/leds" is empty
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-05-07 21:14:48 +08:00
Florian Eckert
da4fab0462 luci-mod-admin-full: change supports_reset() test for factory reset
The check "supports_reset" only covers /proc/mtd partitions. If we have
this the commands checks for names like ubi or rootfs_data. If this is
found the system is possible for a factory reset.  But on x86 the
situation is different.  We have no /proc/mtd partitions because this
system do not use a bare metall flash.

To solve this issue check if we have an overlay and if so we could do a
factory reset. This could be applied for system which uses bare metal
flash and system which uses FTL or harddisks.

Jffs2reset is the current command used for factory reset.  It will try
to find volume "rootfs_data" and if it's mounted will delete all files
under directory /overlay

luci-mod-admin-mini also has check for reset available, but we leave it
alone for now as it uses "mtd -r erase rootfs_data"

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-05-07 20:36:40 +08:00
Jo-Philipp Wich
fd1ddcc419 luci-mod-admin-full: rework wifi configuration
- localize variables
- get rid of redirects breaking apply workflow
- auto-adjust unusable channels when switching country
- use apply/rollback workflow when enabling/disabling networks

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
8deb949551 treewide: rework uci apply workflow
Switch to rpcd based uci apply/rollback workflow which helps to avoid soft-
bricking devices by requiring an explicit confirmation call after config
apply.

When a user now clicks "Save & Apply", LuCI first issues a call to uci apply
which commits and reloads configuration, then goes into a polling countdown
mode where it repeatedly attempts to call uci confirm.

If the committed configuration is sane, the confirm call will go through and
cancel rpcd's pending rollback timer.

If the configuration change leads to a loss of connectivity (e.g. due to bad
firewall rules or similar), the rollback mechanism will kick in after the
timeout and revert configuration files and pending changes to the pre-apply
state.

In order to cover such rare cases where a lost of connectivity is expected
and desired, the user is offered an "unchecked" apply option after timing
out, which allows committing and applying the changes anyway, without the
extra safety checks.

As a consequence of this change, the luci-reload mechanism is now completely
unsused since rpcd uses ubus config reload signals to reload affected
services, which means that only procd-enabled services will receive proper
reload treatment with the new workflow.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05 23:11:23 +02:00
Ricardo Lamego
e55a5fa386 Fixing small typo
indentifies > identifies
2018-05-02 21:01:53 +01:00
Jo-Philipp Wich
9adbd79faa luci-mod-admin-full: canonicalize configured static lease MAC
When reading the configured mac address of the static lease, filter it
through luci.ip.checkmac() to canonicalize and uppercase the value for
mapping it against the combo box host hints.

Fixes #1772.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-02 16:55:22 +02:00
Jo-Philipp Wich
8335997df5
Merge pull request #1705 from Mushoz/add-igmp-snooping
luci-mod-admin-full: add igmp snooping option
2018-05-02 16:31:27 +02:00
Marc Benoit
fbeea4ee33 luci-mod-admin-full: limit dns cachesize to 10000
The value of cachesize is hardcoded to 10000 in
dnsmasq-2.79/src/option.c to 10000 max

    case 'c':  /* --cache-size */
      {
        int size;

        if (!atoi_check(arg, &size))
          ret_err(gen_err);
        else
          {
            /* zero is OK, and means no caching. */

            if (size < 0)
              size = 0;
            else if (size > 10000)
              size = 10000;

            daemon->cachesize = size;
          }
        break;
      }

Tested on Netgear R7800
Signed-off-by: Marc Benoit <marcb62185@gmail.com>
2018-04-09 20:51:14 -04:00
Marc Benoit
28d10632a1 luci-mod-admin-full: allow setting dns cachesize
In the case of more powerful routers the default
cachesize value == 150 is too small and can easily
be extended to 1,000's and 10,000's of entries.
It makes sense to make it easy configurable.

Tested on Netgear R7800

Signed-off-by: Marc Benoit <marcb62185@gmail.com>

Fix whitespace, edit the proposed help text.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-04-09 17:17:02 +03:00
Jo-Philipp Wich
14da6e85a6 luci-mod-admin-full: dispatch SimpleForm models using the form() action
This fixes issues dicovered by check-controllers.sh

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-06 12:10:16 +02:00
Jo-Philipp Wich
d6b4a3d45a luci-mod-admin-full: fix request path access in uci controller
Fixes #1725
Fixes 731ed77c0 ("treewide: improve handling of page redirections in uci change views")

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-06 06:58:32 +02:00
Jo-Philipp Wich
bfc98bec4d luci-mod-admin-full: escape display parameter
Prevent reflected XSS through the reset button by url encoding the
display parameter.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-05 23:03:01 +02:00
Jo-Philipp Wich
731ed77c0b treewide: improve handling of page redirections in uci change views
Instead of passing the full LuCI request url, pass the relative resolved
request path instead and filter the received value through the lookup()
dispatcher function to only allow paths to actual internal pages.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-05 23:03:01 +02:00
Jo-Philipp Wich
c0d9c4f3ce treewide: filter shell arguments through shellquote() where applicable
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-05 09:37:43 +02:00
Jo-Philipp Wich
9e4b8a9138 luci-mod-admin-full: fix possible shell injection in bandwith status
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-05 00:33:09 +02:00
Jo-Philipp Wich
94ea907707 luci-mod-admin-full: use strict hostname validation for dhcp hosts
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-04 23:21:53 +02:00
Jaap Buurman
6c5bfff53c luc-mod-admin-full: add igmp snooping option
Signed-off-by: Jaap Buurman <jaapbuurman@gmail.com>
2018-03-28 15:59:29 +02:00
Jo-Philipp Wich
005f4fb7d4
Merge pull request #1654 from TDT-AG/pr/20180301-luci-several-fixes
luci-app-firewall/luci-base/luci-mod-admin-full: some fixes and improvements
2018-03-15 09:52:22 +01:00