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