From 34db03ce3b6a455a17da33bf10a8eb0165b90c2c Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Wed, 26 Mar 2008 14:41:22 +0000 Subject: First commit on opennhrp. Only shows standard process information and shows connected peers (or what to call them). git-svn-id: svn://svn.alpinelinux.org/acf/opennhrp/trunk@841 ab2d0c66-481e-0410-8bed-d214d4d58bed --- opennhrp-controller.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 opennhrp-controller.lua (limited to 'opennhrp-controller.lua') diff --git a/opennhrp-controller.lua b/opennhrp-controller.lua new file mode 100644 index 0000000..e592bbc --- /dev/null +++ b/opennhrp-controller.lua @@ -0,0 +1,37 @@ +module(..., package.seeall) + +-- This is the object/text used when we want to add a new record + +require("format") + +local newrecordtxt = "[New]" + +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 +-- ################################################################################ +-- PUBLIC FUNCTIONS +function status(self) + return { status=getstatus(self) } +end + -- cgit v1.2.3