mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 10:46:16 +01:00
Adds display unit preference (#938)
* Adds temperature unit preference * add unit preferences for networking * adds options for MB/s and bps. * supports disk throughput unit preferences
This commit is contained in:
@@ -17,6 +17,9 @@ type UserSettings struct {
|
||||
ChartTime string `json:"chartTime"`
|
||||
NotificationEmails []string `json:"emails"`
|
||||
NotificationWebhooks []string `json:"webhooks"`
|
||||
TemperatureUnit string `json:"temperatureUnit"` // "celsius" or "fahrenheit"
|
||||
NetworkUnit string `json:"networkUnit"` // "mbps" (MB/s) or "bps"
|
||||
DiskUnit string `json:"diskUnit"` // "mbps" (MB/s) or "bps"
|
||||
// Language string `json:"lang"`
|
||||
}
|
||||
|
||||
@@ -43,6 +46,9 @@ func (um *UserManager) InitializeUserSettings(e *core.RecordEvent) error {
|
||||
ChartTime: "1h",
|
||||
NotificationEmails: []string{},
|
||||
NotificationWebhooks: []string{},
|
||||
TemperatureUnit: "celsius",
|
||||
NetworkUnit: "mbps",
|
||||
DiskUnit: "mbps",
|
||||
}
|
||||
record.UnmarshalJSONField("settings", &settings)
|
||||
if len(settings.NotificationEmails) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user