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

- free filter text in overview is case insensitive

- project settings - file prefix is changeble only if no build was done
- fixed: overview - show same version in several phases with a short message only
parent 2f8a6ae7
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ if (array_key_exists("confirm", $aParams)) {
$sOut.='
<p>
URL: <a href="'.$sUrl.'">'.$sUrl.'</a><br>
Die Software wurde erfolgreich getestet und soll auf die n&auml;chste
Die Software wurde erfolgreich <span class="'.$sPhase.'">'.$sPhase.'</span> getestet und soll auf die n&auml;chste
Phase <span class="'.$sNext.'">'.$sNext.'</span> ausgerollt werden?<br>
</p>';
if (
......
......@@ -219,7 +219,8 @@ class formgen {
$sFormElement.="</select>\n";
if ($sLabelText) {
$sLabelElement.='<span class="help-block">' . $sLabelText . '</span>' . "\n";
// $sLabelElement.='<span class="help-block">' . $sLabelText . '</span>' . "\n";
$sLabelElement = $this->_addLabel($sLabelText, $sId, "control-label");
}
$sHtmlTable = '<td>' . $sLabelText . '</td><td>' . $sFormElement . '</td>';
......
<?php
/* ######################################################################
IML DEPLOYMENT
......@@ -844,7 +845,7 @@ class project {
$sReturn.="<h3>get default data</h3>";
if ($this->_getDefaultsDir()) {
$sReturn.='get data from ' . $this->_getDefaultsDir() . '<br>';
$sReturn.=$this->_execAndSend("find " . $this->_getDefaultsDir());
$sReturn.=$this->_execAndSend("find " . $this->_getDefaultsDir() . " | head -15");
$sReturn.=$this->_execAndSend("rsync -r " . $this->_getDefaultsDir() . "/* $sTempDir");
// $sReturn.=$this->_execAndSend("find $sTempDir");
} else {
......@@ -1121,7 +1122,8 @@ class project {
}
// TODO: run puppet agent on target server(s) - for preview only
if (array_key_exists("puppethost", $this->_aPrjConfig["phases"][$sPhase])) {
if (array_key_exists("puppethost", $this->_aPrjConfig["phases"][$sPhase]) && $this->_aPrjConfig["phases"][$sPhase]["puppethost"]
) {
$sReturn.="Run puppet agent.<br>";
$sReturn.=$this->_execAndSend("ssh imldeployment@" . $this->_aPrjConfig["phases"][$sPhase]["puppethost"] . " sudo puppet agent -t | fgrep -i Deploy");
} else {
......@@ -1252,8 +1254,8 @@ class project {
* @param float $fAlpha alpha channel for rgba; 0..1
* @return string
*/
function getChecksumDiv($sText, $sFormat = "hex", $fAlpha = 1.0) {
return '<div style="background: ' . $this->getChecksumColor($sText, $sFormat, $fAlpha) . '; height: 3px;"> </div>';
private function _getChecksumDiv($sText, $sFormat = "hex", $fAlpha = 1.0) {
return '<div style="background: ' . $this->_getChecksumColor($sText, $sFormat, $fAlpha) . '; height: 3px;"> </div>';
}
/**
......@@ -1261,7 +1263,7 @@ class project {
* @param string $sText text that is used for checksum
* @return string
*/
function getChecksumColor($sText, $sFormat = "hex", $fAlpha = 1.0) {
private function _getChecksumColor($sText, $sFormat = "hex", $fAlpha = 1.0) {
$sReturn = '';
$s = md5($sText);
$sRH = substr($s, 0, 2);
......@@ -1279,6 +1281,21 @@ class project {
return $sReturn;
}
/**
* get html code for the colored bar on top of each phase detail items
* @param string $sPhase
* @param string $sPlace
* @return string
*/
private function _renderBar($sPhase, $sPlace) {
$aDataPhase = $this->getPhaseInfos($sPhase);
$aData = $aDataPhase[$sPlace];
if (!array_key_exists("revision", $aData)) {
return false;
}
return $this->_getChecksumDiv($aData["revision"]);
}
/**
* render html for a colored link to any project action
* @param string $sFunction name of the action; one of accept|build|cleanup|deploy|phase
......@@ -1421,7 +1438,7 @@ class project {
if (array_key_exists("ok", $aData) && array_key_exists("version", $aData)) {
// TODO: getChecksumDiv anhand der Repo-Versionsnummer - dann kann man beim build auch die Farbe mit dem Repo HEAD vergleichen
$sReturn .= '
' . $this->getChecksumDiv($aData["revision"]) . '
' . $this->_renderBar($sPhase, $sPlace) . '
<i class="icon-calendar"></i> Build vom ' . date("d.m.Y H:i:s", strtotime($aData["date"]));
if ($bLong) {
$sReturn.='<br><i class="icon-tag"></i> Revision: ' . $aData["revision"] . '<br>
......@@ -1514,8 +1531,19 @@ class project {
}
$sRow2 = false;
foreach ($this->_aPlaces as $sPlace => $sLabel) {
$sRow2.='<td class="' . $sPhase . ' tdphase td' . $this->_aConfig["id"] . '">' . $this->renderPhaseDetail($sPhase, $sPlace, $bActions, $bLong) . '</td>';
$aRows = array();
$sLastPlace = '';
// 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"]
) {
$aRows[$sLastPlace] = $this->_renderBar($sPhase, $sPlace) . "&raquo;";
}
$sLastPlace = $sPlace;
}
foreach (array_keys($this->_aPlaces) as $sPlace) {
$sRow2.='<td class="' . $sPhase . ' tdphase td' . $this->_aConfig["id"] . '">' . $aRows[$sPlace] . '</td>';
}
return $sRow2;
}
......@@ -1534,7 +1562,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");
$sRevision = $this->getRepoRevision();
$sReturn.=$this->getChecksumDiv($sRevision);
$sReturn.=$this->_getChecksumDiv($sRevision);
$sReturn.= '<i class="icon-tag"></i> Revision: ' . $sRevision;
$sReturn.="<br>$sGitCmd<br>";
......@@ -1601,28 +1629,6 @@ class project {
return $sReturn;
}
/**
* Form Item
* @param string $sType one of text | ...
* @param id $sId id for form element
* @param string $sValue prefilled form value
* @param string $sLabel label
* @return string
*/
private function _renderFormitem($sType, $sId, $sValue, $sLabel = "") {
$sReturn = '';
switch ($sType) {
case "text":
$sReturn = '<label for="' . $sId . '">' . $sLabel . '</label><input type="text" id="' . $sId . '" name="' . $sId . '" size="100" value="' . $sValue . '">';
break;
default:
break;
}
return $sReturn;
}
/**
* return html code for the setup form of an exsiting project
* @return string
......@@ -1632,6 +1638,31 @@ class project {
require_once ("formgen.class.php");
$i = 0;
$aPrefixItem = count($this->getVersions()) ?
array(
'type' => 'markup',
'value' => '<fieldset>
<label class="control-label">File-Prefix</label>
<div>
<input id="inputprefix" type="hidden" name="fileprefix" value="' . $this->_aPrjConfig["fileprefix"] . '">
' . $this->_aPrjConfig["fileprefix"] . '
</div>
</fieldset>
',
) :
array(
'type' => 'text',
'name' => 'fileprefix',
// 'disabled' => 'disabled',
'label' => 'File-Prefix <span class="error"><br>Nach dem ersten Build nicht mehr änderbar!</span>',
'value' => $this->_aPrjConfig["fileprefix"],
'required' => 'required',
'validate' => 'isastring',
'pattern' => '[a-z0-9\-\_]*',
'size' => 100,
'placeholder' => '',
);
$aForms = array(
'setup' => array(
......@@ -1746,18 +1777,7 @@ class project {
'size' => 100,
'placeholder' => '',
),
'input' . $i++ => array(
'type' => 'text',
'name' => 'fileprefix',
// 'disabled' => 'disabled',
'label' => 'File-Prefix <span class="error">(nachträglich NICHT mehr ändern!)</span>',
'value' => $this->_aPrjConfig["fileprefix"],
'required' => 'required',
'validate' => 'isastring',
'pattern' => '[a-z0-9\-\_]*',
'size' => 100,
'placeholder' => '',
),
'input' . $i++ => $aPrefixItem,
// --------------------------------------------------
'input' . $i++ => array(
'type' => 'markup',
......
......@@ -107,18 +107,20 @@ class projectlist {
}
$sOut = '
<script>
function filterOverviewTable(){
sPrj=$("#prjfilter").val();
sPhase=$("#phasefilter").val();
var sPrj=$("#prjfilter").val();
var sPhase=$("#phasefilter").val();
$(\'.'.$sTrClass.'\').hide(); $(\'.\' + sPrj).show();
$(\'.'.$sColClass.'\').hide(); $(\'.\' + sPhase).show();
}
function filterTable(){
sSearch=$("#efilter").val();
var sSearch=$("#efilter").val();
var Regex = new RegExp(sSearch, "i");
$(".trproject").each(function() {
sVisible="none";
if (this.innerHTML.search(sSearch)>=0){
if ( Regex.exec(this.innerHTML)) {
sVisible="";
}
$(this).css("display", sVisible);
......@@ -126,6 +128,14 @@ class projectlist {
}
</script>
Freitext-Filter (Regex):
<input type="text" id="efilter" name="efilter"
style="width: 150px;"
onchange="filterTable();"
onKeypress="filterTable(); "
onKeyup="filterTable(); "
>
&nbsp;&nbsp;&nbsp;
Projekt-Filter:
<select id="prjfilter" onchange="filterOverviewTable(); return false;">
'.$sPrjFilter.'
......@@ -136,13 +146,6 @@ class projectlist {
'.$sPhaseFilter.'
</select>
&nbsp;&nbsp;&nbsp;
Freitext:
<input type="text" id="efilter" name="efilter"
onchange="filterTable();"
onKeypress="filterTable(); "
onKeyup="filterTable(); "
>
<table class="table" id="tbloverview">
<thead>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment