Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

157 add view for application deployment parameters #181

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ <h4 style="text-align: center">{{'APP_INSTANCES.MANUAL_UPDATE.HEADER' | translat
</div>
</div>
<div class="nmaas-modal-footer">
<button type="button" class="btn btn-primary " [disabled]="appVersions.length === 0 || selectedVersion === ''"
<button type="button" class="btn btn-primary "
[disabled]="appVersions.length === 0 || selectedVersion === ''"
(click)="this.manualUpdateVersion()">{{'APP_INSTANCES.MANUAL_UPDATE.YES_BUTTON' | translate}}</button>
<button type="button" class="btn btn-danger"
(click)="this.manualUpdateModal.hide()">{{'UNDEPLOY_MODAL.CANCEL_BUTTON' | translate}}</button>
Expand Down Expand Up @@ -434,8 +435,10 @@ <h4>{{'DISABLE_AUTO_UPGRADES_MODAL.HEADER' | translate}}</h4>
[upgradeInfo]="appInstance?.upgradeInfo"></nmaas-modal-app-upgrade>

<!-- App access methods modal -->
<app-access-methods-modal *ngIf="appInstance?.serviceAccessMethods"
[accessMethods]="appInstance?.serviceAccessMethods"></app-access-methods-modal>
<app-access-methods-modal
*ngIf="appInstance?.serviceAccessMethods"
[accessMethods]="appInstance?.serviceAccessMethods"
[deployParameters$]="deployParameters$"></app-access-methods-modal>

<!-- Add members modal -->
<app-add-members-modal *ngIf="appInstance" [appInstance]="appInstance"></app-add-members-modal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {AppInstanceStateHistory} from '../../../model/app-instance-state-history
import {ModalComponent, RateComponent} from '../../../shared';
import {AppConfiguration} from '../../../model/app-configuration';
import {LOCAL_STORAGE, StorageService} from 'ngx-webstorage-service';
import {interval} from 'rxjs';
import {BehaviorSubject, interval} from 'rxjs';
import {TranslateService} from '@ngx-translate/core';
import {SessionService} from '../../../service/session.service';
import {LocalDatePipe} from '../../../pipe/local-date.pipe';
Expand Down Expand Up @@ -130,6 +130,9 @@ export class AppInstanceComponent implements OnInit, OnDestroy {
public appVersions: ApplicationVersion[] = [];
public selectedVersion = '';

private deployParametersSubject = new BehaviorSubject<Map<string, string>>(new Map<string, string>());
public deployParameters$ = this.deployParametersSubject.asObservable();

constructor(private appsService: AppsService,
public appImagesService: AppImagesService,
private appInstanceService: AppInstanceService,
Expand Down Expand Up @@ -177,6 +180,10 @@ export class AppInstanceComponent implements OnInit, OnDestroy {
property: 'form',
value: this.addValidationToConfigurationTemplateSpecificElement({key: 'storageSpace'}, validation),
});

this.appInstanceService.getDeploymentParameters(this.appInstanceId).subscribe(
deployParams => this.deployParametersSubject.next(deployParams)
)
},
err => {
console.error(err);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,76 +1,103 @@
<nmaas-modal [styleModal]="'info'">
<div class="nmaas-modal-header">{{'APP_ACCESS_METHODS_MODAL.HEADER' | translate}}</div>
<div class="nmaas-modal-body">
<div *ngIf="externalAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.EXTERNAL_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with external access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of externalAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td> <a type="button" class="btn btn-success" href="{{validateURL(am.url)}}">{{'APP_ACCESS_METHODS_MODAL.EXTERNAL_ACCESS' | translate}}</a> </td>
</tr>
</tbody>
</table>
<div class="nmaas-modal-header">{{'APP_ACCESS_METHODS_MODAL.HEADER' | translate}}</div>
<div class="nmaas-modal-body">
<div *ngIf="externalAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.EXTERNAL_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with external access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of externalAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td><a type="button" class="btn btn-success"
href="{{validateURL(am.url)}}">{{'APP_ACCESS_METHODS_MODAL.EXTERNAL_ACCESS' | translate}}</a>
</td>
</tr>
</tbody>
</table>
</div>
<div *ngIf="publicAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.PUBLIC_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with public access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of publicAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td><a type="button" class="btn btn-success"
href="{{validateURL(am.url)}}">{{'APP_ACCESS_METHODS_MODAL.PUBLIC_ACCESS' | translate}}</a>
</td>
</tr>
</tbody>
</table>
</div>
<div *ngIf="internalAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.INTERNAL_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with internal access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.ACCESS_METHOD' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of internalAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td>
<div class="well well-sm">{{am.protocol}}: {{!!am.url ? am.url : "Not available"}}</div>
</td>
</tr>
</tbody>
</table>
</div>
<div *ngIf="localAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.LOCAL_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with local access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.ACCESS_METHOD' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of localAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td>
<div class="well well-sm">{{am.protocol}}: {{!!am.url ? am.url : "Not available"}}</div>
</td>
</tr>
</tbody>
</table>
</div>

<div *ngIf="deployParameters$ | async as deployParameters" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.DEPLOYMENT_PARAMETERS.HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with internal access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.DEPLOYMENT_PARAMETERS.KEY' | translate}}</th>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.DEPLOYMENT_PARAMETERS.VALUE' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let param of deployParameters | keyvalue">
<td><strong>{{param.key}}</strong></td>
<td>{{param.value}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div *ngIf="publicAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.PUBLIC_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with public access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of publicAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td> <a type="button" class="btn btn-success" href="{{validateURL(am.url)}}">{{'APP_ACCESS_METHODS_MODAL.PUBLIC_ACCESS' | translate}}</a> </td>
</tr>
</tbody>
</table>
<div class="nmaas-modal-footer">
<button type="button" class="btn btn-primary"
(click)="modal.hide()">{{'APP_ACCESS_METHODS_MODAL.HIDE_BUTTON' | translate}}</button>
</div>
<div *ngIf="internalAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.INTERNAL_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with internal access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.ACCESS_METHOD' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of internalAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td><div class="well well-sm">{{am.protocol}}: {{!!am.url ? am.url: "Not available"}}</div></td>
</tr>
</tbody>
</table>
</div>
<div *ngIf="localAccessMethods.length > 0" class="">
<h4>{{'APP_ACCESS_METHODS_MODAL.LOCAL_HEADER' | translate}}</h4>
<table class="table table-hover table-condensed" aria-describedby="Table with local access details">
<thead>
<tr>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.SERVICE_NAME' | translate}}</th>
<th scope="col">{{'APP_ACCESS_METHODS_MODAL.ACCESS_METHOD' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let am of localAccessMethods">
<td><strong>{{am.name}}</strong></td>
<td><div class="well well-sm">{{am.protocol}}: {{!!am.url ? am.url: "Not available"}}</div></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="nmaas-modal-footer">
<button type="button" class="btn btn-primary" (click)="modal.hide()">{{'APP_ACCESS_METHODS_MODAL.HIDE_BUTTON' | translate}}</button>
</div>
</nmaas-modal>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {ServiceAccessMethod, ServiceAccessMethodType} from '../../../../model/service-access-method';
import {ModalComponent} from '../../../../shared';
import {Observable} from 'rxjs';

@Component({
selector: 'app-access-methods-modal',
Expand All @@ -20,6 +21,9 @@ export class AccessMethodsModalComponent implements OnInit {
public publicAccessMethods: ServiceAccessMethod[] = [];
public localAccessMethods: ServiceAccessMethod[] = [];

@Input()
public deployParameters$: Observable<Map<string, string>>

ngOnInit() {
if (this.accessMethods) {
this.externalAccessMethods = this.accessMethods.filter(s => this.accessMethodTypeAsEnum(s.type) === ServiceAccessMethodType.EXTERNAL
Expand Down
Loading