-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from Hydrospheredata/feature/build_info
added build Infromation
- Loading branch information
Showing
12 changed files
with
155 additions
and
7 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './navbar/navbar.component'; | ||
export * from './page-not-found/page-not-found.component'; | ||
export * from './dialogs'; |
25 changes: 25 additions & 0 deletions
25
src/modules/core/components/dialogs/build-information-dialog.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,25 @@ | ||
<div class='build-info'> | ||
<div class='build-info__title'>Build information</div> | ||
<div class='service-info build-info__service-info' *ngFor='let serviceInfo of buildInfo$ | async'> | ||
<div class='service-info__title'> | ||
{{ serviceInfo.name }} | ||
</div> | ||
<div class='service-info__container'> | ||
<div class='service-info__keys'> | ||
<div class='service-info__key' *ngFor='let item of serviceInfo | keyvalue'> | ||
<span >{{item.key}}</span> | ||
</div> | ||
</div> | ||
<div class='service-info__values'> | ||
<div class='service-info__value' *ngFor='let item of serviceInfo | keyvalue'> | ||
<ng-container *ngIf='item.value; else na'> | ||
<span >{{item.value}}</span> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<ng-template #na>n/a</ng-template> |
37 changes: 37 additions & 0 deletions
37
src/modules/core/components/dialogs/build-information-dialog.component.scss
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,37 @@ | ||
.build-info { | ||
&__title { | ||
text-transform: uppercase; | ||
text-align: center; | ||
font-size: 18px; | ||
letter-spacing: 1px; | ||
color: #35495a; | ||
margin-bottom: 24px | ||
} | ||
|
||
&__service-info { | ||
margin-bottom: 24px; | ||
} | ||
} | ||
|
||
.service-info { | ||
&__title { | ||
text-transform: uppercase; | ||
letter-spacing: 1px; | ||
color: #213f48; | ||
font-weight: 700; | ||
margin-bottom: 8px | ||
} | ||
&__container { | ||
display: flex; | ||
} | ||
&__key, &__value { | ||
min-height: 24px; | ||
} | ||
&__key { | ||
color: #787d82; | ||
font-size: 12px; | ||
letter-spacing: 1px; | ||
text-align: right; | ||
padding-right: 4px; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/modules/core/components/dialogs/build-information-dialog.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,16 @@ | ||
import { Component } from '@angular/core'; | ||
import { BuildInformationService } from '@core/services/build-information.service'; | ||
import { Observable } from 'rxjs'; | ||
|
||
@Component({ | ||
templateUrl: './build-information-dialog.component.html', | ||
styleUrls: ['./build-information-dialog.component.scss'], | ||
}) | ||
export class BuildInformationDialogComponent { | ||
buildInfo$: Observable<any>; | ||
constructor( | ||
buildInfo: BuildInformationService | ||
) { | ||
this.buildInfo$ = buildInfo.getBuildInformation(); | ||
} | ||
} |
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 @@ | ||
export * from './build-information-dialog.component'; |
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,21 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpService } from '@core/services/http'; | ||
import { Observable } from 'rxjs'; | ||
import { combineLatest } from 'rxjs'; | ||
|
||
@Injectable() | ||
export class BuildInformationService { | ||
private buildInfoApi = '/api/buildinfo'; | ||
private gatewayInfoApi = '/gateway/buildinfo'; | ||
|
||
constructor( | ||
private http: HttpService | ||
) {} | ||
|
||
getBuildInformation(): Observable<any> { | ||
return combineLatest( | ||
this.http.get(this.buildInfoApi), | ||
this.http.get(this.gatewayInfoApi) | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './model-version-status.directive'; | ||
export * from './copy-to-buffer.directive'; | ||
export * from './build-information.directive'; |
23 changes: 23 additions & 0 deletions
23
src/modules/shared/directives/build-information.directive.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,23 @@ | ||
import { Directive, HostListener } from '@angular/core'; | ||
import { BuildInformationDialogComponent } from '@core/_index'; | ||
import { DialogService } from '@dialog/dialog.service'; | ||
|
||
@Directive({ | ||
selector: '[hsBuildInformation]', | ||
}) | ||
export class BuildInformationDirective { | ||
constructor( | ||
private dialog: DialogService | ||
) { | ||
} | ||
|
||
@HostListener('click') | ||
onclick() { | ||
this.dialog.createDialog({ | ||
component: BuildInformationDialogComponent, | ||
styles: { | ||
width: '600px', | ||
}, | ||
}); | ||
} | ||
} |
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