feat: image preview for stable-diffusion task is ready

This commit is contained in:
RockYang
2024-04-02 17:24:38 +08:00
parent 3f1ad4b7dc
commit 9cc2ea412b
13 changed files with 171 additions and 13 deletions

View File

@@ -559,7 +559,7 @@ const connect = () => {
});
}
const _socket = new WebSocket(host + `/api/sd/client?user_id=${userId.value}`);
const _socket = new WebSocket(host + `/api/sd/client`);
_socket.addEventListener('open', () => {
socket.value = _socket;
@@ -621,9 +621,9 @@ const initData = () => {
});
}
const fetchRunningJobs = (userId) => {
const fetchRunningJobs = () => {
// 获取运行中的任务
httpGet(`/api/sd/jobs?status=0&user_id=${userId}`).then(res => {
httpGet(`/api/sd/jobs?status=0`).then(res => {
const jobs = res.data
const _jobs = []
for (let i = 0; i < jobs.length; i++) {