Fixed 'refresh' routine to refresh on the current url (which includes current page, sort and search criteria). In other words refresh now respects the current page state rather than resetting it back to thebeginning. Also added first attempt at a dashboard and widget.

This commit is contained in:
chouseknecht
2013-09-26 01:50:01 -04:00
parent 879936ab37
commit 44c6bca6f0
10 changed files with 205 additions and 18 deletions

View File

@@ -74,7 +74,7 @@ function Authenticate($cookieStore, $window, $scope, $rootScope, $location, Auth
Authorization.getLicense()
.success(function(data, status, headers, config) {
Authorization.setLicense(data['license_info']);
$location.path('/organizations');
$location.url('/home?login=true');
})
.error(function(data, status, headers, config) {
Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', setLoginFocus);

View File

@@ -0,0 +1,29 @@
/************************************
* Copyright (c) 2013 AnsibleWorks, Inc.
*
*
* Home.js
*
* Controller functions for Home tab
*
*/
'use strict';
function Home ($routeParams, $scope, $rootScope, $location, Wait, ObjectCount, ClearScope)
{
//ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
if (!$routeParams['login']) {
Wait('start');
}
ObjectCount({ target: 'container1' });
if (!$routeParams['login']) {
Wait('stop');
}
}
Home.$inject=[ '$routeParams', '$scope', '$rootScope', '$location', 'Wait', 'ObjectCount', 'ClearScope'];

View File

@@ -12,7 +12,7 @@
function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath, LookUpInit, SubmitJob, FormatDate)
ClearScope, ProcessErrors, GetBasePath, LookUpInit, SubmitJob, FormatDate, Refresh)
{
ClearScope('htmlTemplate');
var list = JobList;
@@ -71,7 +71,9 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
LoadBreadCrumbs();
scope.refresh = function() {
scope.search(list.iterator);
scope['jobSearchSpin'] = true;
scope['jobLoading'] = true;
Refresh({ scope: scope, set: 'jobs', iterator: 'job', url: scope['current_url'] });
}
scope.refreshJob = scope.refresh;
@@ -155,7 +157,7 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
JobsListCtrl.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobList',
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
'ProcessErrors','GetBasePath', 'LookUpInit', 'SubmitJob', 'FormatDate'
'ProcessErrors','GetBasePath', 'LookUpInit', 'SubmitJob', 'FormatDate', 'Refresh'
];

View File

@@ -13,7 +13,7 @@
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate, ProjectStatus,
FormatDate)
FormatDate, Refresh)
{
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
@@ -136,7 +136,9 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
}
scope.refresh = function() {
scope.search(list.iterator);
scope['projectSearchSpin'] = true;
scope['projectLoading'] = true;
Refresh({ scope: scope, set: 'projects', iterator: 'project', url: scope['current_url'] });
}
scope.SCMUpdate = function(project_id) {
@@ -158,7 +160,7 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'SelectionInit', 'ProjectUpdate', 'ProjectStatus', 'FormatDate' ];
'GetBasePath', 'SelectionInit', 'ProjectUpdate', 'ProjectStatus', 'FormatDate', 'Refresh' ];
function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm,