diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-08-03 15:54:48 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-08-03 15:54:48 +0000 |
commit | f9a09e6fe4d8bd7743a7530d9ef3e848f5a373fe (patch) | |
tree | af08b1200b9068f12bd4a93b757b7dfd167a4e5a | |
parent | c2053788e17c731603b5c50547d4396f29e83721 (diff) | |
download | acf-vlc-daemon-f9a09e6fe4d8bd7743a7530d9ef3e848f5a373fe.tar.bz2 acf-vlc-daemon-f9a09e6fe4d8bd7743a7530d9ef3e848f5a373fe.tar.xz |
Modify logfile to use common view
-rw-r--r-- | vlc-controller.lua | 2 | ||||
l---------[-rw-r--r--] | vlc-logfile-html.lsp | 7 | ||||
-rw-r--r-- | vlc-model.lua | 13 |
3 files changed, 9 insertions, 13 deletions
diff --git a/vlc-controller.lua b/vlc-controller.lua index 3799d8e..f42d7a2 100644 --- a/vlc-controller.lua +++ b/vlc-controller.lua @@ -20,7 +20,7 @@ function mymodule.expert(self) end function mymodule.logfile(self) - return self.model.getlogfile() + return self.model.get_logfile(self, self.clientdata) end return mymodule diff --git a/vlc-logfile-html.lsp b/vlc-logfile-html.lsp index 16c583a..ac8854f 100644..120000 --- a/vlc-logfile-html.lsp +++ b/vlc-logfile-html.lsp @@ -1,6 +1 @@ -<% local data, viewlibrary = ... -%> - -<% if viewlibrary and viewlibrary.dispatch_component then - viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {filename=data.value}) -end %> +../logfile-html.lsp
\ No newline at end of file diff --git a/vlc-model.lua b/vlc-model.lua index 5a8da68..abad8a9 100644 --- a/vlc-model.lua +++ b/vlc-model.lua @@ -41,16 +41,17 @@ function mymodule.getconfigfile() return modelfunctions.getfiledetails(configfile) end -function mymodule.getlogfile () - local path=logfile - local path2 +function mymodule.get_logfile(self, clientdata) + local retval = cfe({ type="group", value={}, label="Log File Configuration" }) + retval.value.filename = cfe({value=logfile, label="File name"}) + local path if fs.is_file(configfile) then for line in string.gmatch(fs.read_file(configfile) or "", "(.-)\n") do - path2=string.match(line,"^VLC_OPTS.*--logfile%s+(%S+)") or path2 + path=string.match(line,"^VLC_OPTS.*--logfile%s+(%S+)") or path end end - if path2 then path=path2 end - return cfe({ value=path, label="VLC logfile" }) + if path then retval.value.filename.value = path end + return retval end function mymodule.setconfigfile(self, filedetails) |