Kill strict mode in favor of doing it once

This commit is contained in:
Joe Fiorini
2015-01-28 17:14:27 -05:00
parent a70d6b80aa
commit f4350f4a28
116 changed files with 641 additions and 114 deletions

View File

@@ -17,7 +17,7 @@
* Controller functions for ading Admins to an Organization. * Controller functions for ading Admins to an Organization.
* *
*/ */
'use strict';
function AdminsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, AdminList, GenerateList, LoadBreadCrumbs, function AdminsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, AdminList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, GetBasePath, SelectionInit) { Prompt, SearchInit, PaginateInit, ReturnToCaller, GetBasePath, SelectionInit) {

View File

@@ -57,7 +57,7 @@
* @Usage * @Usage
* This is usage information. * This is usage information.
*/ */
'use strict';
function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $location, Authorization, ToggleClass, Alert, Wait, function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $location, Authorization, ToggleClass, Alert, Wait,
Timer, Empty, ClearScope) { Timer, Empty, ClearScope) {

View File

@@ -11,7 +11,7 @@
* @name controllers.function:Credentials * @name controllers.function:Credentials
* @description This controller's for the credentials page * @description This controller's for the credentials page
*/ */
'use strict';
function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList, function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,

View File

@@ -14,7 +14,7 @@
* @name controllers.function:Home * @name controllers.function:Home
* @description This controller's for the dashboard * @description This controller's for the dashboard
*/ */
'use strict';
/** /**
* @ngdoc method * @ngdoc method

View File

@@ -12,7 +12,7 @@
* @name controllers.function:Inventories * @name controllers.function:Inventories
* @description This controller's for the Inventory page * @description This controller's for the Inventory page
*/ */
'use strict';
function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $compile, $filter, Rest, Alert, InventoryList, GenerateList, function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $compile, $filter, Rest, Alert, InventoryList, GenerateList,
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream,

View File

@@ -9,7 +9,7 @@
* @name controllers.function:JobDetail * @name controllers.function:JobDetail
* @description This controller's for the Job Detail Page * @description This controller's for the Job Detail Page
*/ */
'use strict';
function JobDetailController ($location, $rootScope, $scope, $compile, $routeParams, $log, ClearScope, Breadcrumbs, LoadBreadCrumbs, GetBasePath, Wait, Rest, function JobDetailController ($location, $rootScope, $scope, $compile, $routeParams, $log, ClearScope, Breadcrumbs, LoadBreadCrumbs, GetBasePath, Wait, Rest,
ProcessErrors, SelectPlay, SelectTask, Socket, GetElapsed, DrawGraph, LoadHostSummary, ReloadHostSummaryList, JobIsFinished, SetTaskStyles, DigestEvent, ProcessErrors, SelectPlay, SelectTask, Socket, GetElapsed, DrawGraph, LoadHostSummary, ReloadHostSummaryList, JobIsFinished, SetTaskStyles, DigestEvent,

View File

@@ -12,7 +12,7 @@
* @name controllers.function:JobEvent * @name controllers.function:JobEvent
* @description This controller's for the job event page * @description This controller's for the job event page
*/ */
'use strict';
function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobEventList, GenerateList, function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobEventList, GenerateList,
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, LookUpInit, ToggleChildren, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, LookUpInit, ToggleChildren,

View File

@@ -12,7 +12,7 @@
* @name controllers.function:JobHosts * @name controllers.function:JobHosts
* @description This controller's for the job hosts page * @description This controller's for the job hosts page
*/ */
'use strict';
function JobHostSummaryList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobHostList, GenerateList, function JobHostSummaryList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobHostList, GenerateList,
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Refresh, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Refresh,

View File

@@ -9,7 +9,7 @@
* @name controllers.function:JobStdout * @name controllers.function:JobStdout
* @description This controller's for the standard out page that can be displayed when a job runs * @description This controller's for the standard out page that can be displayed when a job runs
*/ */
'use strict';
function JobStdoutController ($log, $rootScope, $scope, $compile, $routeParams, ClearScope, GetBasePath, Wait, Rest, ProcessErrors, Socket) { function JobStdoutController ($log, $rootScope, $scope, $compile, $routeParams, ClearScope, GetBasePath, Wait, Rest, ProcessErrors, Socket) {

View File

@@ -12,7 +12,7 @@
* @name controllers.function:JobTemplate * @name controllers.function:JobTemplate
* @description This controller's for the Job Template page * @description This controller's for the Job Template page
*/ */
'use strict';
function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobTemplateList, function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobTemplateList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,

View File

@@ -12,7 +12,7 @@
* @name controllers.function:Jobs * @name controllers.function:Jobs
* @description This controller's for the jobs page * @description This controller's for the jobs page
*/ */
'use strict';
function JobsListController ($rootScope, $log, $scope, $compile, $routeParams, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope, function JobsListController ($rootScope, $log, $scope, $compile, $routeParams, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope,
LoadJobsScope, RunningJobsList, CompletedJobsList, QueuedJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait, Socket) { LoadJobsScope, RunningJobsList, CompletedJobsList, QueuedJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait, Socket) {

View File

@@ -12,7 +12,7 @@
* @name controllers.function:Organizations * @name controllers.function:Organizations
* @description This controller's for the Organizations page * @description This controller's for the Organizations page
*/ */
'use strict';
function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt, function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt,
GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) { GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {

View File

@@ -12,7 +12,7 @@
* @name controllers.function:Permissions * @name controllers.function:Permissions
* @description This controller's for permissions * @description This controller's for permissions
*/ */
'use strict';
function PermissionsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList, function PermissionsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,

View File

@@ -14,7 +14,7 @@
* @name controllers.function:Portal * @name controllers.function:Portal
* @description This controller's for portal mode * @description This controller's for portal mode
*/ */
'use strict';
/** /**
* @ngdoc method * @ngdoc method

View File

@@ -12,7 +12,7 @@
* @name controllers.function:Projects * @name controllers.function:Projects
* @description This controller's for the projects page * @description This controller's for the projects page
*/ */
'use strict';
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList, GenerateList, LoadBreadCrumbs, function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate,

View File

@@ -12,7 +12,7 @@
* @name controllers.function:Schedules * @name controllers.function:Schedules
* @description This controller's for schedules * @description This controller's for schedules
*/ */
'use strict';
function ScheduleEditController($scope, $compile, $location, $routeParams, SchedulesList, Rest, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, function ScheduleEditController($scope, $compile, $location, $routeParams, SchedulesList, Rest, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, GetChoices, Stream) { GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, GetChoices, Stream) {

View File

@@ -11,7 +11,7 @@
* @description This controller's for controlling websockets * @description This controller's for controlling websockets
* discuss * discuss
*/ */
'use strict';
function SocketsController ($scope, $compile, ClearScope, Socket) { function SocketsController ($scope, $compile, ClearScope, Socket) {

View File

@@ -26,7 +26,7 @@
// * // *
// * The variables in local memory are cleaned out whenever the user navigates to a page (other than the Survey Maker page) // * The variables in local memory are cleaned out whenever the user navigates to a page (other than the Survey Maker page)
// */ // */
// 'use strict'; //
// function SurveyController($scope, $rootScope, $compile, $location, $log, $routeParams, SurveyMakerForm, // function SurveyController($scope, $rootScope, $compile, $location, $log, $routeParams, SurveyMakerForm,
// GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath, // GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,

View File

@@ -12,7 +12,7 @@
* @name controllers.function:Teams * @name controllers.function:Teams
* @description This controller's for teams * @description This controller's for teams
*/ */
'use strict';
function TeamsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, TeamList, GenerateList, LoadBreadCrumbs, function TeamsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, TeamList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait,

View File

@@ -11,7 +11,7 @@
* @name controllers.function:Users * @name controllers.function:Users
* @description This controller's the Users page * @description This controller's the Users page
*/ */
'use strict';
function UsersList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, UserList, GenerateList, LoadBreadCrumbs, function UsersList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, UserList, GenerateList, LoadBreadCrumbs,
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) { Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {

View File

@@ -12,7 +12,7 @@
* @name forms.function:JobTemplate * @name forms.function:JobTemplate
* @description This form is for adding/editing a Job Template * @description This form is for adding/editing a Job Template
*/ */
'use strict';
angular.module('JobTemplateFormDefinition', ['SchedulesListDefinition', 'CompletedJobsDefinition']) angular.module('JobTemplateFormDefinition', ['SchedulesListDefinition', 'CompletedJobsDefinition'])

View File

@@ -11,7 +11,7 @@
* @name forms.function:JobVarsPrompt * @name forms.function:JobVarsPrompt
* @description This form is for job variables prompt modal * @description This form is for job variables prompt modal
*/ */
'use strict';
angular.module('JobVarsPromptFormDefinition', []) angular.module('JobVarsPromptFormDefinition', [])

View File

@@ -10,7 +10,7 @@
* @name forms.function:LicenseForm * @name forms.function:LicenseForm
* @description This form is for viewing the license information * @description This form is for viewing the license information
*/ */
'use strict';
angular.module('LicenseFormDefinition', []) angular.module('LicenseFormDefinition', [])
.value('LicenseForm', { .value('LicenseForm', {

View File

@@ -18,7 +18,7 @@
* @name help.function:ChromeSocketHelp * @name help.function:ChromeSocketHelp
* @description This help modal gives instructions on what the user should do if not connected to the web sockets while using Chrome. * @description This help modal gives instructions on what the user should do if not connected to the web sockets while using Chrome.
*/ */
'use strict';
angular.module('ChromeSocketHelpDefinition', []) angular.module('ChromeSocketHelpDefinition', [])
.value('ChromeSocketHelp', { .value('ChromeSocketHelp', {

View File

@@ -11,7 +11,7 @@
* @name help.function:FirefoxSocketHelp * @name help.function:FirefoxSocketHelp
* @description This help modal gives instructions on what the user should do if not connected to the web sockets while using Firefox. * @description This help modal gives instructions on what the user should do if not connected to the web sockets while using Firefox.
*/ */
'use strict';
angular.module('FFSocketHelpDefinition', []) angular.module('FFSocketHelpDefinition', [])
.value('FFSocketHelp', { .value('FFSocketHelp', {

View File

@@ -12,7 +12,7 @@
* @name help.function:InventoryGroups * @name help.function:InventoryGroups
* @description This help modal walks the user how to add groups to an inventory or a subgroup to an existing group. * @description This help modal walks the user how to add groups to an inventory or a subgroup to an existing group.
*/ */
'use strict';
angular.module('InventoryGroupsHelpDefinition', []) angular.module('InventoryGroupsHelpDefinition', [])
.value('InventoryGroupsHelp', { .value('InventoryGroupsHelp', {

View File

@@ -11,7 +11,7 @@
* @name help.function:SafariSocketHelp * @name help.function:SafariSocketHelp
* @description This help modal gives instructions on what the user should do if not connected to the web sockets while using Safari. Safari does not support websockets. * @description This help modal gives instructions on what the user should do if not connected to the web sockets while using Safari. Safari does not support websockets.
*/ */
'use strict';
angular.module('SafariSocketHelpDefinition', []) angular.module('SafariSocketHelpDefinition', [])
.value('SafariSocketHelp', { .value('SafariSocketHelp', {

View File

@@ -16,7 +16,7 @@
* @name helpers.function:AboutAnsible * @name helpers.function:AboutAnsible
* @description This is the code for the About Ansible modal window that pops up with cowsay giving company/tower info and copyright information. * @description This is the code for the About Ansible modal window that pops up with cowsay giving company/tower info and copyright information.
*/ */
'use strict';
angular.module('AboutAnsibleHelpModal', ['RestServices', 'Utilities','ModalDialog']) angular.module('AboutAnsibleHelpModal', ['RestServices', 'Utilities','ModalDialog'])
.factory('AboutAnsibleHelp', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'CreateDialog', .factory('AboutAnsibleHelp', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'CreateDialog',

View File

@@ -12,7 +12,7 @@
* @description routines checking user access * @description routines checking user access
*/ */
'use strict';
angular.module('AccessHelper', ['RestServices', 'Utilities']) angular.module('AccessHelper', ['RestServices', 'Utilities'])

View File

@@ -11,7 +11,7 @@
* 'show' attribute of each job_event in the set of job_events. * 'show' attribute of each job_event in the set of job_events.
* See the filter in job_events.js list. * See the filter in job_events.js list.
*/ */
'use strict';
angular.module('ChildrenHelper', ['RestServices', 'Utilities']) angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
.factory('ToggleChildren', ['$location', 'Store', function ($location, Store) { .factory('ToggleChildren', ['$location', 'Store', function ($location, Store) {

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog', angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
'GeneratorHelpers']) 'GeneratorHelpers'])

View File

@@ -10,7 +10,7 @@
* @name helpers.function:Credentials * @name helpers.function:Credentials
* @description Functions shared amongst Credential related controllers * @description Functions shared amongst Credential related controllers
*/ */
'use strict';
angular.module('CredentialsHelper', ['Utilities']) angular.module('CredentialsHelper', ['Utilities'])

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('CreateCustomInventoryHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog', angular.module('CreateCustomInventoryHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
'GeneratorHelpers', 'CustomInventoryFormDefinition']) 'GeneratorHelpers', 'CustomInventoryFormDefinition'])

View File

@@ -9,7 +9,7 @@
* @name helpers.function:EventViewer * @name helpers.function:EventViewer
* @description eventviewerhelper * @description eventviewerhelper
*/ */
'use strict';
angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFormDefinition', 'HostsHelper']) angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFormDefinition', 'HostsHelper'])

View File

@@ -11,7 +11,7 @@
* @name helpers.function:Events * @name helpers.function:Events
* @description EventView - show the job_events form in a modal dialog * @description EventView - show the job_events form in a modal dialog
*/ */
'use strict';
angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventDataDefinition', 'JobEventsFormDefinition']) angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventDataDefinition', 'JobEventsFormDefinition'])

View File

@@ -6,7 +6,7 @@
* Routines that handle group add/edit/delete on the Inventory tree widget. * Routines that handle group add/edit/delete on the Inventory tree widget.
* *
*/ */
'use strict';
/** /**
* @ngdoc function * @ngdoc function

View File

@@ -11,7 +11,7 @@
* @name helpers.function:HostEventsViewer * @name helpers.function:HostEventsViewer
* @description view a list of events for a given job and host * @description view a list of events for a given job and host
*/ */
'use strict';
angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities', 'EventViewerHelper']) angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities', 'EventViewerHelper'])

View File

@@ -14,7 +14,7 @@
* @description Routines that handle host add/edit/delete on the Inventory detail page. * @description Routines that handle host add/edit/delete on the Inventory detail page.
*/ */
'use strict';
angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'HostListDefinition', angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'HostListDefinition',
'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'AuthService', 'HostsHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'AuthService', 'HostsHelper',

View File

@@ -37,7 +37,7 @@
*/ */
'use strict';
angular.module('JobDetailHelper', ['Utilities', 'RestServices', 'ModalDialog']) angular.module('JobDetailHelper', ['Utilities', 'RestServices', 'ModalDialog'])

View File

@@ -9,7 +9,7 @@
* @name helpers.function:JobSubmission * @name helpers.function:JobSubmission
* @description * @description
*/ */
'use strict';
angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'CredentialFormDefinition', 'CredentialsListDefinition', angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'CredentialFormDefinition', 'CredentialsListDefinition',
'LookUpHelper', 'JobSubmissionHelper', 'JobTemplateFormDefinition', 'ModalDialog', 'FormGenerator', 'JobVarsPromptFormDefinition']) 'LookUpHelper', 'JobSubmissionHelper', 'JobTemplateFormDefinition', 'ModalDialog', 'FormGenerator', 'JobVarsPromptFormDefinition'])

View File

@@ -11,7 +11,7 @@
* @name helpers.function:JobTemplatesHelper * @name helpers.function:JobTemplatesHelper
* @description Routines shared by job related controllers * @description Routines shared by job related controllers
*/ */
'use strict';
angular.module('JobTemplatesHelper', ['Utilities']) angular.module('JobTemplatesHelper', ['Utilities'])

View File

@@ -11,7 +11,7 @@
* @name helpers.function:Jobs * @name helpers.function:Jobs
* @description routines shared by job related controllers * @description routines shared by job related controllers
*/ */
'use strict';
angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'JobSummaryDefinition', 'InventoryHelper', 'GeneratorHelpers', angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'JobSummaryDefinition', 'InventoryHelper', 'GeneratorHelpers',
'JobSubmissionHelper', 'LogViewerHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator']) 'JobSubmissionHelper', 'LogViewerHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator'])

View File

@@ -17,7 +17,7 @@
* *
* *
*/ */
'use strict';
angular.module('LicenseHelper', ['RestServices', 'Utilities', 'LicenseUpdateFormDefinition', 'FormGenerator', 'ParseHelper', 'ModalDialog', 'VariablesHelper', 'LicenseFormDefinition', 'AccessHelper']) angular.module('LicenseHelper', ['RestServices', 'Utilities', 'LicenseUpdateFormDefinition', 'FormGenerator', 'ParseHelper', 'ModalDialog', 'VariablesHelper', 'LicenseFormDefinition', 'AccessHelper'])

View File

@@ -14,7 +14,7 @@
/*jshint evil:true */ /*jshint evil:true */
'use strict';
angular.module('LoadConfigHelper', ['Utilities']) angular.module('LoadConfigHelper', ['Utilities'])

View File

@@ -9,7 +9,7 @@
* @name helpers.function:LogViewer * @name helpers.function:LogViewer
* @description logviewer * @description logviewer
*/ */
'use strict';
angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator', 'VariablesHelper']) angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator', 'VariablesHelper'])

View File

@@ -22,7 +22,7 @@
* }) * })
*/ */
'use strict';
angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ApiLoader', 'ModalDialog']) angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ApiLoader', 'ModalDialog'])

View File

@@ -9,7 +9,7 @@
* @name helpers.function:PaginationHelpers * @name helpers.function:PaginationHelpers
* @description pagination * @description pagination
*/ */
'use strict';
angular.module('PaginationHelpers', ['Utilities', 'RefreshHelper', 'RefreshRelatedHelper']) angular.module('PaginationHelpers', ['Utilities', 'RefreshHelper', 'RefreshRelatedHelper'])

View File

@@ -12,7 +12,7 @@
* *
*/ */
'use strict';
angular.module('ParseHelper', ['Utilities', 'AngularCodeMirrorModule']) angular.module('ParseHelper', ['Utilities', 'AngularCodeMirrorModule'])
.factory('ParseTypeChange', ['Alert', 'AngularCodeMirror', function (Alert, AngularCodeMirror) { .factory('ParseTypeChange', ['Alert', 'AngularCodeMirror', function (Alert, AngularCodeMirror) {

View File

@@ -13,7 +13,7 @@
* *
*/ */
'use strict';
angular.module('ProjectsHelper', ['RestServices', 'Utilities', 'ProjectStatusDefinition', 'ProjectFormDefinition']) angular.module('ProjectsHelper', ['RestServices', 'Utilities', 'ProjectStatusDefinition', 'ProjectFormDefinition'])

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog', angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
'GeneratorHelpers']) 'GeneratorHelpers'])

View File

@@ -14,7 +14,7 @@
* }) * })
*/ */
'use strict';
angular.module('SelectionHelper', ['Utilities', 'RestServices']) angular.module('SelectionHelper', ['Utilities', 'RestServices'])

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('SocketHelper', ['Utilities', 'FFSocketHelpDefinition', 'SafariSocketHelpDefinition' , 'ChromeSocketHelpDefinition']) angular.module('SocketHelper', ['Utilities', 'FFSocketHelpDefinition', 'SafariSocketHelpDefinition' , 'ChromeSocketHelpDefinition'])

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog' , angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog' ,
'GeneratorHelpers']) 'GeneratorHelpers'])

View File

@@ -10,7 +10,7 @@
* *
*/ */
'use strict';
angular.module('UserHelper', ['UserFormDefinition']) angular.module('UserHelper', ['UserFormDefinition'])
.factory('ResetForm', ['UserForm', .factory('ResetForm', ['UserForm',

View File

@@ -10,7 +10,7 @@
* *
*/ */
'use strict';
angular.module('VariablesHelper', ['Utilities']) angular.module('VariablesHelper', ['Utilities'])

View File

@@ -10,7 +10,7 @@
* @name helpers.function:api-defaults * @name helpers.function:api-defaults
* @description this could use more discussion * @description this could use more discussion
*/ */
'use strict';
angular.module('APIDefaults', ['RestServices', 'Utilities']) angular.module('APIDefaults', ['RestServices', 'Utilities'])
.factory('GetAPIDefaults', ['Alert', 'Rest', '$rootScope', .factory('GetAPIDefaults', ['Alert', 'Rest', '$rootScope',

View File

@@ -10,7 +10,7 @@
* for the menu piece. The routine for building the menu is in InventoriesEdit controller * for the menu piece. The routine for building the menu is in InventoriesEdit controller
* (controllers/Inventories.js) * (controllers/Inventories.js)
*/ */
'use strict';
angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', 'ListGenerator', 'AuthService', angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', 'ListGenerator', 'AuthService',
'InventoryHelper', 'InventoryFormDefinition', 'ParseHelper', 'SearchHelper', 'VariablesHelper', 'InventoryHelper', 'InventoryFormDefinition', 'ParseHelper', 'SearchHelper', 'VariablesHelper',

View File

@@ -13,7 +13,7 @@
* discussion * discussion
*/ */
'use strict';
angular.module('md5Helper', ['RestServices', 'Utilities', 'angular-md5']) angular.module('md5Helper', ['RestServices', 'Utilities', 'angular-md5'])
.factory('md5Setup', ['md5', function (md5) { .factory('md5Setup', ['md5', function (md5) {

View File

@@ -19,7 +19,7 @@
* *
*/ */
'use strict';
angular.module('RefreshRelatedHelper', ['RestServices', 'Utilities', 'PaginationHelpers']) angular.module('RefreshRelatedHelper', ['RestServices', 'Utilities', 'PaginationHelpers'])
.factory('RefreshRelated', ['ProcessErrors', 'Rest', 'Wait', 'PageRangeSetup', .factory('RefreshRelated', ['ProcessErrors', 'Rest', 'Wait', 'PageRangeSetup',

View File

@@ -18,7 +18,7 @@
* *
*/ */
'use strict';
angular.module('RefreshHelper', ['RestServices', 'Utilities', 'PaginationHelpers']) angular.module('RefreshHelper', ['RestServices', 'Utilities', 'PaginationHelpers'])
.factory('Refresh', ['ProcessErrors', 'Rest', 'Wait', 'Empty', 'PageRangeSetup', .factory('Refresh', ['ProcessErrors', 'Rest', 'Wait', 'Empty', 'PageRangeSetup',

View File

@@ -19,7 +19,7 @@
* *
*/ */
'use strict';
angular.module('RelatedSearchHelper', ['RestServices', 'Utilities', 'RefreshRelatedHelper']) angular.module('RelatedSearchHelper', ['RestServices', 'Utilities', 'RefreshRelatedHelper'])
.factory('RelatedSearchInit', ['$timeout', 'Alert', 'Rest', 'RefreshRelated', 'Wait', 'Empty', .factory('RelatedSearchInit', ['$timeout', 'Alert', 'Rest', 'RefreshRelated', 'Wait', 'Empty',

View File

@@ -19,7 +19,7 @@
* *
*/ */
'use strict';
angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper']) angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])

View File

@@ -9,7 +9,7 @@
* Routines shared amongst the team controllers * Routines shared amongst the team controllers
*/ */
'use strict';
angular.module('TeamHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', 'SearchHelper', angular.module('TeamHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', 'SearchHelper',
'PaginationHelpers', 'ListGenerator' 'PaginationHelpers', 'ListGenerator'

View File

@@ -7,7 +7,7 @@
* @dict * @dict
*/ */
'use strict';
angular.module('AdminListDefinition', []) angular.module('AdminListDefinition', [])
.value('AdminList', { .value('AdminList', {

View File

@@ -7,7 +7,7 @@
* @dict * @dict
*/ */
'use strict';
angular.module('CloudCredentialsListDefinition', []) angular.module('CloudCredentialsListDefinition', [])
.value('CloudCredentialList', { .value('CloudCredentialList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('CompletedJobsDefinition', []) angular.module('CompletedJobsDefinition', [])
.value( 'CompletedJobsList', { .value( 'CompletedJobsList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('ConfigureTowerJobsListDefinition', []) angular.module('ConfigureTowerJobsListDefinition', [])
.value('ConfigureTowerJobsList', { .value('ConfigureTowerJobsList', {

View File

@@ -7,7 +7,7 @@
* @dict * @dict
*/ */
'use strict';
angular.module('CredentialsListDefinition', []) angular.module('CredentialsListDefinition', [])
.value('CredentialList', { .value('CredentialList', {

View File

@@ -7,7 +7,7 @@
* @dict * @dict
*/ */
'use strict';
angular.module('CustomInventoryListDefinition', []) angular.module('CustomInventoryListDefinition', [])
.value('CustomInventoryList', { .value('CustomInventoryList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('GroupListDefinition', []) angular.module('GroupListDefinition', [])
.value('GroupList', { .value('GroupList', {

View File

@@ -8,7 +8,7 @@
* *
*/ */
'use strict';
angular.module('HomeGroupListDefinition', []) angular.module('HomeGroupListDefinition', [])
.value('HomeGroupList', { .value('HomeGroupList', {

View File

@@ -8,7 +8,7 @@
* *
*/ */
'use strict';
angular.module('HomeHostListDefinition', []) angular.module('HomeHostListDefinition', [])
.value('HomeHostList', { .value('HomeHostList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('HostListDefinition', []) angular.module('HostListDefinition', [])
.value('HostList', { .value('HostList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('InventoriesListDefinition', []) angular.module('InventoriesListDefinition', [])
.value('InventoryList', { .value('InventoryList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('InventoryHostsDefinition', []) angular.module('InventoryHostsDefinition', [])
.value('InventoryHosts', { .value('InventoryHosts', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('JobEventsListDefinition', []) angular.module('JobEventsListDefinition', [])
.value('JobEventList', { .value('JobEventList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('JobHostDefinition', []) angular.module('JobHostDefinition', [])
.value('JobHostList', { .value('JobHostList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('JobTemplatesListDefinition', []) angular.module('JobTemplatesListDefinition', [])
.value('JobTemplateList', { .value('JobTemplateList', {

View File

@@ -9,7 +9,7 @@
* *
*/ */
'use strict';
angular.module('JobsListDefinition', []) angular.module('JobsListDefinition', [])
.value( 'JobsList', { .value( 'JobsList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('OrganizationListDefinition', []) angular.module('OrganizationListDefinition', [])
.value('OrganizationList', { .value('OrganizationList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('PermissionListDefinition', []) angular.module('PermissionListDefinition', [])
.value('PermissionList', { .value('PermissionList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('PortalJobTemplatesListDefinition', []) angular.module('PortalJobTemplatesListDefinition', [])
.value('PortalJobTemplateList', { .value('PortalJobTemplateList', {

View File

@@ -9,7 +9,7 @@
* *
*/ */
'use strict';
angular.module('PortalJobsListDefinition', []) angular.module('PortalJobsListDefinition', [])
.value( 'PortalJobsList', { .value( 'PortalJobsList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('ProjectsListDefinition', []) angular.module('ProjectsListDefinition', [])
.value('ProjectList', { .value('ProjectList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('QueuedJobsDefinition', []) angular.module('QueuedJobsDefinition', [])
.value( 'QueuedJobsList', { .value( 'QueuedJobsList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('RunningJobsDefinition', []) angular.module('RunningJobsDefinition', [])
.value( 'RunningJobsList', { .value( 'RunningJobsList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('ScheduledJobsDefinition', []) angular.module('ScheduledJobsDefinition', [])
.value( 'ScheduledJobsList', { .value( 'ScheduledJobsList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('SchedulesListDefinition', []) angular.module('SchedulesListDefinition', [])
.value('SchedulesList', { .value('SchedulesList', {

View File

@@ -7,7 +7,7 @@
* *
*/ */
'use strict';
angular.module('StreamListDefinition', []) angular.module('StreamListDefinition', [])
.value('StreamList', { .value('StreamList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('TeamsListDefinition', []) angular.module('TeamsListDefinition', [])
.value('TeamList', { .value('TeamList', {

View File

@@ -6,7 +6,7 @@
* *
*/ */
'use strict';
angular.module('UserListDefinition', []) angular.module('UserListDefinition', [])
.value('UserList', { .value('UserList', {

View File

@@ -13,7 +13,7 @@
* *
*/ */
'use strict';
angular.module('DashboardCountsWidget', ['RestServices', 'Utilities']) angular.module('DashboardCountsWidget', ['RestServices', 'Utilities'])
.factory('DashboardCounts', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', .factory('DashboardCounts', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',

View File

@@ -8,7 +8,7 @@
* *
*/ */
'use strict';
angular.module('DashboardJobsWidget', ['RestServices', 'Utilities']) angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
.factory('DashboardJobs', ['$rootScope', '$compile', 'LoadSchedulesScope', 'LoadJobsScope', 'JobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', .factory('DashboardJobs', ['$rootScope', '$compile', 'LoadSchedulesScope', 'LoadJobsScope', 'JobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath',

View File

@@ -0,0 +1,180 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/**
* @ngdoc function
* @name widgets.function:HostGraph
* @description
*
*/
angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
.factory('HostGraph', ['$rootScope', '$compile', '$location', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
function ($rootScope, $compile, $location, Rest, GetBasePath, ProcessErrors) {
return function (params) {
var scope = params.scope,
target = params.target,
html, element, url, license, license_graph;
// html = "<div class=\"graph-container\">\n";
html ="<div class=\"row\">\n";
html += "<div class=\"h6 col-xs-8 text-center\"><b>Host Count</b></div>\n";
html += "</div>\n";
html +="<div class=\"row\">\n";
html += "<div class=\"host-count-graph\"><svg></svg></div>\n";
// html += "</div>\n";
element = angular.element(document.getElementById(target));
element.html(html);
$compile(element)(scope);
url = GetBasePath('config');
if (scope.removeResizeHostGraph) {
scope.removeResizeHostGraph();
}
scope.removeResizeHostGraph= scope.$on('ResizeHostGraph', function () {
if($(window).width()<500){
$('.graph-container').height(300);
}
else{
var winHeight = $(window).height(),
available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 120;
$('.graph-container').height(available_height/2);
license_graph.update();
}
});
Rest.setUrl(url);
Rest.get()
.success(function (data){
license = data.license_info.instance_count;
scope.$emit('licenseCountReady', license);
})
.error(function (data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get: ' + url + ' GET returned: ' + status });
});
if (scope.removeLicenseCountReady) {
scope.removeLicenseCountReady();
}
scope.removeLicenseCountReady = scope.$on('licenseCountReady', function (e, license) {
url = GetBasePath('dashboard')+'graphs/inventory/';
Rest.setUrl(url);
Rest.get()
.success(function (data) {
scope.$emit('hostDataReady', data, license);
})
.error(function (data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get: ' + url + ' GET returned: ' + status });
});
});
if (scope.removeHostDataReady) {
scope.removeHostDataReady();
}
scope.removeHostDataReady = scope.$on('hostDataReady', function (e, data, license) {
//url = GetBasePath('dashboard')+'graphs/';
var graphData = [
{
"key" : "Hosts" ,
"color" : "#1778c3",
"values": data.hosts
},
{
"key" : "License" ,
"color" : "#171717",
"values": data.hosts
}
];
graphData.map(function(series) {
if(series.key==="Hosts"){
series.values = series.values.map(function(d) {
return {
x: d[0],
y: d[1]
};
});
}
if(series.key==="License"){
series.values = series.values.map(function(d) {
return {
x: d[0],
y: license
};
});
}
return series;
});
nv.addGraph({
generate: function() {
var width = $('.graph-container').width(), // nv.utils.windowSize().width/3,
height = $('.graph-container').height()*0.6; //nv.utils.windowSize().height/5,
license_graph = nv.models.lineChart()
.margin({top: 15, right: 75, bottom: 40, left: 85})
.x(function(d,i) { return i ;})
.useInteractiveGuideline(true) //We want nice looking tooltips and a guideline!
.transitionDuration(350) //how fast do you want the lines to transition?
.showLegend(true) //Show the legend, allowing users to turn on/off line series.
.showYAxis(true) //Show the y-axis
.showXAxis(true) //Show the x-axis
;
license_graph.xAxis
.axisLabel("Time")
.tickFormat(function(d) {
var dx = graphData[0].values[d] && graphData[0].values[d].x || 0;
return dx ? d3.time.format('%m/%d')(new Date(Number(dx+'000'))) : '';
});
license_graph.yAxis //Chart y-axis settings
.axisLabel('Hosts')
.tickFormat(d3.format('.f'));
d3.select('.host-count-graph svg')
.datum(graphData).transition()
.attr('width', width)
.attr('height', height)
.duration(500)
.call(license_graph)
.style({
// 'width': width,
// 'height': height,
"font-family": 'Open Sans',
"font-style": "normal",
"font-weight":400,
"src": "url(/static/fonts/OpenSans-Regular.ttf)"
});
// nv.utils.windowResize(license_graph.update);
scope.$emit('WidgetLoaded');
return license_graph;
},
});
//});
});
};
}
]);

View File

@@ -0,0 +1,128 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/**
* @ngdoc function
* @name widgets.function:HostPieChart
* @description
* HostPieChart.js
*
* file for the host status pie chart
*
*/
angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
.factory('HostPieChart', ['$rootScope', '$compile',
//'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
function ($rootScope, $compile){
//, Rest, GetBasePath, ProcessErrors) {
return function (params) {
var scope = params.scope,
target = params.target,
dashboard = params.dashboard,
html, element, data,
canvas, context, winHeight, available_height, host_pie_chart;
// html = "<div class=\"graph-container\">\n";
html ="<div class=\"row\">\n";
html += "<div id=\"job-status-title\" class=\"h6 col-xs-8 text-center\"><b>Host Status</b></div>\n";
html += "</div>\n";
html +="<div class=\"row\">\n";
html += "<div class=\"host-pie-chart text-center\"><svg></svg></div>\n";
html += "</div>\n";
// html += "</div>\n";
element = angular.element(document.getElementById(target));
element.html(html);
$compile(element)(scope);
if (scope.removeResizeHostPieGraph) {
scope.removeResizeHostPieGraph();
}
scope.removeResizeHostPieGraph= scope.$on('ResizeHostPieGraph', function () {
if($(window).width()<500){
$('.graph-container').height(300);
}
else{
var winHeight = $(window).height(),
available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 120;
$('.graph-container').height(available_height/2);
if(host_pie_chart){
host_pie_chart.update();
}
}
});
if(dashboard.hosts.total+dashboard.hosts.failed>0){
data = [
{
"label": "Successful",
"color": "#00aa00",
"value" : dashboard.hosts.total
} ,
{
"label": "Failed",
"color" : "#aa0000",
"value" : dashboard.hosts.failed
}
];
nv.addGraph(function() {
var width = $('.graph-container').width(), // nv.utils.windowSize().width/3,
height = $('.graph-container').height()*0.7; //nv.utils.windowSize().height/5,
host_pie_chart = nv.models.pieChart()
.margin({top: 5, right: 75, bottom: 40, left: 85})
.x(function(d) { return d.label; })
.y(function(d) { return d.value; })
.showLabels(true)
.labelThreshold(0.01)
.tooltipContent(function(x, y) {
return '<b>'+x+'</b>'+ '<p>' + Math.floor(y.replace(',','')) + ' Hosts ' + '</p>';
})
.color(['#00aa00', '#aa0000']);
host_pie_chart.pie.pieLabelsOutside(true).labelType("percent");
d3.select(".host-pie-chart svg")
.datum(data)
.attr('width', width)
.attr('height', height)
.transition().duration(350)
.call(host_pie_chart)
.style({
"font-family": 'Open Sans',
"font-style": "normal",
"font-weight":400,
"src": "url(/static/fonts/OpenSans-Regular.ttf)"
});
// nv.utils.windowResize(host_pie_chart.update);
scope.$emit('WidgetLoaded');
return host_pie_chart;
});
}
else{
winHeight = $(window).height();
available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 120;
$('.graph-container:eq(1)').height(available_height/2);
$('.host-pie-chart svg').replaceWith('<canvas id="circlecanvas" width="120" height="120"></canvas>');
canvas = document.getElementById("circlecanvas");
context = canvas.getContext("2d");
context.arc(55, 55, 50, 0, Math.PI * 2, false);
context.lineWidth = 1;
context.strokeStyle = '#1778c3';
context.stroke();
context.font = "12px Open Sans";
context.fillText("No Host data",18,55);
scope.$emit('WidgetLoaded');
}
};
}
]);

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities']) angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities'])
.factory('InventorySyncStatus', ['$rootScope', '$compile', function ($rootScope, $compile) { .factory('InventorySyncStatus', ['$rootScope', '$compile', function ($rootScope, $compile) {

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('JobStatusWidget', ['RestServices', 'Utilities']) angular.module('JobStatusWidget', ['RestServices', 'Utilities'])
.factory('JobStatus', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', .factory('JobStatus', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',

View File

@@ -0,0 +1,219 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/**
* @ngdoc function
* @name widgets.function:JobStatusGraph
* @description
*/
angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
.factory('JobStatusGraph', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
function ($rootScope, $compile , $location, Rest, GetBasePath, ProcessErrors) {
return function (params) {
var scope = params.scope,
target = params.target,
// dashboard = params.dashboard,
html, element, url, job_status_chart,
period="month",
job_type="all";
// html = "<div class=\"graph-container\">\n";
html = "<div class=\"row\">\n";
html += "<div id=\"job-status-title\" class=\"h6 col-xs-2 col-sm-3 col-lg-4 text-center\"><b>Job Status</b></div>\n"; // for All Jobs, Past Month
html += "<div class=\"h6 col-xs-5 col-sm-5 col-lg-4\">\n";
html += "<div class=\"dropdown\">\n";
html += "Job Type: <a id=\"type-dropdown\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\" href=\"/page.html\">\n";
html += "All<span class=\"caret\"></span>\n";
html += " </a>\n";
html += "<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"type-dropdown\">\n";
html += "<li><a class=\"m\" id=\"all\">All</a></li>\n";
html += "<li><a class=\"m\" id=\"inv_sync\">Inventory Sync</a></li>\n";
html += "<li><a class=\"m\" id=\"scm_update\">SCM Update</a></li>\n";
html += "<li><a class=\"m\" id=\"playbook_run\">Playbook Run</a></li>\n";
html += "</ul>\n";
html += "</div>\n";
html += "</div>\n"; //end of filter div
html += "<div class=\"h6 col-xs-5 col-sm-4 col-lg-4\">\n";
html += "<div class=\"dropdown\">\n";
html += "Period: <a id=\"period-dropdown\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\" href=\"/page.html\">\n";
html += "Past Month<span class=\"caret\"></span>\n";
html += " </a>\n";
html += "<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"period-dropdown\">\n";
html += "<li><a class=\"n\" id=\"day\" >Past 24 Hours </a></li>\n";
html += "<li><a class=\"n\" id=\"week\">Past Week</a></li>\n";
html += "<li><a class=\"n\" id=\"month\">Past Month</a></li>\n";
html += "</ul>\n";
html += "</div>\n";
html += "</div>\n"; //end of filter div
html += "</div>\n"; // end of row
html +="<div class=\"row\">\n";
html += "<div class=\"job-status-graph\"><svg></svg></div>\n";
html += "</div>\n";
// html += "</div>\n";
function createGraph(){
url = GetBasePath('dashboard')+'graphs/jobs/?period='+period+'&job_type='+job_type;
Rest.setUrl(url);
Rest.get()
.success(function (data){
scope.$emit('graphDataReady', data);
return job_type, period;
})
.error(function (data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get: ' + url + ' GET returned: ' + status });
});
}
if ($rootScope.removeReloadJobStatusGraph) {
$rootScope.removeReloadJobStatusGraph();
}
$rootScope.removeReloadJobStatusGraph = $rootScope.$on('ReloadJobStatusGraph', function() {
createGraph();
});
element = angular.element(document.getElementById(target));
element.html(html);
$compile(element)(scope);
createGraph();
if (scope.removeResizeJobGraph) {
scope.removeResizeJobGraph();
}
scope.removeResizeJobGraph= scope.$on('ResizeJobGraph', function () {
if($(window).width()<500){
$('.graph-container').height(300);
}
else{
var winHeight = $(window).height(),
available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 120;
$('.graph-container').height(available_height/2);
job_status_chart.update();
}
});
if (scope.removeGraphDataReady) {
scope.removeGraphDataReady();
}
scope.removeGraphDataReady = scope.$on('graphDataReady', function (e, data) {
var timeFormat, graphData = [
{
"color": "#00aa00",
"key": "Successful",
"values": data.jobs.successful
},
{
"key" : "Failed" ,
"color" : "#aa0000",
"values": data.jobs.failed
}
];
if(period==="day"){
timeFormat="%H:%M";
}
else {
timeFormat = '%m/%d';
}
graphData.map(function(series) {
series.values = series.values.map(function(d) {
return {
x: d[0],
y: d[1]
};
});
return series;
});
nv.addGraph({
generate: function() {
var width = $('.graph-container').width(), // nv.utils.windowSize().width/3,
height = $('.graph-container').height()*0.7; //nv.utils.windowSize().height/5,
job_status_chart = nv.models.lineChart()
.margin({top: 5, right: 75, bottom: 80, left: 85}) //Adjust chart margins to give the x-axis some breathing room.
.x(function(d,i) { return i; })
.useInteractiveGuideline(true) //We want nice looking tooltips and a guideline!
.transitionDuration(350) //how fast do you want the lines to transition?
.showLegend(true) //Show the legend, allowing users to turn on/off line series.
.showYAxis(true) //Show the y-axis
.showXAxis(true) //Show the x-axis
// .width(width)
// .height(height)
;
job_status_chart.xAxis
.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'))) : '';
});
job_status_chart.yAxis //Chart y-axis settings
.axisLabel('Jobs')
.tickFormat(d3.format('.f'));
d3.select('.job-status-graph svg')
.datum(graphData).transition()
.attr('width', width)
.attr('height', height)
.duration(1000)
.call(job_status_chart)
.style({
// 'width': width,
// 'height': height,
"font-family": 'Open Sans',
"font-style": "normal",
"font-weight":400,
"src": "url(/static/fonts/OpenSans-Regular.ttf)"
});
// when the Period drop down filter is used, create a new graph based on the
d3.selectAll(".n")
.on("click", function() {
period = this.getAttribute("id");
$('#period-dropdown').replaceWith("<a id=\"period-dropdown\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\" href=\"/page.html\">"+this.text+"<span class=\"caret\"><span>\n");
createGraph();
});
//On click, update with new data
d3.selectAll(".m")
.on("click", function() {
job_type = this.getAttribute("id");
$('#type-dropdown').replaceWith("<a id=\"type-dropdown\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\" href=\"/page.html\">"+this.text+"<span class=\"caret\"><span>\n");
createGraph();
});
scope.$emit('WidgetLoaded');
return job_status_chart;
},
});
});
};
}
]);

View File

@@ -11,7 +11,7 @@
* *
*/ */
'use strict';
angular.module('ObjectCountWidget', ['RestServices', 'Utilities']) angular.module('ObjectCountWidget', ['RestServices', 'Utilities'])
.factory('ObjectCount', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', .factory('ObjectCount', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',

View File

@@ -8,7 +8,7 @@
* *
*/ */
'use strict';
angular.module('PortalJobsWidget', ['RestServices', 'Utilities']) angular.module('PortalJobsWidget', ['RestServices', 'Utilities'])
.factory('PortalJobsWidget', ['$rootScope', '$compile', 'LoadSchedulesScope', 'LoadJobsScope', 'PortalJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'PortalJobTemplateList' , .factory('PortalJobsWidget', ['$rootScope', '$compile', 'LoadSchedulesScope', 'LoadJobsScope', 'PortalJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'PortalJobTemplateList' ,

Some files were not shown because too many files have changed in this diff Show More