diff --git a/cerberus/src/app/applications/status/status.component.ts b/cerberus/src/app/applications/status/status.component.ts
index 899b099..20faa1b 100644
--- a/cerberus/src/app/applications/status/status.component.ts
+++ b/cerberus/src/app/applications/status/status.component.ts
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Application } from 'src/app/core/entities/Application';
+import { ApplicationStatus } from 'src/app/core/entities/ApplicationStatus';
import { ApplicationService } from 'src/app/core/services/application.service';
import { ModalService } from 'src/app/core/services/modal.service';
@@ -9,7 +10,7 @@ import { ModalService } from 'src/app/core/services/modal.service';
styleUrls: ['./status.component.scss']
})
export class StatusComponent implements OnInit {
- applications: Application[] = [];
+ applicationsStatus: ApplicationStatus[] = [];
constructor(
private _applicationService: ApplicationService,
@@ -17,21 +18,7 @@ export class StatusComponent implements OnInit {
) {}
ngOnInit(): void {
- this.applications.push({
- name: 'Codiki',
- image: 'https://gitea.takiguchi.ovh/avatars/7639cce68867d968ec848e444d726c8b',
- status: 'started'
- } as Application, {
- name: 'Minager',
- image: 'https://gitea.takiguchi.ovh/avatars/2f5f6bc51f8e16f0467885d7bc0d1f8b',
- status: 'stoped'
- } as Application, {
- name: 'Tamotsu',
- image: 'https://gitea.takiguchi.ovh/avatars/6c339db7805f158c21b4eed47758dbb1',
- status: 'started'
- } as Application);
-
- this._applicationService.getAll()
- .then(applications => this.applications = applications);
+ this._applicationService.getAllStatus()
+ .then(applicationsStatus => this.applicationsStatus = applicationsStatus);
}
}
diff --git a/cerberus/src/app/core/components/application-card/application-card.component.html b/cerberus/src/app/core/components/application-card/application-card.component.html
index 8cb0bd9..4f13caf 100644
--- a/cerberus/src/app/core/components/application-card/application-card.component.html
+++ b/cerberus/src/app/core/components/application-card/application-card.component.html
@@ -1,7 +1,7 @@
-
![]()
-
+
![]()
+
-
{{application?.name}}
+
{{applicationStatus?.application?.name}}
\ No newline at end of file
diff --git a/cerberus/src/app/core/components/application-card/application-card.component.scss b/cerberus/src/app/core/components/application-card/application-card.component.scss
index 6cedab8..478196a 100644
--- a/cerberus/src/app/core/components/application-card/application-card.component.scss
+++ b/cerberus/src/app/core/components/application-card/application-card.component.scss
@@ -29,7 +29,7 @@
background-image: linear-gradient(#5bc13e, #1fa200);
border: 2px solid #136900;
}
- &.stoped {
+ &.stopped {
background-image: linear-gradient(#c13e3e, #a20000);
border: 2px solid #770000;
}
diff --git a/cerberus/src/app/core/components/application-card/application-card.component.ts b/cerberus/src/app/core/components/application-card/application-card.component.ts
index f70d5fd..754d506 100644
--- a/cerberus/src/app/core/components/application-card/application-card.component.ts
+++ b/cerberus/src/app/core/components/application-card/application-card.component.ts
@@ -1,5 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { Application } from '../../entities/Application';
+import { ApplicationStatus } from '../../entities/ApplicationStatus';
import { ApplicationService } from '../../services/application.service';
interface AppDisplaying {
@@ -13,14 +14,10 @@ interface AppDisplaying {
templateUrl: './application-card.component.html',
styleUrls: ['./application-card.component.scss']
})
-export class ApplicationCardComponent implements OnInit {
- @Input() application: Application | undefined;
+export class ApplicationCardComponent {
+ @Input() applicationStatus: ApplicationStatus | undefined;
constructor(
private _applicationService: ApplicationService
) {}
-
- ngOnInit(): void {
-
- }
}
diff --git a/cerberus/src/app/core/entities/ApplicationStatus.ts b/cerberus/src/app/core/entities/ApplicationStatus.ts
new file mode 100644
index 0000000..b525938
--- /dev/null
+++ b/cerberus/src/app/core/entities/ApplicationStatus.ts
@@ -0,0 +1,6 @@
+import { Application } from "./Application";
+
+export interface ApplicationStatus {
+ application: Application;
+ status: string
+}
\ No newline at end of file
diff --git a/cerberus/src/app/core/services/application.service.ts b/cerberus/src/app/core/services/application.service.ts
index 7c1118d..04b6a96 100644
--- a/cerberus/src/app/core/services/application.service.ts
+++ b/cerberus/src/app/core/services/application.service.ts
@@ -1,6 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Application } from '../entities/Application';
+import { ApplicationStatus } from '../entities/ApplicationStatus';
@Injectable({
providedIn: 'root'
@@ -11,8 +12,8 @@ export class ApplicationService {
private _httpClient: HttpClient
) {}
- getAll(): Promise
{
- return this._httpClient.get('/api/applications').toPromise();
+ getAllStatus(): Promise {
+ return this._httpClient.get('/api/applications/status').toPromise();
}
add(application: Application): Promise {