Skip to content
Snippets Groups Projects
Commit 2d9ddd8a authored by hahn's avatar hahn
Browse files

- overview - filter link moved to top right

- revision fixed to top right
- fixed warning "headers already sent" 
- new: setup: show errors on top
- new try: read remote git log
parent bd466ed7
No related branches found
No related tags found
No related merge requests found
......@@ -131,18 +131,18 @@ class project {
* @param string $sCommand
* @return string
*/
private function _execAndSend($sCommand) {
private function _execAndSend($sCommand, $bFlush=false) {
$sReturn = '';
$bUseHtml = $_SERVER ? true : false;
ob_implicit_flush(true);
if ($bFlush) ob_implicit_flush(true);
// ob_end_flush();
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pipe that the child will write to
2 => array("pipe", "w") // stderr is a pipe that the child will write to
);
flush();
if ($bFlush) flush();
$process = proc_open($sCommand, $descriptorspec, $pipes, realpath('./'), array());
$sReturn.="[" . date("H:i:s d.m.Y") . "] ";
......@@ -153,11 +153,11 @@ class project {
if (is_resource($process)) {
while ($s = fgets($pipes[1])) {
$sReturn.=$s;
flush();
if ($bFlush) flush();
}
while ($s = fgets($pipes[2])) {
$sErrors.=$s;
flush();
if ($bFlush) flush();
}
}
if ($sErrors)
......@@ -175,7 +175,7 @@ class project {
$sReturn.='</pre>';
}
flush();
if ($bFlush) flush();
return $sReturn;
}
......@@ -660,7 +660,7 @@ class project {
$sGitCmd = "git ls-remote --heads " . $this->_aPrjConfig["build"]["ssh"] . " master | awk '{ print $1 }'";
$sRevision = shell_exec("export GIT_SSH=$sWrapper ; export PKEY=$sKeyfile; $sGitCmd");
$sReturn = trim($sRevision);
/*
$sGitCmd="export GIT_SSH=$sWrapper ; ";
$sGitCmd.="export PKEY=$sKeyfile ; ";
$sGitCmd.="export testdir=/tmp/test_\$\$ ; set -vx ; ";
......@@ -668,12 +668,12 @@ class project {
$sGitCmd.="git init && ";
$sGitCmd.="git remote add origin " . $this->_aPrjConfig["build"]["ssh"] . " && ";
// $sGitCmd.="git clean -f && ";
// $sGitCmd.="git pull ; ";
$sGitCmd.="git fetch && ";
// $sGitCmd.="sleep 1 ; ";
$sGitCmd.="git log -1 --format=fuller origin/master remote; ";
// $sGitCmd.="cd /tmp ; rm -rf \$testdir ";
$sGitCmd.="cd /tmp ; rm -rf \$testdir ";
$sReturn.= $this->_execAndSend($sGitCmd);
*/
$this->_aData["phases"]["source"] = $sReturn;
break;
default:
......@@ -1564,7 +1564,10 @@ class project {
// echo "<pre>" . print_r($this->_aData, true) . "</pre>";
foreach (array_keys($this->_aPlaces) as $sPlace) {
$aRows[$sPlace] = $this->renderPhaseDetail($sPhase, $sPlace, $bActions, $bLong);
if ($sLastPlace && array_key_exists("version", $this->_aData["phases"][$sPhase][$sLastPlace]) && array_key_exists("version", $this->_aData["phases"][$sPhase][$sPlace]) && $this->_aData["phases"][$sPhase][$sLastPlace]["version"] == $this->_aData["phases"][$sPhase][$sPlace]["version"]
if ($sLastPlace && array_key_exists("version", $this->_aData["phases"][$sPhase][$sLastPlace])
&& array_key_exists("version", $this->_aData["phases"][$sPhase][$sPlace])
&& $this->_aData["phases"][$sPhase][$sLastPlace]["version"] == $this->_aData["phases"][$sPhase][$sPlace]["version"]
&& !$bLong
) {
$aRows[$sLastPlace] = $this->_renderBar($sPhase, $sPlace) . "&raquo;";
}
......@@ -1663,6 +1666,7 @@ class project {
*/
public function renderProjectSetup() {
$sMessages='';
require_once ("formgen.class.php");
$i = 0;
......@@ -1850,7 +1854,9 @@ class project {
if ($sPuppethost) {
$sCmd='ssh ' . $this->_aConfig["installPackages"]["user"] . '@' . $sPuppethost . ' sudo puppet --version 2>&1';
$sOut=shell_exec($sCmd);
// Check auf Versionsnummer - mehr als n Zeichen ist mutmasslich eine Fehlermeldung
if (strlen($sOut)>7){
$sMessages.=$this->getBox("error", 'Puppet-Host von Phase '.$sPhase.' konnte nicht angesprochen werden.<br><strong>'.$sCmd.'</strong><br>'.$sOut.'');
$sOut='FEHLER: <span class="error" title="'.$sCmd.'">'.$sOut.'</span>';
} else {
$sOut='<span class="ok">OK - SSH-Verbindung zu '.$sPuppethost.' erfolgreich.</span>';
......@@ -1877,7 +1883,7 @@ class project {
);
$oForm = new formgen($aForms);
return $oForm->renderHtml("setup");
return $sMessages . $oForm->renderHtml("setup");
}
/**
......
......@@ -79,14 +79,17 @@ class projectlist {
$sOutPhases.=$oPrj->renderAllPhaseDetails($sPhase,true,false);
}
$sOut2 .= '<div class="'.$sPrj.' '.$sTrClass.' prjbox">'
$sOut2 .= '<div class="'.$sPrj.' '.$sTrClass.' prjbox"><div class="title">'
. '<a href="" onclick="$(\'#prjfilter\').val(\''.$sPrj.'\'); window.setTimeout(\'filterOverviewTable();\', 10);setview(\'extended\'); return false;"'
. 'style="float: right;"'
. 'title="in der erweiterten Ansicht nur dieses Projekt anzeigen"><i class="icon-filter"></i> Filter</a>'
. '<strong>'
. '<a href="/deployment/'.$sPrj.'/" title="Projekt-Übersicht"><i class=" icon-book"></i> '.$oPrj->getLabel().'</a>'
. '</strong><br>'
. '</strong>'
. '</div><div class="box">'
. $oPrj->getDescription()
. '<br><a href="" onclick="$(\'#prjfilter\').val(\''.$sPrj.'\'); window.setTimeout(\'filterOverviewTable();\', 10);setview(\'extended\'); return false;"'
. 'title="in der erweiterten Ansicht nur dieses Projekt anzeigen"><i class="icon-filter"></i> Filter</a>'
. '<br><br>';
. '<br>'
. '';
// render output
$sOut.='
......@@ -104,7 +107,7 @@ class projectlist {
$sOut.='</td>
' . $sOutPhases . '
</tr>';
$sOut2.='</div>';
$sOut2.='</div></div>';
}
if ($sOut) {
$sRowHead1='';
......
......@@ -28,10 +28,13 @@ body, label, input, button, select, textarea, p, .btn {
}
.description{font-weight:bold; color:#ccc; font-size: 150%; font-style: italic;}
.navbar .brand {color:#a33;}
.navbar .version {float: right; position: absolute; top: 20px; right: 0;padding: 0 1em;
transform: rotate(5deg);
.navbar .version {float: right; position: fixed; top: 0px; right: 0;padding: 0 0.5em;
transform: rotate(0deg);
-webkit-transform: rotate(5deg);
opacity: 0.9;
border-bottom: 1px solid #fff;
border-left: 1px solid #fff;
box-shadow: 0 0 5px #888;
border-bottom-left-radius: 10px;
}
#content{
margin-top: 2em;
......@@ -75,10 +78,16 @@ ul li {
}
.prjbox{
float: left; width: 17%; margin: 0 1em 1em 0;padding: 1em;height: 12em;
float: left; width: 17%; margin: 0 1em 1em 0; height: 12em;
background:#f8f8f8;
border: 1px solid #eee;
}
.prjbox:hover{background:#eee; box-shadow: none;}
.prjbox div{padding: 1em;}
.prjbox .title{
background:none; padding: 0.5em 1em 0; border-bottom: 1px solid #fff;
}
.viewextended{display: none;}
thead{font-size: 130%;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment