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...');
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();

View File

@ -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],

View File

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

View File

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

View File

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

View File

@ -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",