diff options
-rw-r--r-- | alpine-baselayout.roles | 4 | ||||
-rw-r--r-- | modules-controller.lua | 6 | ||||
-rw-r--r-- | modules-model.lua | 9 | ||||
-rw-r--r-- | modules-status-html.lsp | 6 | ||||
-rw-r--r-- | modules.menu | 3 |
5 files changed, 23 insertions, 5 deletions
diff --git a/alpine-baselayout.roles b/alpine-baselayout.roles index f241ca8..e03c65f 100644 --- a/alpine-baselayout.roles +++ b/alpine-baselayout.roles @@ -1,5 +1,5 @@ GUEST=health:system,hostname:read -USER=health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,skins:update,skins:read,syslog:status,syslog:loginfo,syslog:startstop,rc:status +USER=health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,skins:update,skins:read,syslog:status,syslog:loginfo,syslog:startstop,rc:status EDITOR=hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit EXPERT=syslog:expert,interfaces:editintfile,modules:edit,modules:reload -ADMIN=health:system,hostname:read,health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,skins:update,skins:read,syslog:status,syslog:loginfo,syslog:startstop,rc:status,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit,syslog:expert,interfaces:editintfile,modules:edit,modules:reload,password:edit +ADMIN=health:system,hostname:read,health:storage,health:proc,health:network,health:modules,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,skins:update,skins:read,syslog:status,syslog:loginfo,syslog:startstop,rc:status,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit,syslog:expert,interfaces:editintfile,modules:edit,modules:reload,password:edit diff --git a/modules-controller.lua b/modules-controller.lua index f1da11c..dc7735c 100644 --- a/modules-controller.lua +++ b/modules-controller.lua @@ -3,7 +3,11 @@ require("controllerfunctions") module (..., package.seeall) -default_action = "edit" +default_action = "status" + +status = function(self) + return self.model.read_modules() +end edit = function(self) return controllerfunctions.handle_form(self, self.model.read_file, self.model.write_file, self.clientdata, "Save", "Edit Modules file", "File saved") diff --git a/modules-model.lua b/modules-model.lua index 751aa3d..e3e70d0 100644 --- a/modules-model.lua +++ b/modules-model.lua @@ -3,7 +3,14 @@ module (..., package.seeall) require("modelfunctions") require("fs") -local configfile = "/etc/modules" +local configfile = "/etc/modules" + +function read_modules() + local f = io.popen("/sbin/lsmod") + local retval = f:read("*a") + f:close() + return cfe({ type="longtext", value=retval, label="Modules List" }) +end function read_file() return modelfunctions.getfiledetails(configfile) diff --git a/modules-status-html.lsp b/modules-status-html.lsp new file mode 100644 index 0000000..9854e28 --- /dev/null +++ b/modules-status-html.lsp @@ -0,0 +1,6 @@ +<% local view = ... %> + +<h1>Modules</h1> + +<h2>Installed modules</h2> +<pre><%= view.value %></pre> diff --git a/modules.menu b/modules.menu index 4f96581..129d13b 100644 --- a/modules.menu +++ b/modules.menu @@ -1,2 +1,3 @@ # Cat Group Tab Action -System 20Modules Status edit +System 20Modules Status status +System 20Modules Expert edit |