Finally finished theme switching!!!!

This commit is contained in:
Donald Cheng Hong Zou
2022-04-23 00:34:11 -04:00
parent 36e33a4c10
commit e06cc1bd2d
13 changed files with 218 additions and 36 deletions
+11 -1
View File
@@ -181,4 +181,14 @@ class manageConfiguration:
return ret(status=False, reason="No [Interface] in configuration file")
return ret(data=dict(conf['Interface']))
except FileNotFoundError as err:
return ret(status=False, reason=str(err))
return ret(status=False, reason=str(err))
class settings:
def setTheme(self, theme, config, setConfig):
themes = ['light', 'dark']
if theme not in themes:
return ret(status=False, reason="Theme does not exist")
config['Server']['dashboard_theme'] = theme
setConfig(config)
return ret()