-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No code formatting for Manage Sites --> Advanced #73
Comments
We use gonginx to build the configuration content from the JSON object (ngx object). The ngx object is parsed by gonginx. When you edit the configuration in basic mode, you are actually editing the ngx object. When you click the "Advance" toggle button, the ngx object is sent to the backend, and the configuration content is rendered in the frontend, with automatic code formatting. However, gonginx may not always work as expected and cause issues in your environment. I plan to add a setting option in the preference page that will force the use of advance mode in the site editing page, implementing your proposal. However, this will result in the loss of some functions in basic mode, such as "Encrypting the website with Let's Encrypt". |
Added in defd814. The system now will save your preference of edior mode. For example, after enabling advanced mode, the next time you enter the editor for this domain, it will use advanced mode by default with no code formatting. But we still hope you can give us more information of the problems you met, thanks. |
Hi @tufanbarisyildirim. Sorry for the delay... but here is the example. GoNginx destroys my location blocks. Here is my original config code and here is the mangled code from GoNginx |
Try to upgrade nginx-ui to v1.8.3? This issue might be fixed in previous version. |
Hi @0xJacky and @pksml85 can you please test this tufanbarisyildirim/gonginx#18 (issue-17 is the branch) to see if it works for your nginx conf? Thanks again for finding it! |
Thanks @tufanbarisyildirim , now it works perfactly! |
Thanks for that quick confirmation @0xJacky ! |
First of all, thanks for getting Issue #69 tackled so quickly! Much appreciated.
When I go to Manage Sites --> Modify --> Advanced, my nginx code is automatically formatted. I have a rather complicated configuration for my site (complicated at least in the eyes of the parser), and the auto formatting breaks my config. (While I can modify my site config through Manage Configs, it's a bit more of a hassle.)
So my proposal is when clicking the 'Advanced' toggle button in Manage Sites, don't automatically format the code. This way advanced users won't have their config messed up. (I also really like white space in my config for ease of understanding and I lose this with auto formatting.)
You might consider having a button at the bottom of the screen to auto format like you do for Manage Configs for those who would like to use it. This would greatly improve usability. Thanks!
The text was updated successfully, but these errors were encountered: