mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
Rework userFileStore (#815)
* Rework userFileStore * nit * Add back unittests
This commit is contained in:
@@ -11,7 +11,8 @@ import {
|
||||
PromptResponse,
|
||||
SystemStats,
|
||||
User,
|
||||
Settings
|
||||
Settings,
|
||||
UserDataFullInfo
|
||||
} from '@/types/apiTypes'
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -671,6 +672,19 @@ class ComfyApi extends EventTarget {
|
||||
return resp.json()
|
||||
}
|
||||
|
||||
async listUserDataFullInfo(dir: string): Promise<UserDataFullInfo[]> {
|
||||
const resp = await this.fetchApi(
|
||||
`/userdata?dir=${encodeURIComponent(dir)}&recurse=true&split=false&full_info=true`
|
||||
)
|
||||
if (resp.status === 404) return []
|
||||
if (resp.status !== 200) {
|
||||
throw new Error(
|
||||
`Error getting user data list '${dir}': ${resp.status} ${resp.statusText}`
|
||||
)
|
||||
}
|
||||
return resp.json()
|
||||
}
|
||||
|
||||
async getLogs(): Promise<string> {
|
||||
return (await axios.get(this.internalURL('/logs'))).data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user