kopia lustrzana https://github.com/cyoung/stratux
Add dark mode setting storage
rodzic
fb7a09ba3e
commit
463721c93b
|
@ -1103,6 +1103,7 @@ func getProductNameFromId(product_id int) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
type settings struct {
|
type settings struct {
|
||||||
|
DarkMode bool
|
||||||
UAT_Enabled bool
|
UAT_Enabled bool
|
||||||
ES_Enabled bool
|
ES_Enabled bool
|
||||||
Ping_Enabled bool
|
Ping_Enabled bool
|
||||||
|
@ -1186,6 +1187,7 @@ var globalSettings settings
|
||||||
var globalStatus status
|
var globalStatus status
|
||||||
|
|
||||||
func defaultSettings() {
|
func defaultSettings() {
|
||||||
|
globalSettings.DarkMode = false
|
||||||
globalSettings.UAT_Enabled = true
|
globalSettings.UAT_Enabled = true
|
||||||
globalSettings.ES_Enabled = true
|
globalSettings.ES_Enabled = true
|
||||||
globalSettings.GPS_Enabled = true
|
globalSettings.GPS_Enabled = true
|
||||||
|
|
|
@ -271,6 +271,8 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
|
||||||
for key, val := range msg {
|
for key, val := range msg {
|
||||||
// log.Printf("handleSettingsSetRequest:json: testing for key:%s of type %s\n", key, reflect.TypeOf(val))
|
// log.Printf("handleSettingsSetRequest:json: testing for key:%s of type %s\n", key, reflect.TypeOf(val))
|
||||||
switch key {
|
switch key {
|
||||||
|
case "DarkMode":
|
||||||
|
globalSettings.DarkMode = val.(bool)
|
||||||
case "UAT_Enabled":
|
case "UAT_Enabled":
|
||||||
globalSettings.UAT_Enabled = val.(bool)
|
globalSettings.UAT_Enabled = val.(bool)
|
||||||
case "ES_Enabled":
|
case "ES_Enabled":
|
||||||
|
|
Ładowanie…
Reference in New Issue