summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf54a01)
raw | patch | inline | side by side (parent: cf54a01)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 19 May 2008 13:01:00 +0000 (13:01 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 19 May 2008 13:01:00 +0000 (13:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10953 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/html/getFAIstatus.php | patch | blob | history | |
gosa-plugins/goto/addons/goto/class_gotomasses.inc | patch | blob | history | |
gosa-plugins/goto/addons/goto/gotomasses.tpl | patch | blob | history |
index ebac934462b25055264494abc4fac29c10f7cfc9..4f931a26f03fd3a6fca06045c4f9cb9a04d75f98 100644 (file)
$config = session::get("config");
$o = new gosaSupportDaemon();
-$res = $o->get_entries_by_mac(array($_GET['mac']));
+$res = $o->get_entries_by_mac(split(",",$_GET['mac']));
foreach($res as $entry){
- if(strtolower($entry['MACADDRESS']) == strtolower($_GET['mac'])){
- $img = "<img src='progress.php?x=80&y=13&p=".$entry['PROGRESS']."'
- alt='".$entry['STATUS']."' title='".$entry['STATUS']."'>";
- }
+ echo $entry['MACADDRESS']."|".$entry['PROGRESS']."\n";
}
-
-
?>
-<html>
-<head>
- <meta http-equiv="refresh" content="15">
-</head>
-<body style="margin:0px;padding:0px;">
-<?php echo $img; ?>
-</body>
-</html>
diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc
index 5aa837e6c5c2ec8c6f2a17da1205895692102edb..b7f0e6ef7eac8d17ec59de9e0c214529dbc334e2 100644 (file)
/* Real percent */
} else {
if (preg_match('/install/', $task['HEADERTAG'])){
- $status = "<iframe style='border:0px;width:80px;height:13px; margin:0px; padding:0px;'
- src='getFAIstatus.php?mac=".$task['MACADDRESS']."'>
- </iframe>";
+ $status = "<img src='progress.php?x=80&y=13&p=".$task['PROGRESS']."' alt=''
+ id='progress_".preg_replace("/:/","_",$task['MACADDRESS'])."'>";
} else {
$status = preg_replace('/ /', ' ', _("in progress"));
}
diff --git a/gosa-plugins/goto/addons/goto/gotomasses.tpl b/gosa-plugins/goto/addons/goto/gotomasses.tpl
index 0f99633dfe46797b7b9a48760cc8f0820a16b76a..7ff94f653338b6f1fcb5241b83de76d8e7d3e918 100644 (file)
+
+
{$div}
+
+
+{literal}
+<script type="text/javascript">
+
+if (typeof XMLHttpRequest != 'undefined')
+{
+ xmlHttpObject = new XMLHttpRequest();
+}
+if (!xmlHttpObject)
+{
+ try
+ {
+ xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch(e)
+ {
+ try
+ {
+ xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch(e)
+ {
+ xmlHttpObject = null;
+ }
+ }
+}
+
+var fai_status = new Array();
+
+function loadContent()
+{
+ var c = 0;
+
+ /* Create array of available progress images once
+ */
+ if(!fai_status.length){
+ for (var i = 0; i < document.images.length; i++) {
+ var img = document.images[i];
+ var id = img.id;
+ if(id.match(/^progress_/)){
+ var mac = id.replace(/^progress_/,'');
+ mac = mac.replace(/_/g,':');
+ fai_status[c] = new Object();
+ fai_status[c]['MAC'] = mac;
+ fai_status[c]['PROGRESS'] = -1;
+ c ++;
+ }
+ }
+ }
+
+ /* Create string of macs used as parameter for getFAIstatus.php
+ to retrieve all progress values.
+ */
+ var macs = "";
+ for (var i = 0; i < fai_status.length; i++) {
+ macs += fai_status[i]['MAC'] + ","
+ }
+
+ /* Send request
+ */
+ xmlHttpObject.open('get','getFAIstatus.php?mac=' + macs);
+ xmlHttpObject.onreadystatechange = handleContent;
+ xmlHttpObject.send(null);
+ return false;
+}
+
+
+function handleContent()
+{
+ if (xmlHttpObject.readyState == 4)
+ {
+ /* Get text and split by newline
+ */
+ var text = xmlHttpObject.responseText;
+ var data = text.split("\n");
+
+ /* Walk through returned values and parse out
+ mac and progress value */
+ for (var i = 0; i < data.length; i++) {
+ var mac = data[i].replace(/\|.*$/,"");
+ var progress= data[i].replace(/^.*\|/,"");
+
+ /* Walk through progress images and check if the
+ progress status has changed
+ */
+ for (var e = 0; e < fai_status.length; e++) {
+
+ /* */
+ if(fai_status[e]["MAC"] == mac){
+
+ /* Check if progress has changed
+ */
+ if(fai_status[e]["PROGRESS"] != progress){
+ var id = mac.replace(/:/g,"_");
+ id = "progress_" + id;
+ if(document.getElementById(id)){
+ document.getElementById(id).src = "progress.php?x=80&y=13&p=" + progress;
+ fai_status[e]["PROGRESS"] = progress;
+ }
+ }
+ }
+ }
+ }
+ timer=setTimeout('loadContent()',5000);
+ }
+}
+
+timer=setTimeout('loadContent()',5000);
+</script>
+{/literal}
+