feat(gui): add version to gui header
add version from package.json to gui header next to title close #25
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
<p class="title">
|
<p class="title">
|
||||||
<i class="fa-brands fa-spotify"></i>
|
<i class="fa-brands fa-spotify"></i>
|
||||||
<span>Spooty</span>
|
<span>Spooty</span>
|
||||||
|
<span class="tag is-dark is-size-7">v{{version}}</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="subtitle">Self-hosted spotify downloader</p>
|
<p class="subtitle">Self-hosted spotify downloader</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {FormsModule} from "@angular/forms";
|
|||||||
import {CommonModule, NgFor} from "@angular/common";
|
import {CommonModule, NgFor} from "@angular/common";
|
||||||
import {PlaylistService, PlaylistStatusEnum} from "./services/playlist.service";
|
import {PlaylistService, PlaylistStatusEnum} from "./services/playlist.service";
|
||||||
import {PlaylistBoxComponent} from "./components/playlist-box/playlist-box.component";
|
import {PlaylistBoxComponent} from "./components/playlist-box/playlist-box.component";
|
||||||
|
import {VersionService} from "./services/version.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
@@ -16,8 +17,12 @@ export class AppComponent {
|
|||||||
url = ''
|
url = ''
|
||||||
createLoading$ = this.playlistService.createLoading$;
|
createLoading$ = this.playlistService.createLoading$;
|
||||||
playlists$ = this.playlistService.all$;
|
playlists$ = this.playlistService.all$;
|
||||||
|
version = this.versionService.getVersion();
|
||||||
|
|
||||||
constructor(private readonly playlistService: PlaylistService) {
|
constructor(
|
||||||
|
private readonly playlistService: PlaylistService,
|
||||||
|
private readonly versionService: VersionService,
|
||||||
|
) {
|
||||||
this.fetchPlaylists();
|
this.fetchPlaylists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { VersionService } from './version.service';
|
||||||
|
|
||||||
|
describe('VersionService', () => {
|
||||||
|
let service: VersionService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(VersionService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import {version} from '../../../package.json';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class VersionService {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
getVersion(): string {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user