mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
315c174ff9
(cherry picked from commit dba4c8bf75ed76f41ba24d945bf7d22efb9665c2)
64 lines
1.8 KiB
TypeScript
64 lines
1.8 KiB
TypeScript
/* tslint:disable:no-inferrable-types */
|
|
import * as path from 'path';
|
|
import {ConfigClass, ConfigClassBuilder} from 'typeconfig/node';
|
|
import {ConfigProperty, SubConfigClass} from 'typeconfig/common';
|
|
import {JobTrigger, JobTriggerType} from '../src/common/entities/job/JobScheduleDTO';
|
|
import {ServerVideoConfig} from '../src/common/config/private/PrivateConfig';
|
|
|
|
|
|
|
|
@SubConfigClass()
|
|
export class BenchmarksConfig {
|
|
@ConfigProperty()
|
|
bmScanDirectory: boolean = true;
|
|
@ConfigProperty()
|
|
bmSaveDirectory: boolean = true;
|
|
@ConfigProperty()
|
|
bmListDirectory: boolean = true;
|
|
@ConfigProperty()
|
|
bmListPersons: boolean = true;
|
|
@ConfigProperty()
|
|
bmAllSearch: boolean = true;
|
|
@ConfigProperty()
|
|
bmAutocomplete: boolean = true;
|
|
}
|
|
|
|
@ConfigClass({
|
|
configPath: path.join(__dirname, './../bm_config.json'),
|
|
saveIfNotExist: true,
|
|
attachDescription: true,
|
|
enumsAsString: true,
|
|
softReadonly: true,
|
|
cli: {
|
|
prefix: 'bm-config',
|
|
enable: {
|
|
configPath: true,
|
|
attachState: true,
|
|
attachDescription: true,
|
|
rewriteCLIConfig: true,
|
|
rewriteENVConfig: true,
|
|
enumsAsString: true,
|
|
saveIfNotExist: true,
|
|
exitOnConfig: true
|
|
},
|
|
defaults: {
|
|
enabled: true
|
|
}
|
|
}
|
|
})
|
|
export class PrivateConfigClass {
|
|
@ConfigProperty({description: 'Images are loaded from this folder (read permission required)'})
|
|
path: string = '/app/data/images';
|
|
@ConfigProperty({description: 'Describe your system setup'})
|
|
system: string = '';
|
|
@ConfigProperty({description: 'Number of times to run the benchmark'})
|
|
RUNS: number = 50;
|
|
@ConfigProperty({description: 'Enables / disables benchmarks'})
|
|
Benchmarks: BenchmarksConfig = new BenchmarksConfig();
|
|
|
|
|
|
}
|
|
|
|
export const BMConfig = ConfigClassBuilder.attachInterface(new PrivateConfigClass());
|
|
BMConfig.loadSync();
|