Skip to content

Commit

Permalink
[JENKINS-45601] Provided checkbox to show/hide job/build parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
pskumar448 committed Aug 5, 2017
1 parent 0f2dbe1 commit 261d4c2
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
list-style-type: none;
white-space: nowrap;
display: block;
padding: 0;
}
.column-wrapper {
margin: 20px;
display: inline-block;
vertical-align: top;
}
.column-wrapper:first-child {
margin-left: 0;
}
.build {
margin: 10px;
border:solid 1px black;
Expand Down Expand Up @@ -89,9 +93,66 @@
table.progress-bar.red td.progress-bar-done {
background-color: #cc0000;
}

.roundedCheckbox {
width: 28px;
height: 28px;
position: relative;
margin: 5px auto;
background: #fcfff4;
background: -webkit-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: linear-gradient(to bottom, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
border-radius: 50px;
box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
}
.roundedCheckbox label {
width: 20px;
height: 20px;
cursor: pointer;
position: absolute;
left: 4px;
top: 4px;
background: -webkit-linear-gradient(top, #222222 0%, #45484d 100%);
background: linear-gradient(to bottom, #222222 0%, #45484d 100%);
border-radius: 50px;
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px white;
}
.roundedCheckbox label:after {
content: '';
width: 16px;
height: 16px;
position: absolute;
top: 2px;
left: 2px;
background: #27ae60;
background: -webkit-linear-gradient(top, #27ae60 0%, #145b32 100%);
background: linear-gradient(to bottom, #27ae60 0%, #145b32 100%);
opacity: 0;
border-radius: 50px;
box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
}
.roundedCheckbox label:hover::after {
opacity: 0.3;
}
.roundedCheckbox input[type=checkbox] {
visibility: hidden;
}
.roundedCheckbox input[type=checkbox]:checked + label:after {
opacity: 1;
}

</style>

<div ng-app="buildgraphapp" ng-controller="BuildGraphAppCtrl" id="buildgraph">
<div style="border-bottom: 2px solid #d3d7cf; padding-bottom: 5px;">
<div style="width: 150px; text-align: center;">
<div class="roundedCheckbox">
<input type="checkbox" ng-model="showparameters" id="showparameters"/>
<label for="showparameters"></label>
</div>
<span>Show Parameters</span>
</div>
</div>
<my-build-graph style="margin: 5px; width: 100%; height: 100%;" jenkinsurl="${resURL}">
</my-build-graph>
</div>
Expand Down
17 changes: 13 additions & 4 deletions src/main/webapp/scripts/buildgraph-appctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ angular.module('buildgraphapp', [])
var buildGraphPlumb = jsPlumb.getInstance({Container:"buildgraph"});
var nodesSize = 0;
var isBuilding = false;
$scope.showparameters = true;
$scope.refreshinterval = 200;
$scope.toggleparameters = function() {
$scope.showparameters = !$scope.showparameters;
};
$scope.callAtTimeout = function() {
$http.get(ajaxPath)
.then(function(response) {
Expand Down Expand Up @@ -39,22 +44,26 @@ angular.module('buildgraphapp', [])
});
}
buildGraphPlumb.repaintEverything();
},200);
},$scope.refreshinterval);
}
}
);

$timeout( function(){ $scope.callAtTimeout(); }, 3000);
}
};
$scope.toggleparameters();
$scope.callAtTimeout();
}])
.directive('myBuildGraph', function() {
.directive('myBuildGraph', function($compile) {
return {
restrict: 'E',
templateUrl: function(element, attrs) {
return attrs.jenkinsurl + "/plugin/buildgraph-view/scripts/buildgraph-nodetemplate.html";
},
replace: true
link: function(scope, element, attrs) {
$compile(element.contents())(scope.$new());
},
replace: true
};
})
.filter('rawHtml', ['$sce', function($sce){
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/buildgraph-nodetemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ng-src="{{node.terminalpng}}"/>
</a>
<br/>
<div ng-show="node.parameters != null">
<div ng-show="node.parameters != null && showparameters">
Parameters:
<div ng-repeat="parameter in node.parameters">
{{parameter}}
Expand Down

0 comments on commit 261d4c2

Please sign in to comment.