• ATTENTION! You'll notice a Prefix dropdown when you create a thread. If your post applies to one of the topics listed, please use that Prefix for your post. When browsing the thread list you can use the Prefix to filter the view.
  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

Asad Ali

Very Senior Member
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!!
 

bluepoint

Very Senior Member
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)
 

bluepoint

Very Senior Member
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,:)
 

thelonelycoder

Part of the Furniture
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.
 

thelonelycoder

Part of the Furniture
. 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.
 

thelonelycoder

Part of the Furniture
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 ;)
 

L&LD

Part of the Furniture
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! :)
 

thelonelycoder

Part of the Furniture
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.
 

thelonelycoder

Part of the Furniture
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:

thelonelycoder

Part of the Furniture
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:

thelonelycoder

Part of the Furniture
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.
 

Asad Ali

Very Senior Member
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]
 

Ro berto

Regular Contributor
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:

tomsk

Very Senior Member
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.
 

thelonelycoder

Part of the Furniture
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.
You are mistaken, that Tab is added by @Jack Yaz 'es script(s), not the Firmware.
 

thelonelycoder

Part of the Furniture
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]
@RMerlin specifically added this to the API to add a page anywhere, only @john9527 interpreted it differently.
No matter what the opinions, I stay firm along with @Adamm that the tab goes where it belongs.
End of discussion for me about this topic, it is moot. I am the coder and made the decision based on logic and my preferences.
 

Jack Yaz

Part of the Furniture
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]
@RMerlin specifically added this to the API to add a page anywhere, only @john9527 interpreted it differently.
No matter what the opinions, I stay firm along with @Adamm that the tab goes where it belongs.
End of discussion for me about this topic, it is moot. I am the coder and made the decision based on logic and my preferences.
My bad for trying to be clever and creating an Addons area :(
 

Latest threads

Sign Up For SNBForums Daily Digest

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