Option to Fully Disable / Detach state.js modifications#71
Option to Fully Disable / Detach state.js modifications#71Martinski4GitHub merged 6 commits intodevelopfrom
Conversation
Initial commit to support disabling of Dropdown Sub-Menus from scMerlin
Actually detach state.js modifications
|
After some reflection I'm thinking we should add a similar option for the sitemap since it also requires modifications to state.js. Thoughts? |
I fully agree that it's a good idea to make the "WebUI left-side menu dropdowns" feature optional, but not necessarily as "a separate feature detached of scMerlin." Instead, it would be a new user-selectable option available within the scMerlin menu.
I'll start to take a look later this evening, but probably will not finish the review until Friday or Saturday evening, depending on how things go the rest of the week (I have a work deadline coming up next week and some personal stuff to take care of this week). We'll talk later. |
Yes, you might as well make the Sitemap and the "Help and Support" WebUI pages also user-selectable options. |
Include Unload of Sitemap.asp
|
Hey @Martinski4GitHub buddy I added code to also manage the unloading of the Sitemap.asp (as discussed) However I left the Help and Support tab, since that seems to actually stem from the shared-jy and not from scMerlin, also the Help And Support does not require modifications to the state.js javascript file, so it doesn't have nearly as heavy of modifications/dependencies like the other scMerlin functions (sitemap and drop down menus) I also tested this across both 3004 and 3006 firmware with expected behavior, seems to work correctly for me. However I can always use an extra pair of eyes! I was not sure if you wanted it as 2 separate options (one for the drop downs and one for the sitemap), or a single option for both, so I opted to have a single option that unloads all the modifications instead of one for the drop down and one for the sitemap. However I made sure to keep the code for each in their own separate functions incase you do want separate buttons for each. Let me know if you have any questions or notice anything while testing! |
|
Now that we've handled unloading the modifications to state.js - I also wonder about any modifications to the index_style.css Would this be a potential area of concern for firmware upgrades and breaking the webUI? Maybe? Right now we continue to load modifications to the css at index_style.css , just wanted to bring that to your attention. (not trying to hide anything) I believe the actual source of issues in the past was state.js , but the css could probably cause issues as well, I'm assuming. |
Very good job, bud!!
Ah yes, good point, and it makes sense since that's a separate webpage with no ties to the state.js file.
Either way (one option for both, or a separate option for each) is fine with me. I suspect the Sitemap page is not widely used, so having a single option for both should be fine for the vast majority of users.
Apologies for the long "radio silence." My wife's mother had cataract surgery on Friday, so we've been over to their house all weekend to keep an eye on her recovery and take care of things. The 1st few days after surgery are crucial to avoid possible infection and inflammation risks, so my wife has been ensuring that the medications and post-surgery hygienic routines are followed religiously. So I have had no time to do a full review of the PR changes, nor have I done proper testing. I'll try to do it whenever I can, but likely after I have completed my work deliverables due end-of-day on March 12th. Talk to you later, bud. |
Frankly, I don't recall the modifications made in the index_style.css file. They were likely added to support the Sitemap webpage and/or the WebUI left-side menu dropdowns, and as such, they wouldn't be needed if those 2 are disabled. I don't think CSS changes by themselves would cause issues if nobody else is using them, but it's probably better to remove them and have a "cleaner" slate. Have a good week, bud. |
Unload any changes to css when disabling
Bug Fixes Cleanup the uninstall
Just minor details, but wanted you to know the reason behind my thinking. Naturally, if we learn down the line that shared-jy is actually causing issues, we can re-evaluate then :)
Yeah exactly what I figured, I did leave them as 2 functions (one for the drop downs, one for the sitemap) JUSTTT incase though ;) But my thought was the same as yours, probably few people use the sitemap and the real concern was unloading the changes if/when it breaks some day in the future, so I renamed the option and just made it a "one big bang" approach, if scMerlin breaks something again in the future, the single button is all the user needs to restore functionality and undo "all" changes to the WebUI.
Oh wow! I hope she recovers quickly. As you know my father "recently" went through that, and he ended up being one of the few individuals with complications from the surgery. Luckily the doctors seem to have stabilized the infection/inflammation and his eye is under control these days, the doctors initially weren't so sure if he was going to have permanent vision loss, the remaining side effect now is some permanent "blurriness" to his vision, they aren't sure will ever be fixed with the new lens. All that to say I totally understand the situation your in. Do take care of her where you can! My father needed us to drive him around to the eye doctor every other day, and help him with basic tasks while his eye was patched up and under observation.
No rush, you know how I work, I am just poking away at it when I have free time, the goal is to help where I can. But I did test these latest changes and all seems to work for me! I think it's ready for your stamp of approval (or disapproval if you or the linter tool finds anything!) |
It was a like 4-5 lines... Found below: The main additions that are scMerlin related are: .dropdown:hover and .dropdown-content Due to this, I made the changes for .menu_Addons conditional on if the add-ons drop menu exists in MenuTree.js The others for .dropdown:hover and .dropdown-content are removed and added with the new control option on disable and enable. I really don't think those are high risk, but as you mentioned, the cleaner the better when it comes to avoiding future issues. |
Agreed.
Sounds good.
I hope your Dad has by now fully recovered from his eye surgery with very minimal to no side effects, and things are under control. So far, my mother-in-law is doing well in her recovery, and my wife especially has been on top of things, making sure her Mom takes her medications at the scheduled times and keeps her eye patch clean, etc. Today, we drove her to the clinic for a follow-up visit to check the progress of her recovery. My father might need the same surgery sometime this year if his cataracts become worse to the point that it impairs his daily activities, especially driving around town.
Sounds like you've already done your due diligence. I'll let you know when I complete my part, most likely by Friday evening, or sometime over the coming weekend, depending on how things go with work and personal stuff. Have a good night and take care, bud. |
Looks like you've taken care of everything that was inserted into the state.js file, and which could have become a potential issue in future F/W releases. Good job. bud!! |
Gate AJAX Loops when restarting WebUI
|
I noticed some errors today in the F12 dev console, after adding the restart to httpd, and it was due to the AJAX loops continuing to try and fetch data and getting html back while restarting the WebUI. Added some gates to silence the errors. It wasn't something I checked initially after adding the restarts to httpd but I noticed it today while testing, simple fix was to just gate the AJAX loops when we knew we were going to disrupt the WebUI |
Great catch, bud. This morning, I reviewed the PR changes and then ran testing and validation. So far, it looks very good. I also put the source code through the Linter, and there were only some minor warnings (about not following some of our formatting standards and coding style) - really nothing to worry about. But most importantly: no errors!!! There are some changes/improvements I'd like to make, so I'll approve this PR and then submit my changes in a separate PR for your review and validation. Great job, bud!!! |
Martinski4GitHub
left a comment
There was a problem hiding this comment.
Looking good - Approved.
@Martinski4GitHub
Food for thought on this? You can follow the discussion here for the details and inspiration :
https://www.snbforums.com/threads/long-time-asus-merlin-first-time-amtm-reassurance-please.96827/post-986236
In short, the idea is to offset some of the bad press scMerlin has received over the years due to making modifications to state.js causing things to break the WebUI in firmware upgrades. This change means we no longer make it mandatory to have the drop down options, and make it user controllable and a separate feature detached of scMerlin.
If something breaks in a future firmware upgrade, a single click and the user is back in business as we unload the modifications to state.js
Might need further testing and put through it's paces with both 3006 and 3004 firmware.
I wouldn't be surprised if I introduced a bug or two as this isn't my regular project I'm familiar with, so please put it through the linter tool as well when you have a moment! :)
Thanks buddy! Hope you agree with the idea/premise