diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 0bbe9bcc70f4d6ae2b3c4fffc26eb985ac6fb873..d0122f9709b05f1546daa3819e13650dc4544626 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -2413,13 +2413,38 @@ class project extends base { /** * return html code for a div with background color based on a checksum of the given text - * @param string $sText text that is used for checksum - * @param string $sFormat one of hex|rgba - * @param float $fAlpha alpha channel for rgba; 0..1 + * @param string $sText text that is used for checksum; if false ist returns a gray + * @param string $sContent optional: text to show * @return string */ - private function _getChecksumDiv($sText, $sFormat = "hex", $fAlpha = 1.0) { - return '<div style="background: ' . $this->_getChecksumColor($sText, $sFormat, $fAlpha) . '; height: 3px;"> </div>'; + private function _getChecksumDiv($sText, $sContent='') { + if ($sText){ + + // color ranges in decimal values for RGB from ... to + $iFgStart=60; $iFgEnd=160; + $iBgStart=220; $iBgEnd=240; + + // deivider: 3 digits of md5 will be extracted + $iFgDivider=16*16*16/($iFgEnd-$iFgStart); + $iBgDivider=16*16*16/($iBgEnd-$iBgStart); + + $sHash=md5($sText); + $sColor='' + . 'color: rgba(' + . ($iFgStart + round(hexdec(substr($sHash,0,3))/$iFgDivider)) . ',' + . ($iFgStart + round(hexdec(substr($sHash,3,3))/$iFgDivider)) . ',' + . ($iFgStart + round(hexdec(substr($sHash,6,3))/$iFgDivider)) + . ');' + . 'background: rgba(' + . ($iBgStart + round(hexdec(substr($sHash,0,3))/$iBgDivider)) . ',' + . ($iBgStart + round(hexdec(substr($sHash,3,3))/$iBgDivider)) . ',' + . ($iBgStart + round(hexdec(substr($sHash,6,3))/$iBgDivider)) + . ');' + ; + } else { + $sColor = "color: #888; background: #ccc;"; + } + return '<div style="' . $sColor . '; border-top: 3px solid; ">'.($sContent ? $sContent : ' ').'</div>'; } /** @@ -2428,24 +2453,39 @@ class project extends base { * @return string */ private function _getChecksumColor($sText, $sFormat = "hex", $fAlpha = 1.0) { - $sReturn = ''; + $sReturn = ''; if ($sText){ + $sHash=md5($rssItem["feedtitle"]); + $iStartFg=100; + $iStartBg=220; + $sColor='' + . '' + . 'color: rgba(' + . ($iStartFg + round(hexdec(substr($sHash,0,2))/4)) . ',' + . ($iStartFg + round(hexdec(substr($sHash,2,2))/4)) . ',' + . ($iStartFg + round(hexdec(substr($sHash,4,2))/4)) + . ');' + . 'background: rgba(' + . ($iStartBg + round(hexdec(substr($sHash,0,2))/8)) . ',' + . ($iStartBg + round(hexdec(substr($sHash,2,2))/8)) . ',' + . ($iStartBg + round(hexdec(substr($sHash,4,2))/8)) + . ');' + ; + $s = md5($sText); $sRH = substr($s, 0, 2); $sGH = substr($s, 2, 2); $sBH = substr($s, 4, 2); } else { - $sRH = 'AA'; - $sGH = 'AA'; - $sBH = 'AA'; + $sReturn = "background: #aaaaaa;"; } switch ($sFormat) { case "rgba": - $sReturn = "rgba(" . hexdec($sRH) . ", " . hexdec($sGH) . ", " . hexdec($sBH) . ", " . $fAlpha . ")"; + $sReturn = "background: rgba(" . hexdec($sRH) . ", " . hexdec($sGH) . ", " . hexdec($sBH) . ", " . $fAlpha . ")"; break; default: - $sReturn = "#$sRH$sGH$sBH"; + $sReturn = "background: #$sRH$sGH$sBH"; break; } return $sReturn; @@ -2481,9 +2521,11 @@ class project extends base { $sAge = $iAgeUpdate < 60 * 60 * 13 ? $iAgeUpdate . " min" : "??"; $sReturn.= '<div class="host">' - . $this->_getChecksumDiv($aHostinfos['_data']['revision']) - . $oHtml->getIcon('host').'<br>' - . $sHostname . "<br>($sAge) " + . $this->_getChecksumDiv( + $aHostinfos['_data']['revision'], + $oHtml->getIcon('host').'<br>' . $sHostname + ) + . "($sAge)" . '</div>' ; } @@ -2713,9 +2755,14 @@ class project extends base { $sAgeClass="last1h"; } */ - $sReturn .= ' - ' . $this->_renderBar($sPhase, $sPlace) - . $oHtml->getIconByType('calendar') .' ' . date($sDateFormat, $oPkgDate); + $sReturn .= + // $this->_renderBar($sPhase, $sPlace) + $this->_getChecksumDiv( + $aData["revision"], + $oHtml->getIconByType('calendar') .' ' . date($sDateFormat, $oPkgDate) + ) + // . $oHtml->getIconByType('calendar') .' ' . date($sDateFormat, $oPkgDate) + ; if ($bLong) { // long display of the revision @@ -2831,7 +2878,7 @@ class project extends base { $sLastPlace = $sPlace; } foreach (array_keys($this->_aPlaces) as $sPlace) { - $sRow2.='<td class="' . $sPhase . ' tdphase td' . $this->_aConfig["id"] . '">' . $aRows[$sPlace] . '</td>'; + $sRow2.='<td class=" td-phase-'.$sPhase.' td-place-'.$sPlace.' td' . $this->_aConfig["id"] . '">' . $aRows[$sPlace] . '</td>'; } return $sRow2; } @@ -2848,10 +2895,11 @@ class project extends base { $aRepodata = $this->getRepoRevision(); if (array_key_exists("revision", $aRepodata)) { - $sReturn.=$this->_getChecksumDiv($aRepodata["revision"]); - $sReturn.= '<i class="glyphicon glyphicon-bookmark"></i> ' . t('branch') . ': ' . (array_key_exists("branch", $aRepodata) ? $aRepodata["branch"] : '-') . '<br>'; - $sReturn.= '<i class="glyphicon glyphicon-tag"></i> ' . t('revision') . ': ' . $aRepodata["revision"] . '<br>'; - $sReturn.="<pre>" . strip_tags($aRepodata["message"], '<br>') . "</pre>"; + $sReturn.=$this->_getChecksumDiv($aRepodata["revision"], + '<i class="glyphicon glyphicon-bookmark"></i> ' . t('branch') . ': ' . (array_key_exists("branch", $aRepodata) ? $aRepodata["branch"] : '-') . '<br>' + .'<i class="glyphicon glyphicon-tag"></i> ' . t('revision') . ': ' . $aRepodata["revision"] . '<br>' + ) + ."<pre>" . strip_tags($aRepodata["message"], '<br>') . "</pre>"; } else { $sReturn .= $oHtml->getBox("error", sprintf(t('class-project-error-no-repoaccess'), $aRepodata["error"])) . $this->renderLink("setup") . '<br>'; @@ -2906,10 +2954,11 @@ class project extends base { if (array_key_exists("ok", $aInfos)) { $sLinktitle = t('infos'); if (array_key_exists("message", $aInfos)) { - $sInfos.=$this->_getChecksumDiv($aInfos["revision"]) - . $oHtml->getIconByType('calendar') . t('build-from') . ' ' . date("d.m.Y H:i:s", strtotime($aInfos["date"])) . '<br>' + $sInfos.=$this->_getChecksumDiv($aInfos["revision"], + $oHtml->getIconByType('calendar') . t('build-from') . ' ' . date("d.m.Y H:i:s", strtotime($aInfos["date"])) . '<br>' . $oHtml->getIconByType('branch') . t('branch') . ': ' . $aInfos["branch"] . '<br>' . $oHtml->getIconByType('revision') . t('revision') . ': ' . $this->_renderRevision($aInfos["revision"]) . '<br>' + ) . $oHtml->getIconByType('comment') . t('commitmessage') . ':<br><span class="pre">' . strip_tags($aInfos["message"], '<br>') . '</span>'; if (array_key_exists("more", $aOptions)) { $sInfos.=$aOptions["more"]; @@ -2972,17 +3021,19 @@ class project extends base { $sRowHead1.='<th class="' . $sPhase . '" colspan="' . (count($this->_aPlaces) + 1) . '">' . $sPhase . '</th>'; $sRowHead2.='<td></td>' . $this->renderPlacesAsTd($sPhase); } - + + krsort($aAllVersions); foreach ($aAllVersions as $sVersion => $aData) { $sReturn.='<tr>'; $sInfos = $this->renderInfoLink($aData["info"], array('hpos' => 'left')); $sReturn.='<td>' - // . $this->_getChecksumDiv($aData['info']['revision']) - // . print_r($aData, 1).'<br>' - . $oHtml->getIconByType('calendar') . t('build-from') . ': ' . $sVersion .'<br>' - // . $oHtml->getIconByType('branch') . t('branch') . ': ' . $aData['info']["branch"] . '<br>' - . $oHtml->getIconByType('revision') . t('revision') . ': ' . $this->_renderRevision($aData['info']["revision"]) . '<br>' + . $this->_getChecksumDiv( + $aData['info']['revision'], + $oHtml->getIconByType('calendar') . t('build-from') . ': ' . $sVersion .'<br>' + . $oHtml->getIconByType('branch') . t('branch') . ': ' . $aData['info']["branch"] . '<br>' + . $oHtml->getIconByType('revision') . t('revision') . ': ' . $this->_renderRevision($aData['info']["revision"]) . '<br>' + ) . '</td><td>' . ' ' . $sInfos . ' ' . '</td>' @@ -3000,8 +3051,7 @@ class project extends base { $bFound = false; $sReturn.=$aData["usage"][$sPhase][$sPlace] ? '<td class="' . $sPhase . '" style="text-align: center;">' - . $this->_getChecksumDiv($aData['info']['revision']) - . 'X' + . $this->_getChecksumDiv($aData['info']['revision'], 'X') . '</td>' : '<td> </td>' ; @@ -3441,6 +3491,17 @@ class project extends base { $sDeploymethod = array_key_exists("deploymethod", $this->_aPrjConfig["phases"][$sPhase]) ? $this->_aPrjConfig["phases"][$sPhase]["deploymethod"] : ""; $sDeployhosts = array_key_exists("hosts", $this->_aPrjConfig["phases"][$sPhase]) ? $this->_aPrjConfig["phases"][$sPhase]["hosts"] : ""; + if($sDeployhosts){ + echo "$sDeployhosts<br>"; + if(!strpos($sDeployhosts, ",")){ + $sCmd=sprintf($this->_aConfig["installPackages"]["addkeycommand"], $sDeployhosts, $sDeployhosts); + exec($sCmd . " 2>&1", $aOut); + echo "<pre>\$ $sCmd<br>" + . implode('<br>', $aOut) + ."</pre>" + ; + } + } $sDeploytimes = array_key_exists("deploytimes", $this->_aPrjConfig["phases"][$sPhase]) ? $this->_aPrjConfig["phases"][$sPhase]["deploytimes"] : ""; $sDivId4PhaseSettings = 'divSettings' . $sPhase; $sDivId4TargetHosts = 'divSettings' . $sPhase . 'hosts'; diff --git a/public_html/deployment/classes/projectlist.class.php b/public_html/deployment/classes/projectlist.class.php index d6ba00a51a3ff9e3266d5dd2c61274875514a87c..8c267914e88d12ae6d869b7c5fea9f55d3363ae1 100644 --- a/public_html/deployment/classes/projectlist.class.php +++ b/public_html/deployment/classes/projectlist.class.php @@ -91,8 +91,8 @@ class projectlist extends base{ ; $sProgress='' - .($aProgress['inprogress'] ? ' <i class="fa fa-refresh" title="'.t("progress-inprogress").'"></i> ' : '') - .($aProgress['hasQueue'] ? ' <i class="glyphicon glyphicon-time" title="'.t("progress-hasqueue").'"></i> ' : '') + .($aProgress['inprogress'] ? '<div class="progressinprogress"><i class="fa fa-refresh" title="'.t("progress-inprogress").'"></i> '.t("progress-inprogress").'</div>' : '') + .($aProgress['hasQueue'] ? '<div class="progresshasqueue"><i class="glyphicon glyphicon-time" title="'.t("progress-hasqueue").'"></i> '.t("progress-hasqueue").'</div>' : '') ; $sOut2 .= '<div class="' . $sClasses . ' prjbox"><div class="title">' @@ -112,7 +112,7 @@ class projectlist extends base{ 'label'=>'<strong>'.$oPrj->getLabel().'</strong>' )) .'</strong>' - . $sProgress + // . $sProgress . '</div>' . '<div class="box" ' . 'onclick="location.href=\'/deployment/' . $sPrj . '/\'">' diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index cc917dc0073b0ce8d8ba34ca9010431f93fca08d..447a410ee2955309ad0a18045e9a30af63239700 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -132,14 +132,18 @@ tr:hover{background:#ddd; background: linear-gradient(#f0f0f0,#fff,#f0f0f0);} .trproject:hover a.btn{opacity: 1;} .trproject{border-left:3px solid #fff;} -.progressinprogress{border-left:3px solid #fea;} -.progresshasqueue{border-left:3px solid #fc1;} +tr.progressinprogress{border-left:0.5em solid #aec;} +div.progressinprogress{color: #6a9;} +tr.progresshasqueue{border-left:0.5em solid #f81;} +div.progresshasqueue{color: #d61;} td.preview{} td.stage{} td.live{} td{transition: ease-in 0.5s} td.highlight{background:rgba(255,220,50,0.5) !important;} +.td-place-onhold{color:#d61;} +.td-place-ready2install{} .dev{background:#ccc;} .preview{}