ecosystem/packages/deploy-application/deploy-application.component.ts
selector | c8y-deploy-application |
templateUrl | ./deploy-application.component.html |
Properties |
|
Methods |
|
constructor(ecosystemService: EcosystemService, applicationService: ApplicationService, wizardComponent: WizardComponent, translate: TranslateService, pluginsService: PluginsService, inventoryService: InventoryService, gainsightService: GainsightService)
|
||||||||||||||||||||||||
Parameters :
|
cancel |
cancel()
|
Returns :
void
|
Async deployApp |
deployApp()
|
Returns :
any
|
Async fallbackToCloneLatest | ||||
fallbackToCloneLatest(config)
|
||||
Parameters :
Returns :
any
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
onAppVersionSelect | ||||||
onAppVersionSelect(appVersion: IApplicationVersion)
|
||||||
Parameters :
Returns :
void
|
applicationPropertiesForm |
Type : ApplicationPropertiesFormComponent
|
Decorators :
@ViewChild(ApplicationPropertiesFormComponent)
|
Readonly cancelLabel |
Default value : gettext('Cancel')
|
canDeploy |
Type : boolean
|
Default value : false
|
CURRENT_LOCATION |
Default value : location.href
|
deployedWithSuccess |
Type : boolean
|
Default value : false
|
Readonly descriptionTemplate |
Type : string
|
Default value : gettext(
'Deploy application using "{{ packageName }}" package'
)
|
Readonly doneLabel |
Default value : gettext('Done')
|
headerText |
Type : string
|
inProgress |
Type : boolean
|
Default value : true
|
isDeployed |
Type : boolean
|
Default value : false
|
model |
Type : object
|
Default value : {
selected: undefined,
binary: {
id: undefined
}
}
|
newAppConfig |
Type : IApplication
|
onInput |
Type : BehaviorSubject<string>
|
Default value : new BehaviorSubject<string>('')
|
package |
Type : IApplication
|
Readonly successMessageTemplate |
Default value : gettext('Application "{{ packageName }}" created')
|
versions$ |
Type : Observable<IResultList<IApplicationVersion>>
|
<c8y-wizard-header>
<div class="modal-header dialog-header">
<h1 c8yIcon="output"></h1>
<h4>{{ 'Deploy application' | translate }}</h4>
</div>
</c8y-wizard-header>
<c8y-wizard-body>
<ng-container *ngIf="!isDeployed">
<div class="fadeIn animated d-flex a-i-center j-c-center d-col" style="min-height: 309px">
<p
class="bg-white fit-w p-16 text-center text-medium sticky-top bg-white separator-bottom"
*ngIf="!inProgress"
>
{{ headerText | translate }}
</p>
<c8y-application-properties-form
*ngIf="!inProgress"
[application]="newAppConfig"
class="d-block fit-w bg-gray-white"
></c8y-application-properties-form>
<ng-container *ngIf="!inProgress">
<div [ngStyle]="{ padding: '0 16px' }" class="d-block fit-w bg-gray-white">
<label for="packageVersion" translate>Use package version</label>
<c8y-form-group>
<c8y-typeahead
[(ngModel)]="model.selected"
name="packageVersion"
(onSearch)="onInput.next($event)"
placeholder="{{ 'Select or enter' | translate }}"
[displayProperty]="'version'"
[required]="true"
[hideNew]="true"
[container]="'body'"
>
<c8y-li
*c8yFor="let version of versions$; loadMore: 'auto'; notFound: notFoundTemplate"
(click)="onAppVersionSelect(version)"
class="p-l-8 p-r-8 c8y-list__item--link"
[active]="model.selected === version"
>
<c8y-li-icon icon="big-parcel"></c8y-li-icon>
<span
[ngStyle]="{
display: 'flex',
'flex-direction': 'row',
'align-content': 'center',
'justify-content': 'space-between',
'align-items': 'center'
}"
>
<c8y-highlight
[text]="version.version || '--'"
[pattern]="onInput | async"
></c8y-highlight>
<span>
<span *ngFor="let tag of version.tags" class="label label-info m-l-4">
{{ tag }}
</span>
</span>
</span>
</c8y-li>
<ng-template #notFoundTemplate>
<c8y-li
class="bg-gray-lighter p-8"
*ngIf="(onInput | async)?.length > 0 && (versions$ | async)?.data?.length === 0"
>
<span translate>No match found.</span>
</c8y-li>
</ng-template>
</c8y-typeahead>
</c8y-form-group>
</div>
</ng-container>
<c8y-progress-bar
*ngIf="inProgress"
[message]="'Deploying…' | translate"
class="text-center"
></c8y-progress-bar>
</div>
</ng-container>
<ng-container *ngIf="isDeployed">
<div
*ngIf="deployedWithSuccess; else failedDeploy"
class="modal-body fadeIn animated"
style="min-height: 309px"
>
<div class="d-flex a-i-center j-c-center d-col">
<c8y-operation-result
type="success"
[size]="84"
[vertical]="true"
[text]="successMessageTemplate | translate: { packageName: package.name }"
class="lead d-block m-b-16"
></c8y-operation-result>
</div>
</div>
<ng-template #failedDeploy>
<div class="modal-body fadeIn animated text-center" style="min-height: 257px">
<c8y-operation-result
type="error"
[size]="84"
[vertical]="true"
text="{{ 'Application creation failed' | translate }}"
class="lead"
></c8y-operation-result>
</div>
</ng-template>
</ng-container>
</c8y-wizard-body>
<c8y-wizard-footer>
<button
(click)="cancel()"
type="button"
class="btn btn-default"
title="{{ (isDeployed && deployedWithSuccess ? doneLabel : cancelLabel) | translate }}"
>
{{ (isDeployed && deployedWithSuccess ? doneLabel : cancelLabel) | translate }}
</button>
<button
(click)="deployApp()"
*ngIf="!isDeployed"
[disabled]="inProgress || !canDeploy"
[ngClass]="{ 'btn-pending': inProgress }"
class="btn btn-primary"
type="button"
title="{{ 'Deploy' | translate }}"
>
{{ 'Deploy' | translate }}
</button>
</c8y-wizard-footer>