This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#121: Implement the UI to connect manage the certificate of the PKI/ …
…Added Button-OperationService-certificateService
- Loading branch information
Showing
6 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...e/src/modules/pki-managed-certificates/create-certificate/create-certificate.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
pkiintergration-fe/src/modules/pki-managed-certificates/navi.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 29 additions & 2 deletions
31
...ergration-fe/src/modules/pki-managed-certificates/pki-managed-certificates.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,31 @@ | ||
<c8y-title translate>Managed Certificates - PKI</c8y-title> | ||
<c8y-action-bar-item [placement]="'right'"> | ||
<a class="btn btn-link" (click)="createCertificate()"> <i [c8yIcon]="'plus-circle'"></i> {{ 'Add certificate' }} </a> | ||
|
||
<c8y-action-bar-item itemClass="navbar-form" placement="right"> | ||
<div class="dropdown" dropdown > | ||
<button | ||
type="button" | ||
title="dropdown-toggle" | ||
dropdownToggle | ||
class="btn btn-default dropdown-toggle c8y-dropdown" | ||
> | ||
<span>Add Certificate</span> <span class="caret"></span> | ||
</button> | ||
<ul class="dropdown-menu" *dropdownMenu> | ||
<li> | ||
<button type="button"> | ||
<i c8yicon="cogs" class="dlt-c8y-icon-cogs"></i> | ||
with Cumulocity | ||
</button> | ||
</li> | ||
<li> | ||
<button type="button" (click)="createCertificate()"> | ||
<i c8yIcon="trash" class="dlt-c8y-icon-trash" ></i> | ||
With a connected Device | ||
</button> | ||
</li> | ||
|
||
</ul> | ||
</div> | ||
</c8y-action-bar-item> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
pkiintergration-fe/src/services/create-certificate.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { FetchClient } from '@c8y/client'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class CreateCertificateService { | ||
private options = { | ||
method: 'GET', | ||
headers: { 'Content-Type': 'application/json' } | ||
}; | ||
|
||
constructor(private fetchClient: FetchClient) {} | ||
async getCertificate() { | ||
//Dummy service, there are not available from Backend | ||
const response = await this.fetchClient.fetch('service/certificates', this.options); | ||
if (response.status !== 200) { | ||
throw Error('Wrong status code'); | ||
} | ||
} | ||
} |