Issue UI: add system and timezone (#26072)
This commit is contained in:
parent
795e12ba16
commit
97444e6241
10 changed files with 80 additions and 15 deletions
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ function generateBody(issue: IssueData, additional: string): string {
|
|||
additional,
|
||||
"## Version",
|
||||
issue.version,
|
||||
"## System",
|
||||
`${issue.system}, ${issue.timezone}`,
|
||||
];
|
||||
|
||||
return toString(sections);
|
||||
|
|
|
|||
2
assets/js/components/Issue/types.d.ts
vendored
2
assets/js/components/Issue/types.d.ts
vendored
|
|
@ -3,6 +3,8 @@ export interface IssueData {
|
|||
description: string;
|
||||
steps: string;
|
||||
version: string;
|
||||
system: string;
|
||||
timezone: string;
|
||||
}
|
||||
|
||||
export interface SectionData {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ export interface State {
|
|||
authProviders?: AuthProviders;
|
||||
evopt?: EvOpt;
|
||||
version?: string;
|
||||
system?: string;
|
||||
timezone?: string;
|
||||
battery?: BatteryMeter[];
|
||||
pv?: Meter[];
|
||||
aux?: Meter[];
|
||||
|
|
|
|||
|
|
@ -107,18 +107,44 @@
|
|||
required
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label for="version" class="form-label">
|
||||
{{ $t("issue.version") }}
|
||||
</label>
|
||||
<input
|
||||
id="version"
|
||||
v-model="versionString"
|
||||
type="text"
|
||||
class="form-control"
|
||||
required
|
||||
readonly
|
||||
/>
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 col-md-4 mb-4 mb-md-0">
|
||||
<label for="version" class="form-label">
|
||||
{{ $t("issue.version") }}
|
||||
</label>
|
||||
<input
|
||||
id="version"
|
||||
v-model="versionString"
|
||||
type="text"
|
||||
class="form-control"
|
||||
required
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-4 mb-4 mb-md-0">
|
||||
<label for="system" class="form-label">
|
||||
{{ $t("issue.system") }}
|
||||
</label>
|
||||
<input
|
||||
id="system"
|
||||
v-model="systemString"
|
||||
type="text"
|
||||
class="form-control"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="timezone" class="form-label">
|
||||
{{ $t("issue.timezone") }}
|
||||
</label>
|
||||
<input
|
||||
id="timezone"
|
||||
v-model="timezoneString"
|
||||
type="text"
|
||||
class="form-control"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<small class="text-muted">* required</small>
|
||||
|
|
@ -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 }));
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -838,6 +838,8 @@
|
|||
"stepTwo": "Schritt 2: Zusätzliche Informationen kopieren",
|
||||
"title": "GitHub Problem-Zusammenfassung"
|
||||
},
|
||||
"system": "System",
|
||||
"timezone": "Zeitzone",
|
||||
"title": "Problem melden",
|
||||
"version": "Version"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -838,6 +838,8 @@
|
|||
"stepTwo": "Step 2: Copy additional information",
|
||||
"title": "GitHub Problem Summary"
|
||||
},
|
||||
"system": "System",
|
||||
"timezone": "Timezone",
|
||||
"title": "Report a problem",
|
||||
"version": "Version"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue