mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
AC-691 fixed detail AS view so that JSON changes displays correctly. Fixed Refresh and AS buttons on Home page.
This commit is contained in:
parent
0cd6e5412b
commit
38e9dbcf3c
@ -16,7 +16,8 @@ function Home ($routeParams, $rootScope, $location, Wait, ObjectCount, JobStatus
|
||||
ClearScope('home'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||
//scope.
|
||||
|
||||
var scope = $rootScope.$new();
|
||||
var element = angular.element(document.getElementById('htmlTemplate'));
|
||||
var scope = element.scope();
|
||||
var waitCount = 4;
|
||||
var loadedCount = 0;
|
||||
|
||||
@ -31,7 +32,6 @@ function Home ($routeParams, $rootScope, $location, Wait, ObjectCount, JobStatus
|
||||
scope.removeWidgetLoaded = scope.$on('WidgetLoaded', function() {
|
||||
// Once all the widgets report back 'loaded', turn off Wait widget
|
||||
loadedCount++;
|
||||
console.log('count: ' + loadedCount);
|
||||
if ( loadedCount == waitCount ) {
|
||||
Wait('stop');
|
||||
}
|
||||
@ -48,18 +48,24 @@ function Home ($routeParams, $rootScope, $location, Wait, ObjectCount, JobStatus
|
||||
});
|
||||
|
||||
scope.showActivity = function() { Stream(); }
|
||||
scope.refresh = function() { load(); }
|
||||
|
||||
scope.refresh = function() {
|
||||
Wait('start');
|
||||
loadedCount = 0;
|
||||
Rest.setUrl(GetBasePath('dashboard'));
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
scope.$emit('dashboardReady', data);
|
||||
})
|
||||
.error ( function(data, status, headers, config) {
|
||||
Wait('stop');
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Failed to get dashboard: ' + status });
|
||||
})
|
||||
}
|
||||
|
||||
scope.refresh();
|
||||
|
||||
Rest.setUrl(GetBasePath('dashboard'));
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
scope.$emit('dashboardReady', data);
|
||||
})
|
||||
.error ( function(data, status, headers, config) {
|
||||
Wait('stop');
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Failed to get dashboard: ' + status });
|
||||
})
|
||||
}
|
||||
|
||||
Home.$inject=[ '$routeParams', '$rootScope', '$location', 'Wait', 'ObjectCount', 'JobStatus', 'InventorySyncStatus',
|
||||
|
||||
@ -214,9 +214,7 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
||||
scope['object2_name'] = results.summary_fields.object2.name;
|
||||
}
|
||||
scope['user'] = (results.summary_fields.user) ? results.summary_fields.user.username : 'system';
|
||||
scope['changes'] = results['changes'];
|
||||
//scope['changes'] = (!Empty(results['changes'])) ? JSON.parse(scope.variables) : '';
|
||||
//scope['changes'] = JSON.stringify(results['changes'], null, '\t');
|
||||
scope['changes'] = JSON.stringify(results['changes'], null, '\t');
|
||||
scope.formModalAction = function() {
|
||||
$('#form-modal').modal("hide");
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<div class="tab-pane" id="home">
|
||||
<div id="htmlTemplate">
|
||||
<div id="refresh-row" class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="list-actions pull-right">
|
||||
@ -15,4 +16,5 @@
|
||||
<div id="container3" class="col-lg-6"></div>
|
||||
<div id="container4" class="col-lg-6"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user