From cf8b56cc75af43a26f1bd7fadb29a2ab0dd64633 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 9 Jul 2015 00:12:00 +0200 Subject: webui: show multiple cert New certificate widget which replaced certificate status widget. It can display multiple certs. Drawback is that it cannot display if the certificate was revoked. Web UI does not have the information. part of: https://fedorahosted.org/freeipa/ticket/5045 Reviewed-By: Martin Basti --- install/ui/less/widgets.less | 12 +++++ install/ui/src/freeipa/certificate.js | 90 +++++++++++++++++++++++++++++++++++ install/ui/src/freeipa/host.js | 5 +- install/ui/src/freeipa/service.js | 5 +- install/ui/src/freeipa/user.js | 4 ++ install/ui/test/data/ipa_init.json | 3 ++ ipalib/plugins/internal.py | 3 ++ 7 files changed, 116 insertions(+), 6 deletions(-) diff --git a/install/ui/less/widgets.less b/install/ui/less/widgets.less index 7778f6bf4..99b22068d 100644 --- a/install/ui/less/widgets.less +++ b/install/ui/less/widgets.less @@ -131,5 +131,17 @@ } } +// Certificate Widget + +.certificate-widget { + label { + padding-right: 10px; + } + .certificate { + word-wrap: break-word; + padding-bottom: 10px; + } +} + // workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=409254 tbody:empty { display: none; } \ No newline at end of file diff --git a/install/ui/src/freeipa/certificate.js b/install/ui/src/freeipa/certificate.js index 71f0dfbf5..93f3cfc68 100755 --- a/install/ui/src/freeipa/certificate.js +++ b/install/ui/src/freeipa/certificate.js @@ -1000,6 +1000,95 @@ IPA.cert.status_field = function(spec) { return that; }; +IPA.cert.cert_widget = function(spec) { + + spec = spec || {}; + spec.css_class = spec.css_class || 'certificate-widget'; + + var that = IPA.input_widget(spec); + that.certs_visible = false; + + that.create = function(container) { + + that.widget_create(container); + that.content_el = $('
').appendTo(container); + }; + + that.create_status = function(name, text, icon) { + + var status = $('