That fixed it but led me to my next hurdle.Rename the file to end with.js
. Refer to it as/ext/results.js
Or you can use .htm.
function runScript(){
/* Retrieve value from input fields, and store in object */
custom_settings.scriptsui_script = "/jffs/addons/scriptsui/mysript.sh";
/* Store object as a string in the amng_custom hidden input field */
document.getElementById('amng_custom').value = JSON.stringify(custom_settings);
/* Apply */
showLoading()
document.form.submit();
get_results_data();
}
There are a few examples of "submitting" a request to trigger the service-event without getting into the whole "Please wait..." overlay.Any suggestions or pointers much appreciated
cake_status_check
hidden form and submit_refresh_status()
function in CakeQoS-Merlin.initial()
function to load that file under /ext/ into your text field. Maybe you should post the full code somewhere for review. Or study how the System Log page loads the initial syslog files and then refreshes every 3 seconds. It uses special commands for fetching the syslog data, but the initial load through ajax calls is still there.Thank you @dave14305 for all the pointers, feedback, and references. I finally have a working prototype based on the Third Party API.There are a few examples of "submitting" a request to trigger the service-event without getting into the whole "Please wait..." overlay.
See if you can make sense of thecake_status_check
hidden form andsubmit_refresh_status()
function in CakeQoS-Merlin.
![]()
cakeqos-merlin/cake-qos.asp at master · ttgapers/cakeqos-merlin
Custom add-on for supported Asus routers with Merlin firmware that introduces CAKE QoS as an alternative to Traditional/Adaptive/FreshJR implementations. - ttgapers/cakeqos-merlingithub.com
You essentially pass the action for service-event to run via the action_script ASP variable and then trigger the ajax check with a suitable timeout based on how long you think it will take for the response to be ready in /www/ext/.
The main page doesn't get blocked or refreshed until the result is available. If you need to use the custom_settings to transfer your script name, I don't recall if you need to submit the main form in order for httpd to process that variable or not.
Otherwise, when your page refreshes after submit, you need something in theinitial()
function to load that file under /ext/ into your text field. Maybe you should post the full code somewhere for review. Or study how the System Log page loads the initial syslog files and then refreshes every 3 seconds. It uses special commands for fetching the syslog data, but the initial load through ajax calls is still there.
start_scriptsuiname1
and you can have a service-event
script check look for that event, and pass name1 to your script to run it:if echo "$2" | /bin/grep -q "^scriptsui"; then
sh /jffs/addons/scriptsui/scriptsui.sh "${2#scriptsui}" &
fi
Thank you @dave14305, I now have a working solution based on all your input and direction - this is solved!!!I would submit a different form than the main form so it doesn’t need to reload the whole page. If you are loading your script list via js, presumably you have some way to identify them uniquely.
So the action_script on this additional form could bestart_scriptsuiname1
and you can have aservice-event
script check look for that event, and pass name1 to your script to run it:
Another example is the ver_check form in FlexQoS. It submits and fetches results without reloading the page.Code:if echo "$2" | /bin/grep -q "^scriptsui"; then sh /jffs/addons/scriptsui/scriptsui.sh "${2#scriptsui}" & fi
![]()
FlexQoS/flexqos.asp at master · dave14305/FlexQoS
FlexQoS - Flexible QoS Enhancement Script for Adaptive QoS on ASUSWRT-Merlin - dave14305/FlexQoSgithub.com
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!