mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 19:35:02 -02: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:
@@ -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
|
ClearScope('home'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
|
|
||||||
var scope = $rootScope.$new();
|
var element = angular.element(document.getElementById('htmlTemplate'));
|
||||||
|
var scope = element.scope();
|
||||||
var waitCount = 4;
|
var waitCount = 4;
|
||||||
var loadedCount = 0;
|
var loadedCount = 0;
|
||||||
|
|
||||||
@@ -31,7 +32,6 @@ function Home ($routeParams, $rootScope, $location, Wait, ObjectCount, JobStatus
|
|||||||
scope.removeWidgetLoaded = scope.$on('WidgetLoaded', function() {
|
scope.removeWidgetLoaded = scope.$on('WidgetLoaded', function() {
|
||||||
// Once all the widgets report back 'loaded', turn off Wait widget
|
// Once all the widgets report back 'loaded', turn off Wait widget
|
||||||
loadedCount++;
|
loadedCount++;
|
||||||
console.log('count: ' + loadedCount);
|
|
||||||
if ( loadedCount == waitCount ) {
|
if ( loadedCount == waitCount ) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
}
|
}
|
||||||
@@ -48,18 +48,24 @@ function Home ($routeParams, $rootScope, $location, Wait, ObjectCount, JobStatus
|
|||||||
});
|
});
|
||||||
|
|
||||||
scope.showActivity = function() { Stream(); }
|
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',
|
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['object2_name'] = results.summary_fields.object2.name;
|
||||||
}
|
}
|
||||||
scope['user'] = (results.summary_fields.user) ? results.summary_fields.user.username : 'system';
|
scope['user'] = (results.summary_fields.user) ? results.summary_fields.user.username : 'system';
|
||||||
scope['changes'] = results['changes'];
|
scope['changes'] = JSON.stringify(results['changes'], null, '\t');
|
||||||
//scope['changes'] = (!Empty(results['changes'])) ? JSON.parse(scope.variables) : '';
|
|
||||||
//scope['changes'] = JSON.stringify(results['changes'], null, '\t');
|
|
||||||
scope.formModalAction = function() {
|
scope.formModalAction = function() {
|
||||||
$('#form-modal').modal("hide");
|
$('#form-modal').modal("hide");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<div class="tab-pane" id="home">
|
<div class="tab-pane" id="home">
|
||||||
|
<div id="htmlTemplate">
|
||||||
<div id="refresh-row" class="row">
|
<div id="refresh-row" class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="list-actions pull-right">
|
<div class="list-actions pull-right">
|
||||||
@@ -15,4 +16,5 @@
|
|||||||
<div id="container3" class="col-lg-6"></div>
|
<div id="container3" class="col-lg-6"></div>
|
||||||
<div id="container4" class="col-lg-6"></div>
|
<div id="container4" class="col-lg-6"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user