-
-
Notifications
You must be signed in to change notification settings - Fork 947
Discuss: add config modal #20928
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
base: master
Are you sure you want to change the base?
Discuss: add config modal #20928
Conversation
Reviewer's Guide by SourceryAdds 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…sion for static and dynamic configurations
if err := jsonDecoder(r).Decode(&payload); err != nil { | ||
return loadpoint.DynamicConfig{}, nil, err | ||
// Hilfsfunktion: Struct zu map[string]any | ||
func structToMap(s any) map[string]any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das wäre
structs.Map
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. |
"startup": importSettings("startup"), | ||
"plant": importSettings("plant"), | ||
"telemetry": importSettings("telemetry"), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In vielen diese Entries können sensible Daten drin sein. Wir müssen hier auf jeden Fall sauber redact
machen.
Hier ein paar stellen wo wir so etwas schon machen:
-
evcc dump
Line 68 in de40390
redacted = redact(string(src)) -
publishing von
mqtt
,influx
, ...
evcc/api/globalconfig/types.go
Line 88 in de40390
func (m Mqtt) Redacted() any { -
config api device Endpunkte (
vehicle
, ...)
evcc/server/http_config_helper.go
Line 96 in de40390
func sanitizeMasked(class templates.Class, conf map[string]any) (map[string]any, error) {
@@ -260,6 +260,7 @@ func (s *HTTPd) RegisterSystemHandler(site *core.Site, valueChan chan<- util.Par | |||
"interval": {"POST", "/interval/{value:[0-9.]+}", settingsSetDurationHandler(keys.Interval)}, | |||
"updatesponsortoken": {"POST", "/sponsortoken", updateSponsortokenHandler}, | |||
"deletesponsortoken": {"DELETE", "/sponsortoken", deleteSponsorTokenHandler}, | |||
"liveconfig": {"GET", "/live", LiveConfigHandler(site)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich bin mit dem Namen noch nicht glücklich. Ich wäre dafür das in den /system
Namespace zu hängen. Also GET /system/config
analog zu GET /system/log
.
@click="openDiscussModal" | ||
> | ||
{{ $t("help.discussButton") }} | ||
</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return loadpoint.DynamicConfig{}, nil, err | ||
} | ||
|
||
return loadpoint.SplitConfig(payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bin mir nicht sicher wo hier der Fehler ist, aber mit dieser Umstellung funktioniert die Loadpoint API nicht mehr. Siehe Integrationstests:
4 failed
[chromium] › tests/config-loadpoint.spec.js:66:3 › loadpoint › create, update and delete ───────
[chromium] › tests/config-loadpoint.spec.js:161:3 › loadpoint › priority ───────────────────────
[chromium] › tests/config-loadpoint.spec.js:215:3 › loadpoint › vehicle ────────────────────────
[chromium] › tests/config-loadpoint.spec.js:272:3 › loadpoint › keep mode ──────────────────────
@@ -166,6 +298,64 @@ export default { | |||
async restartConfirmed() { | |||
await performRestart(); | |||
}, | |||
async openDiscussModal() { | |||
const modal = Modal.getOrCreateInstance(document.getElementById("discussModal")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die Endpunkte hier erfordern Login. Hier müssen wir, analog Restart Modal, den Status prüfen.
evcc/assets/js/components/HelpModal.vue
Line 292 in de40390
if (!isLoggedIn()) { |
generatedData: "", | ||
includeLogs: false, // Neue Variable für die Checkbox | ||
logData: "", // Neue Variable für die Log-Daten | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das DiscussModal
sollte auf jeden Fall eine eigene Vue Komponenten werden. Da kommt ja einiges an State und Logik zusammen.
@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 |
#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:
/api/live
endpoint consolidating configuration from various sources (files, UI, database).Enhancements: