removing some old portal mode code that's unused

while auditing Tower strings
This commit is contained in:
Jared Tabor 2017-07-13 15:34:44 -07:00
parent 2c6e229e71
commit d2a914a040
26 changed files with 88 additions and 98 deletions

View File

@ -1,3 +1,3 @@
{
"BRAND_NAME": "Tower"
"BRAND_NAME": "AWX"
}

View File

@ -45,12 +45,6 @@ body {
.collapsed-option {
display: none;
}
.navbar-brand {
padding-top: 3px;
padding-bottom: 3px;
padding-right: 0;
padding-left: 0;
}
.nav > li > a {
padding-top: 11px;
padding-bottom: 11px;

View File

@ -0,0 +1,9 @@
// The purpose of this file is to instantiate the BaseStringService
// for app-wide usage.
function AppStrings (BaseString) {
BaseString.call(this, 'app');
}
AppStrings.$inject = ['BaseStringService'];
export default AppStrings;

View File

@ -1,8 +1,7 @@
export default
['$scope', '$state', 'ConfigService', 'AppStrings',
function($scope, $state, ConfigService, AppStrings){
['$scope', '$state', 'ConfigService',
function($scope, $state, ConfigService){
var init = function(){
$scope.name = AppStrings.get('BRAND_NAME');
ConfigService.getConfig()
.then(function(config){
$scope.version = config.version.split('-')[0];

View File

@ -11,7 +11,7 @@
<!-- Don't indent this properly, you'll break the cow -->
<pre class="About-cowsayCode">
_______________
< {{name}} {{version}} >
< {{BRAND_NAME}} {{version}} >
---------------
\ ^__^
\ (oo)\_______

View File

@ -205,12 +205,12 @@ var tower = angular.module('Tower', [
'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'Timer',
'LoadConfig', 'Store', 'pendoService', 'Prompt', 'Rest',
'Wait', 'ProcessErrors', '$state', 'GetBasePath', 'ConfigService',
'FeaturesService', '$filter', 'SocketService',
'FeaturesService', '$filter', 'SocketService', 'AppStrings',
function($stateExtender, $q, $compile, $cookies, $rootScope, $log, $stateParams,
CheckLicense, $location, Authorization, LoadBasePaths, Timer,
LoadConfig, Store, pendoService, Prompt, Rest, Wait,
ProcessErrors, $state, GetBasePath, ConfigService, FeaturesService,
$filter, SocketService) {
$filter, SocketService, AppStrings) {
$rootScope.$state = $state;
$rootScope.$state.matches = function(stateName) {
@ -231,6 +231,7 @@ var tower = angular.module('Tower', [
};
$rootScope.breadcrumb = {};
$rootScope.BRAND_NAME = AppStrings.get('BRAND_NAME');
function activateTab() {
// Make the correct tab active
@ -242,14 +243,6 @@ var tower = angular.module('Tower', [
//base.replace(/\_/g, ' ');
base = (base === 'job_events' || base === 'job_host_summaries') ? 'jobs' : base;
}
//make sure that the tower icon works when not in portal mode
$('.navbar-brand').attr('href', '/#/home');
$rootScope.portalMode = false;
if (base === 'portal') {
$rootScope.portalMode = true;
//in portal mode we don't want the tower icon to lead anywhere
$('.navbar-brand').removeAttr('href');
}
$('#ansible-list-title').html('<strong>' + base.replace(/\_/, ' ') + '</strong>');
@ -447,11 +440,6 @@ var tower = angular.module('Tower', [
$('#' + tabs + ' #' + tab).tab('show');
};
$rootScope.leavePortal = function() {
$rootScope.portalMode = false;
$location.path('/home/');
};
}); // end of 'ConfigReady'

View File

@ -7,7 +7,7 @@
<div class="tab-pane" id="configuration-panel">
<div ng-cloak id="htmlTemplate" class="Panel">
<div class="Form-header">
<div class="Form-title" translate>CONFIGURE TOWER</div>
<div class="Form-title" translate>CONFIGURE {{BRAND_NAME}}</div>
</div>
<div class="row Form-tabRow">
<div class="col-lg-12">

View File

@ -22,7 +22,7 @@
*
* ?aw.suspend=true
*
* to the end of the URL. When you see the Tower logo loaded on an otherwise blank page,
* to the end of the URL. When you see the main logo loaded on an otherwise blank page,
* open the Dev Tools console and execute the code:
*
* angular.resumeBootstrap()
@ -55,4 +55,3 @@ export function time(fn, label) {
};
}
/* jshint ignore:end */

View File

@ -26,7 +26,7 @@ export default ['i18n', function(i18n) {
' track by module.value',
ngChange: 'moduleChange()',
required: true,
awPopOver: i18n._('These are the modules that Tower supports running commands against.'),
awPopOver: i18n._('These are the modules that {{BRAND_NAME}} supports running commands against.'),
dataTitle: i18n._('Module'),
dataPlacement: 'right',
dataContainer: 'body'

View File

@ -9,10 +9,12 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions',
'rbacUiControlService', 'ToJSON', 'SourcesService', 'Empty',
'Wait', 'Rest', 'Alert', 'ProcessErrors', 'inventorySourcesOptions',
'$rootScope',
function($state, $stateParams, $scope, SourcesFormDefinition, ParseTypeChange,
GenerateForm, inventoryData, GroupsService, GetChoices,
GetBasePath, CreateSelect2, GetSourceTypeOptions, rbacUiControlService,
ToJSON, SourcesService, Empty, Wait, Rest, Alert, ProcessErrors, inventorySourcesOptions) {
ToJSON, SourcesService, Empty, Wait, Rest, Alert, ProcessErrors,
inventorySourcesOptions,$rootScope) {
let form = SourcesFormDefinition;
init();
@ -152,7 +154,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
if($scope && $scope.source && $scope.source === 'ec2' || $scope && $scope.source && $scope.source.value && $scope.source.value === 'ec2'){
$scope.group_by_choices = $scope.ec2_group_by;
$scope.groupByPopOver = "<p>Select which groups to create automatically. " +
"Tower will create group names similar to the following examples based on the options selected:</p><ul>" +
$rootScope.BRAND_NAME + " will create group names similar to the following examples based on the options selected:</p><ul>" +
"<li>Availability Zone: <strong>zones &raquo; us-east-1b</strong></li>" +
"<li>Image ID: <strong>images &raquo; ami-b007ab1e</strong></li>" +
"<li>Instance ID: <strong>instances &raquo; i-ca11ab1e</strong></li>" +
@ -165,7 +167,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
"<li>Tag None: <strong>tags &raquo; tag_none</strong></li>" +
"</ul><p>If blank, all groups above are created except <em>Instance ID</em>.</p>";
$scope.instanceFilterPopOver = "<p>Provide a comma-separated list of filter expressions. " +
"Hosts are imported to Tower when <em>ANY</em> of the filters match.</p>" +
"Hosts are imported to " + $rootScope.BRAND_NAME + " when <em>ANY</em> of the filters match.</p>" +
"Limit to hosts having a tag:<br />\n" +
"<blockquote>tag-key=TowerManaged</blockquote>\n" +
"Limit to hosts using either key pair:<br />\n" +

View File

@ -8,12 +8,12 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
'rbacUiControlService', 'ToJSON', 'ParseTypeChange', 'GroupsService',
'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions',
'inventorySourceData', 'SourcesService', 'inventoryData', 'inventorySourcesOptions', 'Empty',
'Wait', 'Rest', 'Alert',
'Wait', 'Rest', 'Alert', '$rootScope',
function($state, $stateParams, $scope, ParseVariableString,
rbacUiControlService, ToJSON,ParseTypeChange, GroupsService,
GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions,
inventorySourceData, SourcesService, inventoryData, inventorySourcesOptions, Empty,
Wait, Rest, Alert) {
Wait, Rest, Alert, $rootScope) {
function init() {
$scope.projectBasePath = GetBasePath('projects') + '?not__status=never updated';
@ -247,7 +247,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
let group_by = inventorySourceData.group_by.split(',');
$scope.group_by = _.map(group_by, (item) => _.find($scope.ec2_group_by, { value: item }));
$scope.groupByPopOver = "<p>Select which groups to create automatically. " +
"Tower will create group names similar to the following examples based on the options selected:</p><ul>" +
$rootScope.BRAND_NAME + " will create group names similar to the following examples based on the options selected:</p><ul>" +
"<li>Availability Zone: <strong>zones &raquo; us-east-1b</strong></li>" +
"<li>Image ID: <strong>images &raquo; ami-b007ab1e</strong></li>" +
"<li>Instance ID: <strong>instances &raquo; i-ca11ab1e</strong></li>" +
@ -260,7 +260,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
"<li>Tag None: <strong>tags &raquo; tag_none</strong></li>" +
"</ul><p>If blank, all groups above are created except <em>Instance ID</em>.</p>";
$scope.instanceFilterPopOver = "<p>Provide a comma-separated list of filter expressions. " +
"Hosts are imported to Tower when <em>ANY</em> of the filters match.</p>" +
"Hosts are imported to " + $rootScope.BRAND_NAME + " when <em>ANY</em> of the filters match.</p>" +
"Limit to hosts having a tag:<br />\n" +
"<blockquote>tag-key=TowerManaged</blockquote>\n" +
"Limit to hosts using either key pair:<br />\n" +

View File

@ -54,8 +54,8 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
$scope.jobExtraCredentials = jobExtraCredentials;
var getTowerLinks = function() {
var getTowerLink = function(key) {
var getLinks = function() {
var getLink = function(key) {
if(key === 'schedule') {
if($scope.job.related.schedule) {
return '/#/templates/job_template/' + $scope.job.job_template + '/schedules' + $scope.job.related.schedule.split(/api\/v\d+\/schedules/)[1];
@ -82,21 +82,21 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
}
};
$scope.created_by_link = getTowerLink('created_by');
$scope.scheduled_by_link = getTowerLink('schedule');
$scope.inventory_link = getTowerLink('inventory');
$scope.project_link = getTowerLink('project');
$scope.machine_credential_link = getTowerLink('credential');
$scope.cloud_credential_link = getTowerLink('cloud_credential');
$scope.network_credential_link = getTowerLink('network_credential');
$scope.vault_credential_link = getTowerLink('vault_credential');
$scope.schedule_link = getTowerLink('schedule');
$scope.created_by_link = getLink('created_by');
$scope.scheduled_by_link = getLink('schedule');
$scope.inventory_link = getLink('inventory');
$scope.project_link = getLink('project');
$scope.machine_credential_link = getLink('credential');
$scope.cloud_credential_link = getLink('cloud_credential');
$scope.network_credential_link = getLink('network_credential');
$scope.vault_credential_link = getLink('vault_credential');
$scope.schedule_link = getLink('schedule');
};
// uses options to set scope variables to their readable string
// value
var getTowerLabels = function() {
var getTowerLabel = function(key) {
var getLabels = function() {
var getLabel = function(key) {
if ($scope.jobOptions && $scope.jobOptions[key]) {
return $scope.jobOptions[key].choices
.filter(val => val[0] === $scope.job[key])
@ -106,8 +106,8 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
}
};
$scope.type_label = getTowerLabel('job_type');
$scope.verbosity_label = getTowerLabel('verbosity');
$scope.type_label = getLabel('job_type');
$scope.verbosity_label = getLabel('verbosity');
};
var getTotalHostCount = function(count) {
@ -174,10 +174,10 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
$scope.job_status = jobData.status;
}
// turn related api browser routes into tower routes
getTowerLinks();
// turn related api browser routes into front end routes
getLinks();
// the links below can't be set in getTowerLinks because the
// the links below can't be set in getLinks because the
// links on the UI don't directly match the corresponding URL
// on the API browser
if(jobData.summary_fields && jobData.summary_fields.job_template &&
@ -201,7 +201,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
}
// use options labels to manipulate display of details
getTowerLabels();
getLabels();
// set up a read only code mirror for extra vars
$scope.variables = ParseVariableString($scope.job.extra_vars);

View File

@ -139,7 +139,7 @@ export default
.success(function(data) {
Wait('stop');
var job = data.job || data.system_job || data.project_update || data.inventory_update || data.ad_hoc_command;
if($rootScope.portalMode===false && Empty(data.system_job) || (base === 'home')){
if(base !== 'portal' && Empty(data.system_job) || (base === 'home')){
// use $state.go with reload: true option to re-instantiate sockets in
var goTojobResults = function(state) {

View File

@ -37,7 +37,7 @@ export default
var init = function(){
// license/license.partial.html compares fileName
$scope.fileName = N_("No file selected.");
$scope.title = $rootScope.licenseMissing ? ("Tower " + i18n._("License")) : i18n._("License Management");
$scope.title = $rootScope.licenseMissing ? ($rootScope.BRAND_NAME + i18n._(" License")) : i18n._("License Management");
$scope.license = config;
$scope.license.version = config.version.split('-')[0];
$scope.time = {};

View File

@ -44,7 +44,7 @@ export default
// Detailed mode
// VisitorId: username+hash of license_key
// AccountId: hash of license_key from license
// email: contact_email from license OR email from Tower account
// email: contact_email from license OR email from user account
options.visitor.id = $rootScope.current_user.username + '@' + config.deployment_id;
options.account.id = config.deployment_id;

View File

@ -10,7 +10,7 @@
* @description
* Controller for handling /#/login and /#/logout routes.
*
* Tower (app.js) verifies the user is authenticated and that the user session is not expired. If either condition is not true,
* (app.js) verifies the user is authenticated and that the user session is not expired. If either condition is not true,
* the user is redirected to /#/login and the Authentication controller.
*
* Methods for checking the session state are found in [js/shared/AuthService.js](/static/docs/api/shared.function:AuthService), which is referenced here as Authorization.
@ -43,10 +43,10 @@
* - Start the expiration timer by calling the init() method of [js/shared/Timer.js](/static/docs/api/shared.function:Timer)
* - Get user informaton by calling Authorization.getUser() - sends a GET request to /api/v2/me
* - Store user information in the session cookie by calling Authorization.setUser().
* - Get the Tower license by calling ConfigService.getConfig() - sends a GET request to /api/vi/config
* - Stores the license object in memory by calling CheckLicense.test(). This adds the Tower version and a tested flag to the license object. The tested flag is initially set to false. Additionally, the pendoService and FeaturesService are called to initiate the other startup services of Tower
* - Get the license by calling ConfigService.getConfig() - sends a GET request to /api/vi/config
* - Stores the license object in memory by calling CheckLicense.test(). This adds the version and a tested flag to the license object. The tested flag is initially set to false. Additionally, the pendoService and FeaturesService are called to initiate the other startup services of Tower
*
* Note that there is a session timer kept on the server side as well as the client side. Each time an API request is made, Tower (in app.js) calls
* Note that there is a session timer kept on the server side as well as the client side. Each time an API request is made, app.js calls
* Timer.isExpired(). This verifies the UI does not think the session is expired, and if not, moves the expiration time into the future. The number of
* seconds between API calls before a session is considered expired is set in config.js as session_timeout.
*

View File

@ -15,7 +15,7 @@
</div>
<div class="LoginModal-body">
<div class="LoginModal-alert" ng-show="!sessionExpired && !sessionLimitExpired && !attemptFailed && !thirdPartyAttemptFailed" translate>
Welcome to Ansible Tower! &nbsp;Please sign in.
Welcome to Ansible {{BRAND_NAME}}! &nbsp;Please sign in.
</div>
<div class="LoginModal-alert LoginModal-alert--error" ng-show="sessionExpired">
<i class="LoginModal-alertIcon fa fa-exclamation-triangle"></i>

View File

@ -4,7 +4,6 @@
* All Rights Reserved
*************************************************/
// import listGenerator from 'tower/shared/list-generator/main';
export default
[ 'Wait', 'CreateDialog', 'GetBasePath' ,

View File

@ -67,7 +67,7 @@ export default ['i18n', 'NotificationsList', function(i18n, NotificationsList) {
alertTxt: '<p class=\"text-justify\"><strong>WARNING:</strong> There are no available playbook directories in {{ base_dir }}. ' +
'Either that directory is empty, or all of the contents are already assigned to other projects. ' +
'Create a new directory there and make sure the playbook files can be read by the "awx" system user, ' +
'or have Tower directly retrieve your playbooks from source control using the SCM Type option above.</p>',
'or have {{BRAND_NAME}} directly retrieve your playbooks from source control using the SCM Type option above.</p>',
closeable: false
},
base_dir: {
@ -78,7 +78,7 @@ export default ['i18n', 'NotificationsList', function(i18n, NotificationsList) {
ngShow: "scm_type.value == 'manual' " ,
awPopOver: '<p>' + i18n._('Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. ' +
'Together the base path and selected playbook directory provide the full path used to locate playbooks.') + '</p>' +
'<p>' + i18n.sprintf(i18n._('Change %s under "Configure Tower" to change this location.'), 'PROJECTS_ROOT') + '</p>',
'<p>' + i18n.sprintf(i18n._('Change %s under "Configure {{BRAND_NAME}}" to change this location.'), 'PROJECTS_ROOT') + '</p>',
dataTitle: i18n._('Project Base Path'),
dataContainer: 'body',
dataPlacement: 'right',

View File

@ -9,7 +9,7 @@
<a ui-sref="users" class="SetupItem">
<h4 class="SetupItem-title" translate>Users</h4>
<p class="SetupItem-description" translate>
Allow others to sign into Tower and own the content they create.
Allow others to sign into {{BRAND_NAME}} and own the content they create.
</p>
</a>
<a ui-sref="teams" class="SetupItem">
@ -59,19 +59,19 @@
<a ui-sref="instanceGroups" class="SetupItem">
<h4 class="SetupItem-title" translate>Instance Groups</h4>
<p class="SetupItem-description" translate>
View list and capacity of Tower instances.
View list and capacity of {{BRAND_NAME}} instances.
</p>
</a>
<a ui-sref="configuration" class="SetupItem" ng-if="user_is_superuser || user_is_system_auditor">
<h4 class="SetupItem-title" translate>Configure Tower</h4>
<h4 class="SetupItem-title" translate>Configure {{BRAND_NAME}}</h4>
<p class="SetupItem-description" translate>
Edit Tower's configuration.
Edit {{BRAND_NAME}}'s configuration.
</p>
</a>
<a ui-sref="setup.about" class="SetupItem">
<h4 class="SetupItem-title" translate>About Tower</h4>
<h4 class="SetupItem-title" translate>About {{BRAND_NAME}}</h4>
<p class="SetupItem-description" translate>
View information about this version of Ansible Tower.
View information about this version of Ansible {{BRAND_NAME}}.
</p>
</a>
</div>

View File

@ -4,7 +4,7 @@ export default
// These ettings used to be found in config.js, hardcoded now.
var configSettings = {
//custom_logo: false, // load /var/lib/awx/public/static/assets/custom_console_logo.png as the login modal header. if false, will load the standard tower console logo
//custom_logo: false, // load /var/lib/awx/public/static/assets/custom_console_logo.png as the login modal header. if false, will load the standard console logo
// custom_login_info: "example notice", // have a notice displayed in the login modal for users. note that, as a security measure, custom html is not supported and will be escaped.
"tooltip_delay": {
"show": 500,

View File

@ -165,7 +165,7 @@ export default
if(self.socket){
if (self.socket.readyState === 0 ) {
$rootScope.socketStatus = 'connecting';
$rootScope.socketTip = i18n._("Live events: attempting to connect to the Tower server.");
$rootScope.socketTip = i18n._(`Live events: attempting to connect to the ${$rootScope.BRAND_NAME} server.`);
}
else if (self.socket.readyState === 1){
$rootScope.socketStatus = 'ok';
@ -173,7 +173,7 @@ export default
}
else if (self.socket.readyState === 2 || self.socket.readyState === 3 ){
$rootScope.socketStatus = 'error';
$rootScope.socketTip = i18n._("Live events: error connecting to the Tower server.");
$rootScope.socketTip = i18n._(`Live events: error connecting to the ${$rootScope.BRAND_NAME} server.`);
}
return;
}

View File

@ -1,6 +1,6 @@
export default
function CallbackHelpInit($q, $location, GetBasePath, Rest, JobTemplateForm, GenerateForm, $stateParams, ProcessErrors,
ParseVariableString, Empty, Wait, MultiCredentialService) {
ParseVariableString, Empty, Wait, MultiCredentialService, $rootScope) {
return function(params) {
var scope = params.scope,
defaultUrl = GetBasePath('job_templates'),
@ -16,11 +16,11 @@ export default
// The form uses awPopOverWatch directive to 'watch' scope.callback_help for changes. Each time the
// popover is activated, a function checks the value of scope.callback_help before constructing the content.
scope.setCallbackHelp = function() {
scope.callback_help = "<p>With a provisioning callback URL and a host config key a host can contact Tower and request a configuration update using this job " +
scope.callback_help = "<p>With a provisioning callback URL and a host config key a host can contact " + $rootScope.BRAND_NAME + " and request a configuration update using this job " +
"template. The request from the host must be a POST. Here is an example using curl:</p>\n" +
"<pre>curl --data \"host_config_key=" + scope.example_config_key + "\" " +
scope.callback_server_path + GetBasePath('job_templates') + scope.example_template_id + "/callback/</pre>\n" +
"<p>Note the requesting host must be defined in the inventory associated with the job template. If Tower fails to " +
"<p>Note the requesting host must be defined in the inventory associated with the job template. If " + $rootScope.BRAND_NAME + " fails to " +
"locate the host, the request will be denied.</p>" +
"<p>Successful requests create an entry on the Jobs page, where results and history can be viewed.</p>";
};
@ -170,5 +170,5 @@ export default
CallbackHelpInit.$inject =
[ '$q', '$location', 'GetBasePath', 'Rest', 'JobTemplateForm', 'GenerateForm',
'$stateParams', 'ProcessErrors', 'ParseVariableString',
'Empty', 'Wait', 'MultiCredentialService'
'Empty', 'Wait', 'MultiCredentialService', '$rootScope'
];

View File

@ -138,7 +138,7 @@ function(NotificationsList, CompletedJobsList, i18n) {
credentials-to-post="credentialsToPost">
</multi-credential>`,
required: true,
awPopOver: "<p>" + i18n._("Select credentials that allow Tower to access the nodes this job will be ran against. You can only select one credential of each type.<br /><br />You must select either a machine (SSH) credential or \"Prompt on launch\". \"Prompt on launch\" requires you to select a machine credential at run time.<br /><br />If you select credentials AND check the \"Prompt on launch\" box, you make the selected credentials the defaults that can be updated at run time.") + "</p>",
awPopOver: "<p>" + i18n._("Select credentials that allow {{BRAND_NAME}} to access the nodes this job will be ran against. You can only select one credential of each type.<br /><br />You must select either a machine (SSH) credential or \"Prompt on launch\". \"Prompt on launch\" requires you to select a machine credential at run time.<br /><br />If you select credentials AND check the \"Prompt on launch\" box, you make the selected credentials the defaults that can be updated at run time.") + "</p>",
dataTitle: i18n._('Credentials'),
dataPlacement: 'right',
dataContainer: "body",
@ -281,7 +281,7 @@ function(NotificationsList, CompletedJobsList, i18n) {
type: 'checkbox',
ngChange: "toggleCallback('host_config_key')",
column: 2,
awPopOver: "<p>" + i18n._("Enables creation of a provisioning callback URL. Using the URL a host can contact Tower and request a configuration update " +
awPopOver: "<p>" + i18n._("Enables creation of a provisioning callback URL. Using the URL a host can contact {{BRAND_NAME}} and request a configuration update " +
"using this job template.") + "</p>",
dataPlacement: 'right',
dataTitle: i18n._('Allow Provisioning Callbacks'),

View File

@ -10,7 +10,7 @@
* @description This form is for adding/editing a Job Template
*/
export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
export default ['NotificationsList', 'i18n', '$rootScope', function(NotificationsList, i18n, $rootScope) {
return function() {
var WorkflowMakerFormObject = {
@ -99,7 +99,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) {
i18n.sprintf(i18n._("Setting the type to %s will not execute the playbook. Instead, %s will check playbook " +
" syntax, test environment setup and report problems."), "<em>check</em>", "<code>ansible</code>") + "</p> <p>" +
i18n.sprintf(i18n._("Setting the type to %s will execute the playbook and store any " +
" scanned facts for use with Tower's System Tracking feature."), "<em>scan</em>") + "</p>",
" scanned facts for use with " + $rootScope.BRAND_NAME + "'s System Tracking feature."), "<em>scan</em>") + "</p>",
dataTitle: i18n._('Job Type'),
dataPlacement: 'right',
dataContainer: "body",

View File

@ -6,8 +6,8 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
ParseVariableString, WorkflowService, count, $state, i18n, moment) {
var runTimeElapsedTimer = null;
var getTowerLinks = function() {
var getTowerLink = function(key) {
var getLinks = function() {
var getLink = function(key) {
if(key === 'schedule') {
if($scope.workflow.related.schedule) {
return '/#/templates/workflow_job_template/' + $scope.workflow.workflow_job_template + '/schedules' + $scope.workflow.related.schedule.split(/api\/v\d+\/schedules/)[1];
@ -27,14 +27,14 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
};
$scope.workflow_template_link = '/#/templates/workflow_job_template/'+$scope.workflow.workflow_job_template;
$scope.created_by_link = getTowerLink('created_by');
$scope.scheduled_by_link = getTowerLink('schedule');
$scope.cloud_credential_link = getTowerLink('cloud_credential');
$scope.network_credential_link = getTowerLink('network_credential');
$scope.created_by_link = getLink('created_by');
$scope.scheduled_by_link = getLink('schedule');
$scope.cloud_credential_link = getLink('cloud_credential');
$scope.network_credential_link = getLink('network_credential');
};
var getTowerLabels = function() {
var getTowerLabel = function(key) {
var getLabels = function() {
var getLabel = function(key) {
if ($scope.workflowOptions && $scope.workflowOptions[key]) {
return $scope.workflowOptions[key].choices
.filter(val => val[0] === $scope.workflow[key])
@ -44,9 +44,9 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
}
};
$scope.status_label = getTowerLabel('status');
$scope.type_label = getTowerLabel('job_type');
$scope.verbosity_label = getTowerLabel('verbosity');
$scope.status_label = getLabel('status');
$scope.type_label = getLabel('job_type');
$scope.verbosity_label = getLabel('verbosity');
};
var updateWorkflowJobElapsedTimer = function(time) {
@ -75,11 +75,11 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
// stdout full screen toggle tooltip text
$scope.toggleStdoutFullscreenTooltip = i18n._("Expand Output");
// turn related api browser routes into tower routes
getTowerLinks();
// turn related api browser routes into front end routes
getLinks();
// use options labels to manipulate display of details
getTowerLabels();
getLabels();
// set up a read only code mirror for extra vars
$scope.variables = ParseVariableString($scope.workflow.extra_vars);