diff options
Diffstat (limited to 'quagga-controller.lua')
-rw-r--r-- | quagga-controller.lua | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/quagga-controller.lua b/quagga-controller.lua index 8550fb5..cb63668 100644 --- a/quagga-controller.lua +++ b/quagga-controller.lua @@ -1,24 +1,20 @@ module(..., package.seeall) --- This is the object/text used when we want to add a new record - +-- Load libraries require("format") +-- Set variables local newrecordtxt = "[New]" -local list_redir = function (self) +-- ################################################################################ +-- LOCAL FUNCTIONS + +local function list_redir(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 displaycmdmanagement(disablestart,disablestop,disablerestart) -- Add a management buttons local management = {} @@ -48,11 +44,18 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS +mvc = {} +function mvc.on_load(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 + function status(self) return { status=self.model.getstatus() } end -expert = function (self) +function expert(self) local modifications = self.clientdata.filecontent or "" if ( self.clientdata.cmdsave ) then modifications = self.model:update_filecontent(modifications) @@ -107,7 +110,8 @@ expert = function (self) cmdmanagement = cmdmanagement, url = url, } ) end -logfile = function (self) + +function logfile(self) local status=self.model.getstatus() local logfile = self.model:get_logfile() |