Skip to content

Commit

Permalink
fixed restart multiple && container health view
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahannes committed Nov 20, 2023
1 parent d5ff11c commit 12571f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/container/pages/list/list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<ng-container matColumnDef="state">
<th mat-header-cell mat-sort-header *matHeaderCellDef>State</th>
<td mat-cell *matCellDef="let container">
{{container.info.state}}
<span *ngIf="!!container.info">{{container.info.state}}</span>
</td>
</ng-container>

Expand Down
6 changes: 3 additions & 3 deletions src/app/deployments/pages/info/info.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@

<mat-checkbox [disabled]="true" [ngModel]="deployment.enabled">Enabled</mat-checkbox>

<h2 *ngIf="objectKeys(deployment['host_resources']).length > 0">Host Resources</h2>
<h2 *ngIf="!!deployment['host_resources'] && objectKeys(deployment['host_resources']).length > 0">Host Resources</h2>
<div *ngFor="let hostResourceItem of deployment['host_resources'] | keyvalue;" class="form-field-container">
<mat-form-field appearance="fill">
<mat-label>{{hostResourceItem.key}}</mat-label>
<input [readonly]="true" matInput [value]="hostResourceIDToName[hostResourceItem.value]">
</mat-form-field>
</div>

<H2 *ngIf="objectKeys(deployment['secrets']).length > 0">Secrets</H2>
<H2 *ngIf="!!deployment['secrets'] && objectKeys(deployment['secrets']).length > 0">Secrets</H2>
<div *ngFor="let secretItem of deployment['secrets'] | keyvalue" class="form-field-container">
<!-- Create new Secret -->
<div class="secret-container">
Expand All @@ -50,7 +50,7 @@ <H2 *ngIf="objectKeys(deployment['secrets']).length > 0">Secrets</H2>

</div>

<h2 *ngIf="objectKeys(deployment['configs']).length > 0">Configs</h2>
<h2 *ngIf="!!deployment['configs'] && objectKeys(deployment['configs']).length > 0">Configs</h2>
<div *ngFor="let configItem of deployment['configs'] | keyvalue;" class="form-field-container">
<!-- Single Value Config -->
<span *ngIf="!configItem.value.is_slice">
Expand Down
12 changes: 9 additions & 3 deletions src/app/deployments/pages/list/deployment-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
}

loadDeployments(background: boolean): void {
this.moduleService.loadDeployments(false).subscribe(
this.moduleService.loadDeployments(true).subscribe(
{
next: (deployments) => {
if(!deployments) {
Expand Down Expand Up @@ -133,7 +133,7 @@ export class DeploymentListComponent implements OnInit, OnDestroy {

sendStop(ids: string[], forceConfirmed: boolean) {
var obs
if(ids.length > 1) {
if(ids.length == 1) {
obs = this.moduleService.stopDeployment(ids[0], forceConfirmed)
} else {
obs = this.moduleService.stopDeployments(ids, forceConfirmed)
Expand Down Expand Up @@ -209,7 +209,13 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
this.ready = false;
this.stopPeriodicRefresh()

this.moduleService.restartDeployments(ids).pipe(
var obs
if(ids.length == 1) {
obs = this.moduleService.restartDeployment(ids[0])
} else {
obs = this.moduleService.restartDeployments(ids)
}
obs.pipe(
concatMap(jobID => {
var message = "Deployments are restarting"
return this.utilsService.checkJobStatus(jobID, message)
Expand Down

0 comments on commit 12571f0

Please sign in to comment.