mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 20:51:21 -03:30
fixing merge conflicts
This commit is contained in:
parent
66352ce5c9
commit
7f16036171
File diff suppressed because it is too large
Load Diff
@ -1,93 +0,0 @@
|
||||
@import "./client/src/shared/branding/colors.less";
|
||||
@import "./client/src/shared/branding/colors.default.less";
|
||||
|
||||
.HostEvents .CodeMirror{
|
||||
border: none;
|
||||
}
|
||||
.HostEvents .modal-footer{
|
||||
border: 0;
|
||||
margin-top: 0px;
|
||||
padding: 0px 20px 20px 20px;
|
||||
}
|
||||
button.HostEvents-close{
|
||||
width: 70px;
|
||||
color: #FFFFFF!important;
|
||||
text-transform: uppercase;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
background-color: @default-link;
|
||||
border-color: @default-link;
|
||||
&:hover{
|
||||
background-color: @default-link-hov;
|
||||
border-color: @default-link-hov;
|
||||
}
|
||||
}
|
||||
.HostEvents-status--ok{
|
||||
color: @green;
|
||||
}
|
||||
.HostEvents-status--unreachable{
|
||||
color: @unreachable;
|
||||
}
|
||||
.HostEvents-status--changed{
|
||||
color: @changed;
|
||||
}
|
||||
.HostEvents-status--failed{
|
||||
color: @default-err;
|
||||
}
|
||||
.HostEvents-status--skipped{
|
||||
color: @skipped;
|
||||
}
|
||||
|
||||
.HostEvents-filter--form{
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
float: right;
|
||||
display: inline-block;
|
||||
}
|
||||
.HostEvents .modal-body{
|
||||
padding: 20px;
|
||||
}
|
||||
.HostEvents .select2-container{
|
||||
text-transform: capitalize;
|
||||
max-width: 220px;
|
||||
float: right;
|
||||
}
|
||||
.HostEvents-form--container{
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.HostEvents-title{
|
||||
text-transform: uppercase;
|
||||
color: @default-interface-txt;
|
||||
font-weight: 600;
|
||||
}
|
||||
.HostEvents-status i {
|
||||
padding-right: 10px;
|
||||
}
|
||||
.HostEvents-table--header {
|
||||
height: 30px;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
text-transform: uppercase;
|
||||
color: @default-interface-txt;
|
||||
background-color: @default-list-header-bg;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
border-bottom-width: 0px;
|
||||
}
|
||||
.HostEvents-table--header:first-of-type{
|
||||
border-top-left-radius: 5px;
|
||||
}
|
||||
.HostEvents-table--header:last-of-type{
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
.HostEvents-table--row{
|
||||
color: @default-data-txt;
|
||||
border: 0 !important;
|
||||
}
|
||||
.HostEvents-table--row:nth-child(odd){
|
||||
background: @default-tertiary-bg;
|
||||
}
|
||||
.HostEvents-table--cell{
|
||||
border: 0 !important;
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2016 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default
|
||||
['$stateParams', '$scope', '$rootScope', '$state', 'Wait',
|
||||
'JobDetailService', 'CreateSelect2', 'hosts',
|
||||
function($stateParams, $scope, $rootScope, $state, Wait,
|
||||
JobDetailService, CreateSelect2, hosts){
|
||||
|
||||
// pagination not implemented yet, but it'll depend on this
|
||||
$scope.page_size = $stateParams.page_size;
|
||||
|
||||
$scope.processEventStatus = JobDetailService.processEventStatus;
|
||||
$scope.activeFilter = $stateParams.filter || null;
|
||||
|
||||
$scope.filters = ['all', 'changed', 'failed', 'ok', 'unreachable', 'skipped'];
|
||||
|
||||
// watch select2 for changes
|
||||
$('.HostEvents-select').on("select2:select", function () {
|
||||
$scope.activeFilter = $('.HostEvents-select').val();
|
||||
});
|
||||
|
||||
var init = function(){
|
||||
$scope.hostName = $stateParams.hostName;
|
||||
// create filter dropdown
|
||||
CreateSelect2({
|
||||
element: '.HostEvents-select',
|
||||
multiple: false
|
||||
});
|
||||
// process the filter if one was passed
|
||||
if ($stateParams.filter){
|
||||
$scope.activeFilter = $stateParams.filter;
|
||||
|
||||
$('#HostEvents').modal('show');
|
||||
}
|
||||
else{
|
||||
$scope.results = hosts.data.results;
|
||||
$('#HostEvents').modal('show');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
init();
|
||||
|
||||
}];
|
||||
@ -1,52 +0,0 @@
|
||||
<div id="HostEvents" class="HostEvents modal fade" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="HostEvents-header">
|
||||
<span class="HostEvents-title">HOST EVENTS | {{hostName}}</span>
|
||||
<!-- Close -->
|
||||
<button ui-sref="jobDetail.host-summary" type="button" class="close">
|
||||
<i class="fa fa fa-times-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="HostEvents-form--container">
|
||||
<select class="HostEvents-select">
|
||||
<option ng-selected="filter == activeFilter" class="HostEvents-select--option" value="{{filter}}" ng-repeat="filter in filters">{{filter}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- event results table -->
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<!-- column labels -->
|
||||
<th ng-hide="results.length == 0" class="HostEvents-table--header">STATUS</th>
|
||||
<th ng-hide="results.length == 0" class="HostEvents-table--header">PLAY</th>
|
||||
<th ng-hide="results.length == 0" class="HostEvents-table--header">TASK</th>
|
||||
<!-- result rows -->
|
||||
<tr class="HostEvents-table--row" ng-repeat="event in results track by $index" modal-paginate="event in results | page_size: page_size">
|
||||
<td class=HostEvents-table--cell>
|
||||
<!-- status circles -->
|
||||
<a class="HostEvents-status">
|
||||
<i class="fa fa-circle" ng-class="processEventStatus(event).class"></i>
|
||||
</a>
|
||||
{{processEventStatus(event).status}}
|
||||
</td>
|
||||
<td class=HostEvents-table--cell>{{event.play}}</td>
|
||||
<td class=HostEvents-table--cell>{{event.task}}</td>
|
||||
</tr>
|
||||
<tr ng-show="results.length == 0" class="HostEvents-table--row">
|
||||
<td class=HostEvents-table--cell>
|
||||
No results were found.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!-- pagination -->
|
||||
<!-- close -->
|
||||
<button ui-sref="jobDetail.host-summary" class="btn btn-default pull-right HostEvents-close">OK</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,131 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2016 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default
|
||||
['$scope', '$rootScope', '$stateParams', 'Wait', 'JobDetailService', 'DrawGraph', function($scope, $rootScope, $stateParams, Wait, JobDetailService, DrawGraph){
|
||||
|
||||
var page_size = 200;
|
||||
$scope.loading = $scope.hosts.length > 0 ? false : true;
|
||||
$scope.filter = 'all';
|
||||
|
||||
var buildGraph = function(hosts){
|
||||
// status waterfall: unreachable > failed > changed > ok > skipped
|
||||
var count;
|
||||
count = {
|
||||
ok : _.filter(hosts, function(o){
|
||||
return o.failures === 0 && o.changed === 0 && o.ok > 0;
|
||||
}),
|
||||
skipped : _.filter(hosts, function(o){
|
||||
return o.skipped > 0;
|
||||
}),
|
||||
unreachable : _.filter(hosts, function(o){
|
||||
return o.dark > 0;
|
||||
}),
|
||||
failures : _.filter(hosts, function(o){
|
||||
return o.failed === true;
|
||||
}),
|
||||
changed : _.filter(hosts, function(o){
|
||||
return o.changed > 0;
|
||||
})
|
||||
};
|
||||
return count;
|
||||
};
|
||||
var init = function(){
|
||||
Wait('start');
|
||||
JobDetailService.getJobHostSummaries($stateParams.id, {page_size: page_size, order_by: 'host_name'})
|
||||
.success(function(res){
|
||||
$scope.hosts = res.results;
|
||||
$scope.next = res.next;
|
||||
$scope.count = buildGraph(res.results);
|
||||
Wait('stop');
|
||||
DrawGraph({count: $scope.count, resize:true});
|
||||
});
|
||||
JobDetailService.getJob({id: $stateParams.id})
|
||||
.success(function(res){
|
||||
$scope.status = res.results[0].status;
|
||||
});
|
||||
};
|
||||
if ($rootScope.removeJobSummaryComplete) {
|
||||
$rootScope.removeJobSummaryComplete();
|
||||
}
|
||||
// emitted by the API in the same function used to persist host summary data
|
||||
// JobEvent.update_host_summary_from_stats() from /awx/main.models.jobs.py
|
||||
$scope.$on('ws-jobs-summary', function(e, data) {
|
||||
// discard socket msgs we don't care about in this context
|
||||
if (parseInt($stateParams.id) === data.unified_job_id){
|
||||
init();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on('ws-jobs', function(e, data) {
|
||||
if (parseInt($stateParams.id) === data.unified_job_id){
|
||||
$scope.status = data.status;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$scope.buildTooltip = function(n, status){
|
||||
var grammar = function(n, status){
|
||||
var dict = {
|
||||
0: 'No host events were ',
|
||||
1: ' host event was ',
|
||||
2: ' host events were '
|
||||
};
|
||||
if (n >= 2){
|
||||
return n + dict[2] + status;
|
||||
}
|
||||
else{
|
||||
return n !== 0 ? n + dict[n] + status : dict[n] + status;
|
||||
}
|
||||
};
|
||||
return grammar(n, status);
|
||||
};
|
||||
$scope.getNextPage = function(){
|
||||
if ($scope.next){
|
||||
JobDetailService.getNextPage($scope.next).success(function(res){
|
||||
res.results.forEach(function(key, index){
|
||||
$scope.hosts.push(res.results[index]);
|
||||
});
|
||||
$scope.hosts.push(res.results);
|
||||
$scope.next = res.next;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.setFilter = function(filter){
|
||||
$scope.filter = filter;
|
||||
var getAll = function(){
|
||||
Wait('start');
|
||||
JobDetailService.getJobHostSummaries($stateParams.id, {
|
||||
page_size: page_size,
|
||||
order_by: 'host_name'
|
||||
}).success(function(res){
|
||||
Wait('stop');
|
||||
$scope.hosts = res.results;
|
||||
$scope.next = res.next;
|
||||
});
|
||||
};
|
||||
var getFailed = function(){
|
||||
Wait('start');
|
||||
JobDetailService.getJobHostSummaries($stateParams.id, {
|
||||
page_size: page_size,
|
||||
failed: true,
|
||||
order_by: 'host_name'
|
||||
}).success(function(res){
|
||||
Wait('stop');
|
||||
$scope.hosts = res.results;
|
||||
$scope.next = res.next;
|
||||
});
|
||||
};
|
||||
$scope.get = filter === 'all' ? getAll() : getFailed();
|
||||
};
|
||||
|
||||
init();
|
||||
// calling the init routine twice will size the d3 chart correctly - no idea why
|
||||
// instantiating the graph inside a setTimeout() SHOULD have the same effect, but it doesn't
|
||||
// instantiating the graph further down the promise chain e.g. .then() or .finally() also does not work
|
||||
init();
|
||||
}];
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user