module(..., package.seeall) local list_redir = function (self) self.conf.action = "status" self.conf.type = "redir" error (self.conf) end mvc = {} mvc.on_load = function(self, parent) if (self.worker[self.conf.action] == nil ) or ( self.conf.action == "init" ) then self.worker[self.conf.action] = list_redir(self) end end local function getstatus(self) local status = self.model.getstatus() if (#status.status.value > 0) then status.status.value = "Enabled" else status.status.value = "Disabled" end return status end function status(self) return { status=getstatus(self) } end function config(self) local config = self.model.getconfig(self) local debug = self.model.getdebug(self) return ({ status=getstatus(self), config=config, debug=debug, }) end