0
0
mirror of https://github.com/hexparrot/mineos synced 2025-10-06 00:02:56 +02:00

generalized webui config access

mask_password replaced with webui_config that returns ALL
webui.attributes for future web-ui settings.
This commit is contained in:
hexparrot
2014-02-27 18:53:28 -07:00
parent 6884b3b734
commit 64cfe284f4
4 changed files with 6 additions and 8 deletions

View File

@@ -175,7 +175,7 @@
$('input[name=password]').attr('type', 'password');
}
$.getJSON('/mask_password', function(data) {
$.getJSON('/webui_config', function(data) {
if (data.mask_password)
$('input[name=hide]').iCheck('check');
})

View File

@@ -175,7 +175,7 @@
$('input[name=password]').attr('type', 'password');
}
$.getJSON('/mask_password', function(data) {
$.getJSON('/webui_config', function(data) {
if (data.mask_password)
$('input[name=hide]').iCheck('check');
})

View File

@@ -16,4 +16,5 @@ misc.pid_file = "/var/run/mineos.pid"
misc.require_https = True
misc.base_directory = "/var/games/minecraft"
misc.localization = "en"
misc.mask_password = False
webui.mask_password = False

View File

@@ -219,11 +219,8 @@ class Root(object):
@cherrypy.expose
@cherrypy.tools.json_out()
def mask_password(self):
try:
return {'mask_password': cherrypy.config['misc.mask_password']}
except KeyError:
return {'mask_password': False}
def webui_config(self):
return {k.lstrip('webui.'):v for k,v in cherrypy.config.iteritems() if k.startswith('webui.')}
@property
def login(self):