-
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.
Implement basic dashboard page, add ports field on container api
- Loading branch information
1 parent
5a77590
commit 9db4c8d
Showing
16 changed files
with
496 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
<div class="text-center mb-2"> | ||
<h1 | ||
pTooltip="I'm not frontend developer, I'm trying my best." | ||
tooltipPosition="top" | ||
> | ||
Dashboard | ||
</h1> | ||
</div> | ||
|
||
<div class="grid"> | ||
<div class="col-6"> | ||
<p-fieldset legend="Docker"> | ||
<div class="grid"> | ||
<div class="col-6"> | ||
<p-divider align="center" type="solid"> | ||
<b><i class="fa-brands fa-docker"></i> Docker Related</b> | ||
</p-divider> | ||
<h3> | ||
Docker API Version | ||
<p-badge | ||
[value]="dashboardInfo.docker_info.api_version" | ||
severity="success" | ||
size="large" | ||
pTooltip="The default (and highest) API version that is supported by the daemon" | ||
tooltipPosition="top" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
Platform Version | ||
<p-badge | ||
[value]="dashboardInfo.docker_info.platform_version" | ||
severity="success" | ||
size="large" | ||
pTooltip="The version of the daemon" | ||
tooltipPosition="top" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
Go Version | ||
<p-badge | ||
[value]="dashboardInfo.docker_info.go_version" | ||
severity="warning" | ||
size="large" | ||
pTooltip="The version Go used to compile the daemon, and the version of the Go runtime in use." | ||
tooltipPosition="top" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
Root Dir | ||
<p-badge | ||
[value]="dashboardInfo.system_wide_info.root_dir" | ||
size="large" | ||
pTooltip="Root directory of persistent Docker state." | ||
tooltipPosition="top" | ||
></p-badge> | ||
</h3> | ||
</div> | ||
|
||
<div class="col-6 mx-5"> | ||
<p-divider align="left" type="solid"> | ||
<b><i class="fa-solid fa-box-open"></i> Containers</b> | ||
</p-divider> | ||
|
||
<h3> | ||
<i class="fa-solid fa-box-open" style="color: var(--blue-500)"></i> | ||
Total | ||
<p-badge | ||
[value]=" | ||
dashboardInfo.system_wide_info.containers.total.toString() | ||
" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
<i class="fa-solid fa-rocket" style="color: var(--green-400)"></i> | ||
Running | ||
<p-badge | ||
[value]=" | ||
dashboardInfo.system_wide_info.containers.running.toString() | ||
" | ||
severity="success" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
<i | ||
class="fa-solid fa-circle-pause" | ||
style="color: var(--orange-400)" | ||
></i> | ||
Paused | ||
<p-badge | ||
[value]=" | ||
dashboardInfo.system_wide_info.containers.paused.toString() | ||
" | ||
severity="warning" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
<i class="fa-solid fa-hand" style="color: var(--red-400)"></i> | ||
Stopped | ||
<p-badge | ||
[value]=" | ||
dashboardInfo.system_wide_info.containers.stopped.toString() | ||
" | ||
severity="danger" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
</div> | ||
</div> | ||
</p-fieldset> | ||
</div> | ||
|
||
<div class="col-6"> | ||
<p-fieldset legend="System"> | ||
<p-divider align="center" type="solid"> | ||
<b><i class="fa-solid fa-desktop"></i> Operating System Info</b> | ||
</p-divider> | ||
<h3> | ||
Name | ||
<p-badge | ||
[value]="dashboardInfo.system_wide_info.os.name" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
OS Type | ||
<p-badge | ||
[value]="dashboardInfo.system_wide_info.os.type" | ||
severity="warning" | ||
size="large" | ||
></p-badge> | ||
Version | ||
<p-badge | ||
[value]="dashboardInfo.system_wide_info.os.version" | ||
severity="success" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
|
||
<p-divider align="center" type="solid"> | ||
<b>Others</b> | ||
</p-divider> | ||
|
||
<h3> | ||
<i class="fa-solid fa-memory"></i> Total Memory | ||
<p-badge | ||
[value]="dashboardInfo.system_wide_info.total_memory" | ||
severity="success" | ||
size="large" | ||
></p-badge> | ||
<i class="fa-solid fa-microchip"></i> CPU count | ||
<p-badge | ||
pTooltip="The number of logical CPUs usable by the daemon." | ||
[value]="dashboardInfo.system_wide_info.cpu_count.toString()" | ||
severity="danger" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
|
||
<h3> | ||
Kernel Version | ||
<p-badge | ||
[value]="dashboardInfo.system_wide_info.kernel_version" | ||
size="large" | ||
></p-badge> | ||
</h3> | ||
</p-fieldset> | ||
</div> | ||
</div> | ||
|
||
<div class="text-center"> | ||
<small>Running on {{ dashboardInfo.docker_info.platform_name }}</small> | ||
</div> |
Empty file.
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,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DashboardComponent } from './dashboard.component'; | ||
|
||
describe('DashboardComponent', () => { | ||
let component: DashboardComponent; | ||
let fixture: ComponentFixture<DashboardComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DashboardComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DashboardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,21 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { DashboardService } from '@services/dashboard.service' | ||
import { DashboardInfo } from '@models/dashboard' | ||
|
||
@Component({ | ||
selector: 'app-dashboard', | ||
templateUrl: './dashboard.component.html', | ||
styleUrl: './dashboard.component.scss' | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
dashboardInfo!: DashboardInfo; | ||
|
||
constructor(private dashboardService: DashboardService) { } | ||
|
||
ngOnInit(): void { | ||
this.dashboardService.getDashboardInfo().subscribe((data: DashboardInfo) => { | ||
this.dashboardInfo = data; | ||
}) | ||
} | ||
} |
Oops, something went wrong.