Download ui/src/utils/queue.ts from michaelu0826/ai_toolkit_code: direct link, hf CLI and curl.
- Browser
- Download file 840 Bytes
-
https://huggingface.co/datasets/michaelu0826/ai_toolkit_code/resolve/main/ui/src/utils/queue.ts
- Command line
-
hf download hf://datasets/michaelu0826/ai_toolkit_code/ui/src/utils/queue.ts
-
curl -L -o queue.ts https://huggingface.co/datasets/michaelu0826/ai_toolkit_code/resolve/main/ui/src/utils/queue.ts
840 Bytes
| import { apiClient } from '@/utils/api'; | |
| export const startQueue = (queueID: string) => { | |
| return new Promise<void>((resolve, reject) => { | |
| apiClient | |
| .get(`/api/queue/${queueID}/start`) | |
| .then(res => res.data) | |
| .then(data => { | |
| console.log('Queue started:', data); | |
| resolve(); | |
| }) | |
| .catch(error => { | |
| console.error('Error starting queue:', error); | |
| reject(error); | |
| }); | |
| }); | |
| }; | |
| export const stopQueue = (queueID: string) => { | |
| return new Promise<void>((resolve, reject) => { | |
| apiClient | |
| .get(`/api/queue/${queueID}/stop`) | |
| .then(res => res.data) | |
| .then(data => { | |
| console.log('Queue stopped:', data); | |
| resolve(); | |
| }) | |
| .catch(error => { | |
| console.error('Error stopping queue:', error); | |
| reject(error); | |
| }); | |
| }); | |
| }; | |