summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--health-controller.lua4
-rw-r--r--logfiles-controller.lua5
-rw-r--r--logfiles-status-html.lsp2
-rw-r--r--logfiles-tail-html.lsp2
4 files changed, 3 insertions, 10 deletions
diff --git a/health-controller.lua b/health-controller.lua
index 3b2bbf1..f5cc26c 100644
--- a/health-controller.lua
+++ b/health-controller.lua
@@ -22,9 +22,7 @@ end
networkstats = function(self)
local retval = self.model.get_networkstats()
- if self.clientdata.viewtype then
- self.conf.viewtype = "ajax"
- else
+ if self.conf.viewtype == "html" then
local intf = self:new("alpine-baselayout/interfaces")
local interfaces = intf.model.get_addresses()
intf:destroy()
diff --git a/logfiles-controller.lua b/logfiles-controller.lua
index 72a9b95..a90afec 100644
--- a/logfiles-controller.lua
+++ b/logfiles-controller.lua
@@ -21,14 +21,9 @@ download = function (self)
local filestatus = view(self)
local filecontent = filestatus.value.filecontent
filecontent.label = posix.basename(filestatus.value.filename.value)
- self.conf.viewtype = "stream"
-
return filecontent
end
tail = function (self)
- if self.clientdata.offset then
- self.conf.viewtype = "ajax"
- end
return self.model.tail(self.clientdata.name, self.clientdata.offset, self.clientdata.grep)
end
diff --git a/logfiles-status-html.lsp b/logfiles-status-html.lsp
index 743daea..2fdab82 100644
--- a/logfiles-status-html.lsp
+++ b/logfiles-status-html.lsp
@@ -31,7 +31,7 @@
<% end %>
<TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "view?name="..file.value.filename.value, label="View" } %></TD>
<TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "tail?name="..file.value.filename.value, label="Tail" } %></TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "download?name="..file.value.filename.value, label="Download" } %></TD>
+ <TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "download?viewtype=stream&name="..file.value.filename.value, label="Download" } %></TD>
<TD style="padding-right:20px;white-space:nowrap;text-align:right"><%= html.html_escape(file.value.filesize.value) %></TD>
<TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(file.value.mtime.value) %></TD>
<TD style="white-space:nowrap;"><%= html.html_escape(file.value.filename.value) %></TD>
diff --git a/logfiles-tail-html.lsp b/logfiles-tail-html.lsp
index ca7a9d7..c480b0b 100644
--- a/logfiles-tail-html.lsp
+++ b/logfiles-tail-html.lsp
@@ -10,7 +10,7 @@
$.ajaxSetup({cache:false});
$.getJSON(
'<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action) %>',
- {name:'<% io.write(html.html_escape(form.value.filename.value)) if form.value.grep.value ~= "" then io.write("',grep:'"..html.html_escape(form.value.grep.value)) end %>', offset:currentoffset},
+ {name:'<% io.write(html.html_escape(form.value.filename.value)) if form.value.grep.value ~= "" then io.write("',grep:'"..html.html_escape(form.value.grep.value)) end %>', offset:currentoffset, viewtype:'json'},
function(data) {
if (currentoffset != data.value.filesize.value){