|
|
@ -5,28 +5,33 @@ |
|
|
|
|
|
|
|
|
--> |
|
|
--> |
|
|
@if (!embedded) { |
|
|
@if (!embedded) { |
|
|
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar"> |
|
|
<mat-toolbar color="tb-primary" class="tb-bottom-border"> |
|
|
@if (showBack) { |
|
|
@if (showBack) { |
|
|
<button mat-icon-button (click)="back.emit()" type="button" tabindex="-1"> |
|
|
<button mat-icon-button (click)="back.emit()" type="button"> |
|
|
<mat-icon>arrow_back</mat-icon> |
|
|
<mat-icon class="material-icons">arrow_back</mat-icon> |
|
|
</button> |
|
|
</button> |
|
|
} |
|
|
} |
|
|
<div class="tb-install-wizard-toolbar-content"> |
|
|
<h2>{{ 'agent.app-install-title' | translate }}@if (agent) {: {{ 'agent.app-install-on-agent' | translate: { name: agent?.name } }}}</h2> |
|
|
<h2>{{ 'agent.app-install-title' | translate }}@if (agent) {:}</h2> |
|
|
<span class="flex-1"></span> |
|
|
@if (agent) { |
|
|
|
|
|
<span class="flex-1"> |
|
|
|
|
|
{{ 'agent.app-install-on-agent' | translate: { name: agent?.name } }} |
|
|
|
|
|
</span> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
<div [tb-help]="helpLinkId"></div> |
|
|
<div [tb-help]="helpLinkId"></div> |
|
|
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1"> |
|
|
<button mat-icon-button (click)="cancel()" type="button"> |
|
|
<mat-icon>close</mat-icon> |
|
|
<mat-icon class="material-icons">close</mat-icon> |
|
|
</button> |
|
|
</button> |
|
|
</mat-toolbar> |
|
|
</mat-toolbar> |
|
|
} |
|
|
} |
|
|
|
|
|
@if (embedded) { |
|
|
|
|
|
<ng-container [ngTemplateOutlet]="body"></ng-container> |
|
|
|
|
|
<ng-container [ngTemplateOutlet]="actions"></ng-container> |
|
|
|
|
|
} @else { |
|
|
|
|
|
<div mat-dialog-content> |
|
|
|
|
|
<ng-container [ngTemplateOutlet]="body"></ng-container> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div mat-dialog-actions> |
|
|
|
|
|
<ng-container [ngTemplateOutlet]="actions"></ng-container> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
<div mat-dialog-content class="tb-install-wizard-body" [class.tb-install-wizard-embedded]="embedded"> |
|
|
<ng-template #body> |
|
|
|
|
|
|
|
|
@if (checkingManaged) { |
|
|
@if (checkingManaged) { |
|
|
<div class="loading-state"> |
|
|
<div class="loading-state"> |
|
|
@ -35,7 +40,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@if (!checkingManaged && managedApp) { |
|
|
@if (!checkingManaged && managedApp) { |
|
|
<div class="managed-block"> |
|
|
<div class="managed-block p-6"> |
|
|
<tb-agent-deploy-status |
|
|
<tb-agent-deploy-status |
|
|
[agent]="managedAgent" |
|
|
[agent]="managedAgent" |
|
|
[application]="managedApp" |
|
|
[application]="managedApp" |
|
|
@ -43,17 +48,11 @@ |
|
|
(goToAgentApplication)="goToAgentApplication()" |
|
|
(goToAgentApplication)="goToAgentApplication()" |
|
|
(goToAgentEvents)="goToAgentEvents()"> |
|
|
(goToAgentEvents)="goToAgentEvents()"> |
|
|
</tb-agent-deploy-status> |
|
|
</tb-agent-deploy-status> |
|
|
<div class="step-footer"> |
|
|
|
|
|
<span class="flex-1"></span> |
|
|
|
|
|
@if (!embedded) { |
|
|
|
|
|
<button mat-button (click)="cancel()">{{ 'action.close' | translate }}</button> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@if (selectAgent && !embedded && !checkingManaged && !managedApp) { |
|
|
@if (selectAgent && !embedded && !checkingManaged && !managedApp) { |
|
|
<div class="tb-form-hint tb-primary-fill mb-4"> |
|
|
<div class="tb-form-hint tb-primary-fill mx-6 mt-4"> |
|
|
<mat-icon>info_outline</mat-icon> |
|
|
<mat-icon>info_outline</mat-icon> |
|
|
<span translate>agent.deploy-via-agent-desc</span> |
|
|
<span translate>agent.deploy-via-agent-desc</span> |
|
|
</div> |
|
|
</div> |
|
|
@ -62,302 +61,292 @@ |
|
|
@if (!checkingManaged && !managedApp) { |
|
|
@if (!checkingManaged && !managedApp) { |
|
|
<mat-stepper linear #stepper |
|
|
<mat-stepper linear #stepper |
|
|
[class.tb-steps-locked]="!!installedApplication" |
|
|
[class.tb-steps-locked]="!!installedApplication" |
|
|
|
|
|
(selectionChange)="selectedIndex = $event.selectedIndex" |
|
|
[orientation]="(stepperOrientation | async)" |
|
|
[orientation]="(stepperOrientation | async)" |
|
|
[labelPosition]="(stepperLabelPosition | async)"> |
|
|
[labelPosition]="(stepperLabelPosition | async)"> |
|
|
@if (selectAgent) { |
|
|
@for (step of steps; track step) { |
|
|
<mat-step [label]="'agent.deploy-select-agent-step' | translate" |
|
|
@switch (step) { |
|
|
[completed]="canProceedFromAgent()" |
|
|
@case ('agent') { |
|
|
[editable]="!installedApplication"> |
|
|
<mat-step [label]="stepLabels[step] | translate" |
|
|
<p class="hint" translate>agent.deploy-intro</p> |
|
|
[completed]="canProceedFromAgent()" |
|
|
<tb-agent-autocomplete |
|
|
[editable]="!installedApplication"> |
|
|
[ngModel]="agent" |
|
|
<p class="hint" translate>agent.deploy-intro</p> |
|
|
(ngModelChange)="onSelectedAgentChange($event)"> |
|
|
<tb-agent-autocomplete |
|
|
</tb-agent-autocomplete> |
|
|
[ngModel]="agent" |
|
|
<div class="step-footer"> |
|
|
(ngModelChange)="onSelectedAgentChange($event)"> |
|
|
<button mat-raised-button color="primary" matStepperNext [disabled]="!canProceedFromAgent()"> |
|
|
</tb-agent-autocomplete> |
|
|
{{ 'action.next' | translate }} |
|
|
</mat-step> |
|
|
<mat-icon iconPositionEnd>chevron_right</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</mat-step> |
|
|
|
|
|
} |
|
|
|
|
|
@if (!lockedType) { |
|
|
|
|
|
<mat-step [label]="'agent.app-install-step1' | translate"> |
|
|
|
|
|
<p class="hint" translate>agent.app-install-pick-type</p> |
|
|
|
|
|
<div class="type-cards"> |
|
|
|
|
|
@for (card of typeCards; track card.type) { |
|
|
|
|
|
<button type="button" class="type-card" |
|
|
|
|
|
[class.selected]="selectedType === card.type" |
|
|
|
|
|
[disabled]="isTypeDisabled(card.type)" |
|
|
|
|
|
[attr.aria-pressed]="selectedType === card.type" |
|
|
|
|
|
(click)="selectType(card.type)"> |
|
|
|
|
|
<mat-icon>{{ card.icon }}</mat-icon> |
|
|
|
|
|
<h4>{{ card.labelKey | translate }}</h4> |
|
|
|
|
|
<p>{{ (unavailableTypes.has(card.type) ? 'agent.app-type-unavailable' : card.descKey) | translate }}</p> |
|
|
|
|
|
</button> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
@if (loadingTemplate) { |
|
|
|
|
|
<div class="loading-state"> |
|
|
|
|
|
<mat-spinner diameter="20"></mat-spinner> |
|
|
|
|
|
<span translate>agent.app-install-loading-template</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
} |
|
|
@if (loadError) { |
|
|
@case ('type') { |
|
|
<div class="error-state"> |
|
|
<mat-step [label]="stepLabels[step] | translate" [completed]="canProceedFromType()"> |
|
|
<mat-icon>error_outline</mat-icon> |
|
|
<p class="hint" translate>agent.app-install-pick-type</p> |
|
|
<span>{{ loadError }}</span> |
|
|
<div class="type-cards"> |
|
|
</div> |
|
|
@for (card of typeCards; track card.type) { |
|
|
|
|
|
<button type="button" class="type-card" |
|
|
|
|
|
[class.selected]="selectedType === card.type" |
|
|
|
|
|
[disabled]="isTypeDisabled(card.type)" |
|
|
|
|
|
[attr.aria-pressed]="selectedType === card.type" |
|
|
|
|
|
(click)="selectType(card.type)"> |
|
|
|
|
|
<mat-icon>{{ card.icon }}</mat-icon> |
|
|
|
|
|
<h4>{{ card.labelKey | translate }}</h4> |
|
|
|
|
|
<p>{{ (unavailableTypes.has(card.type) ? 'agent.app-type-unavailable' : card.descKey) | translate }}</p> |
|
|
|
|
|
</button> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
@if (loadingTemplate) { |
|
|
|
|
|
<div class="loading-state"> |
|
|
|
|
|
<mat-spinner diameter="20"></mat-spinner> |
|
|
|
|
|
<span translate>agent.app-install-loading-template</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
@if (loadError) { |
|
|
|
|
|
<div class="error-state"> |
|
|
|
|
|
<mat-icon>error_outline</mat-icon> |
|
|
|
|
|
<span>{{ loadError }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
</mat-step> |
|
|
} |
|
|
} |
|
|
<div class="step-footer"> |
|
|
@case ('config') { |
|
|
@if (selectAgent) { |
|
|
<mat-step [label]="stepLabels[step] | translate" [completed]="canSubmit() || !!installedApplication" |
|
|
<button mat-button matStepperPrevious> |
|
|
[editable]="!installedApplication"> |
|
|
<mat-icon>chevron_left</mat-icon> |
|
|
<div class="config-toggle"> |
|
|
{{ 'action.back' | translate }} |
|
|
<tb-toggle-select class="xs:w-full" [(ngModel)]="useProfile" (ngModelChange)="toggleUseProfile($event)" appearance="fill" disablePagination> |
|
|
</button> |
|
|
<tb-toggle-option [value]="true">{{ 'agent.app-install-from-profile' | translate }}</tb-toggle-option> |
|
|
} |
|
|
<tb-toggle-option [value]="false">{{ 'agent.app-install-custom-config' | translate }}</tb-toggle-option> |
|
|
<button mat-raised-button color="primary" matStepperNext [disabled]="!canProceedFromType()"> |
|
|
</tb-toggle-select> |
|
|
{{ 'action.next' | translate }} |
|
|
</div> |
|
|
<mat-icon iconPositionEnd>chevron_right</mat-icon> |
|
|
<mat-form-field class="mat-block" appearance="outline"> |
|
|
</button> |
|
|
<mat-label translate>agent.app-install-name</mat-label> |
|
|
</div> |
|
|
<input matInput [(ngModel)]="appName" required> |
|
|
</mat-step> |
|
|
</mat-form-field> |
|
|
} |
|
|
@if (canHaveRelatedEntity) { |
|
|
<mat-step [label]="'agent.app-install-step3' | translate" [editable]="!installedApplication"> |
|
|
<tb-agent-related-entity-autocomplete |
|
|
<div class="config-toggle"> |
|
|
[appType]="selectedType" |
|
|
<tb-toggle-select [(ngModel)]="useProfile" (ngModelChange)="toggleUseProfile($event)" appearance="fill" disablePagination> |
|
|
[disabled]="!!lockedRelatedEntity" |
|
|
<tb-toggle-option [value]="true">{{ 'agent.app-install-from-profile' | translate }}</tb-toggle-option> |
|
|
[required]="relatedEntityRequired" |
|
|
<tb-toggle-option [value]="false">{{ 'agent.app-install-custom-config' | translate }}</tb-toggle-option> |
|
|
allowCreate |
|
|
</tb-toggle-select> |
|
|
[ngModel]="relatedEntityId" |
|
|
</div> |
|
|
(ngModelChange)="relatedEntityId = $event; onRelatedEntityChange($event)" |
|
|
<mat-form-field class="mat-block" appearance="outline"> |
|
|
(relatedEntityNameChange)="onRelatedEntityName($event)"> |
|
|
<mat-label translate>agent.app-install-name</mat-label> |
|
|
</tb-agent-related-entity-autocomplete> |
|
|
<input matInput [(ngModel)]="appName" required> |
|
|
} |
|
|
</mat-form-field> |
|
|
@if (useProfile && typesWithoutTemplates.has(selectedType)) { |
|
|
@if (canHaveRelatedEntity) { |
|
|
<div class="tb-form-hint tb-primary-fill tb-form-hint-warning mb-4"> |
|
|
<tb-agent-related-entity-autocomplete |
|
|
<mat-icon>warning_amber</mat-icon> |
|
|
[appType]="selectedType" |
|
|
<span translate>agent.app-no-templates</span> |
|
|
[disabled]="!!lockedRelatedEntity" |
|
|
</div> |
|
|
[required]="relatedEntityRequired" |
|
|
} |
|
|
allowCreate |
|
|
@if (useProfile) { |
|
|
[ngModel]="relatedEntityId" |
|
|
<mat-form-field class="mat-block" appearance="outline" [formGroup]="profileSelectFormGroup"> |
|
|
(ngModelChange)="relatedEntityId = $event; onRelatedEntityChange($event)" |
|
|
<mat-label translate>agent.app-install-select-profile</mat-label> |
|
|
(relatedEntityNameChange)="onRelatedEntityName($event)"> |
|
|
<input matInput type="text" required |
|
|
</tb-agent-related-entity-autocomplete> |
|
|
#profileInput |
|
|
} |
|
|
formControlName="profile" |
|
|
@if (useProfile && typesWithoutTemplates.has(selectedType)) { |
|
|
[matAutocomplete]="profileAutocomplete"> |
|
|
<div class="tb-form-hint tb-primary-fill tb-form-hint-warning mb-4"> |
|
|
@if (profileSelectFormGroup.get('profile').value) { |
|
|
<mat-icon>warning_amber</mat-icon> |
|
|
<button type="button" |
|
|
<span translate>agent.app-no-templates</span> |
|
|
matSuffix mat-icon-button aria-label="Clear" |
|
|
</div> |
|
|
(click)="clearProfile()"> |
|
|
} |
|
|
<mat-icon class="material-icons">close</mat-icon> |
|
|
@if (useProfile) { |
|
|
</button> |
|
|
<mat-form-field class="mat-block" appearance="outline" [formGroup]="profileSelectFormGroup"> |
|
|
} |
|
|
<mat-label translate>agent.app-install-select-profile</mat-label> |
|
|
@if (!profileSelectFormGroup.get('profile').value && canCreateProfileForType) { |
|
|
<input matInput type="text" required |
|
|
<button |
|
|
#profileInput |
|
|
mat-button color="primary" matSuffix type="button" |
|
|
formControlName="profile" |
|
|
(mousedown)="$event.preventDefault()" |
|
|
[matAutocomplete]="profileAutocomplete"> |
|
|
(click)="createProfile($event)"> |
|
|
@if (profileSelectFormGroup.get('profile').value) { |
|
|
<span style="white-space: nowrap">{{ 'agent.deploy-create-new' | translate }}</span> |
|
|
<button type="button" |
|
|
</button> |
|
|
matSuffix mat-icon-button aria-label="Clear" |
|
|
} |
|
|
(click)="clearProfile()"> |
|
|
<mat-autocomplete class="tb-autocomplete" |
|
|
<mat-icon class="material-icons">close</mat-icon> |
|
|
#profileAutocomplete="matAutocomplete" |
|
|
</button> |
|
|
[displayWith]="displayProfileFn"> |
|
|
} |
|
|
@if (filteredProfiles | async; as profiles) { |
|
|
@if (!profileSelectFormGroup.get('profile').value && canCreateProfileForType) { |
|
|
@for (p of profiles; track trackKey(p)) { |
|
|
<button |
|
|
<mat-option [value]="p" class="tb-profile-option" |
|
|
mat-button color="primary" matSuffix type="button" |
|
|
[matTooltip]="isVirtualProfile(p) ? ('agent.app-install-virtual-profile-hint' | translate) : ''" |
|
|
(mousedown)="$event.preventDefault()" |
|
|
matTooltipPosition="right"> |
|
|
(click)="createProfile($event)"> |
|
|
<span>{{ p.name }}</span> |
|
|
<span style="white-space: nowrap">{{ 'agent.deploy-create-new' | translate }}</span> |
|
|
@if (isVirtualProfile(p)) { |
|
|
</button> |
|
|
<span class="tb-virtual-profile-badge">{{ 'agent.app-install-virtual-profile-badge' | translate }}</span> |
|
|
} |
|
|
} |
|
|
<mat-autocomplete class="tb-autocomplete" |
|
|
@if (!isVirtualProfile(p) && p.templateVersion) { |
|
|
#profileAutocomplete="matAutocomplete" |
|
|
<span class="tb-profile-template-version">{{ profileTemplateLabel(p) }}</span> |
|
|
[displayWith]="displayProfileFn"> |
|
|
} |
|
|
@if (filteredProfiles | async; as profiles) { |
|
|
</mat-option> |
|
|
@for (p of profiles; track trackKey(p)) { |
|
|
} |
|
|
<mat-option [value]="p" class="tb-profile-option" |
|
|
@if (!profiles.length) { |
|
|
[matTooltip]="isVirtualProfile(p) ? ('agent.app-install-virtual-profile-hint' | translate) : ''" |
|
|
<mat-option [value]="null" disabled class="tb-not-found"> |
|
|
matTooltipPosition="right"> |
|
|
<div class="tb-not-found-content"> |
|
|
<span>{{ p.name }}</span> |
|
|
<span translate>agent.app-install-no-profiles</span> |
|
|
@if (isVirtualProfile(p)) { |
|
|
</div> |
|
|
<span class="tb-virtual-profile-badge">{{ 'agent.app-install-virtual-profile-badge' | translate }}</span> |
|
|
</mat-option> |
|
|
} |
|
|
} |
|
|
@if (!isVirtualProfile(p) && p.templateVersion) { |
|
|
|
|
|
<span class="tb-profile-template-version">{{ profileTemplateLabel(p) }}</span> |
|
|
|
|
|
} |
|
|
} |
|
|
</mat-option> |
|
|
</mat-autocomplete> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
} |
|
|
|
|
|
@if (loadingProfiles) { |
|
|
|
|
|
<div class="loading-state"> |
|
|
|
|
|
<mat-spinner diameter="20"></mat-spinner> |
|
|
|
|
|
<span translate>agent.app-install-loading-template</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
<tb-agent-app-step-inputs [bindings]="bindings"></tb-agent-app-step-inputs> |
|
|
|
|
|
@if (useProfile && selectedProfile && !isVirtualProfile(selectedProfile)) { |
|
|
|
|
|
<div class="tb-compare-actions"> |
|
|
|
|
|
<button mat-stroked-button color="primary" type="button" (click)="openEditProfile()"> |
|
|
|
|
|
<mat-icon>edit</mat-icon> |
|
|
|
|
|
<span>{{ 'agent.app-update-edit-profile' | translate }}</span> |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
@if (useProfile && selectedProfile) { |
|
|
|
|
|
<mat-expansion-panel class="tb-compose-panel"> |
|
|
|
|
|
<mat-expansion-panel-header> |
|
|
|
|
|
<mat-panel-title translate>agent.app-install-yaml</mat-panel-title> |
|
|
|
|
|
</mat-expansion-panel-header> |
|
|
|
|
|
<ng-template matExpansionPanelContent> |
|
|
|
|
|
<tb-agent-compose-editor [value]="composeYaml" [readOnly]="useProfile && !!selectedProfile"></tb-agent-compose-editor> |
|
|
|
|
|
</ng-template> |
|
|
|
|
|
</mat-expansion-panel> |
|
|
|
|
|
} |
|
|
|
|
|
@if (mergeError) { |
|
|
|
|
|
<div class="error-state"> |
|
|
|
|
|
<mat-icon>error_outline</mat-icon> |
|
|
|
|
|
<span>{{ mergeError }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
@if (!useProfile && !template && loadError) { |
|
|
|
|
|
<div class="error-state"> |
|
|
|
|
|
<mat-icon>error_outline</mat-icon> |
|
|
|
|
|
<span>{{ loadError }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} @else if (!useProfile) { |
|
|
|
|
|
@if (composeTypeKeys.length > 1) { |
|
|
|
|
|
<mat-form-field class="mat-block" appearance="outline"> |
|
|
|
|
|
<mat-label translate>agent.app-compose-template-select</mat-label> |
|
|
|
|
|
<mat-select [value]="composeType" (selectionChange)="onComposeTypeChange($event.value)"> |
|
|
|
|
|
@for (key of composeTypeKeys; track key) { |
|
|
|
|
|
<mat-option [value]="key"> |
|
|
|
|
|
{{ composeTypeLabel(key) }} |
|
|
|
|
|
</mat-option> |
|
|
|
|
|
} |
|
|
|
|
|
</mat-select> |
|
|
|
|
|
</mat-form-field> |
|
|
} |
|
|
} |
|
|
@if (!profiles.length) { |
|
|
@if (relatedEntityId) { |
|
|
<mat-option [value]="null" disabled class="tb-not-found"> |
|
|
<div class="tb-form-hint tb-primary-fill mb-4"> |
|
|
<div class="tb-not-found-content"> |
|
|
<mat-icon>info_outline</mat-icon> |
|
|
<span translate>agent.app-install-no-profiles</span> |
|
|
<span translate>agent.app-compose-creds-overridden-hint</span> |
|
|
</div> |
|
|
</div> |
|
|
</mat-option> |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
<div class="diff-header-row"> |
|
|
|
|
|
<div class="diff-header added" translate>agent.app-install-diff-template</div> |
|
|
|
|
|
<div class="diff-header removed" translate>agent.app-install-diff-editable</div> |
|
|
|
|
|
<button type="button" class="diff-sync-toggle" |
|
|
|
|
|
[class.active]="diffSyncScroll" |
|
|
|
|
|
[matTooltip]="'agent.app-diff-sync-scroll' | translate" |
|
|
|
|
|
(click)="diffSyncScroll = !diffSyncScroll"> |
|
|
|
|
|
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml" [syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff> |
|
|
|
|
|
<p class="diff-hint" translate>agent.app-install-diff-hint</p> |
|
|
} |
|
|
} |
|
|
</mat-autocomplete> |
|
|
</mat-step> |
|
|
</mat-form-field> |
|
|
} |
|
|
} |
|
|
@case ('summary') { |
|
|
@if (loadingProfiles) { |
|
|
<mat-step [label]="stepLabels[step] | translate" [completed]="!!installedApplication" |
|
|
<div class="loading-state"> |
|
|
[editable]="!installedApplication"> |
|
|
<mat-spinner diameter="20"></mat-spinner> |
|
|
<div class="summary-card"> |
|
|
<span translate>agent.app-install-loading-template</span> |
|
|
<div class="summary-row"> |
|
|
</div> |
|
|
<span class="label" translate>agent.app-name</span> |
|
|
} |
|
|
<span class="value">{{ appName }}</span> |
|
|
<tb-agent-app-step-inputs [bindings]="bindings"></tb-agent-app-step-inputs> |
|
|
</div> |
|
|
@if (useProfile && selectedProfile && !isVirtualProfile(selectedProfile)) { |
|
|
<div class="summary-row"> |
|
|
<div class="tb-compare-actions"> |
|
|
<span class="label" translate>agent.app-type</span> |
|
|
<button mat-stroked-button color="primary" type="button" (click)="openEditProfile()"> |
|
|
<span class="value"><span class="tb-type-badge" |
|
|
<mat-icon>edit</mat-icon> |
|
|
[class.edge]="selectedType === 'EDGE'" |
|
|
<span>{{ 'agent.app-update-edit-profile' | translate }}</span> |
|
|
[class.gateway]="selectedType === 'GATEWAY'" |
|
|
</button> |
|
|
[class.generic]="selectedType === 'GENERIC'">{{ selectedType }}</span></span> |
|
|
</div> |
|
|
</div> |
|
|
} |
|
|
@if (template) { |
|
|
@if (useProfile && selectedProfile) { |
|
|
<div class="summary-row"> |
|
|
<mat-expansion-panel class="tb-compose-panel"> |
|
|
<span class="label" translate>agent.app-template</span> |
|
|
<mat-expansion-panel-header> |
|
|
<span class="value">{{ template.appType }} {{ template.currentVersion }}</span> |
|
|
<mat-panel-title translate>agent.app-install-yaml</mat-panel-title> |
|
|
</div> |
|
|
</mat-expansion-panel-header> |
|
|
|
|
|
<ng-template matExpansionPanelContent> |
|
|
|
|
|
<tb-agent-compose-editor [value]="composeYaml" [readOnly]="useProfile && !!selectedProfile"></tb-agent-compose-editor> |
|
|
|
|
|
</ng-template> |
|
|
|
|
|
</mat-expansion-panel> |
|
|
|
|
|
} |
|
|
|
|
|
@if (mergeError) { |
|
|
|
|
|
<div class="error-state"> |
|
|
|
|
|
<mat-icon>error_outline</mat-icon> |
|
|
|
|
|
<span>{{ mergeError }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
@if (!useProfile && !template && loadError) { |
|
|
|
|
|
<div class="error-state"> |
|
|
|
|
|
<mat-icon>error_outline</mat-icon> |
|
|
|
|
|
<span>{{ loadError }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} @else if (!useProfile) { |
|
|
|
|
|
@if (composeTypeKeys.length > 1) { |
|
|
|
|
|
<mat-form-field class="mat-block" appearance="outline"> |
|
|
|
|
|
<mat-label translate>agent.app-compose-template-select</mat-label> |
|
|
|
|
|
<mat-select [value]="composeType" (selectionChange)="onComposeTypeChange($event.value)"> |
|
|
|
|
|
@for (key of composeTypeKeys; track key) { |
|
|
|
|
|
<mat-option [value]="key"> |
|
|
|
|
|
{{ composeTypeLabel(key) }} |
|
|
|
|
|
</mat-option> |
|
|
|
|
|
} |
|
|
} |
|
|
</mat-select> |
|
|
@if (useProfile && selectedProfile) { |
|
|
</mat-form-field> |
|
|
<div class="summary-row"> |
|
|
|
|
|
<span class="label" translate>agent.app-install-select-profile</span> |
|
|
|
|
|
<span class="value">{{ selectedProfile.name }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
@if (agent) { |
|
|
|
|
|
<div class="summary-row"> |
|
|
|
|
|
<span class="label" translate>agent.agents</span> |
|
|
|
|
|
<span class="value">{{ agent.name }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="tb-form-hint tb-primary-fill mb-4"> |
|
|
|
|
|
<mat-icon>info_outline</mat-icon> |
|
|
|
|
|
<span translate>agent.app-install-confirm-info</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</mat-step> |
|
|
} |
|
|
} |
|
|
@if (relatedEntityId) { |
|
|
@case ('deploy') { |
|
|
<div class="tb-form-hint tb-primary-fill mb-4"> |
|
|
<mat-step [label]="stepLabels[step] | translate"> |
|
|
<mat-icon>info_outline</mat-icon> |
|
|
<tb-agent-deploy-status |
|
|
<span translate>agent.app-compose-creds-overridden-hint</span> |
|
|
[agent]="agent" |
|
|
</div> |
|
|
[application]="installedApplication" |
|
|
|
|
|
(goToAgent)="goToAgent()" |
|
|
|
|
|
(goToAgentApplication)="goToAgentApplication()" |
|
|
|
|
|
(goToAgentEvents)="goToAgentEvents()"> |
|
|
|
|
|
</tb-agent-deploy-status> |
|
|
|
|
|
</mat-step> |
|
|
} |
|
|
} |
|
|
<div class="diff-header-row"> |
|
|
|
|
|
<div class="diff-header added" translate>agent.app-install-diff-template</div> |
|
|
|
|
|
<div class="diff-header removed" translate>agent.app-install-diff-editable</div> |
|
|
|
|
|
<button type="button" class="diff-sync-toggle" |
|
|
|
|
|
[class.active]="diffSyncScroll" |
|
|
|
|
|
[matTooltip]="'agent.app-diff-sync-scroll' | translate" |
|
|
|
|
|
(click)="diffSyncScroll = !diffSyncScroll"> |
|
|
|
|
|
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml" [syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff> |
|
|
|
|
|
<p class="diff-hint" translate>agent.app-install-diff-hint</p> |
|
|
|
|
|
} |
|
|
} |
|
|
<div class="step-footer"> |
|
|
|
|
|
@if (!installedApplication) { |
|
|
|
|
|
<button mat-button matStepperPrevious [disabled]="submitting"> |
|
|
|
|
|
<mat-icon>chevron_left</mat-icon> |
|
|
|
|
|
{{ 'action.back' | translate }} |
|
|
|
|
|
</button> |
|
|
|
|
|
} |
|
|
|
|
|
<button mat-raised-button color="primary" matStepperNext [disabled]="!canSubmit()"> |
|
|
|
|
|
{{ 'action.next' | translate }} |
|
|
|
|
|
<mat-icon iconPositionEnd>chevron_right</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</mat-step> |
|
|
|
|
|
<mat-step [label]="'agent.app-install-step4' | translate" [completed]="!!installedApplication" |
|
|
|
|
|
[editable]="!installedApplication"> |
|
|
|
|
|
<div class="summary-card"> |
|
|
|
|
|
<div class="summary-row"> |
|
|
|
|
|
<span class="label" translate>agent.app-name</span> |
|
|
|
|
|
<span class="value">{{ appName }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="summary-row"> |
|
|
|
|
|
<span class="label" translate>agent.app-type</span> |
|
|
|
|
|
<span class="value"><span class="tb-type-badge" |
|
|
|
|
|
[class.edge]="selectedType === 'EDGE'" |
|
|
|
|
|
[class.gateway]="selectedType === 'GATEWAY'" |
|
|
|
|
|
[class.generic]="selectedType === 'GENERIC'">{{ selectedType }}</span></span> |
|
|
|
|
|
</div> |
|
|
|
|
|
@if (template) { |
|
|
|
|
|
<div class="summary-row"> |
|
|
|
|
|
<span class="label" translate>agent.app-template</span> |
|
|
|
|
|
<span class="value">{{ template.appType }} {{ template.currentVersion }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
@if (useProfile && selectedProfile) { |
|
|
|
|
|
<div class="summary-row"> |
|
|
|
|
|
<span class="label" translate>agent.app-install-select-profile</span> |
|
|
|
|
|
<span class="value">{{ selectedProfile.name }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
@if (agent) { |
|
|
|
|
|
<div class="summary-row"> |
|
|
|
|
|
<span class="label" translate>agent.agents</span> |
|
|
|
|
|
<span class="value">{{ agent.name }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="tb-form-hint tb-primary-fill mb-4"> |
|
|
|
|
|
<mat-icon>info_outline</mat-icon> |
|
|
|
|
|
<span translate>agent.app-install-confirm-info</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="step-footer"> |
|
|
|
|
|
@if (!installedApplication) { |
|
|
|
|
|
<button mat-button matStepperPrevious [disabled]="submitting"> |
|
|
|
|
|
<mat-icon>chevron_left</mat-icon> |
|
|
|
|
|
{{ 'action.back' | translate }} |
|
|
|
|
|
</button> |
|
|
|
|
|
} |
|
|
|
|
|
@if (!installedApplication) { |
|
|
|
|
|
<button mat-raised-button color="primary" |
|
|
|
|
|
(click)="submit()" [disabled]="!canSubmit()"> |
|
|
|
|
|
<mat-icon>save</mat-icon> |
|
|
|
|
|
<span>{{ 'agent.app-install-cta' | translate }}</span> |
|
|
|
|
|
</button> |
|
|
|
|
|
} |
|
|
|
|
|
@if (installedApplication) { |
|
|
|
|
|
<button mat-raised-button color="primary" matStepperNext> |
|
|
|
|
|
{{ 'action.next' | translate }} |
|
|
|
|
|
<mat-icon iconPositionEnd>chevron_right</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
</mat-step> |
|
|
|
|
|
@if (selectAgent) { |
|
|
|
|
|
<mat-step [label]="'agent.deploy-install-step' | translate"> |
|
|
|
|
|
<tb-agent-deploy-status |
|
|
|
|
|
[agent]="agent" |
|
|
|
|
|
[application]="installedApplication" |
|
|
|
|
|
(goToAgent)="goToAgent()" |
|
|
|
|
|
(goToAgentApplication)="goToAgentApplication()" |
|
|
|
|
|
(goToAgentEvents)="goToAgentEvents()"> |
|
|
|
|
|
</tb-agent-deploy-status> |
|
|
|
|
|
<div class="step-footer"> |
|
|
|
|
|
<span class="flex-1"></span> |
|
|
|
|
|
@if (!embedded) { |
|
|
|
|
|
<button mat-button (click)="cancel()">{{ 'action.close' | translate }}</button> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
</mat-step> |
|
|
|
|
|
} |
|
|
} |
|
|
</mat-stepper> |
|
|
</mat-stepper> |
|
|
} |
|
|
} |
|
|
</div> |
|
|
</ng-template> |
|
|
|
|
|
|
|
|
|
|
|
<ng-template #actions> |
|
|
|
|
|
@if (!checkingManaged && !managedApp && (canGoBack() || showNext())) { |
|
|
|
|
|
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end"> |
|
|
|
|
|
@if (canGoBack()) { |
|
|
|
|
|
<button mat-stroked-button |
|
|
|
|
|
[disabled]="submitting" |
|
|
|
|
|
(click)="stepper.previous()">{{ 'action.back' | translate }}</button> |
|
|
|
|
|
} |
|
|
|
|
|
<span class="flex-1"></span> |
|
|
|
|
|
@if (showNext()) { |
|
|
|
|
|
<button mat-stroked-button |
|
|
|
|
|
color="primary" |
|
|
|
|
|
[disabled]="!canGoNext()" |
|
|
|
|
|
(click)="stepper.next()">{{ 'action.next-with-label' | translate: { label: (nextStepLabel() | translate) } }}</button> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
@if (!embedded || canInstall()) { |
|
|
|
|
|
<mat-divider class="w-full"></mat-divider> |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
@if (!embedded || canInstall()) { |
|
|
|
|
|
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end gap-2"> |
|
|
|
|
|
@if (!embedded) { |
|
|
|
|
|
<button mat-button |
|
|
|
|
|
[disabled]="submitting" |
|
|
|
|
|
(click)="cancel()">{{ (managedApp || installedApplication ? 'action.close' : 'action.cancel') | translate }}</button> |
|
|
|
|
|
} |
|
|
|
|
|
@if (canInstall()) { |
|
|
|
|
|
<button mat-raised-button |
|
|
|
|
|
color="primary" |
|
|
|
|
|
[disabled]="currentStep() !== 'summary' || !canSubmit()" |
|
|
|
|
|
(click)="submit()">{{ 'agent.app-install-cta' | translate }}</button> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
</ng-template> |
|
|
|