[Cluster-devel] conga/luci/logs index_html log_provider
kupcevic at sourceware.org
kupcevic at sourceware.org
Mon Oct 30 23:00:51 UTC 2006
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-10-30 23:00:51
Modified files:
luci/logs : index_html
Added files:
luci/logs : log_provider
Log message:
luci log viewer: bz212632 - display progress bar while retrieving logging info
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/logs/log_provider.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/logs/index_html.diff?cvsroot=cluster&r1=1.2&r2=1.3
/cvs/cluster/conga/luci/logs/log_provider,v --> standard output
revision 1.1
--- conga/luci/logs/log_provider
+++ - 2006-10-30 23:00:51.365274000 +0000
@@ -0,0 +1 @@
+<pre tal:content="structure python: here.getLogsForNode(request)"></pre>
--- conga/luci/logs/index_html 2006/10/25 16:03:40 1.2
+++ conga/luci/logs/index_html 2006/10/30 23:00:50 1.3
@@ -44,18 +44,61 @@
</metal:javascriptslot>
</head>
- <script type="text/javascript">
- function delWaitBox() {
- var waitbox = document.getElementById('waitbox');
- if (!waitbox)
- return (-1);
- waitbox.parentNode.removeChild(waitbox);
- return (0);
- }
- </script>
- <body onLoad="javascript:delWaitBox()"
- tal:attributes="class here/getSectionFromURL;
+
+<script language="javascript" type="text/javascript">
+
+var xmlHttp_object = false;
+
+function initiate_async_get(url, funct) {
+ xmlHttp_object = false;
+
+ /*@cc_on @*/
+ /*@if (@_jscript_version >= 5)
+ try {
+ xmlHttp_object = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ xmlHttp_object = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e2) {
+ xmlHttp_object = false;
+ }
+ }
+ @end @*/
+
+ if (!xmlHttp_object && typeof XMLHttpRequest != 'undefined') {
+ xmlHttp_object = new XMLHttpRequest();
+ }
+
+ if (xmlHttp_object) {
+ xmlHttp_object.open("GET", url, true);
+ xmlHttp_object.onreadystatechange = funct;
+ xmlHttp_object.send(null);
+ } else {
+ alert("Unable to initiate async GET");
+ }
+}
+
+function replace_loginfo_callback() {
+ if (xmlHttp_object.readyState == 4) {
+ if (xmlHttp_object.status == 200) {
+ var response = xmlHttp_object.responseText;
+ document.getElementById('log_entries').innerHTML = response;
+ } else {
+ alert("Error retrieving data from server");
+ }
+ }
+}
+function replace_loginfo(url) {
+ initiate_async_get(url, replace_loginfo_callback);
+}
+</script>
+
+ <body tal:define="nodename request/nodename;
+ log_url context/logs/log_provider/absolute_url;
+ log_url_full python:log_url + '?nodename=' + nodename"
+ tal:attributes="onload python:'replace_loginfo(\'' + log_url_full + '\')';
+ class here/getSectionFromURL;
dir python:test(isRTL, 'rtl', 'ltr')">
<div id="visual-portal-wrapper">
@@ -69,16 +112,26 @@
<div class="visualClear"><!-- --></div>
- <div id="waitbox">
- <span>
- Log information for <span tal:replace="request/nodename | string: host"/> is being retrieved...
- </span>
- <img src="/luci/storage/100wait.gif">
- </div>
-
<div id="log_data">
<h2>Recent log information for <span tal:replace="request/nodename | string: host"/></h2>
- <pre tal:content="structure python: here.getLogsForNode(request)" />
+
+
+ <div id="log_entries">
+ <table style="width: 100%;">
+ <tr>
+ <td align="center">
+ <img src="../storage/100wait.gif" style="padding-top: 1cm;"/>
+ </td>
+ </tr>
+ <tr>
+ <td align="center">
+ <div style="padding-bottom: 4cm;">Retrieving log info</div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
</div>
</body>
</html>
More information about the Cluster-devel
mailing list