From d93688f0d12c5c7c9f35d4746eef58bac11a144a Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Sat, 22 Dec 2007 09:18:24 +0000 Subject: Display general healt on the system git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@447 ab2d0c66-481e-0410-8bed-d214d4d58bed --- health-controller.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 health-controller.lua (limited to 'health-controller.lua') diff --git a/health-controller.lua b/health-controller.lua new file mode 100644 index 0000000..2ce32d4 --- /dev/null +++ b/health-controller.lua @@ -0,0 +1,36 @@ +module (..., package.seeall) + +local list_redir = function (self) + self.conf.action = "system" + 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 + +-- Public methods + +system = function (self ) + return ({system = self.model:get_system(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) +end + +storage = function (self ) + return ({storage = self.model:get_storage(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) +end + +network = function (self ) + return ({network = self.model:get_network(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) +end + +modules = function (self ) + return ({modules = self.model:get_modules(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) +end + +proc = function (self ) + return ({proc = self.model:get_proc(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) +end -- cgit v1.2.3