Commit ae03699b authored by Sebastien Robin's avatar Sebastien Robin

administration: on introspection tool, add filtering when doing tail of event.log

parent ac9b485c
...@@ -56,10 +56,10 @@ ...@@ -56,10 +56,10 @@
} \n } \n
}\n }\n
}\n }\n
if (request == null)\n if (request == null) {\n
alert("Error creating request object!");\n alert("Error creating request object!");\n
\n }\n
request = createRequest();\n \n
}\n }\n
\n \n
function getLog(timer) {\n function getLog(timer) {\n
...@@ -88,12 +88,23 @@ ...@@ -88,12 +88,23 @@
function updatePage() {\n function updatePage() {\n
var logDiv = document.getElementById("log"), logLine; today = new Date();\n var logDiv = document.getElementById("log"), logLine; today = new Date();\n
var message_div = document.getElementById("message");\n var message_div = document.getElementById("message");\n
var current_value;\n
var regexp = document.getElementById("regexp").value;\n
if (request.readyState == 4) {\n if (request.readyState == 4) {\n
if (request.status == 200) {\n if (request.status == 200) {\n
var currentLogValue = request.responseText.split("\\n");\n var currentLogValue = request.responseText.split("\\n");\n
var logLine = \' \';\n var logLine = \' \';\n
for (i=0; i < currentLogValue.length - 1; i++) {\n for (i=0; i < currentLogValue.length - 1; i++) {\n
logLine += currentLogValue[i] + \'\\n\';\n current_value = currentLogValue[i];\n
add_line = true;\n
if (regexp !== "") {\n
if (current_value.match(regexp) === null) {\n
add_line = false;\n
}\n
}\n
if (add_line === true) {\n
logLine += currentLogValue[i] + \'\\n\';\n
}\n
}\n }\n
logDiv.innerHTML=logLine;\n logDiv.innerHTML=logLine;\n
logDiv.scrollTop = logDiv.scrollHeight;\n logDiv.scrollTop = logDiv.scrollHeight;\n
...@@ -112,6 +123,7 @@ ...@@ -112,6 +123,7 @@
<div id="toolbar">\n <div id="toolbar">\n
<button tal:attributes="onclick string:getLog(\'start\')">Start Log</button>\n <button tal:attributes="onclick string:getLog(\'start\')">Start Log</button>\n
<button onclick="stopTail();">Stop Log</button>\n <button onclick="stopTail();">Stop Log</button>\n
<label>Regexp</label><input type="text" id="regexp" size="20">\n
<span id="message">Press Start...</span>\n <span id="message">Press Start...</span>\n
</div>\n </div>\n
<textarea id="log" style="border:solid 1px #dddddd; margin-left:25px; font-size:9px;\n <textarea id="log" style="border:solid 1px #dddddd; margin-left:25px; font-size:9px;\n
......
...@@ -211,7 +211,7 @@ class IntrospectionTool(LogMixin, BaseTool): ...@@ -211,7 +211,7 @@ class IntrospectionTool(LogMixin, BaseTool):
""" """
Tail the Event Log. Tail the Event Log.
""" """
return escape(self._tailFile(self.__getEventLogPath(), 50)) return escape(self._tailFile(self.__getEventLogPath(), 500))
security.declareProtected(Permissions.ManagePortal, 'tailAccessLog') security.declareProtected(Permissions.ManagePortal, 'tailAccessLog')
def tailAccessLog(self): def tailAccessLog(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment