2018-05-28 14:03:12 -04:00
|
|
|
import {SortingMethods} from '../../entities/SortingMethods';
|
2018-12-04 22:08:13 +01:00
|
|
|
import {UserRoles} from '../../entities/UserDTO';
|
2018-05-28 14:03:12 -04:00
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
export module ClientConfig {
|
2018-12-07 22:06:13 +01:00
|
|
|
|
|
|
|
export enum MapProviders {
|
2018-12-08 11:28:56 +01:00
|
|
|
OpenStreetMap, Mapbox, Custom
|
2018-12-07 22:06:13 +01:00
|
|
|
}
|
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
export interface SearchConfig {
|
2018-05-12 12:19:51 -04:00
|
|
|
enabled: boolean;
|
|
|
|
instantSearchEnabled: boolean;
|
|
|
|
autocompleteEnabled: boolean;
|
2017-07-21 19:33:24 +02:00
|
|
|
InstantSearchTimeout: number;
|
2017-07-29 23:39:06 +02:00
|
|
|
autocompleteCacheTimeout: number;
|
2017-07-30 09:06:12 +02:00
|
|
|
instantSearchCacheTimeout: number;
|
|
|
|
searchCacheTimeout: number;
|
2017-07-15 12:47:11 +02:00
|
|
|
}
|
2016-05-10 21:33:58 +02:00
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
export interface SharingConfig {
|
|
|
|
enabled: boolean;
|
|
|
|
passwordProtected: boolean;
|
|
|
|
}
|
2017-07-03 19:17:49 +02:00
|
|
|
|
2018-10-22 00:24:17 +02:00
|
|
|
export interface RandomPhotoConfig {
|
|
|
|
enabled: boolean;
|
|
|
|
}
|
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
export interface MapConfig {
|
|
|
|
enabled: boolean;
|
2018-12-07 22:06:13 +01:00
|
|
|
mapProvider: MapProviders;
|
2018-12-08 11:28:56 +01:00
|
|
|
mapboxAccessToken: string;
|
2018-12-07 22:06:13 +01:00
|
|
|
tileUrl: string;
|
2017-07-15 12:47:11 +02:00
|
|
|
}
|
2017-07-29 23:39:06 +02:00
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
export interface ThumbnailConfig {
|
|
|
|
iconSize: number;
|
|
|
|
thumbnailSizes: Array<number>;
|
2018-11-02 16:24:37 +01:00
|
|
|
concurrentThumbnailGenerations: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NavBarConfig {
|
|
|
|
showItemCount: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OtherConfig {
|
|
|
|
enableCache: boolean;
|
|
|
|
enableOnScrollRendering: boolean;
|
|
|
|
defaultPhotoSortingMethod: SortingMethods;
|
|
|
|
enableOnScrollThumbnailPrioritising: boolean;
|
|
|
|
NavBar: NavBarConfig;
|
2018-12-06 13:50:55 +01:00
|
|
|
captionFirstNaming: boolean; // shows the caption instead of the filename in the phot grid
|
2017-07-15 12:47:11 +02:00
|
|
|
}
|
2017-07-13 23:39:09 +02:00
|
|
|
|
2018-11-18 20:26:29 +01:00
|
|
|
export interface VideoConfig {
|
|
|
|
enabled: boolean;
|
|
|
|
}
|
|
|
|
|
2018-11-30 17:19:37 +01:00
|
|
|
export interface MetaFileConfig {
|
|
|
|
enabled: boolean;
|
|
|
|
}
|
|
|
|
|
2018-11-18 20:26:29 +01:00
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
export interface Config {
|
|
|
|
applicationTitle: string;
|
2018-11-02 16:24:37 +01:00
|
|
|
publicUrl: string;
|
|
|
|
urlBase: string;
|
2017-07-15 12:47:11 +02:00
|
|
|
Thumbnail: ThumbnailConfig;
|
|
|
|
Search: SearchConfig;
|
|
|
|
Sharing: SharingConfig;
|
|
|
|
Map: MapConfig;
|
2018-10-22 00:24:17 +02:00
|
|
|
RandomPhoto: RandomPhotoConfig;
|
2018-11-02 16:24:37 +01:00
|
|
|
Other: OtherConfig;
|
2017-07-15 12:47:11 +02:00
|
|
|
authenticationRequired: boolean;
|
2018-12-04 22:08:13 +01:00
|
|
|
unAuthenticatedUserRole: UserRoles;
|
2017-12-24 18:42:25 -05:00
|
|
|
languages: string[];
|
2018-11-18 20:26:29 +01:00
|
|
|
Video: VideoConfig;
|
2018-11-30 17:19:37 +01:00
|
|
|
MetaFile: MetaFileConfig;
|
2017-07-15 12:47:11 +02:00
|
|
|
}
|
2016-05-10 21:33:58 +02:00
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
}
|
2017-07-29 23:39:06 +02:00
|
|
|
|
2017-06-04 15:25:08 +02:00
|
|
|
/**
|
|
|
|
* These configuration will be available at frontend and backend too
|
|
|
|
*/
|
|
|
|
export class PublicConfigClass {
|
2016-05-10 21:33:58 +02:00
|
|
|
|
2017-07-15 12:47:11 +02:00
|
|
|
public Client: ClientConfig.Config = {
|
2018-05-12 12:19:51 -04:00
|
|
|
applicationTitle: 'PiGallery 2',
|
2017-07-15 12:47:11 +02:00
|
|
|
Thumbnail: {
|
2018-11-02 16:24:37 +01:00
|
|
|
concurrentThumbnailGenerations: 1,
|
2017-07-15 12:47:11 +02:00
|
|
|
thumbnailSizes: [200, 400, 600],
|
2018-12-09 13:59:51 +01:00
|
|
|
iconSize: 45
|
2017-07-15 12:47:11 +02:00
|
|
|
},
|
2017-06-11 23:33:47 +02:00
|
|
|
Search: {
|
2017-07-13 23:39:09 +02:00
|
|
|
enabled: true,
|
2017-06-11 23:33:47 +02:00
|
|
|
instantSearchEnabled: true,
|
2017-07-21 19:33:24 +02:00
|
|
|
autocompleteEnabled: true,
|
2017-07-29 23:39:06 +02:00
|
|
|
InstantSearchTimeout: 3000,
|
2017-07-30 09:06:12 +02:00
|
|
|
autocompleteCacheTimeout: 1000 * 60 * 60,
|
|
|
|
searchCacheTimeout: 1000 * 60 * 60,
|
|
|
|
instantSearchCacheTimeout: 1000 * 60 * 60
|
2017-06-11 23:33:47 +02:00
|
|
|
},
|
2017-07-03 19:17:49 +02:00
|
|
|
Sharing: {
|
|
|
|
enabled: true,
|
|
|
|
passwordProtected: true
|
|
|
|
},
|
2017-07-13 23:39:09 +02:00
|
|
|
Map: {
|
|
|
|
enabled: true,
|
2018-12-07 22:06:13 +01:00
|
|
|
mapProvider: ClientConfig.MapProviders.OpenStreetMap,
|
2018-12-08 11:28:56 +01:00
|
|
|
mapboxAccessToken: '',
|
2018-12-07 22:06:13 +01:00
|
|
|
tileUrl: ''
|
2017-07-13 23:39:09 +02:00
|
|
|
},
|
2018-10-22 00:24:17 +02:00
|
|
|
RandomPhoto: {
|
|
|
|
enabled: true
|
|
|
|
},
|
2018-11-18 20:26:29 +01:00
|
|
|
Video: {
|
|
|
|
enabled: true
|
|
|
|
},
|
2018-11-30 17:19:37 +01:00
|
|
|
MetaFile: {
|
|
|
|
enabled: true
|
|
|
|
},
|
2018-11-02 16:24:37 +01:00
|
|
|
Other: {
|
2018-12-06 13:50:55 +01:00
|
|
|
captionFirstNaming: false,
|
2018-11-02 16:24:37 +01:00
|
|
|
enableCache: true,
|
|
|
|
enableOnScrollRendering: true,
|
|
|
|
enableOnScrollThumbnailPrioritising: true,
|
|
|
|
defaultPhotoSortingMethod: SortingMethods.ascDate,
|
|
|
|
NavBar: {
|
|
|
|
showItemCount: true
|
|
|
|
}
|
|
|
|
},
|
2017-06-11 23:33:47 +02:00
|
|
|
authenticationRequired: true,
|
2018-12-04 22:08:13 +01:00
|
|
|
unAuthenticatedUserRole: UserRoles.Admin,
|
2018-05-12 12:19:51 -04:00
|
|
|
publicUrl: '',
|
|
|
|
urlBase: '',
|
2018-11-02 16:24:37 +01:00
|
|
|
languages: []
|
2017-06-11 23:33:47 +02:00
|
|
|
};
|
2016-05-10 21:33:58 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|