diff --git a/app/admin-tab/ha/template.hbs b/app/admin-tab/ha/template.hbs index 1cb524b4d..43a677a7c 100644 --- a/app/admin-tab/ha/template.hbs +++ b/app/admin-tab/ha/template.hbs @@ -27,9 +27,9 @@
-

Management Server Certificate: {{#if cert.cert}}{{copy-to-clipboard size="small" clipboardText=cert.cert}}{{/if}}

- {{#if cert.cert}} -
{{cert.cert}}
+

Management Server Certificate: {{#if cert.certChain}}{{copy-to-clipboard size="small" clipboardText=cert.certChain}}{{/if}}

+ {{#if cert.certChain}} +
{{cert.certChain}}
{{else}} Waiting for a host... {{/if}} diff --git a/app/application/controller.js b/app/application/controller.js index 5c7dc3c34..3d6664460 100644 --- a/app/application/controller.js +++ b/app/application/controller.js @@ -34,22 +34,23 @@ export default Ember.Controller.extend({ confirmDeleteResources : null, originalModel : null, - showAbout : null, editAccount : null, - editApikey : null, - editProject : null, - editContainer : null, - editHost : null, - editService : null, - editExternalService : null, editAliasService : null, + editApikey : null, + editCertificate : null, + editContainer : null, + editExternalService : null, + editHost : null, editLoadBalancerService : null, + editProject : null, editRegistry : null, - showShell : null, - showConsole : null, - showContainerLogs : null, + editService : null, openProcessesError : null, + showAbout : null, showAuditLogResponses : null, showConfirmDeactivate : null, + showConsole : null, + showContainerLogs : null, showNewDriver : null, + showShell : null, }); diff --git a/app/certificates/new/template.hbs b/app/certificates/new/template.hbs index d345fe7da..744adc169 100644 --- a/app/certificates/new/template.hbs +++ b/app/certificates/new/template.hbs @@ -14,33 +14,30 @@ descriptionPlaceholder="e.g. EV cert for mydomain.com" }} -
- -
-
- - {{read-text-file accept="text/*, .pem, .pkey, .key" action=(action "readFile" "key")}} -
- {{textarea value=model.key classNames="form-control no-resize" rows="5" placeholder="Paste in the private key, starting with -----BEGIN RSA PRIVATE KEY-----"}} +
+
+
+ + {{read-text-file accept="text/*, .pem, .pkey, .key" action=(action "readFile" "key")}}
+ {{textarea value=model.key classNames="form-control no-resize" rows="5" placeholder="Paste in the private key, starting with -----BEGIN RSA PRIVATE KEY-----"}} +
- -
-
- - {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "cert")}} -
- {{textarea value=model.cert classNames="form-control no-resize" rows="5" placeholder="Paste in the primary certificate, starting with -----BEGIN CERTIFICATE-----"}} +
+
+ + {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "cert")}}
+ {{textarea value=model.cert classNames="form-control no-resize" rows="5" placeholder="Paste in the primary certificate, starting with -----BEGIN CERTIFICATE-----"}} +
-
-
- - {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "certChain")}} -
- {{textarea value=model.certChain classNames="form-control no-resize" rows="5" placeholder="Optional; Paste in the additional chained certificates, starting with -----BEGIN CERTIFICATE-----"}} +
+
+ + {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "certChain")}}
- + {{textarea value=model.certChain classNames="form-control no-resize" rows="5" placeholder="Optional; Paste in the additional chained certificates, starting with -----BEGIN CERTIFICATE-----"}} +
diff --git a/app/components/edit-certificate/component.js b/app/components/edit-certificate/component.js new file mode 100644 index 000000000..90356adfc --- /dev/null +++ b/app/components/edit-certificate/component.js @@ -0,0 +1,29 @@ +import Ember from 'ember'; +import NewOrEdit from 'ui/mixins/new-or-edit'; + +export default Ember.Component.extend(NewOrEdit, { + editing: true, + originalModel: null, + model: null, + + willInsertElement() { + this.set('model', this.get('originalModel').clone()); + }, + + actions: { + outsideClick() { + }, + + cancel() { + this.sendAction('dismiss'); + }, + + readFile(field, text) { + this.set('model.'+field, text.trim()); + }, + }, + + doneSaving() { + this.sendAction('dismiss'); + }, +}); diff --git a/app/components/edit-certificate/template.hbs b/app/components/edit-certificate/template.hbs new file mode 100644 index 000000000..beb9a1e4f --- /dev/null +++ b/app/components/edit-certificate/template.hbs @@ -0,0 +1,43 @@ +
+

Edit Certificate

+ + {{form-name-description + model=primaryResource + nameRequired=true + namePlaceholder="e.g. mydomain.com" + descriptionPlaceholder="e.g. EV cert for mydomain.com" + }} + +
+
Note: The Private Key is intentionally blank because the field is write-only. You will need to provide the Private Key again to update the certificate, even if it hasn't changed.
+
+ +
+
+
+ + {{read-text-file accept="text/*, .pem, .pkey, .key" action=(action "readFile" "key")}} +
+ {{textarea value=model.key classNames="form-control no-resize" rows="5" placeholder="Paste in the private key, starting with -----BEGIN RSA PRIVATE KEY-----"}} +
+ +
+
+ + {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "cert")}} +
+ {{textarea value=model.cert classNames="form-control no-resize" rows="5" placeholder="Paste in the primary certificate, starting with -----BEGIN CERTIFICATE-----"}} +
+ +
+
+ + {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "certChain")}} +
+ {{textarea value=model.certChain classNames="form-control no-resize" rows="5" placeholder="Optional; Paste in the additional chained certificates, starting with -----BEGIN CERTIFICATE-----"}} +
+
+
+ +{{top-errors errors=errors}} +{{save-cancel editing=true save="save" cancel="cancel"}} diff --git a/app/models/certificate.js b/app/models/certificate.js index 31fd3a221..c011526a9 100644 --- a/app/models/certificate.js +++ b/app/models/certificate.js @@ -1,6 +1,14 @@ import Resource from 'ember-api-store/models/resource'; export default Resource.extend({ + actions: { + edit: function() { + this.get('application').setProperties({ + editCertificate: true, + originalModel: this, + }); + }, + }, availableActions: function() { var a = this.get('actionLinks'); if ( !a ) @@ -14,6 +22,8 @@ export default Resource.extend({ { label: 'Purge', icon: '', action: 'purge', enabled: !!a.purge }, { divider: true }, { label: 'View in API', icon: 'icon icon-external-link', action: 'goToApi', enabled: true }, + { divider: true }, + { label: 'Edit', icon: 'icon icon-edit', action: 'edit', enabled: !!a.update }, ]; return choices; diff --git a/app/router.js b/app/router.js index 3b89e2987..91c8eb6b4 100644 --- a/app/router.js +++ b/app/router.js @@ -305,6 +305,12 @@ Router.map(function() { otherParams : 'originalModel', }); + this.modal('edit-certificate', { + dismissWithOutsideClick : false, + withParams : 'editCertificate', + otherParams : 'originalModel', + }); + this.modal('modal-catalog-launch', { dismissWithOutsideClick : true, withParams : 'launchCatalog', diff --git a/package.json b/package.json index f0ba3da69..118333863 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "1.0.2", + "version": "1.0.3", "private": true, "directories": { "doc": "doc",