erp-platform/ui/src/services/UiEvalService.tsx

32 lines
775 B
TypeScript
Raw Normal View History

2025-05-06 06:45:49 +00:00
import { Notification, toast } from '@/components/ui'
import { generateBackgroundWorkers } from '@/services/background-worker.service'
2025-05-28 13:47:54 +00:00
import { useLocalization } from '@/utils/hooks/useLocalization'
2025-05-06 06:45:49 +00:00
export abstract class UiEvalService {
static Init = () => {
//console.log('init')
}
static ApiGenerateBackgroundWorkers = () => {
2025-05-28 13:47:54 +00:00
const { translate } = useLocalization()
2025-05-06 06:45:49 +00:00
const asyncCall = async () => {
await generateBackgroundWorkers()
}
asyncCall()
toast.push(
<Notification type="success" duration={2000}>
2025-05-28 13:47:54 +00:00
{translate('::App.BackgroundWorkers.Message')}
2025-05-06 06:45:49 +00:00
</Notification>,
{
placement: 'top-center',
},
)
}
}
const _global = (window || global) as any
_global.UiEvalService = UiEvalService