... | in tools.naml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
<macro name="view_log" requires="servlet">
<n.if Binary Namespace: BasicNamespace
Parameters:
condition, else, then
♦ ♦ Binary Namespace: BasicNamespace
Parameters:
condition
♦ ♦ Binary Namespace: ServletNamespace
Parameters:
do
♦ ♦ Macro Requires: user
♦ ♦
<then>
<n.login Macro Requires: servlet
Parameters:
message
♦ ♦
</then>
</n.if.not.visitor.is_site_admin>
<n.html Macro Parameters:
head, body
♦ ♦
<head>
<n.title Macro Parameters:
text
♦ ♦
<script type="text/javascript">
function refreshLog() {
var call = '/template/NamlServlet.jtp?macro=get_site_log';
$.get(call, function(data) {
data = Nabble.trim(data);
data = data.length == 0? 'Log is empty' : '<pre>'+data+'</pre>';
$('#log_data').html(data);
});
};
function clearLog() {
var call = '/template/NamlServlet.jtp?macro=clear_site_log';
$.get(call, function(data) {
if (Nabble.trim(data) == 'ok')
$('#log_data').html('Log is empty');
});
};
</script>
</head>
<body>
<n.edit_header Macro Parameters:
first_text, second_text
♦ ♦ Binary Namespace: NabbleNamespace
Parameters:
do
♦ ♦ Binary Namespace: NodeNamespace
Parameters:
do
♦ ♦ Macro Requires: node
♦ ♦
<div style="margin:.5em 0">
<button class="toolbar" style="font-weight:bold" onclick="refreshLog()"><t>Refresh</t></button>
<button class="toolbar" style="font-weight:bold" onclick="clearLog()"><t>Clear Log</t></button>
</div>
<div id="log_data" style="padding:.3em;margin-top:.5em;overflow-x:auto">
<n.if Binary Namespace: BasicNamespace
Parameters:
condition, else, then
♦ ♦ Binary Namespace: BasicNamespace
Parameters:
value
♦ ♦ Binary Namespace: NabbleNamespace
♦ ♦
<then><t>Log is empty</t></then>
<else>
<pre><n.get_log Binary Namespace: NabbleNamespace
♦ ♦
</else>
</n.if.is_empty.get_log>
</div>
</body>
</n.html>
</macro>
|