feat: add tasks page (#692)

This commit is contained in:
Manuel
2024-07-01 18:57:40 +02:00
committed by GitHub
parent 663eb0bf5b
commit 08d571ad74
43 changed files with 668 additions and 174 deletions

View File

@@ -0,0 +1,28 @@
import { beforeCallbackAsync, onCallbackErrorAsync, onCallbackSuccessAsync } from "@homarr/cron-job-status/publisher";
import { createCronJobFunctions } from "@homarr/cron-jobs-core";
import type { Logger } from "@homarr/cron-jobs-core/logger";
import { logger } from "@homarr/log";
import type { TranslationObject } from "@homarr/translation";
class WinstonCronJobLogger implements Logger {
logDebug(message: string) {
logger.debug(message);
}
logInfo(message: string) {
logger.info(message);
}
logError(error: unknown) {
logger.error(error);
}
}
export const { createCronJob, createCronJobGroup } = createCronJobFunctions<
keyof TranslationObject["management"]["page"]["tool"]["tasks"]["job"]
>({
logger: new WinstonCronJobLogger(),
beforeCallback: beforeCallbackAsync,
onCallbackSuccess: onCallbackSuccessAsync,
onCallbackError: onCallbackErrorAsync,
});