mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
[backport rh-test] fix: Use environment-specific log API endpoints for Cloud and OSS (#6544)
Backport of #6539 to `rh-test` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6544-backport-rh-test-fix-Use-environment-specific-log-API-endpoints-for-Cloud-and-OSS-29f6d73d365081dc9dd7d95805242774) by [Unito](https://www.unito.io) --------- Co-authored-by: Jin Yi <jin12cc@gmail.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
@@ -7,6 +7,7 @@ import type {
|
||||
ModelFile,
|
||||
ModelFolderInfo
|
||||
} from '@/platform/assets/schemas/assetSchema'
|
||||
import { isCloud } from '@/platform/distribution/types'
|
||||
import { useToastStore } from '@/platform/updates/common/toastStore'
|
||||
import { type WorkflowTemplates } from '@/platform/workflow/templates/types/template'
|
||||
import type {
|
||||
@@ -1269,15 +1270,22 @@ export class ComfyApi extends EventTarget {
|
||||
}
|
||||
|
||||
async getLogs(): Promise<string> {
|
||||
return (await axios.get(this.internalURL('/logs'))).data
|
||||
const url = isCloud ? this.apiURL('/logs') : this.internalURL('/logs')
|
||||
return (await axios.get(url)).data
|
||||
}
|
||||
|
||||
async getRawLogs(): Promise<LogsRawResponse> {
|
||||
return (await axios.get(this.internalURL('/logs/raw'))).data
|
||||
const url = isCloud
|
||||
? this.apiURL('/logs/raw')
|
||||
: this.internalURL('/logs/raw')
|
||||
return (await axios.get(url)).data
|
||||
}
|
||||
|
||||
async subscribeLogs(enabled: boolean): Promise<void> {
|
||||
return await axios.patch(this.internalURL('/logs/subscribe'), {
|
||||
const url = isCloud
|
||||
? this.apiURL('/logs/subscribe')
|
||||
: this.internalURL('/logs/subscribe')
|
||||
return await axios.patch(url, {
|
||||
enabled,
|
||||
clientId: this.clientId
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user