evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Discuss: add config modal

Open diddip21 opened this issue 8 months ago • 3 comments

#18874 #18772

Erster versuch eine Erste-Hilfe Discussion in Github zu eröffnen. In der UI ist bis jetzt noch nicht die api/config/live referenziert da diese einen vorherigen login benötigt. Ansonsten ist es mein erster "armseliger" versuch eine Art von LiveConfig zu generieren. Nehmt es auseinander 😎

Summary by Sourcery

Add a UI feature to assist users in creating GitHub support discussions and expose the live system configuration via a new API endpoint.

New Features:

  • Introduce a "Discuss" modal accessible from the Help menu to pre-fill a GitHub discussion with system state and optional logs.
  • Add a /api/live endpoint consolidating configuration from various sources (files, UI, database).

Enhancements:

  • Modify device and loadpoint configuration endpoints to return comprehensive data including YAML fields.

diddip21 avatar Apr 28 '25 15:04 diddip21

Reviewer's Guide by Sourcery

Adds a UI feature to generate GitHub discussions with system data and introduces a new API endpoint /api/system/live to expose the full live configuration.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Implement a "First aid discussion" feature in the Help modal.
  • Add a "Discuss" button
  • Create a new modal for discussion content
  • Fetch system state and logs
  • Allow user to add description and include logs
  • Generate a GitHub discussion URL with pre-filled data
  • Provide a button to copy generated data
assets/js/components/HelpModal.vue
Add a new API endpoint to retrieve the live system configuration.
  • Register a new GET route /api/system/live
  • Implement a handler to collect and return site, device, and global settings configuration in JSON format
server/http.go
server/http_config_live_handler.go
Modify backend configuration handlers to include all YAML fields in the output.
  • Update loadpoint configuration handler to return a map including all YAML fields
  • Update generic device configuration handler to include all YAML fields
server/http_config_loadpoint_handler.go
server/http_config_device_handler.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Apr 28 '25 15:04 sourcery-ai[bot]

Ohne im Detail geschaut zu haben: schön wäre, wenn sich der Anwender per Roundtrip bei GH anmelden könnte so dass wir per API direkt in seinem User die Discussion öffnen könnten. Ich hab allerdings nicht geprüft, ob das ohne redirect URL überhaupt klappen kann.

andig avatar May 01 '25 10:05 andig

@diddip21 Danke für den PR. Ist ein großes Thema. Aber ist ein guter Start. Die Idee dem Nutzer die Daten strukturiert einmal in der evcc UI zu präsentieren bevor er sie zu Github rüberflankt ist gut. Gibt dem Nutzer mehr Kontrolle. Größtes Thema ist vmtl. die Redaktion/"Secrets schwärzen" sauber hinzubekommen.

Hätte auch noch einige Anmerkungen zum Ablauf. Bspw. würde ich den state nicht immer mitschicken. Ist aber gut, wenn der Nutzer das auf Anforderung einfach hinzufügen bzw. hier rauskopieren und nachreichen kann. Was aus dem State allerdings immer relevant ist, ist die Versionsnummer. Die sollten wir dediziert ins Template einbauen.

naltatis avatar May 09 '25 12:05 naltatis

Fixed by https://github.com/evcc-io/evcc/pull/23707

naltatis avatar Sep 30 '25 12:09 naltatis