diff --git a/awx/ui/static/js/forms/LicenseUpdate.js b/awx/ui/static/js/forms/LicenseUpdate.js index 064eb1cdb6..63e9ad293d 100644 --- a/awx/ui/static/js/forms/LicenseUpdate.js +++ b/awx/ui/static/js/forms/LicenseUpdate.js @@ -14,7 +14,7 @@ angular.module('LicenseUpdateFormDefinition', []) fields: { license_json: { - label: 'License Key:', + label: 'License File', type: 'textarea', addRequired: true, editRequird: true, diff --git a/awx/ui/static/js/helpers/License.js b/awx/ui/static/js/helpers/License.js index 2893da2881..44aa281127 100644 --- a/awx/ui/static/js/helpers/License.js +++ b/awx/ui/static/js/helpers/License.js @@ -50,7 +50,12 @@ function($rootScope, $compile, CreateDialog, Store, LicenseUpdateForm, GenerateF getHTML: function(license, includeFormButton) { - var title, html, result = {}, license_is_valid=false; + var title, html, + contact_us = "contact us ", + renew = "ansible.com/renew ", + pricing = "ansible.com/pricing ", + result = {}, + license_is_valid=false; if (license && typeof license === 'object' && Object.keys(license).length > 0 && license.valid_key !== undefined) { // we have a license @@ -59,76 +64,68 @@ function($rootScope, $compile, CreateDialog, Store, LicenseUpdateForm, GenerateF html = "

The Ansible Tower license is invalid.

"; } else if (this.getRemainingDays(license.time_remaining) <= 0) { + title = "License Expired"; + html = "
\n" + + "

Thank you for using Ansible Tower. The Ansible Tower license has expired

"; if (parseInt(license.grace_period_remaining,10) > 86400) { - title = "License Expired"; - html = "

Thank you for using Ansible Tower. The Ansible Tower license " + - "has expired. "; // trial licenses don't get a grace period if (license.trial) { - html += "Managed hosts cannot be added and playbooks will no longer run.

"; + html += "

Don't worry- your existing history and content has not been affected, but playbooks will no longer run and new hosts cannot be added. " + + "If you are ready to upgrade, " + contact_us + " or visit " + pricing + " to see all of your license options. Thanks!

"; } else { - html += "After " + this.getRemainingDays(license.grace_period_remaining) + " grace days managed hosts cannot be added and playbooks will no longer run.

"; + html += "

Don't worry- your existing history and content has not been affected, but in " + this.getRemainingDays(license.grace_period_remaining) + " days playbooks will no longer " + + "run and new hosts cannot be added. If you are ready to upgrade, " + contact_us + " " + + "or visit ansible.com/pricing to see all of your license options. Thanks!

"; } } else { - title = "License Expired"; - html = "

Thank you for using Ansible Tower. The Ansible Tower license " + - "has expired"; - // trial licenses don't get a grace period - html += (!license.trial) ? ", and the 30 day grace period has been exceeded." : "."; - html += " To continue using Tower to run playbooks and add managed hosts a valid license key is required.

"; + html += "

Don’t worry- your existing history and content has not been affected, but playbooks will no longer run and new hosts cannot be added. If you are ready to renew or upgrade, contact us " + + "at " + renew + ". Thanks!

"; } } else if (this.getRemainingDays(license.time_remaining) < 15) { // Warning: license expiring in less than 15 days title = "License Warning"; html = "

Thank you for using Ansible Tower. The Ansible Tower license " + - "has " + this.getRemainingDays(license.time_remaining) + " days remaining. "; + "has " + this.getRemainingDays(license.time_remaining) + " days remaining.

"; // trial licenses don't get a grace period if (license.trial) { - html += "After the license expires playbooks will no longer run and managed hosts cannot be added.

"; + html += "

After this license expires, playbooks will no longer run and hosts cannot be added. If you are ready to upgrade, " + contact_us + " or visit " + pricing + " to see all of your license options. Thanks!

"; } else { - html += "After a short grace period of 30 days, playbooks will no longer run and managed hosts cannot be added.

"; + html += "

After this license expires, playbooks will no longer run and hosts cannot be added. If you are ready to renew or upgrade, contact us at " + renew + ". Thanks!

"; } } else if (license.free_instances <= 0) { title = "Host Count Exceeded"; - html = "

The Ansible Tower license has reached capacity for the number of " + - "managed hosts allowed. No additional hosts can be added. Existing playbooks can still be run against hosts already in inventory.

"; + html = "

The Ansible Tower license has reached capacity for the number of managed hosts allowed. No new hosts can be added. Existing " + + "playbooks can still be run against hosts already in inventory.

" + + "

If you are ready to upgrade, contact us at " + renew + ". Thanks!

"; + } else { // license is valid. the following text is displayed in the license viewer title = "Update License"; - html = "

The Ansible Tower license is valid.

"; + html = "

The Ansible Tower license is valid.

" + + "

If you are ready to upgrade, contact us at " + renew + ". Thanks!

"; license_is_valid = true; } } else { // No license title = "License Required"; - html = "

Thank you for trying Ansible Tower. Without a valid license you will not be able to add managed hosts or " + - "run playbooks. A FREE trial license is available for various infrastructure sizes, as well as free unlimited use for up to ten nodes.

"; + html = "

Now that you’ve successfully installed or upgraded Ansible Tower, the next step is to add a license file.

" + + "

If you don’t have a license file yet, visit " + pricing + " to see all of our free and paid license options.

"; } if (IsAdmin()) { - if (license_is_valid) { - html += "

If you need to update or extend the Ansible Tower license, please visit ansible.com/license. " + - "Copy and paste the new license key in the field below and click the Submit button.

"; - } else { - html += "

Please visit ansible.com/license to obtain a valid license key. " + - "Copy and paste the license key in the field below and click the Submit button."; - } + html += "

Copy and paste the contents of the new license file in the field below and click the Submit button.

"; } else { - if (license_is_valid) { - html += "

If you need to update or extend the Ansible Tower license, please visit ansible.com/license. A system administrator " + - "can install the new license by choosing View License on the Account Menu and clicking on the Update License tab."; - } else { - html += "

Please visit ansible.com/license to obtain a valid license key. A system administrator " + - "can install the new license by choosing View License on the Account Menu and clicking on the Update License tab."; - } + html += "

A system administrator can install the new license by choosing View License on the Account Menu and clicking on the Update License tab.

"; } - html += "

"; + + html += "
"; if (IsAdmin()) { html += GenerateForm.buildHTML(LicenseUpdateForm, { mode: 'edit', showButtons:((includeFormButton) ? true : false), breadCrumbs: false }); } + html += "
"; result.body = html; diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index b14489edf2..7c38254ec8 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -1250,6 +1250,11 @@ input[type="checkbox"].checkbox-no-label { background-color: #FBFBFB; border: 1px solid #E0E0E0; } + + .fa-external-link { + color: @grey; + font-size: 10px; + } } /* Inventory nav links */