diff --git a/config/lang/de.json b/config/lang/de.json index e3711a1c20f58a56085978d717eb002ec94c3385..5a8a4061155adf3488e684c949eec6aeb7c60f38 100644 --- a/config/lang/de.json +++ b/config/lang/de.json @@ -220,8 +220,12 @@ "branch-switch": "Switche Branch/ Tag ... Moment ...", "build": "Build", "build-hint": "neues Paket erstellen und in Phase [%s] stellen.", + "build-hint-overview": "neues Paket aus<br>Tag/ Revision erstellen<br>und im Archiv ablegen.", "build-from": "Build vom", "build-type": "Build Typ", + "build-failes": "Build-Fehler", + "build-failes-hint": "Hier sind die Ausgaben der letzten fehlerfaften Builds einsehbar.", + "build-failes-none": "Es wurden noch keine Build-Fehler aufgezeichnet.", "commitmessage": "Commit-Message", "change": "Wechseln", "cleanup": "Cleanup", @@ -298,6 +302,7 @@ "projectname": "Projektname", "projectmanager": "Projektleiter", "queue": "Queue", + "queue-hint-overview": "neuestes Paket<br>in der ersten<br>Phase %s<br>installieren", "raw-data": "Raw data", "replacement-fields": "erkannte Platzhalter:", "replacement-fields-not-found": "Es wurden keine Platzhalter im Format <em>@replace["Name"]</em> im Template gefunden.", diff --git a/config/lang/en.json b/config/lang/en.json index e1a65046f3c03f074905741740030eed5dce591e..e51be7228b7c2ce9224fc5a8aa9fe7ea9701d5a3 100644 --- a/config/lang/en.json +++ b/config/lang/en.json @@ -222,8 +222,12 @@ "branch-switch": "Switching branch/ tag ... please wait ...", "build": "Build", "build-hint": "Create new package and rollout to first active phase [%s].", + "build-hint-overview": "Create new package<br>from tag/ revision<br>and put to archive.", "build-from": "Build date", "build-type": "Build type", + "build-failes": "Build-Errors", + "build-failes-hint": "Here you can view to the output of the latest failed builds.", + "build-failes-none": "No failed builds were recorded yet.", "change": "Change", "commitmessage": "Commit message", "contact": "contact", @@ -300,6 +304,7 @@ "projectname": "Project name", "projectmanager": "Projekt manager", "queue": "Queue", + "queue-hint-overview": "Install newest<br>package in the first<br>phase %s", "raw-data": "Raw data", "replacement-fields": "Detected placeholders:", "replacement-fields-not-found": "No placeholder in the syntax <em>@replace["name"]</em> were found in the template.", diff --git a/public_html/deployment/classes/htmlguielements.class.php b/public_html/deployment/classes/htmlguielements.class.php index 3264208cb40bede5e2322743a5bff86d4249da0c..0fb66c3ad398ae05e1c301b1b486454961d1032c 100644 --- a/public_html/deployment/classes/htmlguielements.class.php +++ b/public_html/deployment/classes/htmlguielements.class.php @@ -92,12 +92,19 @@ class htmlguielements{ 'calendar'=>'glyphicon-calendar', 'comment'=>'glyphicon-comment', 'revision'=>'glyphicon-tag', + + 'link-extern'=>'glyphicon-globe', 'host'=>'fa-hdd-o', 'hostgroup'=>'fa-sitemap', 'templatefile'=>'fa-file-code-o', 'targetfile'=>'fa-file-o', - 'replace'=>'fa-random', + 'replace'=>'fa-random', + + 'sign-info'=>'', + 'sign-warning'=>'', + 'sign-error'=>'fa-bolt', + 'sign-ok'=>'', ), ); @@ -312,7 +319,7 @@ class htmlguielements{ foreach ($aTabData['tabs'] as $sTabLabel=>$sTabContent){ $iCounter++; $iTab++; - $sId="tab${iCounter}"; + $sId="tab-generated-${iCounter}"; $sTabs.= ($iTab==1 ? '<li class="active"' : '<li') . ' role="presentation">' . '<a href="#'.$sId.'" data-toggle="tab">' . $sTabLabel . '</a></li>' diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index c544d2c745de6a15055806b3acc046cbfd5974e6..f6b88e2bc681232ebdc01bf8ab30f4b2660eff9a 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -1175,7 +1175,7 @@ class project extends base { if (!$this->_oVcs) { $this->_initVcs(); } - + require_once("formgen.class.php"); if (!$sActiveBranchname) { $sActiveBranchname = $this->_sBranchname; } @@ -2429,10 +2429,16 @@ class project extends base { */ private function _getChecksumColor($sText, $sFormat = "hex", $fAlpha = 1.0) { $sReturn = ''; - $s = md5($sText); - $sRH = substr($s, 0, 2); - $sGH = substr($s, 2, 2); - $sBH = substr($s, 4, 2); + if ($sText){ + $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'; + } switch ($sFormat) { case "rgba": $sReturn = "rgba(" . hexdec($sRH) . ", " . hexdec($sGH) . ", " . hexdec($sBH) . ", " . $fAlpha . ")"; @@ -2688,6 +2694,7 @@ class project extends base { } $sReturn = false; + $oHtml = new htmlguielements(); $aDataPhase = $this->getPhaseInfos($sPhase); $aData = $aDataPhase[$sPlace]; // foreach($aDataPhase[$sPlace] as $aData) { @@ -2707,25 +2714,25 @@ class project extends base { } */ $sReturn .= ' - ' . $this->_renderBar($sPhase, $sPlace) . ' - <i class="glyphicon glyphicon-calendar"></i> ' . date($sDateFormat, $oPkgDate); + ' . $this->_renderBar($sPhase, $sPlace) + . $oHtml->getIconByType('calendar') .' ' . date($sDateFormat, $oPkgDate); if ($bLong) { // long display of the revision // $sJsonUrl = $this->_getInfofile($sPhase, $sPlace); - $sReturn.='<br> - <i class="glyphicon glyphicon-bookmark"></i> ' . t('branch') . ': ' . $aData["branch"] . '<br> - <i class="glyphicon glyphicon-tag"></i> ' . t('revision') . ': ' . $this->_renderRevision($aData["revision"]) . '<br> - <i class="glyphicon glyphicon-comment"></i> ' . t('commitmessage') . ':<br><pre>' . strip_tags($aData["message"], '<br>') . '</pre>' + $sReturn.='<br>' + . $oHtml->getIconByType('branch') . t('branch') . ': ' . $aData["branch"] . '<br>' + . $oHtml->getIconByType('revision') . t('revision') . ': ' . $this->_renderRevision($aData["revision"]) . '<br>' + . $oHtml->getIconByType('comment') . t('commitmessage') . ':<br><pre>' . strip_tags($aData["message"], '<br>') . '</pre>' // . '<i class="glyphicon glyphicon-globe"></i> ' . t('url') . ': <a href="' . $sJsonUrl . '">' . $sJsonUrl . '</a><br>' ; if ($sPlace == "deployed" && array_key_exists("url", $this->_aPrjConfig["phases"][$sPhase])) { $sUrl = $this->_aPrjConfig["phases"][$sPhase]["url"]; - $sReturn.='<i class="glyphicon glyphicon-globe"></i> ' . t('url') . ': <a href="' . $sUrl . '">' . $sUrl . '</a><br>'; + $sReturn.=$oHtml->getIconByType('link-extern') . ' '. t('url') . ': <a href="' . $sUrl . '">' . $sUrl . '</a><br>'; } } else { if ($sPlace == "deployed" && array_key_exists("url", $this->_aPrjConfig["phases"][$sPhase])) { - $sMore = '<i class="glyphicon glyphicon-globe"></i> ' + $sMore = $oHtml->getIconByType('link-extern').' ' . t('url') . ': <a href="' . $this->_aPrjConfig["phases"][$sPhase]["url"] . '">' . $this->_aPrjConfig["phases"][$sPhase]["url"] . '</a><br>'; } @@ -2954,14 +2961,13 @@ class project extends base { $oHtml = new htmlguielements(); $sReturn = false; $sRowHead1 = false; - $sRowHead2 = ''; + $sRowHead2 = '<td></td>'; $aAllVersions = $this->_getVersionUsage(); if (!count($aAllVersions)) { return $oHtml->getBox("info", t('class-project-info-no-package')); } - echo "<pre>" . print_r($this->getBuildErrors(), 1) . "</pre>"; foreach ($this->getActivePhases() as $sPhase) { $sRowHead1.='<th class="' . $sPhase . '" colspan="' . (count($this->_aPlaces) + 1) . '">' . $sPhase . '</th>'; $sRowHead2.='<td></td>' . $this->renderPlacesAsTd($sPhase); @@ -2971,18 +2977,34 @@ class project extends base { $sReturn.='<tr>'; $sInfos = $this->renderInfoLink($aData["info"], array('hpos' => 'left')); - $sReturn.='<td>' . $sVersion . ' ' . $sInfos . '</td>'; + $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>' + . '</td><td>' + . ' ' . $sInfos . ' ' + . '</td>' + ; foreach ($this->getActivePhases() as $sPhase) { $sTLine = ''; $bCanRollback = $aData["rollback"][$sPhase]; // $sReturn.=$aData["rollback"][$sPhase] ? '<td>'.$this->renderLink("rollback", $sPhase, $sVersion).'</td>' : '<td>Rollback NOT possible</td>'; - $sReturn.=$aData["rollback"][$sPhase] ? '<td> Y </td>' : '<td> N </td>'; + // $sReturn.=$aData["rollback"][$sPhase] ? '<td> Y </td>' : '<td> N </td>'; + $sReturn.='<td> </td>'; foreach (array_keys($this->_aPlaces) as $sPlace) { $bFound = false; - $sReturn.=$aData["usage"][$sPhase][$sPlace] ? '<td class="' . $sPhase . '" style="text-align: center;">X</td>' : '<td> </td>'; + $sReturn.=$aData["usage"][$sPhase][$sPlace] + ? '<td class="' . $sPhase . '" style="text-align: center;">' + . $this->_getChecksumDiv($aData['info']['revision']) + . 'X' + . '</td>' + : '<td> </td>' + ; } } $sReturn.='</tr>'; @@ -2990,7 +3012,7 @@ class project extends base { $sReturn = t('class-project-info-table-packages') . '<br><br>' . '<table>' - . '<thead><tr><td>Version</td>' + . '<thead><tr><td>Version</td><td></td>' . $sRowHead1 . '</tr><tr><td>' . $sRowHead2 @@ -3008,7 +3030,7 @@ class project extends base { */ public function renderVisual() { $sReturn = ''; - $sContinue = '»»'; + $sContinue = '<span style="font-size: 300%; color:#ace;">»»</span><br><br>'; $sRepoBar = ''; @@ -3034,7 +3056,7 @@ class project extends base { if ($this->canAcceptPhase($sLastPhase)) { $sAction = $this->renderLink("accept", $sLastPhase); } - $sPhaseImg.='<div class="action">' . $sAction . '</div>'; + $sPhaseImg.='<div class="action">' . $sContinue . $sAction . '</div>'; } $sLastPhase = $sPhase; @@ -3051,11 +3073,11 @@ class project extends base { <div><img src="/deployment/images/process/bg_phase.png" alt="' . t("phase") . ' ' . $sPhase . '"></div> </div>'; } - + $oHtml = new htmlguielements(); $sReturn = ' <div class="visualprocess"> - <div class="process"> - <div class="title">' . t("versioncontrol") . '</div> + <div class="process box"> + <div class="title">' . $oHtml->getIcon('repository') . t("versioncontrol") . '</div> <div class="details"> ' . $sRepoBar . '<br> <!-- @@ -3074,11 +3096,12 @@ class project extends base { <div class="process"> <div class="title"> </div> - <div class="action">' . ($this->canAcceptPhase() ? $this->renderLink("build") : '') . '</div> + <div class="action">' . $sContinue . t("build-hint-overview") . '<br><br>' . ($this->canAcceptPhase() ? $this->renderLink("build") : '') . '</div> </div> + - <div class="process archive"> - <div class="title">' . t("archive") . '</div> + <div class="process box"> + <div class="title">' . $oHtml->getIcon('package') . t("archive") . '</div> <div class="details"> ' . $sPackagebar . '<br> <!-- @@ -3092,11 +3115,11 @@ class project extends base { <div class="process"> <div class="title"> </div> - <div class="action">' . $sContinue . '</div> + <div class="action">'.$sContinue . sprintf(t("queue-hint-overview"), $this->getNextPhase()).'</div> </div> - <div class="process phases"> - <div class="title">' . t("phases") . '</div> + <div class="process phases box"> + <div class="title">' . $oHtml->getIcon('phase') . t("phases") . '</div> ' . ($sPhaseImg ? $sPhaseImg : '<div class="process">' . t("none") . '</div>') . ' </div> </div> diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index 4297fa1a7dd1fb3e861aab27b896d6e7db43d24c..cc917dc0073b0ce8d8ba34ca9010431f93fca08d 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -208,7 +208,7 @@ span.pre{ background-color: #fea; color: #653; } - +.badge-light{background-color:#eee; color:#aaa;} .center{text-align: center;} .inactive{color:#999; font-style: italic;} .versioninfo{ @@ -241,10 +241,10 @@ input[type="radio"]:checked+label, input[type="checkbox"]:checked+label{ /* ----- visualized process ----- */ .visualprocess{float: left; padding: 1em; box-shadow: 0 0 0em #ddd;} -.visualprocess .process{float:left; text-align: center; padding: 0 0 5px; min-height: 220px; } -.visualprocess .process.phases{border-left: 2px dashed #ddd; padding-left: 1em;} +.visualprocess .process{float:left; text-align: center; padding: 0 0 5px; } +.visualprocess .process.box{border: 2px dashed #ddd; padding: 1em; min-height: 25em;} .visualprocess .process img{} -.visualprocess .action{float:left;padding: 9em 2em; background: #fff;} +.visualprocess .action{float:left;padding: 3em 1em 1em 1em; background: #fff;} .visualprocess .process .title{margin-bottom: 2em; font-weight: bold; font-size: 150%; color:#aaa;} .visualprocess .process .details{background: #fff; min-height: 6em;} diff --git a/public_html/deployment/pages/act_overview.php b/public_html/deployment/pages/act_overview.php index 8bff0dd4ec78ddbfade22fbce36ca92fc5e0062b..9d92438082717690830dad5c4bdf386ad7c0ac84 100644 --- a/public_html/deployment/pages/act_overview.php +++ b/public_html/deployment/pages/act_overview.php @@ -32,14 +32,41 @@ if (!array_key_exists("prj", $aParams)) { require_once("./classes/project.class.php"); $oPrj = new project($aParams["prj"]); + $iCountOfBranches=0; + $iCountOfBuildErrors=count($oPrj->getBuildErrors()); + $iCountOfpackages=count($oPrj->getVersions()); + $iCountOfPhases=count($oPrj->getActivePhases()); + + $sBuildErrorContent='<p>'.t('build-failes-hint').'</p>'; + if($iCountOfBuildErrors){ + $aTabdata=array(); + $aErrorfiles=$oPrj->getBuildErrors(); + rsort($aErrorfiles); + foreach ($aErrorfiles as $sNumber=>$sErrorfile){ + $aTabdata[$oHtml->getIcon('targetfile').' '.$sErrorfile]='' + // . 'file: ' . $oHtml->getIcon('targetfile'). ''.$sErrorfile.'<br>' + // . 'date: ' . .'<br>' + // . 'age: ' . .'<br>' + . $oPrj->getBuildErrorContent($sErrorfile); + } + $sBuildErrorContent.=$oHtml->getNav(array( + 'options' => array( + 'type'=>'pills', + 'justified'=>0, + ), + 'tabs'=>$aTabdata) + ); + } else { + $sBuildErrorContent=$oHtml->getBox('info', t('build-failes-none')); + } + $sListOfBranches='<h4>'.t('branch-select').'</h4><ol>'; foreach($oPrj->getRemoteBranches() as $aBranch){ $sListOfBranches.='<li title="'.$aBranch['revision'].'">'.$aBranch['label'] . '</li>'; + $iCountOfBranches++; } $sListOfBranches.='</ol>'; - $sPhaseTabs=''; - $sPhaseDetails=''; $sOut = ' @@ -48,9 +75,10 @@ if (!array_key_exists("prj", $aParams)) { <ul class="nav nav-tabs"> <li class="active"><a href="#tab1" data-toggle="tab">' . $oHtml->getIcon('workflow') . t("way-of-packages") . '</a></li> - <li><a href="#tab2" data-toggle="tab">' . $oHtml->getIcon('repository') . t("repositoryinfos") . '</a></li> - <li><a href="#tab3" data-toggle="tab">' . $oHtml->getIcon('package') . t("packages") . '</a></li> - <li><a href="#tab4" data-toggle="tab">' . $oHtml->getIcon('phase') . t('phases') . '</a></li> + <li><a href="#tab2" data-toggle="tab">' . $oHtml->getIcon('repository') . t("repositoryinfos") . ($iCountOfBranches ? ' <span class="badge badge-light">'.$iCountOfBranches.'</span>' : '' ).'</a></li> + <li><a href="#tab3" data-toggle="tab">' . $oHtml->getIcon('sign-error') . t("build-failes") . ($iCountOfBuildErrors ? ' <span class="badge badge-light">'.$iCountOfBuildErrors.'</span>' : '' ).'</a></li> + <li><a href="#tab4" data-toggle="tab">' . $oHtml->getIcon('package') . t("packages") . ($iCountOfpackages ? ' <span class="badge badge-light">'.$iCountOfpackages.'</span>' : '' ).'</a></li> + <li><a href="#tab5" data-toggle="tab">' . $oHtml->getIcon('phase') . t('phases') . ($iCountOfPhases ? ' <span class="badge badge-light">'.$iCountOfPhases.'</span>' : '' ) . '</a></li> </ul> <br> <div class="tab-content"> @@ -61,19 +89,24 @@ if (!array_key_exists("prj", $aParams)) { </div> <div class="tab-pane" id="tab2"> <h3 id="h3repo">' . $oHtml->getIcon('repository') . t("repositoryinfos") . '</h3> - <div style="max-width: 40em;"> - ' . $oPrj->renderRepoInfo() . ' - ' . $sListOfBranches . ' + <div style="max-width: 40em;">' + . $oPrj->renderRepoInfo() + // . $oPrj->renderSelectRemoteBranches() + . $sListOfBranches . ' ' . ($oPrj->canAcceptPhase() ? '<br>'.$oPrj->renderLink("build") : '') . ' </div> </div> - <div class="tab-pane" id="tab3"> + <h3 id="h3versions">' . $oHtml->getIcon('sign-error') . t("build-failes") . '</h3> + '.$sBuildErrorContent.' + </div> + + <div class="tab-pane" id="tab4"> <h3 id="h3versions">' . $oHtml->getIcon('package') . t("packages") . '</h3> ' . $oPrj->renderVersionUsage() .' </div> - <div class="tab-pane" id="tab4"> + <div class="tab-pane" id="tab5"> <h3 id="h3phases">' . $oHtml->getIcon('phase') . t("phases") . '</h3> '.($oPrj->getActivePhases() @@ -81,8 +114,6 @@ if (!array_key_exists("prj", $aParams)) { . t("page-overview-phase-infos") . '</p>' . $oPrj->renderPhaseInfo() - . $sPhaseTabs - . $sPhaseDetails : $oHtml->getBox("info", t("page-overview-no-phase")) .$oPrj->renderLink("setup") ).' </div>