From 97444e6241561260eda070b39eafac4c55d33ac8 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Sun, 21 Dec 2025 13:16:59 +0100 Subject: [PATCH] Issue UI: add system and timezone (#26072) --- assets/js/components/Issue/template.test.ts | 8 ++- assets/js/components/Issue/template.ts | 2 + assets/js/components/Issue/types.d.ts | 2 + assets/js/types/evcc.ts | 2 + assets/js/views/Issue.vue | 63 ++++++++++++++++----- cmd/root.go | 2 + core/keys/global.go | 2 + i18n/de.json | 2 + i18n/en.json | 2 + util/version.go | 10 +++- 10 files changed, 80 insertions(+), 15 deletions(-) diff --git a/assets/js/components/Issue/template.test.ts b/assets/js/components/Issue/template.test.ts index d5a21d673..b3b2f2a7b 100644 --- a/assets/js/components/Issue/template.test.ts +++ b/assets/js/components/Issue/template.test.ts @@ -8,6 +8,8 @@ describe("Issue Utils", () => { description: "This is a test description", steps: "1. Do something\n2. See error", version: "v1.0.0", + system: "Linux/amd64", + timezone: "MST -07:00", }; const mockSections: Sections = { @@ -51,7 +53,11 @@ other: test ## Version -v1.0.0`); +v1.0.0 + +## System + +Linux/amd64, MST -07:00`); expect(result.additional).toBeUndefined(); }); diff --git a/assets/js/components/Issue/template.ts b/assets/js/components/Issue/template.ts index 5ef252b19..1620a1663 100644 --- a/assets/js/components/Issue/template.ts +++ b/assets/js/components/Issue/template.ts @@ -35,6 +35,8 @@ function generateBody(issue: IssueData, additional: string): string { additional, "## Version", issue.version, + "## System", + `${issue.system}, ${issue.timezone}`, ]; return toString(sections); diff --git a/assets/js/components/Issue/types.d.ts b/assets/js/components/Issue/types.d.ts index 295c92c88..29cd25c0c 100644 --- a/assets/js/components/Issue/types.d.ts +++ b/assets/js/components/Issue/types.d.ts @@ -3,6 +3,8 @@ export interface IssueData { description: string; steps: string; version: string; + system: string; + timezone: string; } export interface SectionData { diff --git a/assets/js/types/evcc.ts b/assets/js/types/evcc.ts index bb124f603..f48eed4a7 100644 --- a/assets/js/types/evcc.ts +++ b/assets/js/types/evcc.ts @@ -69,6 +69,8 @@ export interface State { authProviders?: AuthProviders; evopt?: EvOpt; version?: string; + system?: string; + timezone?: string; battery?: BatteryMeter[]; pv?: Meter[]; aux?: Meter[]; diff --git a/assets/js/views/Issue.vue b/assets/js/views/Issue.vue index 7f6b1536b..bec26480f 100644 --- a/assets/js/views/Issue.vue +++ b/assets/js/views/Issue.vue @@ -107,18 +107,44 @@ required > -
- - +
+
+ + +
+
+ + +
+
+ + +
* required @@ -362,6 +388,12 @@ export default defineComponent({ versionString(): string { return `v${store.state.version || ""}`; }, + systemString(): string { + return store.state.system || ""; + }, + timezoneString(): string { + return store.state.timezone || ""; + }, configPath(): string | undefined { return store.state.config; }, @@ -369,7 +401,12 @@ export default defineComponent({ return store.state.database; }, issueData(): IssueData { - return { ...this.issue, version: this.versionString }; + return { + ...this.issue, + version: this.versionString, + system: this.systemString, + timezone: this.timezoneString, + }; }, logAreaOptions() { return this.logAvailableAreas.map((area) => ({ name: area, value: area })); diff --git a/cmd/root.go b/cmd/root.go index 7960646e2..67e51da7f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -366,6 +366,8 @@ func runRoot(cmd *cobra.Command, args []string) { valueChan <- util.Param{Key: keys.Version, Val: util.FormattedVersion()} valueChan <- util.Param{Key: keys.Config, Val: viper.ConfigFileUsed()} valueChan <- util.Param{Key: keys.Database, Val: db.FilePath} + valueChan <- util.Param{Key: keys.System, Val: util.System()} + valueChan <- util.Param{Key: keys.Timezone, Val: time.Now().Format("MST -07:00")} // run shutdown functions on stop var once sync.Once diff --git a/core/keys/global.go b/core/keys/global.go index 55ca9bf38..22e4edb2d 100644 --- a/core/keys/global.go +++ b/core/keys/global.go @@ -18,6 +18,8 @@ const ( Version = "version" Config = "config" Database = "database" + System = "system" + Timezone = "timezone" Fatal = "fatal" StartupCompleted = "startupCompleted" // false: starting, true: started SetupRequired = "setupRequired" // initial setup is required (lp = 0), fresh installation diff --git a/i18n/de.json b/i18n/de.json index dae578e1c..421fe2dfd 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -838,6 +838,8 @@ "stepTwo": "Schritt 2: Zusätzliche Informationen kopieren", "title": "GitHub Problem-Zusammenfassung" }, + "system": "System", + "timezone": "Zeitzone", "title": "Problem melden", "version": "Version" }, diff --git a/i18n/en.json b/i18n/en.json index ec5739c30..ed6a43759 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -838,6 +838,8 @@ "stepTwo": "Step 2: Copy additional information", "title": "GitHub Problem Summary" }, + "system": "System", + "timezone": "Timezone", "title": "Report a problem", "version": "Version" }, diff --git a/util/version.go b/util/version.go index 515ac968d..dceab7cf8 100644 --- a/util/version.go +++ b/util/version.go @@ -1,6 +1,9 @@ package util -import "fmt" +import ( + "fmt" + "runtime" +) const DevVersion = "0.0.0" @@ -18,3 +21,8 @@ func FormattedVersion() string { } return Version } + +// System returns the operating system and architecture +func System() string { + return runtime.GOOS + "/" + runtime.GOARCH +}