web/admin: better show metadata download for saml provider
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
3b973e12a4
commit
39e0ed2962
|
@ -75,17 +75,40 @@ export class SAMLProviderViewPage extends AKElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
async renderRelatedObjects(): Promise<TemplateResult> {
|
async renderRelatedObjects(): Promise<TemplateResult> {
|
||||||
if (!this.provider?.signingKp) {
|
const relatedObjects = [];
|
||||||
return Promise.resolve(html``);
|
if (this.provider?.assignedApplicationName) {
|
||||||
|
relatedObjects.push(html`<div class="pf-c-description-list__group">
|
||||||
|
<dt class="pf-c-description-list__term">
|
||||||
|
<span class="pf-c-description-list__text">${t`Metadata`}</span>
|
||||||
|
</dt>
|
||||||
|
<dd class="pf-c-description-list__description">
|
||||||
|
<div class="pf-c-description-list__text">
|
||||||
|
<a
|
||||||
|
class="pf-c-button pf-m-primary"
|
||||||
|
target="_blank"
|
||||||
|
href=${ifDefined(this.provider?.urlDownloadMetadata)}
|
||||||
|
>
|
||||||
|
${t`Download`}
|
||||||
|
</a>
|
||||||
|
<ak-action-button
|
||||||
|
class="pf-m-secondary"
|
||||||
|
.apiRequest=${() => {
|
||||||
|
return navigator.clipboard.writeText(
|
||||||
|
this.provider?.urlDownloadMetadata || "",
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
${t`Copy download URL`}
|
||||||
|
</ak-action-button>
|
||||||
|
</div>
|
||||||
|
</dd>
|
||||||
|
</div>`);
|
||||||
}
|
}
|
||||||
|
if (this.provider?.signingKp) {
|
||||||
const kp = await new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsRetrieve({
|
const kp = await new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsRetrieve({
|
||||||
kpUuid: this.provider.signingKp,
|
kpUuid: this.provider.signingKp,
|
||||||
});
|
});
|
||||||
return html` <div class="pf-c-card pf-l-grid__item pf-m-12-col">
|
relatedObjects.push(html`<div class="pf-c-description-list__group">
|
||||||
<div class="pf-c-card__title">${t`Related objects`}</div>
|
|
||||||
<div class="pf-c-card__body">
|
|
||||||
<dl class="pf-c-description-list pf-m-2-col">
|
|
||||||
<div class="pf-c-description-list__group">
|
|
||||||
<dt class="pf-c-description-list__term">
|
<dt class="pf-c-description-list__term">
|
||||||
<span class="pf-c-description-list__text"
|
<span class="pf-c-description-list__text"
|
||||||
>${t`Download signing certificate`}</span
|
>${t`Download signing certificate`}</span
|
||||||
|
@ -93,14 +116,18 @@ export class SAMLProviderViewPage extends AKElement {
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="pf-c-description-list__description">
|
<dd class="pf-c-description-list__description">
|
||||||
<div class="pf-c-description-list__text">
|
<div class="pf-c-description-list__text">
|
||||||
<a
|
<a class="pf-c-button pf-m-primary" href=${kp.certificateDownloadUrl}
|
||||||
class="pf-c-button pf-m-primary"
|
|
||||||
href=${kp.certificateDownloadUrl}
|
|
||||||
>${t`Download`}</a
|
>${t`Download`}</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>`);
|
||||||
|
}
|
||||||
|
return html` <div class="pf-c-card pf-l-grid__item pf-m-12-col">
|
||||||
|
<div class="pf-c-card__title">${t`Related objects`}</div>
|
||||||
|
<div class="pf-c-card__body">
|
||||||
|
<dl class="pf-c-description-list pf-m-2-col">
|
||||||
|
${relatedObjects.length > 0 ? relatedObjects : html`-`}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
Reference in New Issue