diff --git a/backend/server.ts b/backend/server.ts index 564cd7e8..a1916e29 100644 --- a/backend/server.ts +++ b/backend/server.ts @@ -44,6 +44,8 @@ export class Server { Logger.info(LOG_TAG, 'running diagnostics...'); await ConfigDiagnostics.runDiagnostics(); Logger.info(LOG_TAG, 'using config:'); + const appVer = require('../package.json').version; + Config.Client.appVersion = appVer; Logger.info(LOG_TAG, JSON.stringify(Config, null, '\t')); this.app = _express(); diff --git a/common/config/public/ConfigClass.ts b/common/config/public/ConfigClass.ts index 29fc7d19..313bdb7f 100644 --- a/common/config/public/ConfigClass.ts +++ b/common/config/public/ConfigClass.ts @@ -79,6 +79,7 @@ export module ClientConfig { } export interface Config { + appVersion: string; applicationTitle: string; publicUrl: string; urlBase: string; @@ -105,6 +106,7 @@ export class PublicConfigClass { public Client: ClientConfig.Config = { applicationTitle: 'PiGallery 2', + appVersion: '', Thumbnail: { concurrentThumbnailGenerations: 1, thumbnailSizes: [200, 400, 600], diff --git a/frontend/app/ui/admin/admin.component.css b/frontend/app/ui/admin/admin.component.css index e69de29b..5e46844c 100644 --- a/frontend/app/ui/admin/admin.component.css +++ b/frontend/app/ui/admin/admin.component.css @@ -0,0 +1,7 @@ +.version{ + color: #6c757d; +} + +.version:hover{ + text-decoration: underline; +} diff --git a/frontend/app/ui/admin/admin.component.html b/frontend/app/ui/admin/admin.component.html index bf70ef0f..d2b03fd7 100644 --- a/frontend/app/ui/admin/admin.component.html +++ b/frontend/app/ui/admin/admin.component.html @@ -21,21 +21,27 @@
-
- - - +
diff --git a/frontend/app/ui/admin/admin.component.ts b/frontend/app/ui/admin/admin.component.ts index e8027705..8de25c5e 100644 --- a/frontend/app/ui/admin/admin.component.ts +++ b/frontend/app/ui/admin/admin.component.ts @@ -5,6 +5,7 @@ import {NotificationService} from '../../model/notification.service'; import {NotificationType} from '../../../../common/entities/NotificationDTO'; import {NavigationService} from '../../model/navigation.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; +import {Config} from '../../../../common/config/public/Config'; @Component({ selector: 'app-admin', @@ -18,6 +19,7 @@ export class AdminComponent implements OnInit { Advanced: 'Advanced', Simplified: 'Simplified' }; + appVersion = Config.Client.appVersion; constructor(private _authService: AuthenticationService, private _navigation: NavigationService, diff --git a/frontend/app/ui/settings/settings.service.ts b/frontend/app/ui/settings/settings.service.ts index 57a947d6..1e6fcae9 100644 --- a/frontend/app/ui/settings/settings.service.ts +++ b/frontend/app/ui/settings/settings.service.ts @@ -20,6 +20,7 @@ export class SettingsService { constructor(private _networkService: NetworkService) { this.settings = new BehaviorSubject({ Client: { + appVersion: '', Search: { enabled: true, AutoComplete: { diff --git a/package.json b/package.json index ebe2f6fe..b030fd07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pigallery2", - "version": "1.5.9", + "version": "1.6.5", "description": "This is a photo gallery optimised for running low resource servers (especially on raspberry pi)", "author": "Patrik J. Braun", "homepage": "https://github.com/bpatrik/PiGallery2",