ecosystem/license-confirm/license-view.component.ts
OnInit
selector | c8y-license-view |
imports |
NgIf
IconDirective
C8yTranslateDirective
C8yTranslatePipe
|
templateUrl | ./license-view.component.html |
Properties |
Methods |
|
Inputs |
constructor(fetchClient: FetchClient)
|
||||||
Parameters :
|
name |
Type : string
|
url |
Type : string
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
content |
Type : string
|
Default value : gettext('Loading license content…')
|
FALL_BACK_URL |
Type : string
|
Default value : 'https://spdx.org/licenses/'
|
<ng-container *ngIf="content">
<a [href]="url" target="_blank" rel="noopener noreferrer" class="small pull-right">
<i c8yIcon="external-link" class="m-r-4"></i>
<span translate>Open in new window</span>
</a>
<textarea
[attr.aria-label]="'License' | translate"
class="form-control bg-level-1 text-monospace small m-b-16"
readonly
style="height: 170px"
[textContent]="content"
></textarea>
</ng-container>
<div class="alert alert-warning" role="alert" *ngIf="!content && name">
<strong translate>No license attached</strong>
<p translate>
The author of the package hasn't included a license file in a format that can be displayed.
Verify the license online, for example, with a website like:
</p>
<a [href]="FALL_BACK_URL + name" target="_blank" rel="noopener noreferrer">
{{ FALL_BACK_URL }}{{ name }}
</a>
</div>
<div class="alert alert-danger" role="alert" *ngIf="!content && !name">
<strong translate>No license found</strong>
<p translate>
There is no license attached to this package. You can continue installing it at your own risk.
</p>
</div>