Subscription name to UI

adding subscription name to hte UI in About Tower modal and on License page on license tab for card https://trello.com/c/4IMj3H4V/535-include-subscription-type-in-tower-license-and-present-in-api-and-ui
This commit is contained in:
Jared Tabor
2015-06-01 12:24:10 -04:00
parent c03a4e2873
commit f5973c81e2
3 changed files with 26 additions and 16 deletions

View File

@@ -45,6 +45,12 @@ export default
readonly: true, readonly: true,
tab: 'license' tab: 'license'
}, },
subscription_name: {
label: 'Subscription Name',
type: 'text',
readonly: true,
tab: 'license'
},
license_key: { license_key: {
label: 'License Key', label: 'License Key',
type: 'textarea', type: 'textarea',

View File

@@ -50,22 +50,24 @@ export default
scope.removeBuildAboutDialog(); scope.removeBuildAboutDialog();
} }
scope.removeBuildAboutDialog = scope.$on('BuildAboutDialog', function(e, data) { scope.removeBuildAboutDialog = scope.$on('BuildAboutDialog', function(e, data) {
var spaces, i, var spaces, i, j,
paddedStr = "", l, paddedStr = "",
version = data.version.replace(/-.*$/,''), str = data.version,
license_type = data.license_info.license_type; subscription = data.license_info.subscription_name || "";
// get the length of the license type and the word license (7) plus the extra spaces (4) if(str.search('-')){
l = license_type.length + 11; str = str.substr(0,str.search('-'));
}
spaces = Math.floor(l-(version.length + 10)); // 8 comes from " Tower " spaces = Math.floor((16-str.length)/2);
for( i=0; i<=spaces; i++){ for( i=0; i<=spaces; i++){
paddedStr = paddedStr +" "; paddedStr = paddedStr +" ";
} }
paddedStr = version+paddedStr; paddedStr = paddedStr+str;
for( j = paddedStr.length; j<16; j++){
paddedStr = paddedStr + " ";
}
$('#about-modal-version').html(paddedStr); $('#about-modal-version').html(paddedStr);
$('#about-modal-license-type').html(license_type); $('#about-modal-subscription').html(subscription);
scope.modalOK = function(){ scope.modalOK = function(){
$('#about-modal-dialog').dialog('close'); $('#about-modal-dialog').dialog('close');
}; };
@@ -74,7 +76,7 @@ export default
scope: scope, scope: scope,
// buttons: [], // buttons: [],
width: 710, width: 710,
height: 380, height: 400,
minWidth: 300, minWidth: 300,
resizable: false, resizable: false,
// title: , //'<img src="static/img/tower_login_logo.png">' ,//'About Ansible', // title: , //'<img src="static/img/tower_login_logo.png">' ,//'About Ansible',

View File

@@ -5,8 +5,8 @@
<div style="width: 340px; margin: 0 auto;"> <div style="width: 340px; margin: 0 auto;">
<pre id="cowsay"> <pre id="cowsay">
________________ ________________
/ Tower <span id='about-modal-version'></span> \ / Tower Version \
\ <span id='about-modal-license-type'></span> license / \<span id='about-modal-version'></span>/
---------------- ----------------
\ ^__^ \ ^__^
\ (oo)\_______ \ (oo)\_______
@@ -22,5 +22,7 @@
<p>Ansible and Ansible Tower are registered trademarks of Ansible, Inc.</p> <p>Ansible and Ansible Tower are registered trademarks of Ansible, Inc.</p>
<br> <br>
<p>Visit <a href="http://www.ansible.com" target="_blank">Ansible.com</a> for more information.</p> <p>Visit <a href="http://www.ansible.com" target="_blank">Ansible.com</a> for more information.</p>
<br>
<p><span id='about-modal-subscription'></span></p>
</div> </div>
</div> </div>