Skip to content
Snippets Groups Projects
Commit 1bcb18b1 authored by hahn's avatar hahn
Browse files

- footer navigation in actions was simplified

- fetch output instead of fille $sPhpOut
- ajax test III
parent 5be76373
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,10 @@ $sOut = '';
print_r($aParams);
if (array_key_exists("confirm", $aParams)) {
$sOutDir = "/tmp"; // Ausgabeverzeichnis
$sTmpFile=basename(tempnam("", $aParams["prj"]));
$sTmpFile = basename(tempnam("", "out_".$aParams["prj"]."_".$aParams["action"]));
$sDivname = "outAjax";
$sUrl="?"
$sUrl = "/deployment/?"
. "&prj=" . $aParams["prj"]
. "&action=" . $aParams["action"]
. "&confirm=" . $aParams["confirm"]
......@@ -37,31 +37,40 @@ if (array_key_exists("confirm", $aParams)) {
// im Hintergrund Prozess ankicken
if (array_key_exists("run", $aParams)) {
echo "CALL oPrj->build ...<br>";
$oPrj->build($sOutDir . "/" . $aParams["ajax"]);
die();
}
// im Hintergrund Prozess ankicken
if (array_key_exists("ajax", $aParams)) {
echo "<br>" . date("H:i:s");
echo "<br>Ausgabe von ".$sOutDir."/".$aParams["ajax"] ."<br>";
echo file_get_contents($sOutDir . "/" . $aParams["ajax"]);
die();
}
$sOut.='<div id="' . $sDivname . '">Moment...</div>'
. '<script>
// init build process
var iRepeat=1000
// init process
$.post( "' . $sUrlStartAction . '", function( data ) {
$( ".' . $sDivname . '" ).html( data );
iRepeat=false;
});
function AjaxPolling(sUrl, sDivname, iRepeat){
// polling result so far ...
function AjaxPolling(sUrl, sDivname){
$.post( sUrl, function( data ) {
if (iRepeat) {
$("#"+sDivname ).html( data );
}
});
if (iRepeat){
window.settimeout("AjaxPolling( \'"+sUrl+"\', \'"+sDivname+"\', \'"+iRepeat+"\')", iRepeat);
window.setTimeout("AjaxPolling( \'"+sUrl+"\', \'"+sDivname+"\', \'"+iRepeat+"\')", iRepeat);
}
}
AjaxPolling("'.$sUrl.'", "'.$sDivname.'", 2000);
// init polling
AjaxPolling("' . $sUrl . '", "' . $sDivname . '");
</script>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment