1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

version bump and adding app version to the admin page

This commit is contained in:
Patrik J. Braun 2019-07-21 13:49:32 +02:00
parent 8e5be78464
commit 03d7d68c10
7 changed files with 36 additions and 16 deletions

View File

@ -44,6 +44,8 @@ export class Server {
Logger.info(LOG_TAG, 'running diagnostics...'); Logger.info(LOG_TAG, 'running diagnostics...');
await ConfigDiagnostics.runDiagnostics(); await ConfigDiagnostics.runDiagnostics();
Logger.info(LOG_TAG, 'using config:'); 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')); Logger.info(LOG_TAG, JSON.stringify(Config, null, '\t'));
this.app = _express(); this.app = _express();

View File

@ -79,6 +79,7 @@ export module ClientConfig {
} }
export interface Config { export interface Config {
appVersion: string;
applicationTitle: string; applicationTitle: string;
publicUrl: string; publicUrl: string;
urlBase: string; urlBase: string;
@ -105,6 +106,7 @@ export class PublicConfigClass {
public Client: ClientConfig.Config = { public Client: ClientConfig.Config = {
applicationTitle: 'PiGallery 2', applicationTitle: 'PiGallery 2',
appVersion: '',
Thumbnail: { Thumbnail: {
concurrentThumbnailGenerations: 1, concurrentThumbnailGenerations: 1,
thumbnailSizes: [200, 400, 600], thumbnailSizes: [200, 400, 600],

View File

@ -0,0 +1,7 @@
.version{
color: #6c757d;
}
.version:hover{
text-decoration: underline;
}

View File

@ -21,21 +21,27 @@
</div> </div>
</div> </div>
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group d-flex justify-content-end"> <div class="d-flex justify-content-between">
<label class="control-label align-self-end mr-2" for="simplifiedMode" i18n>Mode</label> <a class="version" href="https://github.com/bpatrik/pigallery2/releases">
<bSwitch <span i18n>App version:</span>&nbsp;
id="simplifiedMode" v<span>{{appVersion}}</span>
class="switch" </a>
name="simplifiedMode" <div class="form-group">
[switch-off-color]="'warning'" <label class="control-label align-self-end mr-2" for="simplifiedMode" i18n>Mode</label>
[switch-on-color]="'primary'" <bSwitch
[switch-inverse]="'inverse'" id="simplifiedMode"
[switch-off-text]="text.Advanced" class="switch"
[switch-on-text]="text.Simplified" name="simplifiedMode"
[switch-handle-width]="'100'" [switch-off-color]="'warning'"
[switch-label-width]="'20'" [switch-on-color]="'primary'"
[(ngModel)]="simplifiedMode"> [switch-inverse]="true"
</bSwitch> [switch-off-text]="text.Advanced"
[switch-on-text]="text.Simplified"
[switch-handle-width]="100"
[switch-label-width]="20"
[(ngModel)]="simplifiedMode">
</bSwitch>
</div>
</div> </div>
</div> </div>
<app-settings-basic [simplifiedMode]="simplifiedMode"></app-settings-basic> <app-settings-basic [simplifiedMode]="simplifiedMode"></app-settings-basic>

View File

@ -5,6 +5,7 @@ import {NotificationService} from '../../model/notification.service';
import {NotificationType} from '../../../../common/entities/NotificationDTO'; import {NotificationType} from '../../../../common/entities/NotificationDTO';
import {NavigationService} from '../../model/navigation.service'; import {NavigationService} from '../../model/navigation.service';
import {I18n} from '@ngx-translate/i18n-polyfill'; import {I18n} from '@ngx-translate/i18n-polyfill';
import {Config} from '../../../../common/config/public/Config';
@Component({ @Component({
selector: 'app-admin', selector: 'app-admin',
@ -18,6 +19,7 @@ export class AdminComponent implements OnInit {
Advanced: 'Advanced', Advanced: 'Advanced',
Simplified: 'Simplified' Simplified: 'Simplified'
}; };
appVersion = Config.Client.appVersion;
constructor(private _authService: AuthenticationService, constructor(private _authService: AuthenticationService,
private _navigation: NavigationService, private _navigation: NavigationService,

View File

@ -20,6 +20,7 @@ export class SettingsService {
constructor(private _networkService: NetworkService) { constructor(private _networkService: NetworkService) {
this.settings = new BehaviorSubject<IPrivateConfig>({ this.settings = new BehaviorSubject<IPrivateConfig>({
Client: { Client: {
appVersion: '',
Search: { Search: {
enabled: true, enabled: true,
AutoComplete: { AutoComplete: {

View File

@ -1,6 +1,6 @@
{ {
"name": "pigallery2", "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)", "description": "This is a photo gallery optimised for running low resource servers (especially on raspberry pi)",
"author": "Patrik J. Braun", "author": "Patrik J. Braun",
"homepage": "https://github.com/bpatrik/PiGallery2", "homepage": "https://github.com/bpatrik/PiGallery2",