local util = require("util") local data = util.merge({notification=''},{ opts = app.opts }) if GetMethod() == 'POST' then local params = GetParams() local saveconfig = false foreach(params, function(k,v) if v[1]:match("^opts.") then app.opts[ v[1]:gsub("^opts.","") ] = v[2] -- update saveconfig = true end end) if saveconfig then app.set('app.opts', app.opts ) data.notification = '
updated
' else data.notification = '
no changes detected
' end end local html = util.template( LoadAsset("page/admin/index.html"),data) SetStatus(200) SetHeader('Content-Type', 'text/html; charset=utf-8') Write( html )