What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I've pushed a Diversion update, no version change

- NEW : Option to enable the Diversion WebUI beta in d.
- CHANGED: Dnsmasq and pixelserv-tls operation functions to make them compatible with the new WebUI functions.

This first WebUI beta version is limited in its ability but fully functional. I need some feedback if things work as intended on a broader range of routers.
The Home page with its general settings is of most interest to me, while the Test pages are solely there to test the page switching function I came up with to outmaneuver the limitation of the firmware.
I tested this on my newer Merlin routers and the trusted RT-AC66U on Johns fork.

Please report inconsistencies and errors. And enjoy this first release of a GUI for Diversion :)

Use u to update
Looks great on my 88U, and seems to work in in page switching between Home page and the two Test Pages. I haven't actually played with the Home Page switches, as I'm not sure of the outcome.

Thanks,
Anton
 
I have a single console error changing to Test One or Test Two, probably because the full page isn't defined yet or has been reduced for this public beta.
Code:
TypeError: document.form.Div_mode is undefined    diversion-lists.js:20:3
I didn't know we could "cheat" and use green buttons. :D

I'm sure we are literally seeing just the tip of the iceberg. Can't wait for more!
 
Ok, I seem to be having quite an issue. Woke up this morning tried to update my Diversion but it wouldn't let me open it up in the amtm menu. Just kept cycling whenever I chose the amtm option. I went to reinstall but it kept saying


[Error] No compatible device(s) found to install
Diversion on.

A permanently plugged in USB storage device
formatted with one of these file systems
is required: ext2, ext3, ext4

Use amtm to format attached USB devices
to any ext* file system.
https://diversion.ch/amtm.html


So I thought hmmm... maybe something has gone on with my USB. I reformatted the USB in amtm, got it all ready, rebooted the router and tried again. Same issue. Any ideas as to what's gone wrong? I think I'll reflash the firmware next and see if that has any influence but even if it fixes it I'd like to know why the issue happened in the first place so I don't have it happen to me again

EDIT: Reinstalled firmware... same issue. Tried another USB drive and hey presto; it works! Seems weird that I was able to format it and access it but hey, it's working now so can't complain. Hope this will help anyone else out having the same issue
 
Last edited:
I've pushed a Diversion update, no version change

- NEW : Option to enable the Diversion WebUI beta in d.
- CHANGED: Dnsmasq and pixelserv-tls operation functions to make them compatible with the new WebUI functions.

This first WebUI beta version is limited in its ability but fully functional. I need some feedback if things work as intended on a broader range of routers.
The Home page with its general settings is of most interest to me, while the Test pages are solely there to test the page switching function I came up with to outmaneuver the limitation of the firmware.
I tested this on my newer Merlin routers and the trusted RT-AC66U on Johns fork.

Please report inconsistencies and errors. And enjoy this first release of a GUI for Diversion :)

Use u to update

Any specific reason to not use the Addons page? Technically Diversion is not a native part of Asuswrt-Merlin (well not yet wink wink) and it's an Add-on to Asuswrt-Merlin so all such script's Web-Ui should be under that page instead of scattered all over the firmware WebUI, that's just my two cents.

BTW it's looking nice!!
 
I've pushed a Diversion update, no version change

- NEW : Option to enable the Diversion WebUI beta in d.
- CHANGED: Dnsmasq and pixelserv-tls operation functions to make them compatible with the new WebUI functions.

This first WebUI beta version is limited in its ability but fully functional. I need some feedback if things work as intended on a broader range of routers.
The Home page with its general settings is of most interest to me, while the Test pages are solely there to test the page switching function I came up with to outmaneuver the limitation of the firmware.
I tested this on my newer Merlin routers and the trusted RT-AC66U on Johns fork.

Please report inconsistencies and errors. And enjoy this first release of a GUI for Diversion :)

Use u to update
When I click "check for update"from he webui this log shows. Normal?
Code:
May 30 21:25:22 rc_service: httpds 1164:notify_rc stop_diversion
May 30 21:25:22 custom_script: Running /jffs/scripts/service-event (args: stop diversion)
 
Yes uiDivStats 2.0 has moved to LAN - though if you haven't rebooted since updating it will stay in Addons
Where can I get uiDivStats 2.0? Amtm installed 1.3.2 and update says I have the latest.

NVM I just read uiDivStats 2.0 is still unreleased,:)
 
I've pushed a Diversion update, no version change

- CHANGED: WebUI beta minor error correction, page switch loading time set to 1 second.

Please report inconsistencies and errors.

Use the WebUI to update, or if your really must, use u to update.
 
. Looking good now. I find I have to press the ‘buttons’ twice eg let’s say I’m on the Test 2 page and then select Home; I get the swirling circle and, when it stops, I’m still on the Test 2 page, so I select Home again, and, this time, when the swirling circle ends, I am, indeed, back on the Home page.
I've added a one second delay, see if that helps.
 
I haven't actually played with the Home Page switches, as I'm not sure of the outcome
Believe me, they do what it says and it works. After all, this is a beta feature, coded with care and love for details by myself ;)
 
Tested WebUI beta on RT-AX88U with RMerlin RT-AX88U_384.18_alpha1-g6368a955e8 (latest Alpha 1 build).

Used all options and Test 1 and Test 2 pages, no issues.

Looking great! :)
 
I have a single console error changing to Test One or Test Two, probably because the full page isn't defined yet or has been reduced for this public beta.
Code:
TypeError: document.form.Div_mode is undefined    diversion-lists.js:20:3
I didn't know we could "cheat" and use green buttons. :D

I'm sure we are literally seeing just the tip of the iceberg. Can't wait for more!
You can bet on it, and the error's fixed.
And it's all coding, be it a programming language like shell script, the scripting language JavaScript, the style sheet CSS and markup language HTML.
Your green button is pure CSS.
 
Any specific reason to not use the Addons page? Technically Diversion is not a native part of Asuswrt-Merlin (well not yet wink wink) and it's an Add-on to Asuswrt-Merlin so all such script's Web-Ui should be under that page instead of scattered all over the firmware WebUI, that's just my two cents.

BTW it's looking nice!!
Technically, I'm the one coder that can claim my script(s) are part of Asuswrt-Merlin :p

The addons page number is limited to ten pages by the firmware. If all of them were on the Addons tab, it would break out of the given space of the page layout. Which on John's fork they will, depending on page title length, as he's decided to force all addons to that tab.
But my main reason to move it to the LAN tab is because Diversion belongs there.
Edit: Also, you'll find that @Adamm 's Skynet started it, not me :cool:
 
Last edited:
When I click "check for update"from he webui this log shows. Normal?
Code:
May 30 21:25:22 rc_service: httpds 1164:notify_rc stop_diversion
May 30 21:25:22 custom_script: Running /jffs/scripts/service-event (args: stop diversion)
The addons API is helpful but sorely limited by Asus's tight control of the http web server built into the firmware.
@RMerlin worked around it with the limited set of possibilities given, which leaves us with a small set of options.

The interaction WebUI <--> Scripts is via service calls and variable settings.
The service calls are limited to start, stop and restart, which is what you see in the syslog. They don't necessarily do what it says, each of us coders implements his/her own set of instructions to act upon such an event.
The service stop_diversion event simply runs a function to check for a Diversion update, which can be perused in file /opt/share/diversion/webui/process.div, if you're so inclined.
 
Last edited:
Thanks.
Computer IP seems to be shown on previous line, replacing this section:
Code:
       tail -F "${LOG_DIR}/dnsmasq.$log" | \
       while read line; do
           if echo "$line" | /opt/bin/grep -q "list/blockinglist\|list/blacklist\| config .* is $blockingIP"; then
               printf "%-43s%s\\n" "${GRAY} $( echo $line | awk '{print $3, "blocked by " $(NF-3)}' | sed 's|/opt/share/diversion/list/||;s|config|wc-blacklist|')${NC} " "${RED}$( echo $line | awk '{print $(NF-2)}')${NC}"
           fi
       done

With this:
Code:
       prevLine=''
       tail -F "${LOG_DIR}/dnsmasq.$log" | \
       while read line; do
           if echo "$line" | /opt/bin/grep -q "list/blockinglist\|list/blacklist\| config .* is $blockingIP"; then
               printf "%-43s%-23s%s\\n" "${GRAY} $( echo $line | awk '{print $3, "blocked by " $(NF-3)}' | sed 's|/opt/share/diversion/list/||;s|config|wc-blacklist|')${NC}" "${BLUE}$( echo $prevLine | awk '{print $NF}')${NC}" "${RED}$( echo $line | awk '{print $(NF-2)}')${NC}"
           fi
           prevLine=$line
       done
Seems to work with log-queries=extra on and off, unless there is another setting that can disable that too..

[EDIT]
Here are modified functions.div and install.div files with the following modifications:
  • edit *list is faster now, it doesn't show list's content until user requested it via new option #8 which significantly speeds up the process with a long list
  • most yes/no questions have "default" command marked with brackets: [1=[Yes] 2=No] which will be automatically selected when hit enter key without any input
  • Set domain active/inactive function now shows the domain itself and allows exit without changing the line
  • computer ip now shows in blocked domains log (follow dnsmasq.log -> 3)
  • removed redundant prompt at Change pixelserv-tls IP address
  • enter IP address function accepts second parameter for default IP which will be used if user hit enter without any input
Thanks, I'll look into it when the time comes to revisit this code.
 
But my main reason to move it to the LAN tab is because Diversion belongs there.

I would've agreed to that argument 100% prior to the introduction of Addons page but now since we have it and respectfully Diversion is still an Addon script to the Asuswrt-Merlin so IMHO it belongs in the Addons tab. @RMerlin adds that page and Addons API for a reason, to give developers a centralized way and page to use for their scripts WebUI but if developers are not going to use it then it seems like a wasted effort. Regarding the 10 page limit, I'm sure it can be increased (he initially started with 6 pages and later on increased it to 10) but if developers will not use it in the fear that the page tabs will run out of space then no one will use it as designed and that page will remain empty.

But in any case, it's just my opinion and in the end, it's your script and you're the big boss here. [emoji16]
 
Please report inconsistencies and errors. And enjoy this first release of a GUI for Diversion :)

Use u to update

I only have amtm and diversion and cannot see the diversion webUI on any tab (tools and lan included). I even used uu to force update and restarted the router buy still cannot see the webUI.

Do I need to install uiDivStats?

EDIT: my bad, didn't read with care [emoji15]

Sent from my SM-G970F using Tapatalk
 
Last edited:
I only have amtm and diversion and cannot see the diversion webUI on any tab (tools and lan included). I even used uu to force update and restarted the router buy still cannot see the webUI.

Do I need to install uiDivStats?

Sent from my SM-G970F using Tapatalk
- NEW : Option to enable the Diversion WebUI beta in d.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top