Skip to content
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

Add ability to edit custom config parameters, both for global and bot configs. #1698

Open
5 tasks done
Rudokhvist opened this issue Oct 14, 2024 · 2 comments
Open
5 tasks done
Labels
✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features. 👍 PR-ok Issues marked with this label are good candidates for being accepted in a pull request.

Comments

@Rudokhvist
Copy link
Member

Checklist

  • I read and understood ASF-ui's Contributing Guidelines
  • I also read FAQ
  • My idea doesn't duplicate existing ASF-ui functionality described on the wiki
  • I believe that my idea falls into ASF-ui's scope and should be offered as part of ASF-ui built-in functionality
  • This is not ASF suggestion

Enhancement purpose

Add ability to edit custom properties in configuration files, that are parsed by third-party plugins.

Solution

I believe it should be a multi-line text area with non-parsed json of unsupported parameters. Upon saving would be nice to check if it's still valid json, if possible, and show error without saving otherwise.

Why currently available solutions are not sufficient?

Currently editing those parameters only possible by directly editing files on disk. For VPS-hosted ASF it will be more convenient to have ability to edit them via ASF-ui

Can you help us with this enhancement idea?

Somehow, I can test and offer feedback, but can't code

Additional info

Theoretically, we can agree on some "well-known" endpoint where plugins should report schema for supported parameters. But it looks a bit hard to implement, so I believe just a field with json should do.

@Rudokhvist Rudokhvist added ✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features. 🧐 Evaluation Issues marked with this label are currently being evaluated if they're going to be considered. labels Oct 14, 2024
@MrBurrBurr MrBurrBurr added 👍 PR-ok Issues marked with this label are good candidates for being accepted in a pull request. and removed 🧐 Evaluation Issues marked with this label are currently being evaluated if they're going to be considered. labels Oct 14, 2024
@JustArchi
Copy link
Member

JustArchi commented Oct 14, 2024

The API already returns all the defined properties, and of course saves them back, so it seems there is no ASF block here:

obraz

How I see it:

  • Check swagger spec to discover all recognized properties. Those should be presented normally because swagger defines type for each property, so you can present them nicely in the UI.
  • All extra unknown properties should be rendered as some kind of additional view, like @Rudokhvist suggested above. We can't do much with them because we don't know their type (sometimes you can guess from true or false to be a boolean, but good luck guessing from null).
  • ASF-ui can simply append extra properties from that additional view to final json sent to ASF, so everything will be saved.

Wishlist:

  • Plugins can expose config properties through swagger. It's a matter of agreeing on some general path and making ASF-ui parse the types from there. I did it with STD plugin for example.

@Aareksio
Copy link
Member

I smell #1022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features. 👍 PR-ok Issues marked with this label are good candidates for being accepted in a pull request.
Projects
None yet
Development

No branches or pull requests

4 participants