diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-03-26 14:41:22 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-03-26 14:41:22 +0000 |
commit | 34db03ce3b6a455a17da33bf10a8eb0165b90c2c (patch) | |
tree | aa27e055e2ec913cfea979e1c865c2f35429e931 /opennhrp-controller.lua | |
download | acf-opennhrp-34db03ce3b6a455a17da33bf10a8eb0165b90c2c.tar.bz2 acf-opennhrp-34db03ce3b6a455a17da33bf10a8eb0165b90c2c.tar.xz |
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
Diffstat (limited to 'opennhrp-controller.lua')
-rw-r--r-- | opennhrp-controller.lua | 37 |
1 files changed, 37 insertions, 0 deletions
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 + |