mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 14:38:00 -03:30
refresh button for non live mode on job detail page and job stdout page
This commit is contained in:
parent
a4851308b4
commit
e17a9a9e1d
@ -23,13 +23,14 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb
|
||||
refresh: {
|
||||
mode: 'all',
|
||||
awToolTip: "Refresh the page",
|
||||
ngClick: "refresh()"
|
||||
},
|
||||
stream: {
|
||||
ngClick: "showActivity()",
|
||||
awToolTip: "View Activity Stream",
|
||||
mode: 'all'
|
||||
ngClick: "refresh()",
|
||||
ngShow:"socketStatus == 'error'"
|
||||
}
|
||||
// stream: {
|
||||
// ngClick: "showActivity()",
|
||||
// awToolTip: "View Activity Stream",
|
||||
// mode: 'all'
|
||||
// }
|
||||
};
|
||||
|
||||
html = Button({
|
||||
@ -38,11 +39,11 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb
|
||||
toolbar: true
|
||||
});
|
||||
|
||||
html += Button({
|
||||
btn: buttons.stream,
|
||||
action: 'stream',
|
||||
toolbar: true
|
||||
});
|
||||
// html += Button({
|
||||
// btn: buttons.stream,
|
||||
// action: 'stream',
|
||||
// toolbar: true
|
||||
// });
|
||||
|
||||
e = angular.element(document.getElementById('home-list-actions'));
|
||||
e.html(html);
|
||||
@ -75,7 +76,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb
|
||||
nv.dev=false;
|
||||
|
||||
var winHeight = $(window).height(),
|
||||
available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 80;
|
||||
available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 93;
|
||||
$('.graph-container').height(available_height/2);
|
||||
// chart.update();
|
||||
|
||||
@ -99,7 +100,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('#dash-host-count-graph').replaceWith("<div id='dash-host-count-graph' class='left-side col-sm-12 col-xs-12'></div>");
|
||||
$('#dash-host-count-graph').remove(); //replaceWith("<div id='dash-host-count-graph' class='left-side col-sm-12 col-xs-12'></div>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -105,7 +105,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
if ($rootScope.jobDetailInterval) {
|
||||
window.clearInterval($rootScope.jobDetailInterval);
|
||||
}
|
||||
$scope.$emit('LoadJob');
|
||||
$scope.$emit('LoadJob'); //this is what is used for the refresh
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1135,6 +1135,9 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
status: status
|
||||
});
|
||||
};
|
||||
scope.refresh = function(){
|
||||
$scope.$emit('LoadJob');
|
||||
};
|
||||
|
||||
scope.editHost = function(id) {
|
||||
HostsEdit({
|
||||
|
||||
@ -68,7 +68,7 @@ function JobStdoutController ($log, $rootScope, $scope, $compile, $routeParams,
|
||||
if (event_queue > 0) {
|
||||
// events happened since the last check
|
||||
$log.debug('checking for stdout...');
|
||||
if (loaded_sections.length === 0) {
|
||||
if (loaded_sections.length === 0) { ////this if statement for refresh
|
||||
$log.debug('calling LoadStdout');
|
||||
$scope.$emit('LoadStdout');
|
||||
}
|
||||
@ -159,6 +159,16 @@ function JobStdoutController ($log, $rootScope, $scope, $compile, $routeParams,
|
||||
msg: 'Failed to retrieve job: ' + job_id + '. GET returned: ' + status });
|
||||
});
|
||||
|
||||
$scope.refresh = function(){
|
||||
if (loaded_sections.length === 0) { ////this if statement for refresh
|
||||
$log.debug('calling LoadStdout');
|
||||
$scope.$emit('LoadStdout');
|
||||
}
|
||||
else if (live_event_processing) {
|
||||
$log.debug('calling getNextSection');
|
||||
getNextSection();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.stdOutScrollToTop = function() {
|
||||
// scroll up or back in time toward the beginning of the file
|
||||
|
||||
@ -139,7 +139,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
||||
;
|
||||
|
||||
chart.xAxis
|
||||
.axisLabel("Time").showMaxMin(true)
|
||||
.axisLabel("Time")//.showMaxMin(true)
|
||||
.tickFormat(function(d) {
|
||||
var dx = graphData[0].values[d] && graphData[0].values[d].x || 0;
|
||||
return dx ? d3.time.format(timeFormat)(new Date(Number(dx+'000'))) : '';
|
||||
@ -159,7 +159,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
||||
.datum(graphData).transition()
|
||||
.attr('width', width)
|
||||
.attr('height', height)
|
||||
.duration(500)
|
||||
.duration(1000)
|
||||
.call(chart)
|
||||
.style({
|
||||
// 'width': width,
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
|
||||
<div class="tab-pane" id="home">
|
||||
<div ng-cloak id="htmlTemplate" style="padding:10px">
|
||||
<!--<div id="refresh-row" class="row">
|
||||
<div class="col-lg-12">
|
||||
<div id="home-list-actions" class="list-actions pull-right"></div>
|
||||
<div id="refresh-row" class="row">
|
||||
<div class="col-lg-12">
|
||||
<div id="home-list-actions" class="list-actions pull-right">
|
||||
<!-- <button type="button" class="btn btn-xs btn-primary ng-hide" ng-click="refreshJobs()" id="refresh_btn" aw-tool-tip="Refresh the page" data-placement="top" ng-show="socketStatus == 'error'" data-original-title="" title=""><i class="fa fa-refresh fa-lg"></i> </button></div> -->
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="row">
|
||||
<div id="dash-counts" class="col-sm-12 col-xs-12"></div>
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<a href="/#/jobs/{{ job_id }}/stdout" id="view-stdout-button" target="_blank" type="button" class="btn btn-primary btn-xs" aw-tool-tip="View standard out. Opens in new tab or window." data-placement="top"><i class="fa fa-external-link"></i></a>
|
||||
<button type="button" class="btn btn-xs btn-primary ng-hide" ng-click="refresh()" id="refresh_btn" aw-tool-tip="Refresh the page" data-placement="top" ng-show="socketStatus == 'error'" data-original-title="" title=""><i class="fa fa-refresh fa-lg"></i> </button>
|
||||
<a href="" ng-click="deleteJob()" id="cancel-job-button" ng-show="job_status.status == 'running'" type="button" class="btn btn-primary btn-xs" aw-tool-tip="Cancel" data-placement="top"><i class="fa fa-minus-circle"></i></a>
|
||||
<a href="" ng-click="deleteJob()" id="delete-job-button" ng-show="job_status.status != 'running'" type="button" class="btn btn-primary btn-xs" aw-tool-tip="Delete" data-placement="top"><i class="fa fa-trash-o"></i></a>
|
||||
<a href="" ng-click="relaunchJob()" id="relaunch-job-button" type="button" class="btn btn-primary btn-xs" aw-tool-tip="Relaunch using the same parameters" data-placement="top"><i class="fa fa-rocket"></i></a>
|
||||
|
||||
@ -2,13 +2,15 @@
|
||||
<div ng-cloak id="htmlTemplate">
|
||||
|
||||
<div class="row">
|
||||
<div id="breadcrumb-container" class="col-md-12" style="position: relative;">
|
||||
<div id="breadcrumb-container" class="col-md-6" style="position: relative;">
|
||||
<ul class="ansible-breadcrumb" id="breadcrumb-list">
|
||||
<li><a href="/#/jobs">Jobs</a></li>
|
||||
<li><a href="/#/jobs/{{ job.id }}"><strong>{{ job.id }}</strong> - {{ job.name }}</a></li>
|
||||
<li class="active"><a href="">Standard Out</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="home-list-actions" class="list-actions pull-right col-md-6">
|
||||
<button type="button" class="btn btn-xs btn-primary ng-hide" ng-click="refresh()" id="refresh_btn" aw-tool-tip="Refresh the page" data-placement="top" ng-show="socketStatus == 'error'" data-original-title="" title=""><i class="fa fa-refresh fa-lg"></i> </button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user