[fix] Fix API URL prefix slash and add error handling

- Update comfyManagerService to use conditional API URL prefix based on manager v4 support
- Fix manager UI state handling in command menubar and workflow warning dialog
- Add proper manager state detection with fallback to settings panel
- Remove unused imports and variables

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
bymyself
2025-08-31 19:29:28 -07:00
parent 2415b979b9
commit 8a26b7ef60
4 changed files with 124 additions and 37 deletions

View File

@@ -1,6 +1,7 @@
import axios, { AxiosError, AxiosResponse } from 'axios'
import { ref } from 'vue'
import { ServerFeatureFlag } from '@/composables/useFeatureFlags'
import { api } from '@/scripts/api'
import {
type InstallPackParams,
@@ -35,8 +36,12 @@ enum ManagerRoute {
IS_LEGACY_MANAGER_UI = 'manager/is_legacy_manager_ui'
}
// Create axios client with conditional v2 prefix based on manager v4 support
const supportsV4 = api.getServerFeature(ServerFeatureFlag.MANAGER_SUPPORTS_V4)
const baseURL = supportsV4 ? api.apiURL('/v2/') : api.apiURL('/')
const managerApiClient = axios.create({
baseURL: api.apiURL('/v2/'),
baseURL,
headers: {
'Content-Type': 'application/json'
}