mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Kill strict mode in favor of doing it once
This commit is contained in:
parent
a70d6b80aa
commit
f4350f4a28
@ -17,7 +17,7 @@
|
||||
* Controller functions for ading Admins to an Organization.
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function AdminsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, AdminList, GenerateList, LoadBreadCrumbs,
|
||||
Prompt, SearchInit, PaginateInit, ReturnToCaller, GetBasePath, SelectionInit) {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
* @Usage
|
||||
* This is usage information.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function Authenticate($log, $cookieStore, $compile, $window, $rootScope, $location, Authorization, ToggleClass, Alert, Wait,
|
||||
Timer, Empty, ClearScope) {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @name controllers.function:Credentials
|
||||
* @description This controller's for the credentials page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList,
|
||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
* @name controllers.function:Home
|
||||
* @description This controller's for the dashboard
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:Inventories
|
||||
* @description This controller's for the Inventory page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $compile, $filter, Rest, Alert, InventoryList, GenerateList,
|
||||
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream,
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* @name controllers.function:JobDetail
|
||||
* @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,
|
||||
ProcessErrors, SelectPlay, SelectTask, Socket, GetElapsed, DrawGraph, LoadHostSummary, ReloadHostSummaryList, JobIsFinished, SetTaskStyles, DigestEvent,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:JobEvent
|
||||
* @description This controller's for the job event page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function JobEventsList($sce, $filter, $scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobEventList, GenerateList,
|
||||
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, LookUpInit, ToggleChildren,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:JobHosts
|
||||
* @description This controller's for the job hosts page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function JobHostSummaryList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobHostList, GenerateList,
|
||||
LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Refresh,
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* @name controllers.function:JobStdout
|
||||
* @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) {
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:JobTemplate
|
||||
* @description This controller's for the Job Template page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobTemplateList,
|
||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:Jobs
|
||||
* @description This controller's for the jobs page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function JobsListController ($rootScope, $log, $scope, $compile, $routeParams, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope,
|
||||
LoadJobsScope, RunningJobsList, CompletedJobsList, QueuedJobsList, ScheduledJobsList, GetChoices, GetBasePath, Wait, Socket) {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:Organizations
|
||||
* @description This controller's for the Organizations page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt,
|
||||
GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:Permissions
|
||||
* @description This controller's for permissions
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function PermissionsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList,
|
||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
* @name controllers.function:Portal
|
||||
* @description This controller's for portal mode
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:Projects
|
||||
* @description This controller's for the projects page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList, GenerateList, LoadBreadCrumbs,
|
||||
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:Schedules
|
||||
* @description This controller's for schedules
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function ScheduleEditController($scope, $compile, $location, $routeParams, SchedulesList, Rest, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
||||
GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, GetChoices, Stream) {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @description This controller's for controlling websockets
|
||||
* discuss
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function SocketsController ($scope, $compile, ClearScope, Socket) {
|
||||
|
||||
|
||||
@ -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)
|
||||
// */
|
||||
// 'use strict';
|
||||
//
|
||||
|
||||
// function SurveyController($scope, $rootScope, $compile, $location, $log, $routeParams, SurveyMakerForm,
|
||||
// GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name controllers.function:Teams
|
||||
* @description This controller's for teams
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function TeamsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, TeamList, GenerateList, LoadBreadCrumbs,
|
||||
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, SetTeamListeners, GetBasePath, SelectionInit, Wait,
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @name controllers.function:Users
|
||||
* @description This controller's the Users page
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
function UsersList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, UserList, GenerateList, LoadBreadCrumbs,
|
||||
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @name forms.function:JobTemplate
|
||||
* @description This form is for adding/editing a Job Template
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobTemplateFormDefinition', ['SchedulesListDefinition', 'CompletedJobsDefinition'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @name forms.function:JobVarsPrompt
|
||||
* @description This form is for job variables prompt modal
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobVarsPromptFormDefinition', [])
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
* @name forms.function:LicenseForm
|
||||
* @description This form is for viewing the license information
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('LicenseFormDefinition', [])
|
||||
.value('LicenseForm', {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
* @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.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ChromeSocketHelpDefinition', [])
|
||||
.value('ChromeSocketHelp', {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @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.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('FFSocketHelpDefinition', [])
|
||||
.value('FFSocketHelp', {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @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.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('InventoryGroupsHelpDefinition', [])
|
||||
.value('InventoryGroupsHelp', {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @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.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('SafariSocketHelpDefinition', [])
|
||||
.value('SafariSocketHelp', {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* @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.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('AboutAnsibleHelpModal', ['RestServices', 'Utilities','ModalDialog'])
|
||||
.factory('AboutAnsibleHelp', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'CreateDialog',
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* @description routines checking user access
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('AccessHelper', ['RestServices', 'Utilities'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* 'show' attribute of each job_event in the set of job_events.
|
||||
* See the filter in job_events.js list.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
|
||||
.factory('ToggleChildren', ['$location', 'Store', function ($location, Store) {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
||||
'GeneratorHelpers'])
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
* @name helpers.function:Credentials
|
||||
* @description Functions shared amongst Credential related controllers
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('CredentialsHelper', ['Utilities'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('CreateCustomInventoryHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
||||
'GeneratorHelpers', 'CustomInventoryFormDefinition'])
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* @name helpers.function:EventViewer
|
||||
* @description eventviewerhelper
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFormDefinition', 'HostsHelper'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @name helpers.function:Events
|
||||
* @description EventView - show the job_events form in a modal dialog
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventDataDefinition', 'JobEventsFormDefinition'])
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Routines that handle group add/edit/delete on the Inventory tree widget.
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @name helpers.function:HostEventsViewer
|
||||
* @description view a list of events for a given job and host
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('HostEventsViewerHelper', ['ModalDialog', 'Utilities', 'EventViewerHelper'])
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
* @description Routines that handle host add/edit/delete on the Inventory detail page.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'HostListDefinition',
|
||||
'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'AuthService', 'HostsHelper',
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobDetailHelper', ['Utilities', 'RestServices', 'ModalDialog'])
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* @name helpers.function:JobSubmission
|
||||
* @description
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'CredentialFormDefinition', 'CredentialsListDefinition',
|
||||
'LookUpHelper', 'JobSubmissionHelper', 'JobTemplateFormDefinition', 'ModalDialog', 'FormGenerator', 'JobVarsPromptFormDefinition'])
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @name helpers.function:JobTemplatesHelper
|
||||
* @description Routines shared by job related controllers
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobTemplatesHelper', ['Utilities'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @name helpers.function:Jobs
|
||||
* @description routines shared by job related controllers
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'JobSummaryDefinition', 'InventoryHelper', 'GeneratorHelpers',
|
||||
'JobSubmissionHelper', 'LogViewerHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator'])
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('LicenseHelper', ['RestServices', 'Utilities', 'LicenseUpdateFormDefinition', 'FormGenerator', 'ParseHelper', 'ModalDialog', 'VariablesHelper', 'LicenseFormDefinition', 'AccessHelper'])
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
/*jshint evil:true */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('LoadConfigHelper', ['Utilities'])
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* @name helpers.function:LogViewer
|
||||
* @description logviewer
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('LogViewerHelper', ['ModalDialog', 'Utilities', 'FormGenerator', 'VariablesHelper'])
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* })
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ApiLoader', 'ModalDialog'])
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* @name helpers.function:PaginationHelpers
|
||||
* @description pagination
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('PaginationHelpers', ['Utilities', 'RefreshHelper', 'RefreshRelatedHelper'])
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ParseHelper', ['Utilities', 'AngularCodeMirrorModule'])
|
||||
.factory('ParseTypeChange', ['Alert', 'AngularCodeMirror', function (Alert, AngularCodeMirror) {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ProjectsHelper', ['RestServices', 'Utilities', 'ProjectStatusDefinition', 'ProjectFormDefinition'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
||||
'GeneratorHelpers'])
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
* })
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('SelectionHelper', ['Utilities', 'RestServices'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('SocketHelper', ['Utilities', 'FFSocketHelpDefinition', 'SafariSocketHelpDefinition' , 'ChromeSocketHelpDefinition'])
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog' ,
|
||||
'GeneratorHelpers'])
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('UserHelper', ['UserFormDefinition'])
|
||||
.factory('ResetForm', ['UserForm',
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('VariablesHelper', ['Utilities'])
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
* @name helpers.function:api-defaults
|
||||
* @description this could use more discussion
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('APIDefaults', ['RestServices', 'Utilities'])
|
||||
.factory('GetAPIDefaults', ['Alert', 'Rest', '$rootScope',
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
* for the menu piece. The routine for building the menu is in InventoriesEdit controller
|
||||
* (controllers/Inventories.js)
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', 'ListGenerator', 'AuthService',
|
||||
'InventoryHelper', 'InventoryFormDefinition', 'ParseHelper', 'SearchHelper', 'VariablesHelper',
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
* discussion
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('md5Helper', ['RestServices', 'Utilities', 'angular-md5'])
|
||||
.factory('md5Setup', ['md5', function (md5) {
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('RefreshRelatedHelper', ['RestServices', 'Utilities', 'PaginationHelpers'])
|
||||
.factory('RefreshRelated', ['ProcessErrors', 'Rest', 'Wait', 'PageRangeSetup',
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('RefreshHelper', ['RestServices', 'Utilities', 'PaginationHelpers'])
|
||||
.factory('Refresh', ['ProcessErrors', 'Rest', 'Wait', 'Empty', 'PageRangeSetup',
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('RelatedSearchHelper', ['RestServices', 'Utilities', 'RefreshRelatedHelper'])
|
||||
.factory('RelatedSearchInit', ['$timeout', 'Alert', 'Rest', 'RefreshRelated', 'Wait', 'Empty',
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* Routines shared amongst the team controllers
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('TeamHelper', ['RestServices', 'Utilities', 'OrganizationListDefinition', 'SearchHelper',
|
||||
'PaginationHelpers', 'ListGenerator'
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* @dict
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('AdminListDefinition', [])
|
||||
.value('AdminList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* @dict
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('CloudCredentialsListDefinition', [])
|
||||
.value('CloudCredentialList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('CompletedJobsDefinition', [])
|
||||
.value( 'CompletedJobsList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ConfigureTowerJobsListDefinition', [])
|
||||
.value('ConfigureTowerJobsList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* @dict
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('CredentialsListDefinition', [])
|
||||
.value('CredentialList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* @dict
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('CustomInventoryListDefinition', [])
|
||||
.value('CustomInventoryList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('GroupListDefinition', [])
|
||||
.value('GroupList', {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('HomeGroupListDefinition', [])
|
||||
.value('HomeGroupList', {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('HomeHostListDefinition', [])
|
||||
.value('HomeHostList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('HostListDefinition', [])
|
||||
.value('HostList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('InventoriesListDefinition', [])
|
||||
.value('InventoryList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('InventoryHostsDefinition', [])
|
||||
.value('InventoryHosts', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobEventsListDefinition', [])
|
||||
.value('JobEventList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobHostDefinition', [])
|
||||
.value('JobHostList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobTemplatesListDefinition', [])
|
||||
.value('JobTemplateList', {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobsListDefinition', [])
|
||||
.value( 'JobsList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('OrganizationListDefinition', [])
|
||||
.value('OrganizationList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('PermissionListDefinition', [])
|
||||
.value('PermissionList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('PortalJobTemplatesListDefinition', [])
|
||||
.value('PortalJobTemplateList', {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('PortalJobsListDefinition', [])
|
||||
.value( 'PortalJobsList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ProjectsListDefinition', [])
|
||||
.value('ProjectList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('QueuedJobsDefinition', [])
|
||||
.value( 'QueuedJobsList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('RunningJobsDefinition', [])
|
||||
.value( 'RunningJobsList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ScheduledJobsDefinition', [])
|
||||
.value( 'ScheduledJobsList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('SchedulesListDefinition', [])
|
||||
.value('SchedulesList', {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('StreamListDefinition', [])
|
||||
.value('StreamList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('TeamsListDefinition', [])
|
||||
.value('TeamList', {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('UserListDefinition', [])
|
||||
.value('UserList', {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('DashboardCountsWidget', ['RestServices', 'Utilities'])
|
||||
.factory('DashboardCounts', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
|
||||
.factory('DashboardJobs', ['$rootScope', '$compile', 'LoadSchedulesScope', 'LoadJobsScope', 'JobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath',
|
||||
|
||||
180
awx/ui/static/js/widgets/HostGraph.js
Normal file
180
awx/ui/static/js/widgets/HostGraph.js
Normal 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;
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
//});
|
||||
});
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
]);
|
||||
128
awx/ui/static/js/widgets/HostPieChart.js
Normal file
128
awx/ui/static/js/widgets/HostPieChart.js
Normal 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');
|
||||
}
|
||||
};
|
||||
}
|
||||
]);
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities'])
|
||||
.factory('InventorySyncStatus', ['$rootScope', '$compile', function ($rootScope, $compile) {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('JobStatusWidget', ['RestServices', 'Utilities'])
|
||||
.factory('JobStatus', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
|
||||
|
||||
219
awx/ui/static/js/widgets/JobStatusGraph.js
Normal file
219
awx/ui/static/js/widgets/JobStatusGraph.js
Normal 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;
|
||||
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
]);
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('ObjectCountWidget', ['RestServices', 'Utilities'])
|
||||
.factory('ObjectCount', ['$rootScope', '$compile', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
angular.module('PortalJobsWidget', ['RestServices', 'Utilities'])
|
||||
.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
Loading…
x
Reference in New Issue
Block a user