-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add first implementation of environment status (#284)
- Loading branch information
1 parent
17fe59e
commit 0f549e7
Showing
30 changed files
with
757 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
exclude_paths: | ||
- "**.spec.ts" | ||
- "**/test/**" | ||
- "**/test-setup.ts" | ||
- "**/test-setup.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...pp/components/environments/environment-status-info/environment-status-info.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class="flex flex-col"> | ||
<span class="text-xs uppercase tracking-tighter font-bold text-gray-500 mb-2">Latest status check</span> | ||
|
||
<div class="flex items-center justify-between"> | ||
<span class="text-sm font-medium text-gray-700">Last Checked:</span> | ||
<span class="text-sm text-gray-500"> | ||
{{ status().checkedAt | timeAgo }} | ||
</span> | ||
</div> | ||
<div class="flex items-center justify-between mt-1"> | ||
<span class="text-sm font-medium text-gray-700">Status Code:</span> | ||
<span class="text-sm text-gray-500"> | ||
{{ status().httpStatusCode || 'N/A' }} | ||
</span> | ||
</div> | ||
|
||
@if (status().checkType === 'ARTEMIS_INFO') { | ||
<span class="text-xs uppercase tracking-tighter text-gray-500 mt-3">Artemis Build</span> | ||
@for (item of artemisBuildInfo(); track item.label) { | ||
<div class="flex items-center justify-between mt-1"> | ||
<span class="text-sm font-medium text-gray-700">{{ item.label }}:</span> | ||
<span class="text-sm text-gray-500">{{ item.value || '-/-' }}</span> | ||
</div> | ||
} | ||
} | ||
</div> |
45 changes: 45 additions & 0 deletions
45
.../app/components/environments/environment-status-info/environment-status-info.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Component, computed, inject, input } from '@angular/core'; | ||
import { EnvironmentStatusDto } from '@app/core/modules/openapi'; | ||
import { DateService } from '@app/core/services/date.service'; | ||
import { TimeAgoPipe } from '@app/pipes/time-ago.pipe'; | ||
|
||
@Component({ | ||
selector: 'app-environment-status-info', | ||
imports: [TimeAgoPipe], | ||
templateUrl: './environment-status-info.component.html', | ||
}) | ||
export class EnvironmentStatusInfoComponent { | ||
status = input.required<EnvironmentStatusDto>(); | ||
dateService = inject(DateService); | ||
|
||
artemisBuildInfo = computed<{ label: string; value?: string }[]>(() => { | ||
const status = this.status(); | ||
const metadata = status.metadata as | ||
| { | ||
name?: string; | ||
group?: string; | ||
version?: string; | ||
buildTime?: number; | ||
} | ||
| undefined; | ||
|
||
return [ | ||
{ | ||
label: 'Name', | ||
value: metadata?.name, | ||
}, | ||
{ | ||
label: 'Group', | ||
value: metadata?.group, | ||
}, | ||
{ | ||
label: 'Version', | ||
value: metadata?.version, | ||
}, | ||
{ | ||
label: 'Build Time', | ||
value: metadata?.buildTime ? this.dateService.formatDate(metadata.buildTime * 1000, 'yyyy-MM-dd HH:mm:ss') || '-/-' : undefined, | ||
}, | ||
]; | ||
}); | ||
} |
16 changes: 16 additions & 0 deletions
16
.../app/components/environments/environment-status-tag/environment-status-tag.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@if (status(); as status) { | ||
<!-- Info State --> | ||
<!-- Success State --> | ||
@if (status.success) { | ||
<p-tag severity="success" [rounded]="true"> | ||
<i-tabler name="check" class="!h-4 !w-4 mr-0.5"></i-tabler> | ||
Status check successful | ||
</p-tag> | ||
} @else { | ||
<!-- Error State --> | ||
<p-tag severity="danger" [rounded]="true"> | ||
<i-tabler name="exclamation-circle" class="!h-4 !w-4 mr-0.5"></i-tabler> | ||
Status check failed | ||
</p-tag> | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...rc/app/components/environments/environment-status-tag/environment-status-tag.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { EnvironmentStatusDto } from '@app/core/modules/openapi'; | ||
import { IconsModule } from 'icons.module'; | ||
import { TagModule } from 'primeng/tag'; | ||
|
||
@Component({ | ||
selector: 'app-environment-status-tag', | ||
imports: [TagModule, IconsModule], | ||
templateUrl: './environment-status-tag.component.html', | ||
}) | ||
export class EnvironmentStatusTagComponent { | ||
status = input.required<EnvironmentStatusDto>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.