Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 22042bf

Browse files
committed
Use RuntimeAppInstance model to handle JSON response
Resolves #315
1 parent 242fb5a commit 22042bf

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

ui/src/app/runtime/model/runtime-app.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ import {Page} from '../../shared/model/page';
88
*/
99
export class RuntimeApp {
1010
public deploymentId: String;
11-
public status: String;
12-
public appInstances: Page<RuntimeAppInstance>;
11+
public state: String;
12+
public instances: any;
13+
public appInstances: RuntimeAppInstance[]
1314

1415
constructor(
1516
deploymentId: String,
16-
status: String,
17-
appInstances: Page<RuntimeAppInstance>) {
17+
state: String,
18+
instances: any,
19+
appInstances: RuntimeAppInstance[]) {
1820
this.deploymentId = deploymentId;
19-
this.status = status;
20-
this.appInstances = appInstances
21+
this.state = state;
22+
this.instances = instances;
23+
this.appInstances = appInstances;
2124
}
2225
}

ui/src/app/runtime/runtime-apps.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h4 class="modal-title">Instances for app <strong>{{runtimeApp.deploymentId}}</s
3939
</div>
4040
<div class="modal-body">
4141
<ng-template ngFor let-item
42-
[ngForOf]="runtimeApp.instances._embedded.appInstanceStatusResourceList">
42+
[ngForOf]="runtimeApp.appInstances">
4343
<div class="row">
4444
<p>Instance ID: <strong>{{item.instanceId}}</strong></p>
4545
</div>

ui/src/app/runtime/runtime-apps.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ export class RuntimeAppsService {
4141
let items: RuntimeApp[];
4242
if (response._embedded && response._embedded.appStatusResourceList) {
4343
items = response._embedded.appStatusResourceList as RuntimeApp[];
44+
for(const item of items) {
45+
item.appInstances = item.instances._embedded.appInstanceStatusResourceList;
46+
}
4447
} else {
4548
items = [];
4649
}
47-
4850
const page = new Page<RuntimeApp>();
4951
page.items = items;
5052
page.totalElements = response.page.totalElements;

0 commit comments

Comments
 (0)