2016-05-10 21:33:58 +02:00
|
|
|
export enum DatabaseType{
|
2016-06-17 00:05:31 +02:00
|
|
|
memory
|
2016-05-10 21:33:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ServerConfig {
|
|
|
|
port:number;
|
|
|
|
imagesFolder:string;
|
|
|
|
thumbnailFolder:string;
|
|
|
|
databaseType:DatabaseType;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SearchConfig {
|
|
|
|
searchEnabled:boolean
|
|
|
|
instantSearchEnabled:boolean
|
|
|
|
autocompleteEnabled:boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ClientConfig {
|
2016-05-12 11:00:46 +02:00
|
|
|
thumbnailSizes:Array<number>;
|
2016-05-10 21:33:58 +02:00
|
|
|
Search:SearchConfig;
|
2016-06-17 11:25:15 +02:00
|
|
|
concurrentThumbnailGenerations:number;
|
2016-05-10 21:33:58 +02:00
|
|
|
}
|
|
|
|
export class ConfigClass {
|
|
|
|
|
|
|
|
public Server:ServerConfig = null;
|
|
|
|
|
|
|
|
public Client:ClientConfig = {
|
2016-05-12 11:00:46 +02:00
|
|
|
thumbnailSizes: [200, 400, 600],
|
2016-05-10 21:33:58 +02:00
|
|
|
Search: {
|
2016-06-22 16:34:44 +02:00
|
|
|
searchEnabled: false,
|
|
|
|
instantSearchEnabled: false,
|
|
|
|
autocompleteEnabled: false
|
2016-06-17 11:25:15 +02:00
|
|
|
},
|
|
|
|
concurrentThumbnailGenerations: 1
|
2016-05-10 21:33:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
public setDatabaseType(type:DatabaseType) {
|
|
|
|
this.Server.databaseType = type;
|
|
|
|
if (type === DatabaseType.memory) {
|
|
|
|
this.Client.Search.searchEnabled = false;
|
|
|
|
this.Client.Search.instantSearchEnabled = false;
|
|
|
|
this.Client.Search.autocompleteEnabled = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|