Skip to content

Commit

Permalink
Solve #1512,Fix action progress bar has too many decimal digits issu…
Browse files Browse the repository at this point in the history
…e (#1516)

* Change rule name to rule text.

* Solve #1512,Fix action progress bar has too many decimal digits issue
  • Loading branch information
zhiqiang authored and littlezhou committed Jan 30, 2018
1 parent 4d86e0a commit 08503f7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ <h4>No action is running</h4>
<td>{{action.finished ? action.successful ? "Successful" : "Faild" : "-"}}</td>
<td>
<div style="width: 100%"><span class="small pull-left"></span>
<span class="small pull-right" ng-bind="action.progress * 100 + '%'"></span>
<span class="small pull-right" ng-bind="action.progress + '%'"></span>
</div>
<div style="clear: both; height: 1px"></div>
<div style="width: 100%" class="progress progress-tiny">
<div ng-style="{'width': action.progress * 100 +'%'}"
<div ng-style="{'width': action.progress + '%'}"
class="progress-bar progress-bar-{{action.progressColor}}"></div>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ angular.module('zeppelinWebApp')
$filter('date')(data.createTime,'yyyy-MM-dd HH:mm:ss');
data.finishTime = data.finished ? data.finishTime === 0 ? "-" :
$filter('date')(data.finishTime,'yyyy-MM-dd HH:mm:ss') : '-';
data.progress = Math.round(data.progress * 100);
data.progressColor = data.finished ? data.successful ? 'success' : 'danger' : 'warning';
});
$scope.totalPage = Math.ceil($scope.totalNumber / $scope.pageNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ <h4>No action is running</h4>
<td>{{action.finished ? action.runTime + "ms" : "-"}}</td>
<td>
<div style="width: 100%"><span class="small pull-left"></span>
<span class="small pull-right" ng-bind="action.progress * 100 + '%'"></span>
<span class="small pull-right" ng-bind="action.progress + '%'"></span>
</div>
<div style="clear: both; height: 1px"></div>
<div style="width: 100%" class="progress progress-tiny">
<div ng-style="{'width': action.progress * 100 +'%'}"
<div ng-style="{'width': action.progress + '%'}"
class="progress-bar progress-bar-{{action.progressColor}}"></div>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ angular.module('zeppelinWebApp')
$filter('date')(data.createTime,'yyyy-MM-dd HH:mm:ss');
data.finishTime = data.finished ? data.finishTime === 0 ? "-" :
$filter('date')(data.finishTime,'yyyy-MM-dd HH:mm:ss') : '-';
data.progress = Math.round(data.progress * 100);
data.progressColor = data.finished ? data.successful ? 'success' : 'danger' : 'warning';
});
$scope.totalPage = Math.ceil($scope.totalNumber / $scope.pageNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ <h4>No action is running</h4>
<td>{{action.finished ? action.runTime + "ms" : "-"}}</td>
<td>
<div style="width: 100%"><span class="small pull-left"></span>
<span class="small pull-right" ng-bind="action.progress * 100 + '%'"></span>
<span class="small pull-right" ng-bind="action.progress + '%'"></span>
</div>
<div style="clear: both; height: 1px"></div>
<div style="width: 100%" class="progress progress-tiny">
<div ng-style="{'width': action.progress * 100 +'%'}"
<div ng-style="{'width': action.progress + '%'}"
class="progress-bar progress-bar-{{action.progressColor}}"></div>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function MoverActionsCtrl($scope, baseUrlSrv, $filter, $http, conf, $route) {
$filter('date')(data.createTime,'yyyy-MM-dd HH:mm:ss');
data.finishTime = data.finished ? data.finishTime === 0 ? "-" :
$filter('date')(data.finishTime,'yyyy-MM-dd HH:mm:ss') : '-';
data.progress = Math.round(data.progress * 100);
data.progressColor = data.finished ? data.successful ? 'success' : 'danger' : 'warning';
});
$scope.totalPage = Math.ceil($scope.totalNumber / $scope.pageNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ angular.module('zeppelinWebApp')
cols: [
$stb.indicator().key('state').canSort('state.condition+"_"+submitTime').styleClass('td-no-padding').done(),
$stb.text('ID').key('id').canSort().sortDefaultDescent().done(),
$stb.text('Name').key(['ruleName']).canSort().done(),
$stb.text('Rule Text').key(['ruleText']).styleClass('col-md-1 hidden-sm hidden-xs').done(),
$stb.datetime('Submission Time').key('submitTime').canSort().done(),
$stb.datetime('Last Check Time').key('lastCheckTime').canSort().done(),
$stb.text('Checked Number').key('numChecked').canSort().styleClass('hidden-sm hidden-xs').done(),
Expand All @@ -60,14 +60,9 @@ angular.module('zeppelinWebApp')
// name: {href: pageUrl, text: rule.appName},
state: {tooltip: rule.state, condition: rule.isRunning ? 'good' : '', shape: 'stripe'},
//user: rule.user,
ruleName: {
value: rule.ruleName,
title: "ID:" + rule.id + " Name:" + rule.ruleName
+ " Submission Time:" + new Date(rule.submitTime).toUTCString()
+ " Last Check Time:" + new Date(rule.lastCheckTime).toUTCString()
+ " Checked Number:" + rule.numChecked
+ " Cmdlets Generated:" + rule.numCmdsGen
+ " Status:" + rule.state
ruleText: {
value: rule.ruleText.length > 70 ? rule.ruleText.substring(0, 70) + ' ...' : rule.ruleText,
title: rule.ruleText
},
submitTime: rule.submitTime,
lastCheckTime: rule.lastCheckTime === 0 ? '-' : rule.lastCheckTime,
Expand All @@ -89,8 +84,10 @@ angular.module('zeppelinWebApp')
click: function () {
if(!rule.isRunning) {
rule.start();
rule.isRunning = true;
}else{
rule.terminate();
rule.isRunning = false;
}
}
},
Expand Down

0 comments on commit 08503f7

Please sign in to comment.