diff --git a/src/backend/middlewares/admin/AdminMWs.ts b/src/backend/middlewares/admin/AdminMWs.ts index d2ba8c56..72e54977 100644 --- a/src/backend/middlewares/admin/AdminMWs.ts +++ b/src/backend/middlewares/admin/AdminMWs.ts @@ -50,56 +50,56 @@ export class AdminMWs { } } - public static async startTask(req: Request, res: Response, next: NextFunction) { + public static async startJob(req: Request, res: Response, next: NextFunction) { try { const id = req.params.id; - const taskConfig: any = req.body.config; - await ObjectManagers.getInstance().TaskManager.run(id, taskConfig); + const JobConfig: any = req.body.config; + await ObjectManagers.getInstance().JobManager.run(id, JobConfig); req.resultPipe = 'ok'; return next(); } catch (err) { if (err instanceof Error) { - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + err.toString(), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + err.toString(), err)); } - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + JSON.stringify(err, null, ' '), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + JSON.stringify(err, null, ' '), err)); } } - public static stopTask(req: Request, res: Response, next: NextFunction) { + public static stopJob(req: Request, res: Response, next: NextFunction) { try { const id = req.params.id; - ObjectManagers.getInstance().TaskManager.stop(id); + ObjectManagers.getInstance().JobManager.stop(id); req.resultPipe = 'ok'; return next(); } catch (err) { if (err instanceof Error) { - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + err.toString(), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + err.toString(), err)); } - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + JSON.stringify(err, null, ' '), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + JSON.stringify(err, null, ' '), err)); } } - public static getAvailableTasks(req: Request, res: Response, next: NextFunction) { + public static getAvailableJobs(req: Request, res: Response, next: NextFunction) { try { - req.resultPipe = ObjectManagers.getInstance().TaskManager.getAvailableTasks(); + req.resultPipe = ObjectManagers.getInstance().JobManager.getAvailableJobs(); return next(); } catch (err) { if (err instanceof Error) { - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + err.toString(), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + err.toString(), err)); } - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + JSON.stringify(err, null, ' '), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + JSON.stringify(err, null, ' '), err)); } } - public static getTaskProgresses(req: Request, res: Response, next: NextFunction) { + public static getJobProgresses(req: Request, res: Response, next: NextFunction) { try { - req.resultPipe = ObjectManagers.getInstance().TaskManager.getProgresses(); + req.resultPipe = ObjectManagers.getInstance().JobManager.getProgresses(); return next(); } catch (err) { if (err instanceof Error) { - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + err.toString(), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + err.toString(), err)); } - return next(new ErrorDTO(ErrorCodes.TASK_ERROR, 'Task error: ' + JSON.stringify(err, null, ' '), err)); + return next(new ErrorDTO(ErrorCodes.JOB_ERROR, 'Job error: ' + JSON.stringify(err, null, ' '), err)); } } } diff --git a/src/backend/middlewares/admin/SettingsMWs.ts b/src/backend/middlewares/admin/SettingsMWs.ts index 2b91f0c0..fa1ce2ba 100644 --- a/src/backend/middlewares/admin/SettingsMWs.ts +++ b/src/backend/middlewares/admin/SettingsMWs.ts @@ -444,16 +444,16 @@ export class SettingsMWs { try { // only updating explicitly set config (not saving config set by the diagnostics) - const settings: ServerConfig.TaskConfig = req.body.settings; + const settings: ServerConfig.JobConfig = req.body.settings; const original = Config.original(); await ConfigDiagnostics.testTasksConfig(settings, original); - Config.Server.Tasks = settings; - original.Server.Tasks = settings; + Config.Server.Jobs = settings; + original.Server.Jobs = settings; original.save(); await ConfigDiagnostics.runDiagnostics(); - ObjectManagers.getInstance().TaskManager.runSchedules(); + ObjectManagers.getInstance().JobManager.runSchedules(); Logger.info(LOG_TAG, 'new config:'); Logger.info(LOG_TAG, JSON.stringify(Config, null, '\t')); return next(); diff --git a/src/backend/model/ObjectManagers.ts b/src/backend/model/ObjectManagers.ts index 4bba16fa..176c43c1 100644 --- a/src/backend/model/ObjectManagers.ts +++ b/src/backend/model/ObjectManagers.ts @@ -7,7 +7,7 @@ import {Logger} from '../Logger'; import {IIndexingManager} from './database/interfaces/IIndexingManager'; import {IPersonManager} from './database/interfaces/IPersonManager'; import {IVersionManager} from './database/interfaces/IVersionManager'; -import {ITaskManager} from './database/interfaces/ITaskManager'; +import {IJobManager} from './database/interfaces/IJobManager'; export class ObjectManagers { @@ -20,7 +20,7 @@ export class ObjectManagers { private _indexingManager: IIndexingManager; private _personManager: IPersonManager; private _versionManager: IVersionManager; - private _taskManager: ITaskManager; + private _jobManager: IJobManager; get VersionManager(): IVersionManager { @@ -80,12 +80,12 @@ export class ObjectManagers { this._sharingManager = value; } - get TaskManager(): ITaskManager { - return this._taskManager; + get JobManager(): IJobManager { + return this._jobManager; } - set TaskManager(value: ITaskManager) { - this._taskManager = value; + set JobManager(value: IJobManager) { + this._jobManager = value; } public static getInstance() { @@ -96,8 +96,8 @@ export class ObjectManagers { } public static async reset() { - if (ObjectManagers.getInstance().TaskManager) { - ObjectManagers.getInstance().TaskManager.stopSchedules(); + if (ObjectManagers.getInstance().JobManager) { + ObjectManagers.getInstance().JobManager.stopSchedules(); } await SQLConnection.close(); this._instance = null; @@ -105,8 +105,8 @@ export class ObjectManagers { public static async InitCommonManagers() { - const TaskManager = require('./tasks/TaskManager').TaskManager; - ObjectManagers.getInstance().TaskManager = new TaskManager(); + const JobManager = require('./jobs/JobManager').JobManager; + ObjectManagers.getInstance().JobManager = new JobManager(); } public static async InitMemoryManagers() { diff --git a/src/backend/model/database/interfaces/IJobManager.ts b/src/backend/model/database/interfaces/IJobManager.ts new file mode 100644 index 00000000..f48f5abf --- /dev/null +++ b/src/backend/model/database/interfaces/IJobManager.ts @@ -0,0 +1,18 @@ +import {JobProgressDTO} from '../../../../common/entities/settings/JobProgressDTO'; +import {JobDTO} from '../../../../common/entities/job/JobDTO'; + +export interface IJobManager { + + run(jobId: string, config: any): Promise; + + stop(jobId: string): void; + + getProgresses(): { [key: string]: JobProgressDTO }; + + + getAvailableJobs(): JobDTO[]; + + stopSchedules(): void; + + runSchedules(): void; +} diff --git a/src/backend/model/database/interfaces/ITaskManager.ts b/src/backend/model/database/interfaces/ITaskManager.ts deleted file mode 100644 index bbc27ec0..00000000 --- a/src/backend/model/database/interfaces/ITaskManager.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {TaskProgressDTO} from '../../../../common/entities/settings/TaskProgressDTO'; -import {TaskDTO} from '../../../../common/entities/task/TaskDTO'; - -export interface ITaskManager { - - run(taskId: string, config: any): Promise; - - stop(taskId: string): void; - - getProgresses(): { [key: string]: TaskProgressDTO }; - - - getAvailableTasks(): TaskDTO[]; - - stopSchedules(): void; - - runSchedules(): void; -} diff --git a/src/backend/model/diagnostics/ConfigDiagnostics.ts b/src/backend/model/diagnostics/ConfigDiagnostics.ts index 3f20bd17..0933b8aa 100644 --- a/src/backend/model/diagnostics/ConfigDiagnostics.ts +++ b/src/backend/model/diagnostics/ConfigDiagnostics.ts @@ -158,7 +158,7 @@ export class ConfigDiagnostics { } - static async testTasksConfig(task: ServerConfig.TaskConfig, config: IPrivateConfig) { + static async testTasksConfig(task: ServerConfig.JobConfig, config: IPrivateConfig) { } @@ -319,7 +319,7 @@ export class ConfigDiagnostics { try { - await ConfigDiagnostics.testTasksConfig(Config.Server.Tasks, Config); + await ConfigDiagnostics.testTasksConfig(Config.Server.Jobs, Config); } catch (ex) { const err: Error = ex; NotificationManager.warning('Some Tasks are not supported with these settings. Disabling temporally. ' + diff --git a/src/backend/model/tasks/TaskManager.ts b/src/backend/model/jobs/JobManager.ts similarity index 59% rename from src/backend/model/tasks/TaskManager.ts rename to src/backend/model/jobs/JobManager.ts index 5bfc6b88..172d379f 100644 --- a/src/backend/model/tasks/TaskManager.ts +++ b/src/backend/model/jobs/JobManager.ts @@ -1,26 +1,26 @@ -import {ITaskManager} from '../database/interfaces/ITaskManager'; -import {TaskProgressDTO} from '../../../common/entities/settings/TaskProgressDTO'; -import {ITask} from './tasks/ITask'; -import {TaskRepository} from './TaskRepository'; +import {IJobManager} from '../database/interfaces/IJobManager'; +import {JobProgressDTO} from '../../../common/entities/settings/JobProgressDTO'; +import {IJob} from './jobs/IJob'; +import {JobRepository} from './JobRepository'; import {Config} from '../../../common/config/private/Config'; -import {TaskScheduleDTO, TaskTriggerType} from '../../../common/entities/task/TaskScheduleDTO'; +import {JobScheduleDTO, JobTriggerType} from '../../../common/entities/job/JobScheduleDTO'; import {Logger} from '../../Logger'; declare var global: NodeJS.Global; -const LOG_TAG = '[TaskManager]'; +const LOG_TAG = '[JobManager]'; -export class TaskManager implements ITaskManager { +export class JobManager implements IJobManager { - protected timers: { schedule: TaskScheduleDTO, timer: NodeJS.Timeout }[] = []; + protected timers: { schedule: JobScheduleDTO, timer: NodeJS.Timeout }[] = []; constructor() { this.runSchedules(); } - getProgresses(): { [id: string]: TaskProgressDTO } { - const m: { [id: string]: TaskProgressDTO } = {}; - TaskRepository.Instance.getAvailableTasks() + getProgresses(): { [id: string]: JobProgressDTO } { + const m: { [id: string]: JobProgressDTO } = {}; + JobRepository.Instance.getAvailableJobs() .filter(t => t.Progress) .forEach(t => { t.Progress.time.current = Date.now(); @@ -29,29 +29,29 @@ export class TaskManager implements ITaskManager { return m; } - async run(taskName: string, config: T): Promise { - const t = this.findTask(taskName); + async run(jobName: string, config: T): Promise { + const t = this.findJob(jobName); if (t) { await t.start(config); } else { - Logger.warn(LOG_TAG, 'cannot find task to start:' + taskName); + Logger.warn(LOG_TAG, 'cannot find job to start:' + jobName); } } - stop(taskName: string): void { - const t = this.findTask(taskName); + stop(jobName: string): void { + const t = this.findJob(jobName); if (t) { t.stop(); if (global.gc) { global.gc(); } } else { - Logger.warn(LOG_TAG, 'cannot find task to stop:' + taskName); + Logger.warn(LOG_TAG, 'cannot find job to stop:' + jobName); } } - getAvailableTasks(): ITask[] { - return TaskRepository.Instance.getAvailableTasks(); + getAvailableJobs(): IJob[] { + return JobRepository.Instance.getAvailableJobs(); } public stopSchedules(): void { @@ -61,8 +61,8 @@ export class TaskManager implements ITaskManager { public runSchedules(): void { this.stopSchedules(); - Logger.info(LOG_TAG, 'Running task schedules'); - Config.Server.Tasks.scheduled.forEach(s => this.runSchedule(s)); + Logger.info(LOG_TAG, 'Running job schedules'); + Config.Server.Jobs.scheduled.forEach(s => this.runSchedule(s)); } protected getNextDayOfTheWeek(refDate: Date, dayOfWeek: number) { @@ -89,12 +89,12 @@ export class TaskManager implements ITaskManager { return date; } - protected getDateFromSchedule(refDate: Date, schedule: TaskScheduleDTO): Date { + protected getDateFromSchedule(refDate: Date, schedule: JobScheduleDTO): Date { switch (schedule.trigger.type) { - case TaskTriggerType.scheduled: + case JobTriggerType.scheduled: return new Date(schedule.trigger.time); - case TaskTriggerType.periodic: + case JobTriggerType.periodic: const hour = Math.floor(schedule.trigger.atTime / 1000 / (60 * 60)); @@ -111,25 +111,25 @@ export class TaskManager implements ITaskManager { return null; } - protected findTask(taskName: string): ITask { - return this.getAvailableTasks().find(t => t.Name === taskName); + protected findJob(jobName: string): IJob { + return this.getAvailableJobs().find(t => t.Name === jobName); } - private runSchedule(schedule: TaskScheduleDTO) { + private runSchedule(schedule: JobScheduleDTO) { const nextDate = this.getDateFromSchedule(new Date(), schedule); if (nextDate && nextDate.getTime() > Date.now()) { - Logger.debug(LOG_TAG, 'running schedule: ' + schedule.taskName + + Logger.debug(LOG_TAG, 'running schedule: ' + schedule.jobName + ' at ' + nextDate.toLocaleString(undefined, {hour12: false})); const timer: NodeJS.Timeout = setTimeout(async () => { this.timers = this.timers.filter(t => t.timer !== timer); - await this.run(schedule.taskName, schedule.config); + await this.run(schedule.jobName, schedule.config); this.runSchedule(schedule); }, nextDate.getTime() - Date.now()); this.timers.push({schedule: schedule, timer: timer}); } else { - Logger.debug(LOG_TAG, 'skipping schedule:' + schedule.taskName); + Logger.debug(LOG_TAG, 'skipping schedule:' + schedule.jobName); } } diff --git a/src/backend/model/jobs/JobRepository.ts b/src/backend/model/jobs/JobRepository.ts new file mode 100644 index 00000000..b9d9c438 --- /dev/null +++ b/src/backend/model/jobs/JobRepository.ts @@ -0,0 +1,34 @@ +import {IJob} from './jobs/IJob'; +import {IndexingJob} from './jobs/IndexingJob'; +import {DBRestJob} from './jobs/DBResetJob'; +import {VideoConvertingJob} from './jobs/VideoConvertingJob'; +import {PhotoConvertingJob} from './jobs/PhotoConvertingJob'; +import {ThumbnailGenerationJob} from './jobs/ThumbnailGenerationJob'; + +export class JobRepository { + + private static instance: JobRepository = null; + availableJobs: { [key: string]: IJob } = {}; + + public static get Instance(): JobRepository { + if (JobRepository.instance == null) { + JobRepository.instance = new JobRepository(); + } + return JobRepository.instance; + } + + getAvailableJobs(): IJob[] { + return Object.values(this.availableJobs).filter(t => t.Supported); + } + + register(job: IJob) { + this.availableJobs[job.Name] = job; + } +} + + +JobRepository.Instance.register(new IndexingJob()); +JobRepository.Instance.register(new DBRestJob()); +JobRepository.Instance.register(new VideoConvertingJob()); +JobRepository.Instance.register(new PhotoConvertingJob()); +JobRepository.Instance.register(new ThumbnailGenerationJob()); diff --git a/src/backend/model/tasks/tasks/DBResetTask.ts b/src/backend/model/jobs/jobs/DBResetJob.ts similarity index 57% rename from src/backend/model/tasks/tasks/DBResetTask.ts rename to src/backend/model/jobs/jobs/DBResetJob.ts index c573f28a..73872959 100644 --- a/src/backend/model/tasks/tasks/DBResetTask.ts +++ b/src/backend/model/jobs/jobs/DBResetJob.ts @@ -1,14 +1,14 @@ -import {TaskProgressDTO} from '../../../../common/entities/settings/TaskProgressDTO'; +import {JobProgressDTO} from '../../../../common/entities/settings/JobProgressDTO'; import {ObjectManagers} from '../../ObjectManagers'; import {Config} from '../../../../common/config/private/Config'; -import {ConfigTemplateEntry, DefaultsTasks} from '../../../../common/entities/task/TaskDTO'; -import {Task} from './Task'; +import {ConfigTemplateEntry, DefaultsJobs} from '../../../../common/entities/job/JobDTO'; +import {Job} from './Job'; import {ServerConfig} from '../../../../common/config/private/IPrivateConfig'; -const LOG_TAG = '[DBRestTask]'; +const LOG_TAG = '[DBRestJob]'; -export class DBRestTask extends Task { - public readonly Name = DefaultsTasks[DefaultsTasks['Database Reset']]; +export class DBRestJob extends Job { + public readonly Name = DefaultsJobs[DefaultsJobs['Database Reset']]; public readonly ConfigTemplate: ConfigTemplateEntry[] = null; protected readonly IsInstant = true; @@ -19,7 +19,7 @@ export class DBRestTask extends Task { protected async init() { } - protected async step(): Promise { + protected async step(): Promise { await ObjectManagers.getInstance().IndexingManager.resetDB(); return null; } diff --git a/src/backend/model/tasks/tasks/FileTask.ts b/src/backend/model/jobs/jobs/FileJob.ts similarity index 84% rename from src/backend/model/tasks/tasks/FileTask.ts rename to src/backend/model/jobs/jobs/FileJob.ts index 8b30ca08..4954168b 100644 --- a/src/backend/model/tasks/tasks/FileTask.ts +++ b/src/backend/model/jobs/jobs/FileJob.ts @@ -1,6 +1,6 @@ -import {TaskProgressDTO, TaskState} from '../../../../common/entities/settings/TaskProgressDTO'; -import {ConfigTemplateEntry} from '../../../../common/entities/task/TaskDTO'; -import {Task} from './Task'; +import {JobProgressDTO, JobState} from '../../../../common/entities/settings/JobProgressDTO'; +import {ConfigTemplateEntry} from '../../../../common/entities/job/JobDTO'; +import {Job} from './Job'; import * as path from 'path'; import {DiskManager} from '../../DiskManger'; import {DiskMangerWorker} from '../../threading/DiskMangerWorker'; @@ -14,7 +14,7 @@ declare var global: NodeJS.Global; const LOG_TAG = '[FileTask]'; -export abstract class FileTask extends Task { +export abstract class FileJob extends Job { public readonly ConfigTemplate: ConfigTemplateEntry[] = null; directoryQueue: string[] = []; fileQueue: T[] = []; @@ -34,9 +34,9 @@ export abstract class FileTask extends Task { protected abstract async processFile(file: T): Promise; - protected async step(): Promise { + protected async step(): Promise { if ((this.directoryQueue.length === 0 && this.fileQueue.length === 0) - || this.state !== TaskState.running) { + || this.state !== JobState.running) { if (global.gc) { global.gc(); } diff --git a/src/backend/model/jobs/jobs/IJob.ts b/src/backend/model/jobs/jobs/IJob.ts new file mode 100644 index 00000000..b369dc62 --- /dev/null +++ b/src/backend/model/jobs/jobs/IJob.ts @@ -0,0 +1,14 @@ +import {JobProgressDTO} from '../../../../common/entities/settings/JobProgressDTO'; +import {JobDTO} from '../../../../common/entities/job/JobDTO'; + +export interface IJob extends JobDTO { + Name: string; + Supported: boolean; + Progress: JobProgressDTO; + + start(config: T): Promise; + + stop(): void; + + toJSON(): JobDTO; +} diff --git a/src/backend/model/tasks/tasks/IndexingTask.ts b/src/backend/model/jobs/jobs/IndexingJob.ts similarity index 73% rename from src/backend/model/tasks/tasks/IndexingTask.ts rename to src/backend/model/jobs/jobs/IndexingJob.ts index 75dca015..7e34d996 100644 --- a/src/backend/model/tasks/tasks/IndexingTask.ts +++ b/src/backend/model/jobs/jobs/IndexingJob.ts @@ -1,16 +1,16 @@ -import {TaskProgressDTO, TaskState} from '../../../../common/entities/settings/TaskProgressDTO'; +import {JobProgressDTO, JobState} from '../../../../common/entities/settings/JobProgressDTO'; import {ObjectManagers} from '../../ObjectManagers'; import * as path from 'path'; import {Config} from '../../../../common/config/private/Config'; -import {Task} from './Task'; -import {ConfigTemplateEntry, DefaultsTasks} from '../../../../common/entities/task/TaskDTO'; +import {Job} from './Job'; +import {ConfigTemplateEntry, DefaultsJobs} from '../../../../common/entities/job/JobDTO'; import {ServerConfig} from '../../../../common/config/private/IPrivateConfig'; declare var global: NodeJS.Global; -const LOG_TAG = '[IndexingTask]'; +const LOG_TAG = '[IndexingJob]'; -export class IndexingTask extends Task { - public readonly Name = DefaultsTasks[DefaultsTasks.Indexing]; +export class IndexingJob extends Job { + public readonly Name = DefaultsJobs[DefaultsJobs.Indexing]; directoriesToIndex: string[] = []; public readonly ConfigTemplate: ConfigTemplateEntry[] = null; @@ -23,7 +23,7 @@ export class IndexingTask extends Task { this.directoriesToIndex.push('/'); } - protected async step(): Promise { + protected async step(): Promise { if (this.directoriesToIndex.length === 0) { if (global.gc) { global.gc(); @@ -34,7 +34,7 @@ export class IndexingTask extends Task { this.progress.comment = directory; this.progress.left = this.directoriesToIndex.length; const scanned = await ObjectManagers.getInstance().IndexingManager.indexDirectory(directory); - if (this.state !== TaskState.running) { + if (this.state !== JobState.running) { return null; } this.progress.progress++; diff --git a/src/backend/model/tasks/tasks/Task.ts b/src/backend/model/jobs/jobs/Job.ts similarity index 59% rename from src/backend/model/tasks/tasks/Task.ts rename to src/backend/model/jobs/jobs/Job.ts index 4436370d..415c67d0 100644 --- a/src/backend/model/tasks/tasks/Task.ts +++ b/src/backend/model/jobs/jobs/Job.ts @@ -1,14 +1,16 @@ -import {TaskProgressDTO, TaskState} from '../../../../common/entities/settings/TaskProgressDTO'; +import {JobProgressDTO, JobState} from '../../../../common/entities/settings/JobProgressDTO'; import {Logger} from '../../../Logger'; -import {ITask} from './ITask'; -import {ConfigTemplateEntry, TaskDTO} from '../../../../common/entities/task/TaskDTO'; +import {IJob} from './IJob'; +import {ConfigTemplateEntry, JobDTO} from '../../../../common/entities/job/JobDTO'; declare const process: any; -export abstract class Task implements ITask { +const LOG_TAG = '[JOB]'; - protected progress: TaskProgressDTO = null; - protected state = TaskState.idle; +export abstract class Job implements IJob { + + protected progress: JobProgressDTO = null; + protected state = JobState.idle; protected config: T; protected prResolve: () => void; protected IsInstant = false; @@ -22,19 +24,19 @@ export abstract class Task implements ITask { public abstract get ConfigTemplate(): ConfigTemplateEntry[]; - public get Progress(): TaskProgressDTO { + public get Progress(): JobProgressDTO { return this.progress; } public start(config: T): Promise { - if (this.state === TaskState.idle && this.Supported) { - Logger.info('[Task]', 'Running task: ' + this.Name); + if (this.state === JobState.idle && this.Supported) { + Logger.info(LOG_TAG, 'Running job: ' + this.Name); this.config = config; this.progress = { progress: 0, left: 0, comment: '', - state: TaskState.running, + state: JobState.running, time: { start: Date.now(), current: Date.now() @@ -44,38 +46,38 @@ export abstract class Task implements ITask { this.prResolve = resolve; }); this.init().catch(console.error); - this.state = TaskState.running; + this.state = JobState.running; this.run(); if (!this.IsInstant) { // if instant, wait for execution, otherwise, return right away return Promise.resolve(); } return pr; } else { - Logger.info('[Task]', 'Task already running: ' + this.Name); + Logger.info(LOG_TAG, 'Job already running: ' + this.Name); return Promise.reject(); } } public stop(): void { - Logger.info('[Task]', 'Stopping task: ' + this.Name); - this.state = TaskState.stopping; - this.progress.state = TaskState.stopping; + Logger.info(LOG_TAG, 'Stopping job: ' + this.Name); + this.state = JobState.stopping; + this.progress.state = JobState.stopping; } - public toJSON(): TaskDTO { + public toJSON(): JobDTO { return { Name: this.Name, ConfigTemplate: this.ConfigTemplate }; } - protected abstract async step(): Promise; + protected abstract async step(): Promise; protected abstract async init(): Promise; private onFinish(): void { this.progress = null; - Logger.info('[Task]', 'Task finished: ' + this.Name); + Logger.info(LOG_TAG, 'Job finished: ' + this.Name); if (this.IsInstant) { this.prResolve(); } @@ -84,19 +86,19 @@ export abstract class Task implements ITask { private run() { process.nextTick(async () => { try { - if (this.state === TaskState.idle) { + if (this.state === JobState.idle) { this.progress = null; return; } this.progress = await this.step(); if (this.progress == null) { // finished - this.state = TaskState.idle; + this.state = JobState.idle; this.onFinish(); return; } this.run(); } catch (e) { - Logger.error('[Task]', e); + Logger.error(LOG_TAG, e); } }); } diff --git a/src/backend/model/tasks/tasks/PhotoConvertingTask.ts b/src/backend/model/jobs/jobs/PhotoConvertingJob.ts similarity index 77% rename from src/backend/model/tasks/tasks/PhotoConvertingTask.ts rename to src/backend/model/jobs/jobs/PhotoConvertingJob.ts index ad880580..a3cc20a3 100644 --- a/src/backend/model/tasks/tasks/PhotoConvertingTask.ts +++ b/src/backend/model/jobs/jobs/PhotoConvertingJob.ts @@ -1,20 +1,19 @@ import {Config} from '../../../../common/config/private/Config'; -import {DefaultsTasks} from '../../../../common/entities/task/TaskDTO'; +import {DefaultsJobs} from '../../../../common/entities/job/JobDTO'; import {ProjectPath} from '../../../ProjectPath'; import * as path from 'path'; import * as fs from 'fs'; import * as util from 'util'; -import {FileTask} from './FileTask'; +import {FileJob} from './FileJob'; import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; import {PhotoProcessing} from '../../fileprocessing/PhotoProcessing'; -import {ThumbnailSourceType} from '../../threading/ThumbnailWorker'; -const LOG_TAG = '[PhotoConvertingTask]'; +const LOG_TAG = '[PhotoConvertingJob]'; const existsPr = util.promisify(fs.exists); -export class PhotoConvertingTask extends FileTask { - public readonly Name = DefaultsTasks[DefaultsTasks['Photo Converting']]; +export class PhotoConvertingJob extends FileJob { + public readonly Name = DefaultsJobs[DefaultsJobs['Photo Converting']]; constructor() { super({noVideo: true, noMetaFile: true}); diff --git a/src/backend/model/tasks/tasks/ThumbnailGenerationTask.ts b/src/backend/model/jobs/jobs/ThumbnailGenerationJob.ts similarity index 83% rename from src/backend/model/tasks/tasks/ThumbnailGenerationTask.ts rename to src/backend/model/jobs/jobs/ThumbnailGenerationJob.ts index 0c2873ca..edd2149f 100644 --- a/src/backend/model/tasks/tasks/ThumbnailGenerationTask.ts +++ b/src/backend/model/jobs/jobs/ThumbnailGenerationJob.ts @@ -1,21 +1,21 @@ import {Config} from '../../../../common/config/private/Config'; -import {ConfigTemplateEntry, DefaultsTasks} from '../../../../common/entities/task/TaskDTO'; +import {ConfigTemplateEntry, DefaultsJobs} from '../../../../common/entities/job/JobDTO'; import {ProjectPath} from '../../../ProjectPath'; import * as path from 'path'; import * as fs from 'fs'; import * as util from 'util'; -import {FileTask} from './FileTask'; +import {FileJob} from './FileJob'; import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; import {PhotoProcessing} from '../../fileprocessing/PhotoProcessing'; import {ThumbnailSourceType} from '../../threading/ThumbnailWorker'; import {MediaDTO} from '../../../../common/entities/MediaDTO'; -const LOG_TAG = '[ThumbnailGenerationTask]'; +const LOG_TAG = '[ThumbnailGenerationJob]'; const existsPr = util.promisify(fs.exists); -export class ThumbnailGenerationTask extends FileTask { - public readonly Name = DefaultsTasks[DefaultsTasks['Thumbnail Generation']]; +export class ThumbnailGenerationJob extends FileJob { + public readonly Name = DefaultsJobs[DefaultsJobs['Thumbnail Generation']]; public readonly ConfigTemplate: ConfigTemplateEntry[] = [{ id: 'sizes', type: 'number-array', diff --git a/src/backend/model/tasks/tasks/VideoConvertingTask.ts b/src/backend/model/jobs/jobs/VideoConvertingJob.ts similarity index 80% rename from src/backend/model/tasks/tasks/VideoConvertingTask.ts rename to src/backend/model/jobs/jobs/VideoConvertingJob.ts index 823dd968..15da4fd5 100644 --- a/src/backend/model/tasks/tasks/VideoConvertingTask.ts +++ b/src/backend/model/jobs/jobs/VideoConvertingJob.ts @@ -1,19 +1,19 @@ import {Config} from '../../../../common/config/private/Config'; -import {DefaultsTasks} from '../../../../common/entities/task/TaskDTO'; +import {DefaultsJobs} from '../../../../common/entities/job/JobDTO'; import {ProjectPath} from '../../../ProjectPath'; import * as path from 'path'; import * as fs from 'fs'; import * as util from 'util'; -import {FileTask} from './FileTask'; +import {FileJob} from './FileJob'; import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; import {VideoProcessing} from '../../fileprocessing/VideoProcessing'; -const LOG_TAG = '[VideoConvertingTask]'; +const LOG_TAG = '[VideoConvertingJob]'; const existsPr = util.promisify(fs.exists); -export class VideoConvertingTask extends FileTask { - public readonly Name = DefaultsTasks[DefaultsTasks['Video Converting']]; +export class VideoConvertingJob extends FileJob { + public readonly Name = DefaultsJobs[DefaultsJobs['Video Converting']]; constructor() { super({noPhoto: true, noMetaFile: true}); diff --git a/src/backend/model/tasks/TaskRepository.ts b/src/backend/model/tasks/TaskRepository.ts deleted file mode 100644 index 3528b4ce..00000000 --- a/src/backend/model/tasks/TaskRepository.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {ITask} from './tasks/ITask'; -import {IndexingTask} from './tasks/IndexingTask'; -import {DBRestTask} from './tasks/DBResetTask'; -import {VideoConvertingTask} from './tasks/VideoConvertingTask'; -import {PhotoConvertingTask} from './tasks/PhotoConvertingTask'; -import {ThumbnailGenerationTask} from './tasks/ThumbnailGenerationTask'; - -export class TaskRepository { - - private static instance: TaskRepository = null; - availableTasks: { [key: string]: ITask } = {}; - - public static get Instance(): TaskRepository { - if (TaskRepository.instance == null) { - TaskRepository.instance = new TaskRepository(); - } - return TaskRepository.instance; - } - - getAvailableTasks(): ITask[] { - return Object.values(this.availableTasks).filter(t => t.Supported); - } - - register(task: ITask) { - this.availableTasks[task.Name] = task; - } -} - - -TaskRepository.Instance.register(new IndexingTask()); -TaskRepository.Instance.register(new DBRestTask()); -TaskRepository.Instance.register(new VideoConvertingTask()); -TaskRepository.Instance.register(new PhotoConvertingTask()); -TaskRepository.Instance.register(new ThumbnailGenerationTask()); diff --git a/src/backend/model/tasks/tasks/ITask.ts b/src/backend/model/tasks/tasks/ITask.ts deleted file mode 100644 index 7369a43e..00000000 --- a/src/backend/model/tasks/tasks/ITask.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {TaskProgressDTO} from '../../../../common/entities/settings/TaskProgressDTO'; -import {TaskDTO} from '../../../../common/entities/task/TaskDTO'; - -export interface ITask extends TaskDTO { - Name: string; - Supported: boolean; - Progress: TaskProgressDTO; - - start(config: T): Promise; - - stop(): void; - - toJSON(): TaskDTO; -} diff --git a/src/backend/model/threading/DiskMangerWorker.ts b/src/backend/model/threading/DiskMangerWorker.ts index 80a6a1c5..7c3bef7a 100644 --- a/src/backend/model/threading/DiskMangerWorker.ts +++ b/src/backend/model/threading/DiskMangerWorker.ts @@ -11,7 +11,7 @@ import {MetadataLoader} from './MetadataLoader'; import {Logger} from '../../Logger'; import {SupportedFormats} from '../../../common/SupportedFormats'; -const LOG_TAG = '[DiskManagerTask]'; +const LOG_TAG = '[DiskMangerWorker]'; export class DiskMangerWorker { diff --git a/src/backend/routes/admin/AdminRouter.ts b/src/backend/routes/admin/AdminRouter.ts index 70baedd5..5bd4d1c9 100644 --- a/src/backend/routes/admin/AdminRouter.ts +++ b/src/backend/routes/admin/AdminRouter.ts @@ -9,7 +9,7 @@ export class AdminRouter { this.addGetStatistic(app); this.addGetDuplicates(app); - this.addTasks(app); + this.addJobs(app); } private static addGetStatistic(app: Express) { @@ -30,29 +30,29 @@ export class AdminRouter { ); } - private static addTasks(app: Express) { - app.get('/api/admin/tasks/available', + private static addJobs(app: Express) { + app.get('/api/admin/jobs/available', AuthenticationMWs.authenticate, AuthenticationMWs.authorise(UserRoles.Admin), - AdminMWs.getAvailableTasks, + AdminMWs.getAvailableJobs, RenderingMWs.renderResult ); - app.get('/api/admin/tasks/scheduled/progress', + app.get('/api/admin/jobs/scheduled/progress', AuthenticationMWs.authenticate, AuthenticationMWs.authorise(UserRoles.Admin), - AdminMWs.getTaskProgresses, + AdminMWs.getJobProgresses, RenderingMWs.renderResult ); - app.post('/api/admin/tasks/scheduled/:id/start', + app.post('/api/admin/jobs/scheduled/:id/start', AuthenticationMWs.authenticate, AuthenticationMWs.authorise(UserRoles.Admin), - AdminMWs.startTask, + AdminMWs.startJob, RenderingMWs.renderResult ); - app.post('/api/admin/tasks/scheduled/:id/stop', + app.post('/api/admin/jobs/scheduled/:id/stop', AuthenticationMWs.authenticate, AuthenticationMWs.authorise(UserRoles.Admin), - AdminMWs.stopTask, + AdminMWs.stopJob, RenderingMWs.renderResult ); } diff --git a/src/common/config/private/IPrivateConfig.ts b/src/common/config/private/IPrivateConfig.ts index 7d32e6ad..465e65f4 100644 --- a/src/common/config/private/IPrivateConfig.ts +++ b/src/common/config/private/IPrivateConfig.ts @@ -1,5 +1,5 @@ import {ClientConfig} from '../public/ConfigClass'; -import {TaskScheduleDTO} from '../../entities/task/TaskScheduleDTO'; +import {JobScheduleDTO} from '../../entities/job/JobScheduleDTO'; export module ServerConfig { export enum DatabaseType { @@ -77,8 +77,8 @@ export module ServerConfig { sqlLevel: SQLLogLevel; } - export interface TaskConfig { - scheduled: TaskScheduleDTO[]; + export interface JobConfig { + scheduled: JobScheduleDTO[]; } export type codecType = 'libvpx-vp9' | 'libx264' | 'libvpx' | 'libx265'; @@ -125,7 +125,7 @@ export module ServerConfig { photoMetadataSize: number; // only this many bites will be loaded when scanning photo for metadata Duplicates: DuplicatesConfig; Log: LogConfig; - Tasks: TaskConfig; + Jobs: JobConfig; } } diff --git a/src/common/config/private/PrivateConfigDefaultsClass.ts b/src/common/config/private/PrivateConfigDefaultsClass.ts index a2d0b0dd..d51450e8 100644 --- a/src/common/config/private/PrivateConfigDefaultsClass.ts +++ b/src/common/config/private/PrivateConfigDefaultsClass.ts @@ -1,7 +1,7 @@ import {PublicConfigClass} from '../public/ConfigClass'; import {IPrivateConfig, ServerConfig} from './IPrivateConfig'; -import {TaskTriggerType} from '../../entities/task/TaskScheduleDTO'; -import {DefaultsTasks} from '../../entities/task/TaskDTO'; +import {JobTriggerType} from '../../entities/job/JobScheduleDTO'; +import {DefaultsJobs} from '../../entities/job/JobDTO'; /** * This configuration will be only at backend @@ -74,19 +74,19 @@ export class PrivateConfigDefaultsClass extends PublicConfigClass implements IPr Duplicates: { listingLimit: 1000 }, - Tasks: { + Jobs: { scheduled: [{ - taskName: DefaultsTasks[DefaultsTasks['Database Reset']], + jobName: DefaultsJobs[DefaultsJobs['Database Reset']], config: {}, - trigger: {type: TaskTriggerType.never} + trigger: {type: JobTriggerType.never} }, { - taskName: DefaultsTasks[DefaultsTasks.Indexing], + jobName: DefaultsJobs[DefaultsJobs.Indexing], config: {}, - trigger: {type: TaskTriggerType.never} + trigger: {type: JobTriggerType.never} }, { - taskName: DefaultsTasks[DefaultsTasks['Video Converting']], + jobName: DefaultsJobs[DefaultsJobs['Video Converting']], config: {}, - trigger: {type: TaskTriggerType.never} + trigger: {type: JobTriggerType.never} }] } }; diff --git a/src/common/entities/Error.ts b/src/common/entities/Error.ts index bdc64b9b..2fca81f5 100644 --- a/src/common/entities/Error.ts +++ b/src/common/entities/Error.ts @@ -19,7 +19,8 @@ export enum ErrorCodes { INPUT_ERROR = 12, SETTINGS_ERROR = 13, - TASK_ERROR = 14 + TASK_ERROR = 14, + JOB_ERROR = 15 } export class ErrorDTO { diff --git a/src/common/entities/task/TaskDTO.ts b/src/common/entities/job/JobDTO.ts similarity index 86% rename from src/common/entities/task/TaskDTO.ts rename to src/common/entities/job/JobDTO.ts index 6a58e1de..e2f98144 100644 --- a/src/common/entities/task/TaskDTO.ts +++ b/src/common/entities/job/JobDTO.ts @@ -1,7 +1,7 @@ export type fieldType = 'string' | 'number' | 'boolean' | 'number-array'; -export enum DefaultsTasks { +export enum DefaultsJobs { Indexing = 1, 'Database Reset' = 2, 'Video Converting' = 3, 'Photo Converting' = 4, 'Thumbnail Generation' = 5 } @@ -12,7 +12,7 @@ export interface ConfigTemplateEntry { defaultValue: any; } -export interface TaskDTO { +export interface JobDTO { Name: string; ConfigTemplate: ConfigTemplateEntry[]; } diff --git a/src/common/entities/job/JobScheduleDTO.ts b/src/common/entities/job/JobScheduleDTO.ts new file mode 100644 index 00000000..7176c96a --- /dev/null +++ b/src/common/entities/job/JobScheduleDTO.ts @@ -0,0 +1,28 @@ +export enum JobTriggerType { + never = 1, scheduled = 2, periodic = 3 +} + +export interface JobTrigger { + type: JobTriggerType; +} + +export interface NeverJobTrigger { + type: JobTriggerType.never; +} + +export interface ScheduledJobTrigger extends JobTrigger { + type: JobTriggerType.scheduled; + time: number; // data time +} + +export interface PeriodicJobTrigger extends JobTrigger { + type: JobTriggerType.periodic; + periodicity: number; // 0-6: week days 7 every day + atTime: number; // day time +} + +export interface JobScheduleDTO { + jobName: string; + config: any; + trigger: NeverJobTrigger | ScheduledJobTrigger | PeriodicJobTrigger; +} diff --git a/src/common/entities/settings/TaskProgressDTO.ts b/src/common/entities/settings/JobProgressDTO.ts similarity index 65% rename from src/common/entities/settings/TaskProgressDTO.ts rename to src/common/entities/settings/JobProgressDTO.ts index 0f5991db..f743391a 100644 --- a/src/common/entities/settings/TaskProgressDTO.ts +++ b/src/common/entities/settings/JobProgressDTO.ts @@ -1,12 +1,12 @@ -export enum TaskState { +export enum JobState { idle = 1, running = 2, stopping = 3 } -export interface TaskProgressDTO { +export interface JobProgressDTO { progress: number; left: number; - state: TaskState; + state: JobState; comment: string; time: { start: number, diff --git a/src/common/entities/task/TaskScheduleDTO.ts b/src/common/entities/task/TaskScheduleDTO.ts deleted file mode 100644 index 832b78ca..00000000 --- a/src/common/entities/task/TaskScheduleDTO.ts +++ /dev/null @@ -1,28 +0,0 @@ -export enum TaskTriggerType { - never = 1, scheduled = 2, periodic = 3 -} - -export interface TaskTrigger { - type: TaskTriggerType; -} - -export interface NeverTaskTrigger { - type: TaskTriggerType.never; -} - -export interface ScheduledTaskTrigger extends TaskTrigger { - type: TaskTriggerType.scheduled; - time: number; // data time -} - -export interface PeriodicTaskTrigger extends TaskTrigger { - type: TaskTriggerType.periodic; - periodicity: number; // 0-6: week days 7 every day - atTime: number; // day time -} - -export interface TaskScheduleDTO { - taskName: string; - config: any; - trigger: NeverTaskTrigger | ScheduledTaskTrigger | PeriodicTaskTrigger; -} diff --git a/src/frontend/app/app.module.ts b/src/frontend/app/app.module.ts index e4f562c2..be914152 100644 --- a/src/frontend/app/app.module.ts +++ b/src/frontend/app/app.module.ts @@ -81,14 +81,13 @@ import {VersionService} from './model/version.service'; import {DirectoriesComponent} from './ui/gallery/directories/directories.component'; import {ControlsLightboxComponent} from './ui/gallery/lightbox/controls/controls.lightbox.gallery.component'; import {FacesSettingsComponent} from './ui/settings/faces/faces.settings.component'; -import {TasksSettingsComponent} from './ui/settings/tasks/tasks.settings.component'; -import {ScheduledTasksService} from './ui/settings/scheduled-tasks.service'; import {TimepickerModule} from 'ngx-bootstrap/timepicker'; import {TimeStampDatePickerComponent} from './ui/utils/timestamp-datepicker/datepicker.component'; import {TimeStampTimePickerComponent} from './ui/utils/timestamp-timepicker/timepicker.component'; -import {TasksProgressComponent} from './ui/settings/tasks/progress/progress.tasks.settings.component'; import {PhotoSettingsComponent} from './ui/settings/photo/photo.settings.component'; - +import {JobProgressComponent} from './ui/settings/jobs/progress/job-progress.settings.component'; +import {JobsSettingsComponent} from './ui/settings/jobs/jobs.settings.component'; +import {ScheduledJobsService} from './ui/settings/scheduled-jobs.service'; @Injectable() @@ -198,8 +197,8 @@ export function translationsFactory(locale: string) { FacesSettingsComponent, OtherSettingsComponent, IndexingSettingsComponent, - TasksProgressComponent, - TasksSettingsComponent, + JobProgressComponent, + JobsSettingsComponent, // Pipes StringifyRole, IconizeSortingMethod, @@ -230,7 +229,7 @@ export function translationsFactory(locale: string) { DuplicateService, FacesService, VersionService, - ScheduledTasksService, + ScheduledJobsService, { provide: TRANSLATIONS, useFactory: translationsFactory, diff --git a/src/frontend/app/ui/admin/admin.component.html b/src/frontend/app/ui/admin/admin.component.html index f3072d0a..726bb462 100644 --- a/src/frontend/app/ui/admin/admin.component.html +++ b/src/frontend/app/ui/admin/admin.component.html @@ -105,9 +105,9 @@ - + diff --git a/src/frontend/app/ui/settings/indexing/indexing.settings.component.html b/src/frontend/app/ui/settings/indexing/indexing.settings.component.html index ef4f75e0..bc1d8f48 100644 --- a/src/frontend/app/ui/settings/indexing/indexing.settings.component.html +++ b/src/frontend/app/ui/settings/indexing/indexing.settings.component.html @@ -108,7 +108,7 @@
- +
@@ -123,7 +123,7 @@ @@ -31,16 +31,16 @@
- +
- + Select a task to schedule. + i18n>Select a job to schedule.
@@ -48,20 +48,20 @@
Set the time to run the task. + i18n>Set the time to run the job.
-
+
-
+
-
@@ -15,7 +15,7 @@
diff --git a/src/frontend/app/ui/settings/tasks/progress/progress.tasks.settings.component.ts b/src/frontend/app/ui/settings/jobs/progress/job-progress.settings.component.ts similarity index 74% rename from src/frontend/app/ui/settings/tasks/progress/progress.tasks.settings.component.ts rename to src/frontend/app/ui/settings/jobs/progress/job-progress.settings.component.ts index f264ffe3..edcf9707 100644 --- a/src/frontend/app/ui/settings/tasks/progress/progress.tasks.settings.component.ts +++ b/src/frontend/app/ui/settings/jobs/progress/job-progress.settings.component.ts @@ -1,16 +1,16 @@ import {Component, Input, OnChanges, OnDestroy} from '@angular/core'; -import {TaskProgressDTO, TaskState} from '../../../../../../common/entities/settings/TaskProgressDTO'; +import {JobProgressDTO, JobState} from '../../../../../../common/entities/settings/JobProgressDTO'; import {Subscription, timer} from 'rxjs'; @Component({ - selector: 'app-settings-tasks-progress', - templateUrl: './progress.tasks.settings.component.html', - styleUrls: ['./progress.tasks.settings.component.css'] + selector: 'app-settings-job-progress', + templateUrl: './job-progress.settings.component.html', + styleUrls: ['./job-progress.settings.component.css'] }) -export class TasksProgressComponent implements OnDestroy, OnChanges { +export class JobProgressComponent implements OnDestroy, OnChanges { - @Input() progress: TaskProgressDTO; - TaskState = TaskState; + @Input() progress: JobProgressDTO; + JobState = JobState; timeCurrentCopy: number; private timerSub: Subscription; diff --git a/src/frontend/app/ui/settings/photo/photo.settings.component.html b/src/frontend/app/ui/settings/photo/photo.settings.component.html index c705dbcb..9210f39c 100644 --- a/src/frontend/app/ui/settings/photo/photo.settings.component.html +++ b/src/frontend/app/ui/settings/photo/photo.settings.component.html @@ -110,7 +110,7 @@ @@ -118,7 +118,7 @@

- +
diff --git a/src/frontend/app/ui/settings/photo/photo.settings.component.ts b/src/frontend/app/ui/settings/photo/photo.settings.component.ts index ca67938f..8b97e349 100644 --- a/src/frontend/app/ui/settings/photo/photo.settings.component.ts +++ b/src/frontend/app/ui/settings/photo/photo.settings.component.ts @@ -6,12 +6,12 @@ import {NavigationService} from '../../../model/navigation.service'; import {NotificationService} from '../../../model/notification.service'; import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {I18n} from '@ngx-translate/i18n-polyfill'; -import {ScheduledTasksService} from '../scheduled-tasks.service'; +import {ScheduledJobsService} from '../scheduled-jobs.service'; import {ServerConfig} from '../../../../../common/config/private/IPrivateConfig'; import {Utils} from '../../../../../common/Utils'; -import {DefaultsTasks} from '../../../../../common/entities/task/TaskDTO'; +import {DefaultsJobs} from '../../../../../common/entities/job/JobDTO'; import {ErrorDTO} from '../../../../../common/entities/Error'; -import {TaskState} from '../../../../../common/entities/settings/TaskProgressDTO'; +import {JobState} from '../../../../../common/entities/settings/JobProgressDTO'; @Component({ @@ -28,7 +28,7 @@ export class PhotoSettingsComponent extends SettingsComponent<{ }> { resolutions = [720, 1080, 1440, 2160, 4320]; PhotoProcessingLib = ServerConfig.PhotoProcessingLib; - TaskState = TaskState; + JobState = JobState; libTypes = Utils .enumToArray(ServerConfig.PhotoProcessingLib).map((v) => { @@ -43,7 +43,7 @@ export class PhotoSettingsComponent extends SettingsComponent<{ constructor(_authService: AuthenticationService, _navigation: NavigationService, _settingsService: PhotoSettingsService, - public tasksService: ScheduledTasksService, + public jobsService: ScheduledJobsService, notification: NotificationService, i18n: I18n) { super(i18n('Photo'), _authService, _navigation, _settingsService, notification, i18n, s => ({ @@ -59,14 +59,14 @@ export class PhotoSettingsComponent extends SettingsComponent<{ get Progress() { - return this.tasksService.progress.value[DefaultsTasks[DefaultsTasks['Photo Converting']]]; + return this.jobsService.progress.value[DefaultsJobs[DefaultsJobs['Photo Converting']]]; } async convertPhoto() { this.inProgress = true; this.error = ''; try { - await this.tasksService.start(DefaultsTasks[DefaultsTasks['Photo Converting']]); + await this.jobsService.start(DefaultsJobs[DefaultsJobs['Photo Converting']]); this.notification.info(this.i18n('Photo converting started')); return true; } catch (err) { @@ -85,7 +85,7 @@ export class PhotoSettingsComponent extends SettingsComponent<{ this.inProgress = true; this.error = ''; try { - await this.tasksService.stop(DefaultsTasks[DefaultsTasks['Photo Converting']]); + await this.jobsService.stop(DefaultsJobs[DefaultsJobs['Photo Converting']]); this.notification.info(this.i18n('Photo converting interrupted')); return true; } catch (err) { diff --git a/src/frontend/app/ui/settings/scheduled-tasks.service.ts b/src/frontend/app/ui/settings/scheduled-jobs.service.ts similarity index 72% rename from src/frontend/app/ui/settings/scheduled-tasks.service.ts rename to src/frontend/app/ui/settings/scheduled-jobs.service.ts index bdbc88f3..54739b49 100644 --- a/src/frontend/app/ui/settings/scheduled-tasks.service.ts +++ b/src/frontend/app/ui/settings/scheduled-jobs.service.ts @@ -1,14 +1,14 @@ import {EventEmitter, Injectable} from '@angular/core'; import {BehaviorSubject} from 'rxjs'; -import {TaskProgressDTO} from '../../../../common/entities/settings/TaskProgressDTO'; +import {JobProgressDTO} from '../../../../common/entities/settings/JobProgressDTO'; import {NetworkService} from '../../model/network/network.service'; @Injectable() -export class ScheduledTasksService { +export class ScheduledJobsService { - public progress: BehaviorSubject<{ [key: string]: TaskProgressDTO }>; - public onTaskFinish: EventEmitter = new EventEmitter(); + public progress: BehaviorSubject<{ [key: string]: JobProgressDTO }>; + public onJobFinish: EventEmitter = new EventEmitter(); timer: number = null; private subscribers = 0; @@ -16,13 +16,13 @@ export class ScheduledTasksService { this.progress = new BehaviorSubject({}); } - public calcTimeElapsed(progress: TaskProgressDTO) { + public calcTimeElapsed(progress: JobProgressDTO) { if (progress) { return (progress.time.current - progress.time.start); } } - public calcTimeLeft(progress: TaskProgressDTO) { + public calcTimeLeft(progress: JobProgressDTO) { if (progress) { return (progress.time.current - progress.time.start) / progress.progress * progress.left; } @@ -41,21 +41,21 @@ export class ScheduledTasksService { } public async start(id: string, config?: any): Promise { - await this._networkService.postJson('/admin/tasks/scheduled/' + id + '/start', {config: config}); + await this._networkService.postJson('/admin/jobs/scheduled/' + id + '/start', {config: config}); this.forceUpdate(); } public async stop(id: string): Promise { - await this._networkService.postJson('/admin/tasks/scheduled/' + id + '/stop'); + await this._networkService.postJson('/admin/jobs/scheduled/' + id + '/stop'); this.forceUpdate(); } protected async getProgress(): Promise { const prevPrg = this.progress.value; - this.progress.next(await this._networkService.getJson<{ [key: string]: TaskProgressDTO }>('/admin/tasks/scheduled/progress')); + this.progress.next(await this._networkService.getJson<{ [key: string]: JobProgressDTO }>('/admin/jobs/scheduled/progress')); for (const prg in prevPrg) { if (!this.progress.value.hasOwnProperty(prg)) { - this.onTaskFinish.emit(prg); + this.onJobFinish.emit(prg); } } } diff --git a/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.html b/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.html index d0655459..c2351709 100644 --- a/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.html +++ b/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.html @@ -80,21 +80,21 @@ [disabled]="inProgress" title="Generates all thumbnails now" i18n-title - (click)="startTask()"> + (click)="startJob()"> Generate thumbnails now

- +
diff --git a/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.ts b/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.ts index 871ebdc5..e07d2386 100644 --- a/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.ts +++ b/src/frontend/app/ui/settings/thumbnail/thumbnail.settings.component.ts @@ -7,10 +7,10 @@ import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {ThumbnailSettingsService} from './thumbnail.settings.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; import {ServerConfig} from '../../../../../common/config/private/IPrivateConfig'; -import {DefaultsTasks} from '../../../../../common/entities/task/TaskDTO'; +import {DefaultsJobs} from '../../../../../common/entities/job/JobDTO'; import {ErrorDTO} from '../../../../../common/entities/Error'; -import {ScheduledTasksService} from '../scheduled-tasks.service'; -import {TaskState} from '../../../../../common/entities/settings/TaskProgressDTO'; +import {ScheduledJobsService} from '../scheduled-jobs.service'; +import {JobState} from '../../../../../common/entities/settings/JobProgressDTO'; @Component({ selector: 'app-settings-thumbnail', @@ -22,13 +22,13 @@ import {TaskState} from '../../../../../common/entities/settings/TaskProgressDTO export class ThumbnailSettingsComponent extends SettingsComponent<{ server: ServerConfig.ThumbnailConfig, client: ClientConfig.ThumbnailConfig }> implements OnInit { - TaskState = TaskState; + JobState = JobState; constructor(_authService: AuthenticationService, _navigation: NavigationService, _settingsService: ThumbnailSettingsService, notification: NotificationService, - public tasksService: ScheduledTasksService, + public jobsService: ScheduledJobsService, i18n: I18n) { super(i18n('Thumbnail'), _authService, _navigation, _settingsService, notification, i18n, s => ({ client: s.Client.Media.Thumbnail, @@ -49,18 +49,18 @@ export class ThumbnailSettingsComponent } get Progress() { - return this.tasksService.progress.value[DefaultsTasks[DefaultsTasks['Thumbnail Generation']]]; + return this.jobsService.progress.value[DefaultsJobs[DefaultsJobs['Thumbnail Generation']]]; } ngOnInit() { super.ngOnInit(); } - async startTask() { + async startJob() { this.inProgress = true; this.error = ''; try { - await this.tasksService.start(DefaultsTasks[DefaultsTasks['Thumbnail Generation']], {sizes: this.original.client.thumbnailSizes[0]}); + await this.jobsService.start(DefaultsJobs[DefaultsJobs['Thumbnail Generation']], {sizes: this.original.client.thumbnailSizes[0]}); this.notification.info(this.i18n('Thumbnail generation started')); this.inProgress = false; return true; @@ -75,11 +75,11 @@ export class ThumbnailSettingsComponent return false; } - async cancelTask() { + async cancelJob() { this.inProgress = true; this.error = ''; try { - await this.tasksService.stop(DefaultsTasks[DefaultsTasks['Thumbnail Generation']]); + await this.jobsService.stop(DefaultsJobs[DefaultsJobs['Thumbnail Generation']]); this.notification.info(this.i18n('Thumbnail generation interrupted')); this.inProgress = false; return true; diff --git a/src/frontend/app/ui/settings/video/video.settings.component.html b/src/frontend/app/ui/settings/video/video.settings.component.html index 14cdf9d6..12ae71ef 100644 --- a/src/frontend/app/ui/settings/video/video.settings.component.html +++ b/src/frontend/app/ui/settings/video/video.settings.component.html @@ -36,7 +36,7 @@ server's upload rate.   The transcoded videos will be save to the thumbnail folder.  - You can trigger the transcoding manually, but you can also create an automatic encoding task + You can trigger the transcoding manually, but you can also create an automatic encoding job in advanced settings mode.   @@ -136,7 +136,7 @@ @@ -144,7 +144,7 @@

- +
diff --git a/src/frontend/app/ui/settings/video/video.settings.component.ts b/src/frontend/app/ui/settings/video/video.settings.component.ts index 9f9d74f3..4dced266 100644 --- a/src/frontend/app/ui/settings/video/video.settings.component.ts +++ b/src/frontend/app/ui/settings/video/video.settings.component.ts @@ -6,11 +6,11 @@ import {NavigationService} from '../../../model/navigation.service'; import {NotificationService} from '../../../model/notification.service'; import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {I18n} from '@ngx-translate/i18n-polyfill'; -import {ScheduledTasksService} from '../scheduled-tasks.service'; -import {DefaultsTasks} from '../../../../../common/entities/task/TaskDTO'; +import {ScheduledJobsService} from '../scheduled-jobs.service'; +import {DefaultsJobs} from '../../../../../common/entities/job/JobDTO'; import {ErrorDTO} from '../../../../../common/entities/Error'; import {ServerConfig} from '../../../../../common/config/private/IPrivateConfig'; -import { TaskState } from '../../../../../common/entities/settings/TaskProgressDTO'; +import { JobState } from '../../../../../common/entities/settings/JobProgressDTO'; @Component({ @@ -27,12 +27,12 @@ export class VideoSettingsComponent extends SettingsComponent<{ server: ServerCo formats: ServerConfig.formatType[] = ['mp4', 'webm']; fps = [24, 25, 30, 48, 50, 60]; - TaskState = TaskState; + JobState = JobState; constructor(_authService: AuthenticationService, _navigation: NavigationService, _settingsService: VideoSettingsService, - public tasksService: ScheduledTasksService, + public jobsService: ScheduledJobsService, notification: NotificationService, i18n: I18n) { super(i18n('Video'), _authService, _navigation, _settingsService, notification, i18n, s => ({ @@ -48,7 +48,7 @@ export class VideoSettingsComponent extends SettingsComponent<{ server: ServerCo get Progress() { - return this.tasksService.progress.value[DefaultsTasks[DefaultsTasks['Video Converting']]]; + return this.jobsService.progress.value[DefaultsJobs[DefaultsJobs['Video Converting']]]; } get bitRate(): number { @@ -96,7 +96,7 @@ export class VideoSettingsComponent extends SettingsComponent<{ server: ServerCo this.inProgress = true; this.error = ''; try { - await this.tasksService.start(DefaultsTasks[DefaultsTasks['Video Converting']]); + await this.jobsService.start(DefaultsJobs[DefaultsJobs['Video Converting']]); this.notification.info(this.i18n('Video transcoding started')); this.inProgress = false; return true; @@ -115,7 +115,7 @@ export class VideoSettingsComponent extends SettingsComponent<{ server: ServerCo this.inProgress = true; this.error = ''; try { - await this.tasksService.stop(DefaultsTasks[DefaultsTasks['Video Converting']]); + await this.jobsService.stop(DefaultsJobs[DefaultsJobs['Video Converting']]); this.notification.info(this.i18n('Video transcoding interrupted')); this.inProgress = false; return true; diff --git a/src/frontend/translate/messages.en.xlf b/src/frontend/translate/messages.en.xlf index 8e2ddc26..d3b9f3cb 100644 --- a/src/frontend/translate/messages.en.xlf +++ b/src/frontend/translate/messages.en.xlf @@ -694,8 +694,8 @@ 170 - app/ui/settings/tasks/tasks.settings.component.html - 189 + app/ui/settings/jobs/jobs.settings.component.html + 187 Save @@ -751,8 +751,8 @@ 174 - app/ui/settings/tasks/tasks.settings.component.html - 193 + app/ui/settings/jobs/jobs.settings.component.html + 191 Reset @@ -871,9 +871,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 56 - The best matching size will be generated. (More sizes give better quality, but use more - storage and CPU to render.) - + The best matching size will be generated. (More sizes give better quality, but use more storage and CPU to render.) ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 @@ -883,9 +881,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 60 - ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 - pixels. - + ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 pixels. Generate thumbnails now @@ -910,8 +906,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 90 - Cancel thumbnail generation - + Cancel thumbnail generation Video support uses ffmpeg. ffmpeg and ffprobe binaries need to be available in the PATH or @@ -951,8 +946,8 @@ The transcoded videos will be save to the thumbnail folder. - - You can trigger the transcoding manually, but you can also create an automatic encoding task + + You can trigger the transcoding manually, but you can also create an automatic encoding job in advanced settings mode. @@ -960,7 +955,10 @@ app/ui/settings/video/video.settings.component.html 39 - You can trigger the transcoding manually, but you can also create an automatic encoding task in advanced settings mode. + You can trigger the transcoding manually, but you can also create an automatic encoding job + in + advanced settings mode. + Format @@ -1133,8 +1131,7 @@ app/ui/settings/photo/photo.settings.component.html 53 - Downsizes photos for faster preview loading. (Zooming in to the photo - loads the original) + Downsizes photos for faster preview loading. (Zooming in to the photo loads the original) On the fly converting @@ -1142,7 +1139,7 @@ app/ui/settings/photo/photo.settings.component.html 59 - On the fly converting + On the fly converting Converts photos on the fly, when they are requested. @@ -1160,9 +1157,7 @@ app/ui/settings/photo/photo.settings.component.html 85 - The shorter edge of the converted photo will be scaled down to this, - while - keeping the aspect ratio. + The shorter edge of the converted photo will be scaled down to this, while keeping the aspect ratio. Convert photos now @@ -1179,8 +1174,7 @@ app/ui/settings/photo/photo.settings.component.html 114 - Cancel converting - + Cancel converting Reads and show *.gpx files on the map @@ -1268,11 +1262,7 @@ app/ui/settings/random-photo/random-photo.settings.component.html 27 - - This feature enables you to generate 'random photo' urls. - That URL returns a photo random selected from your gallery. - You can use the url with 3rd party application like random changing desktop background. - + This feature enables you to generate 'random photo' urls. That URL returns a photo random selected from your gallery. You can use the url with 3rd party application like random changing desktop background. @@ -1759,8 +1749,7 @@ app/ui/settings/indexing/indexing.settings.component.html 127 - Cancel converting - + Cancel converting Reset Indexes @@ -1816,7 +1805,7 @@ Stopping - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 7 Stopping @@ -1824,7 +1813,7 @@ time elapsed - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 14 time elapsed @@ -1832,88 +1821,76 @@ time left - app/ui/settings/tasks/progress/progress.tasks.settings.component.html - 28 + app/ui/settings/jobs/progress/job-progress.settings.component.html + 34 time left every - app/ui/settings/tasks/tasks.settings.component.html - 18 + app/ui/settings/jobs/jobs.settings.component.html + 17 - app/ui/settings/tasks/tasks.settings.component.html - 85 + app/ui/settings/jobs/jobs.settings.component.html + 83 every never - app/ui/settings/tasks/tasks.settings.component.html - 23 + app/ui/settings/jobs/jobs.settings.component.html + 22 never - - - - - + + Job: - app/ui/settings/tasks/tasks.settings.component.html - 26 + app/ui/settings/jobs/jobs.settings.component.html + 34 - - - - + Job: - - Task: - - app/ui/settings/tasks/tasks.settings.component.html - 36 - - Task: - - - Select a task to schedule. + + Select a job to schedule. - app/ui/settings/tasks/tasks.settings.component.html - 45 + app/ui/settings/jobs/jobs.settings.component.html + 43 - Select a task to schedule. + Select a job to schedule. + Periodicity: - app/ui/settings/tasks/tasks.settings.component.html - 50 + app/ui/settings/jobs/jobs.settings.component.html + 48 Periodicity: - - Set the time to run the task. + + Set the time to run the job. - app/ui/settings/tasks/tasks.settings.component.html - 60 + app/ui/settings/jobs/jobs.settings.component.html + 58 - Set the time to run the task. + Set the time to run the job. + At: - app/ui/settings/tasks/tasks.settings.component.html - 67 + app/ui/settings/jobs/jobs.settings.component.html + 65 - app/ui/settings/tasks/tasks.settings.component.html - 77 + app/ui/settings/jobs/jobs.settings.component.html + 75 At: @@ -1921,44 +1898,45 @@ Start now - app/ui/settings/tasks/tasks.settings.component.html - 103 + app/ui/settings/jobs/jobs.settings.component.html + 101 Start now - - Trigger task run manually + + Trigger job run manually - app/ui/settings/tasks/tasks.settings.component.html - 101 + app/ui/settings/jobs/jobs.settings.component.html + 99 - Trigger task run manually + Trigger job run manually Stop - app/ui/settings/tasks/tasks.settings.component.html - 108 + app/ui/settings/jobs/jobs.settings.component.html + 106 Stop ';' separated integers. - app/ui/settings/tasks/tasks.settings.component.html - 171 + app/ui/settings/jobs/jobs.settings.component.html + 169 ';' separated integers. - - + Add task + + + Add Job - app/ui/settings/tasks/tasks.settings.component.html - 196 + app/ui/settings/jobs/jobs.settings.component.html + 194 - + Add task + + Add Job + Server error @@ -2063,6 +2041,22 @@ Simplified + + Built at + + src/frontend/app/ui/admin/admin.component.ts + 1 + + Built at + + + git hash + + src/frontend/app/ui/admin/admin.component.ts + 1 + + git hash + Images @@ -2267,6 +2261,106 @@ Resetting database + + Jobs + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Jobs + + + Monday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Monday + + + Tuesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Tuesday + + + Wednesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Wednesday + + + Thursday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Thursday + + + Friday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Friday + + + Saturday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Saturday + + + Sunday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Sunday + + + day + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + day + + + Job + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Job + + + started + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + started + + + stopped + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + stopped + Map @@ -2339,106 +2433,6 @@ Random Photo - - Tasks - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tasks - - - Monday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Monday - - - Tuesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tuesday - - - Wednesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Wednesday - - - Thursday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Thursday - - - Friday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Friday - - - Saturday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Saturday - - - Sunday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Sunday - - - day - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - day - - - Task - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Task - - - started - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - started - - - stopped - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - stopped - Thumbnail diff --git a/src/frontend/translate/messages.fr.xlf b/src/frontend/translate/messages.fr.xlf index 114cc9c9..a2170185 100644 --- a/src/frontend/translate/messages.fr.xlf +++ b/src/frontend/translate/messages.fr.xlf @@ -694,8 +694,8 @@ 170 - app/ui/settings/tasks/tasks.settings.component.html - 189 + app/ui/settings/jobs/jobs.settings.component.html + 187 Enregistrer @@ -751,8 +751,8 @@ 174 - app/ui/settings/tasks/tasks.settings.component.html - 193 + app/ui/settings/jobs/jobs.settings.component.html + 191 Réinitialiser @@ -871,9 +871,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 56 - The best matching size will be generated. (More sizes give better quality, but use more - storage and CPU to render.) - + The best matching size will be generated. (More sizes give better quality, but use more storage and CPU to render.) ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 @@ -883,9 +881,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 60 - ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 - pixels. - + ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 pixels. Generate thumbnails now @@ -910,8 +906,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 90 - Cancel thumbnail generation - + Cancel thumbnail generation Video support uses ffmpeg. ffmpeg and ffprobe binaries need to be available in the PATH or @@ -951,8 +946,8 @@ The transcoded videos will be save to the thumbnail folder. - - You can trigger the transcoding manually, but you can also create an automatic encoding task + + You can trigger the transcoding manually, but you can also create an automatic encoding job in advanced settings mode. @@ -960,7 +955,10 @@ app/ui/settings/video/video.settings.component.html 39 - You can trigger the transcoding manually, but you can also create an automatic encoding task in advanced settings mode. + You can trigger the transcoding manually, but you can also create an automatic encoding job + in + advanced settings mode. + Format @@ -1133,8 +1131,7 @@ app/ui/settings/photo/photo.settings.component.html 53 - Downsizes photos for faster preview loading. (Zooming in to the photo - loads the original) + Downsizes photos for faster preview loading. (Zooming in to the photo loads the original) On the fly converting @@ -1142,7 +1139,7 @@ app/ui/settings/photo/photo.settings.component.html 59 - On the fly converting + On the fly converting Converts photos on the fly, when they are requested. @@ -1160,9 +1157,7 @@ app/ui/settings/photo/photo.settings.component.html 85 - The shorter edge of the converted photo will be scaled down to this, - while - keeping the aspect ratio. + The shorter edge of the converted photo will be scaled down to this, while keeping the aspect ratio. Convert photos now @@ -1179,8 +1174,7 @@ app/ui/settings/photo/photo.settings.component.html 114 - Cancel converting - + Cancel converting Reads and show *.gpx files on the map @@ -1268,11 +1262,7 @@ app/ui/settings/random-photo/random-photo.settings.component.html 27 - - This feature enables you to generate 'random photo' urls. - That URL returns a photo random selected from your gallery. - You can use the url with 3rd party application like random changing desktop background. - + This feature enables you to generate 'random photo' urls. That URL returns a photo random selected from your gallery. You can use the url with 3rd party application like random changing desktop background. @@ -1759,8 +1749,7 @@ app/ui/settings/indexing/indexing.settings.component.html 127 - Cancel converting - + Cancel converting Reset Indexes @@ -1816,7 +1805,7 @@ Stopping - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 7 Stopping @@ -1824,7 +1813,7 @@ time elapsed - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 14 time elapsed @@ -1832,88 +1821,76 @@ time left - app/ui/settings/tasks/progress/progress.tasks.settings.component.html - 28 + app/ui/settings/jobs/progress/job-progress.settings.component.html + 34 time left every - app/ui/settings/tasks/tasks.settings.component.html - 18 + app/ui/settings/jobs/jobs.settings.component.html + 17 - app/ui/settings/tasks/tasks.settings.component.html - 85 + app/ui/settings/jobs/jobs.settings.component.html + 83 every never - app/ui/settings/tasks/tasks.settings.component.html - 23 + app/ui/settings/jobs/jobs.settings.component.html + 22 never - - - - - + + Job: - app/ui/settings/tasks/tasks.settings.component.html - 26 + app/ui/settings/jobs/jobs.settings.component.html + 34 - - - - + Job: - - Task: - - app/ui/settings/tasks/tasks.settings.component.html - 36 - - Task: - - - Select a task to schedule. + + Select a job to schedule. - app/ui/settings/tasks/tasks.settings.component.html - 45 + app/ui/settings/jobs/jobs.settings.component.html + 43 - Select a task to schedule. + Select a job to schedule. + Periodicity: - app/ui/settings/tasks/tasks.settings.component.html - 50 + app/ui/settings/jobs/jobs.settings.component.html + 48 Periodicity: - - Set the time to run the task. + + Set the time to run the job. - app/ui/settings/tasks/tasks.settings.component.html - 60 + app/ui/settings/jobs/jobs.settings.component.html + 58 - Set the time to run the task. + Set the time to run the job. + At: - app/ui/settings/tasks/tasks.settings.component.html - 67 + app/ui/settings/jobs/jobs.settings.component.html + 65 - app/ui/settings/tasks/tasks.settings.component.html - 77 + app/ui/settings/jobs/jobs.settings.component.html + 75 At: @@ -1921,44 +1898,45 @@ Start now - app/ui/settings/tasks/tasks.settings.component.html - 103 + app/ui/settings/jobs/jobs.settings.component.html + 101 Start now - - Trigger task run manually + + Trigger job run manually - app/ui/settings/tasks/tasks.settings.component.html - 101 + app/ui/settings/jobs/jobs.settings.component.html + 99 - Trigger task run manually + Trigger job run manually Stop - app/ui/settings/tasks/tasks.settings.component.html - 108 + app/ui/settings/jobs/jobs.settings.component.html + 106 Stop ';' separated integers. - app/ui/settings/tasks/tasks.settings.component.html - 171 + app/ui/settings/jobs/jobs.settings.component.html + 169 ';' separated integers. - - + Add task + + + Add Job - app/ui/settings/tasks/tasks.settings.component.html - 196 + app/ui/settings/jobs/jobs.settings.component.html + 194 - + Add task + + Add Job + Server error @@ -2063,6 +2041,22 @@ Simplifié + + Built at + + src/frontend/app/ui/admin/admin.component.ts + 1 + + Built at + + + git hash + + src/frontend/app/ui/admin/admin.component.ts + 1 + + git hash + Images @@ -2267,6 +2261,106 @@ Resetting database + + Jobs + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Jobs + + + Monday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Monday + + + Tuesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Tuesday + + + Wednesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Wednesday + + + Thursday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Thursday + + + Friday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Friday + + + Saturday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Saturday + + + Sunday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Sunday + + + day + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + day + + + Job + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Job + + + started + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + started + + + stopped + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + stopped + Map @@ -2339,106 +2433,6 @@ Random Photo - - Tasks - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tasks - - - Monday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Monday - - - Tuesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tuesday - - - Wednesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Wednesday - - - Thursday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Thursday - - - Friday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Friday - - - Saturday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Saturday - - - Sunday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Sunday - - - day - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - day - - - Task - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Task - - - started - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - started - - - stopped - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - stopped - Thumbnail diff --git a/src/frontend/translate/messages.hu.xlf b/src/frontend/translate/messages.hu.xlf index ad6a026d..19047a86 100644 --- a/src/frontend/translate/messages.hu.xlf +++ b/src/frontend/translate/messages.hu.xlf @@ -694,8 +694,8 @@ 170 - app/ui/settings/tasks/tasks.settings.component.html - 189 + app/ui/settings/jobs/jobs.settings.component.html + 187 Mentés @@ -751,8 +751,8 @@ 174 - app/ui/settings/tasks/tasks.settings.component.html - 193 + app/ui/settings/jobs/jobs.settings.component.html + 191 Visszaállítás @@ -871,9 +871,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 56 - The best matching size will be generated. (More sizes give better quality, but use more - storage and CPU to render.) - + The best matching size will be generated. (More sizes give better quality, but use more storage and CPU to render.) ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 @@ -883,9 +881,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 60 - ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 - pixels. - + ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 pixels. Generate thumbnails now @@ -910,8 +906,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 90 - Thumbnail generálás megszakítása - + Thumbnail generálás megszakítása Video support uses ffmpeg. ffmpeg and ffprobe binaries need to be available in the PATH or @@ -951,8 +946,8 @@ Az átkonvertált videók a thumbnail mappába lesznek mentve. - - You can trigger the transcoding manually, but you can also create an automatic encoding task + + You can trigger the transcoding manually, but you can also create an automatic encoding job in advanced settings mode. @@ -1152,8 +1147,7 @@ Photókat menet közvben konvertálja, amikor kérésre megy rájuk. - - The shorter edge of the converted photo will be scaled down to this, + The shorter edge of the converted photo will be scaled down to this, while keeping the aspect ratio. @@ -1177,8 +1171,7 @@ app/ui/settings/photo/photo.settings.component.html 114 - Konvertálás megszakítása - + Cancel converting Reads and show *.gpx files on the map @@ -1266,11 +1259,7 @@ app/ui/settings/random-photo/random-photo.settings.component.html 27 - - Ez a modul a 'véletlenszerű fotó' utl generálását engedelyezi. - Az url egy véletlen fotót ad vissza a galériából. - Harmadik fél által készített alkalmazásokhoz használhatód. Pl véletlenszerűen változó háttérkép. - + Ez a modul a 'véletlenszerű fotó' utl generálását engedelyezi. Az url egy véletlen fotót ad vissza a galériából. Harmadik fél által készített alkalmazásokhoz használhatód. Pl véletlenszerűen változó háttérkép. @@ -1757,8 +1746,7 @@ app/ui/settings/indexing/indexing.settings.component.html 127 - Cancel converting - + Cancel converting Reset Indexes @@ -1814,7 +1802,7 @@ Stopping - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 7 Leállás alatt @@ -1822,7 +1810,7 @@ time elapsed - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 14 eltelt idő @@ -1830,88 +1818,74 @@ time left - app/ui/settings/tasks/progress/progress.tasks.settings.component.html - 28 + app/ui/settings/jobs/progress/job-progress.settings.component.html + 34 hátramaradt idő every - app/ui/settings/tasks/tasks.settings.component.html - 18 + app/ui/settings/jobs/jobs.settings.component.html + 17 - app/ui/settings/tasks/tasks.settings.component.html - 85 + app/ui/settings/jobs/jobs.settings.component.html + 83 minden never - app/ui/settings/tasks/tasks.settings.component.html - 23 + app/ui/settings/jobs/jobs.settings.component.html + 22 soha - - - - - + + Job: - app/ui/settings/tasks/tasks.settings.component.html - 26 + app/ui/settings/jobs/jobs.settings.component.html + 34 - - - - + Job: - - Task: - - app/ui/settings/tasks/tasks.settings.component.html - 36 - - Feladat: - - - Select a task to schedule. + + Select a job to schedule. - app/ui/settings/tasks/tasks.settings.component.html - 45 + app/ui/settings/jobs/jobs.settings.component.html + 43 Válaszd ki az ütemezendő feladatot. Periodicity: - app/ui/settings/tasks/tasks.settings.component.html - 50 + app/ui/settings/jobs/jobs.settings.component.html + 48 Gyakoriság: - - Set the time to run the task. + + Set the time to run the job. - app/ui/settings/tasks/tasks.settings.component.html - 60 + app/ui/settings/jobs/jobs.settings.component.html + 58 Állítsd be, hogy mikos fusson a feladat. At: - app/ui/settings/tasks/tasks.settings.component.html - 67 + app/ui/settings/jobs/jobs.settings.component.html + 65 - app/ui/settings/tasks/tasks.settings.component.html - 77 + app/ui/settings/jobs/jobs.settings.component.html + 75 Ekkor: @@ -1919,16 +1893,16 @@ Start now - app/ui/settings/tasks/tasks.settings.component.html - 103 + app/ui/settings/jobs/jobs.settings.component.html + 101 Futtatás most - - Trigger task run manually + + Trigger job run manually - app/ui/settings/tasks/tasks.settings.component.html - 101 + app/ui/settings/jobs/jobs.settings.component.html + 99 Manuálisan elnidítja a feladatot @@ -1936,27 +1910,28 @@ Stop - app/ui/settings/tasks/tasks.settings.component.html - 108 + app/ui/settings/jobs/jobs.settings.component.html + 106 Leállítás ';' separated integers. - app/ui/settings/tasks/tasks.settings.component.html - 171 + app/ui/settings/jobs/jobs.settings.component.html + 169 ';'-vel elválaszott egész számok. - - + Add task + + + Add Job - app/ui/settings/tasks/tasks.settings.component.html - 196 + app/ui/settings/jobs/jobs.settings.component.html + 194 - + új feladat + + Add Job + Server error @@ -2061,6 +2036,22 @@ Egyszerűsített + + Built at + + src/frontend/app/ui/admin/admin.component.ts + 1 + + Build-elve + + + git hash + + src/frontend/app/ui/admin/admin.component.ts + 1 + + git hash + Images @@ -2265,6 +2256,106 @@ Adatbázis visszaállítása + + Jobs + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Jobs + + + Monday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Hétfő + + + Tuesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Kedd + + + Wednesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Szerda + + + Thursday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Csütörtök + + + Friday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Péntek + + + Saturday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Szombat + + + Sunday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Vasárnap + + + day + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + nap + + + Job + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Job + + + started + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + elindult + + + stopped + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + leállt + Map @@ -2337,106 +2428,6 @@ Véletleg Fotó - - Tasks - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Feladatok - - - Monday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Hétfő - - - Tuesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Kedd - - - Wednesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Szerda - - - Thursday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Csütörtök - - - Friday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Péntek - - - Saturday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Szombat - - - Sunday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Vasárnap - - - day - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - nap - - - Task - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Feladat - - - started - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - elindult - - - stopped - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - leállt - Thumbnail diff --git a/src/frontend/translate/messages.ro.xlf b/src/frontend/translate/messages.ro.xlf index 40e3c8fd..f8073022 100644 --- a/src/frontend/translate/messages.ro.xlf +++ b/src/frontend/translate/messages.ro.xlf @@ -694,8 +694,8 @@ 170 - app/ui/settings/tasks/tasks.settings.component.html - 189 + app/ui/settings/jobs/jobs.settings.component.html + 187 Salvare @@ -751,8 +751,8 @@ 174 - app/ui/settings/tasks/tasks.settings.component.html - 193 + app/ui/settings/jobs/jobs.settings.component.html + 191 Restabilire @@ -871,9 +871,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 56 - The best matching size will be generated. (More sizes give better quality, but use more - storage and CPU to render.) - + The best matching size will be generated. (More sizes give better quality, but use more storage and CPU to render.) ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 @@ -883,9 +881,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 60 - ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 - pixels. - + ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 pixels. Generate thumbnails now @@ -910,8 +906,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 90 - Cancel thumbnail generation - + Cancel thumbnail generation Video support uses ffmpeg. ffmpeg and ffprobe binaries need to be available in the PATH or @@ -951,8 +946,8 @@ The transcoded videos will be save to the thumbnail folder. - - You can trigger the transcoding manually, but you can also create an automatic encoding task + + You can trigger the transcoding manually, but you can also create an automatic encoding job in advanced settings mode. @@ -960,7 +955,10 @@ app/ui/settings/video/video.settings.component.html 39 - You can trigger the transcoding manually, but you can also create an automatic encoding task in advanced settings mode. + You can trigger the transcoding manually, but you can also create an automatic encoding job + in + advanced settings mode. + Format @@ -1133,8 +1131,7 @@ app/ui/settings/photo/photo.settings.component.html 53 - Downsizes photos for faster preview loading. (Zooming in to the photo - loads the original) + Downsizes photos for faster preview loading. (Zooming in to the photo loads the original) On the fly converting @@ -1142,7 +1139,7 @@ app/ui/settings/photo/photo.settings.component.html 59 - On the fly converting + On the fly converting Converts photos on the fly, when they are requested. @@ -1160,9 +1157,7 @@ app/ui/settings/photo/photo.settings.component.html 85 - The shorter edge of the converted photo will be scaled down to this, - while - keeping the aspect ratio. + The shorter edge of the converted photo will be scaled down to this, while keeping the aspect ratio. Convert photos now @@ -1179,8 +1174,7 @@ app/ui/settings/photo/photo.settings.component.html 114 - Cancel converting - + Cancel converting Reads and show *.gpx files on the map @@ -1268,11 +1262,7 @@ app/ui/settings/random-photo/random-photo.settings.component.html 27 - - This feature enables you to generate 'random photo' urls. - That URL returns a photo random selected from your gallery. - You can use the url with 3rd party application like random changing desktop background. - + This feature enables you to generate 'random photo' urls. That URL returns a photo random selected from your gallery. You can use the url with 3rd party application like random changing desktop background. @@ -1759,8 +1749,7 @@ app/ui/settings/indexing/indexing.settings.component.html 127 - Cancel converting - + Cancel converting Reset Indexes @@ -1816,7 +1805,7 @@ Stopping - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 7 Stopping @@ -1824,7 +1813,7 @@ time elapsed - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 14 time elapsed @@ -1832,88 +1821,76 @@ time left - app/ui/settings/tasks/progress/progress.tasks.settings.component.html - 28 + app/ui/settings/jobs/progress/job-progress.settings.component.html + 34 time left every - app/ui/settings/tasks/tasks.settings.component.html - 18 + app/ui/settings/jobs/jobs.settings.component.html + 17 - app/ui/settings/tasks/tasks.settings.component.html - 85 + app/ui/settings/jobs/jobs.settings.component.html + 83 every never - app/ui/settings/tasks/tasks.settings.component.html - 23 + app/ui/settings/jobs/jobs.settings.component.html + 22 never - - - - - + + Job: - app/ui/settings/tasks/tasks.settings.component.html - 26 + app/ui/settings/jobs/jobs.settings.component.html + 34 - - - - + Job: - - Task: - - app/ui/settings/tasks/tasks.settings.component.html - 36 - - Task: - - - Select a task to schedule. + + Select a job to schedule. - app/ui/settings/tasks/tasks.settings.component.html - 45 + app/ui/settings/jobs/jobs.settings.component.html + 43 - Select a task to schedule. + Select a job to schedule. + Periodicity: - app/ui/settings/tasks/tasks.settings.component.html - 50 + app/ui/settings/jobs/jobs.settings.component.html + 48 Periodicity: - - Set the time to run the task. + + Set the time to run the job. - app/ui/settings/tasks/tasks.settings.component.html - 60 + app/ui/settings/jobs/jobs.settings.component.html + 58 - Set the time to run the task. + Set the time to run the job. + At: - app/ui/settings/tasks/tasks.settings.component.html - 67 + app/ui/settings/jobs/jobs.settings.component.html + 65 - app/ui/settings/tasks/tasks.settings.component.html - 77 + app/ui/settings/jobs/jobs.settings.component.html + 75 At: @@ -1921,44 +1898,45 @@ Start now - app/ui/settings/tasks/tasks.settings.component.html - 103 + app/ui/settings/jobs/jobs.settings.component.html + 101 Start now - - Trigger task run manually + + Trigger job run manually - app/ui/settings/tasks/tasks.settings.component.html - 101 + app/ui/settings/jobs/jobs.settings.component.html + 99 - Trigger task run manually + Trigger job run manually Stop - app/ui/settings/tasks/tasks.settings.component.html - 108 + app/ui/settings/jobs/jobs.settings.component.html + 106 Stop ';' separated integers. - app/ui/settings/tasks/tasks.settings.component.html - 171 + app/ui/settings/jobs/jobs.settings.component.html + 169 ';' separated integers. - - + Add task + + + Add Job - app/ui/settings/tasks/tasks.settings.component.html - 196 + app/ui/settings/jobs/jobs.settings.component.html + 194 - + Add task + + Add Job + Server error @@ -2063,6 +2041,22 @@ Simplificat + + Built at + + src/frontend/app/ui/admin/admin.component.ts + 1 + + Built at + + + git hash + + src/frontend/app/ui/admin/admin.component.ts + 1 + + git hash + Images @@ -2267,6 +2261,106 @@ Resetting database + + Jobs + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Jobs + + + Monday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Monday + + + Tuesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Tuesday + + + Wednesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Wednesday + + + Thursday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Thursday + + + Friday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Friday + + + Saturday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Saturday + + + Sunday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Sunday + + + day + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + day + + + Job + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Job + + + started + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + started + + + stopped + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + stopped + Map @@ -2339,106 +2433,6 @@ Random Photo - - Tasks - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tasks - - - Monday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Monday - - - Tuesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tuesday - - - Wednesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Wednesday - - - Thursday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Thursday - - - Friday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Friday - - - Saturday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Saturday - - - Sunday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Sunday - - - day - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - day - - - Task - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Task - - - started - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - started - - - stopped - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - stopped - Thumbnail diff --git a/src/frontend/translate/messages.ru.xlf b/src/frontend/translate/messages.ru.xlf index 4c2f7030..2327fb6a 100644 --- a/src/frontend/translate/messages.ru.xlf +++ b/src/frontend/translate/messages.ru.xlf @@ -694,8 +694,8 @@ 170 - app/ui/settings/tasks/tasks.settings.component.html - 189 + app/ui/settings/jobs/jobs.settings.component.html + 187 Сохранить @@ -751,8 +751,8 @@ 174 - app/ui/settings/tasks/tasks.settings.component.html - 193 + app/ui/settings/jobs/jobs.settings.component.html + 191 Сбросить @@ -871,9 +871,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 56 - The best matching size will be generated. (More sizes give better quality, but use more - storage and CPU to render.) - + The best matching size will be generated. (More sizes give better quality, but use more storage and CPU to render.) ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 @@ -883,9 +881,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 60 - ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 - pixels. - + ';' separated integers. If size is 160, that shorter side of the thumbnail will have 160 pixels. Generate thumbnails now @@ -910,8 +906,7 @@ app/ui/settings/thumbnail/thumbnail.settings.component.html 90 - Cancel thumbnail generation - + Cancel thumbnail generation Video support uses ffmpeg. ffmpeg and ffprobe binaries need to be available in the PATH or @@ -951,8 +946,8 @@ The transcoded videos will be save to the thumbnail folder. - - You can trigger the transcoding manually, but you can also create an automatic encoding task + + You can trigger the transcoding manually, but you can also create an automatic encoding job in advanced settings mode. @@ -960,7 +955,10 @@ app/ui/settings/video/video.settings.component.html 39 - You can trigger the transcoding manually, but you can also create an automatic encoding task in advanced settings mode. + You can trigger the transcoding manually, but you can also create an automatic encoding job + in + advanced settings mode. + Format @@ -1133,8 +1131,7 @@ app/ui/settings/photo/photo.settings.component.html 53 - Downsizes photos for faster preview loading. (Zooming in to the photo - loads the original) + Downsizes photos for faster preview loading. (Zooming in to the photo loads the original) On the fly converting @@ -1142,7 +1139,7 @@ app/ui/settings/photo/photo.settings.component.html 59 - On the fly converting + On the fly converting Converts photos on the fly, when they are requested. @@ -1160,9 +1157,7 @@ app/ui/settings/photo/photo.settings.component.html 85 - The shorter edge of the converted photo will be scaled down to this, - while - keeping the aspect ratio. + The shorter edge of the converted photo will be scaled down to this, while keeping the aspect ratio. Convert photos now @@ -1179,8 +1174,7 @@ app/ui/settings/photo/photo.settings.component.html 114 - Cancel converting - + Cancel converting Reads and show *.gpx files on the map @@ -1268,11 +1262,7 @@ app/ui/settings/random-photo/random-photo.settings.component.html 27 - - This feature enables you to generate 'random photo' urls. - That URL returns a photo random selected from your gallery. - You can use the url with 3rd party application like random changing desktop background. - + This feature enables you to generate 'random photo' urls. That URL returns a photo random selected from your gallery. You can use the url with 3rd party application like random changing desktop background. @@ -1759,8 +1749,7 @@ app/ui/settings/indexing/indexing.settings.component.html 127 - Cancel converting - + Cancel converting Reset Indexes @@ -1816,7 +1805,7 @@ Stopping - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 7 Stopping @@ -1824,7 +1813,7 @@ time elapsed - app/ui/settings/tasks/progress/progress.tasks.settings.component.html + app/ui/settings/jobs/progress/job-progress.settings.component.html 14 time elapsed @@ -1832,88 +1821,76 @@ time left - app/ui/settings/tasks/progress/progress.tasks.settings.component.html - 28 + app/ui/settings/jobs/progress/job-progress.settings.component.html + 34 time left every - app/ui/settings/tasks/tasks.settings.component.html - 18 + app/ui/settings/jobs/jobs.settings.component.html + 17 - app/ui/settings/tasks/tasks.settings.component.html - 85 + app/ui/settings/jobs/jobs.settings.component.html + 83 every never - app/ui/settings/tasks/tasks.settings.component.html - 23 + app/ui/settings/jobs/jobs.settings.component.html + 22 never - - - - - + + Job: - app/ui/settings/tasks/tasks.settings.component.html - 26 + app/ui/settings/jobs/jobs.settings.component.html + 34 - - - - + Job: - - Task: - - app/ui/settings/tasks/tasks.settings.component.html - 36 - - Task: - - - Select a task to schedule. + + Select a job to schedule. - app/ui/settings/tasks/tasks.settings.component.html - 45 + app/ui/settings/jobs/jobs.settings.component.html + 43 - Select a task to schedule. + Select a job to schedule. + Periodicity: - app/ui/settings/tasks/tasks.settings.component.html - 50 + app/ui/settings/jobs/jobs.settings.component.html + 48 Periodicity: - - Set the time to run the task. + + Set the time to run the job. - app/ui/settings/tasks/tasks.settings.component.html - 60 + app/ui/settings/jobs/jobs.settings.component.html + 58 - Set the time to run the task. + Set the time to run the job. + At: - app/ui/settings/tasks/tasks.settings.component.html - 67 + app/ui/settings/jobs/jobs.settings.component.html + 65 - app/ui/settings/tasks/tasks.settings.component.html - 77 + app/ui/settings/jobs/jobs.settings.component.html + 75 At: @@ -1921,44 +1898,45 @@ Start now - app/ui/settings/tasks/tasks.settings.component.html - 103 + app/ui/settings/jobs/jobs.settings.component.html + 101 Start now - - Trigger task run manually + + Trigger job run manually - app/ui/settings/tasks/tasks.settings.component.html - 101 + app/ui/settings/jobs/jobs.settings.component.html + 99 - Trigger task run manually + Trigger job run manually Stop - app/ui/settings/tasks/tasks.settings.component.html - 108 + app/ui/settings/jobs/jobs.settings.component.html + 106 Stop ';' separated integers. - app/ui/settings/tasks/tasks.settings.component.html - 171 + app/ui/settings/jobs/jobs.settings.component.html + 169 ';' separated integers. - - + Add task + + + Add Job - app/ui/settings/tasks/tasks.settings.component.html - 196 + app/ui/settings/jobs/jobs.settings.component.html + 194 - + Add task + + Add Job + Server error @@ -2063,6 +2041,22 @@ Simplified + + Built at + + src/frontend/app/ui/admin/admin.component.ts + 1 + + Built at + + + git hash + + src/frontend/app/ui/admin/admin.component.ts + 1 + + git hash + Images @@ -2267,6 +2261,106 @@ Resetting database + + Jobs + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Jobs + + + Monday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Monday + + + Tuesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Tuesday + + + Wednesday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Wednesday + + + Thursday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Thursday + + + Friday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Friday + + + Saturday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Saturday + + + Sunday + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Sunday + + + day + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + day + + + Job + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + Job + + + started + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + started + + + stopped + + src/frontend/app/ui/settings/jobs/jobs.settings.component.ts + 1 + + stopped + Map @@ -2339,106 +2433,6 @@ Random Photo - - Tasks - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tasks - - - Monday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Monday - - - Tuesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Tuesday - - - Wednesday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Wednesday - - - Thursday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Thursday - - - Friday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Friday - - - Saturday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Saturday - - - Sunday - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Sunday - - - day - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - day - - - Task - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - Task - - - started - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - started - - - stopped - - src/frontend/app/ui/settings/tasks/tasks.settings.component.ts - 1 - - stopped - Thumbnail diff --git a/test/backend/unit/model/tasks/TaskManager.spec.ts b/test/backend/unit/model/tasks/TaskManager.spec.ts index 51399a79..72038955 100644 --- a/test/backend/unit/model/tasks/TaskManager.spec.ts +++ b/test/backend/unit/model/tasks/TaskManager.spec.ts @@ -1,25 +1,25 @@ import {expect} from 'chai'; -import {TaskManager} from '../../../../../src/backend/model/tasks/TaskManager'; -import {TaskScheduleDTO, TaskTriggerType} from '../../../../../src/common/entities/task/TaskScheduleDTO'; +import {JobManager} from '../../../../../src/backend/model/jobs/JobManager'; +import {JobScheduleDTO, JobTriggerType} from '../../../../../src/common/entities/job/JobScheduleDTO'; -class TaskManagerSpec extends TaskManager { +class JobManagerSpec extends JobManager { - public getDateFromSchedule(refDate: Date, schedule: TaskScheduleDTO): Date { + public getDateFromSchedule(refDate: Date, schedule: JobScheduleDTO): Date { return super.getDateFromSchedule(refDate, schedule); } } -describe('TaskManager', () => { +describe('JobManager', () => { it('should get date from schedule', async () => { - const tm = new TaskManagerSpec(); + const tm = new JobManagerSpec(); const refDate = new Date(2019, 7, 18, 5, 10, 10, 0); // its a sunday expect(tm.getDateFromSchedule(refDate, { trigger: { - type: TaskTriggerType.scheduled, + type: JobTriggerType.scheduled, time: (new Date(2019, 7, 18, 5, 10)).getTime() } })).to.be.deep.equal((new Date(2019, 7, 18, 5, 10, 0))); @@ -32,7 +32,7 @@ describe('TaskManager', () => { let m = 5; expect(tm.getDateFromSchedule(refDate, { trigger: { - type: TaskTriggerType.periodic, + type: JobTriggerType.periodic, atTime: (h * 60 + m) * 60 * 1000, periodicity: dayOfWeek } @@ -43,7 +43,7 @@ describe('TaskManager', () => { nextDay = 18 + dayOfWeek + 1; expect(tm.getDateFromSchedule(refDate, { trigger: { - type: TaskTriggerType.periodic, + type: JobTriggerType.periodic, atTime: (h * 60 + m) * 60 * 1000, periodicity: dayOfWeek } @@ -54,7 +54,7 @@ describe('TaskManager', () => { nextDay = 18 + dayOfWeek + 1; expect(tm.getDateFromSchedule(refDate, { trigger: { - type: TaskTriggerType.periodic, + type: JobTriggerType.periodic, atTime: (h * 60 + m) * 60 * 1000, periodicity: dayOfWeek } @@ -66,7 +66,7 @@ describe('TaskManager', () => { const m = 5; expect(tm.getDateFromSchedule(refDate, { trigger: { - type: TaskTriggerType.periodic, + type: JobTriggerType.periodic, atTime: (h * 60 + m) * 60 * 1000, periodicity: 7 } @@ -77,7 +77,7 @@ describe('TaskManager', () => { const m = 5; expect(tm.getDateFromSchedule(refDate, { trigger: { - type: TaskTriggerType.periodic, + type: JobTriggerType.periodic, atTime: (h * 60 + m) * 60 * 1000, periodicity: 7 } diff --git a/test/backend/unit/model/threading/TaskQue.spec.ts b/test/backend/unit/model/threading/TaskQue.spec.ts index d33f44ba..9bfbb8c2 100644 --- a/test/backend/unit/model/threading/TaskQue.spec.ts +++ b/test/backend/unit/model/threading/TaskQue.spec.ts @@ -24,6 +24,6 @@ describe('TaskQue', () => { const task = tq.get(); tq.ready(task); expect(tq.isEmpty()).to.be.equal(true); - expect(tq.ready.bind(tq, task)).to.be.throw('Task does not exist'); + expect(tq.ready.bind(tq, task)).to.be.throw('Job does not exist'); }); });