mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
[feat] Add remote config support for model upload and asset update feature flags (#7143)
## Summary Feature flags for model upload button and asset update options now check remote config from `/api/features` first, falling back to websocket feature flags. ## Changes - **What**: Added `model_upload_button_enabled` and `asset_update_options_enabled` to `RemoteConfig` type - **What**: Updated feature flag getters to prioritize remote config over websocket flags - **Why**: Enables dynamic feature control without requiring websocket connection, consistent with other feature flags pattern ## Review Focus - Pattern consistency with other remote config feature flags - Proper fallback behavior when remote config is unavailable ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7143-feat-Add-remote-config-support-for-model-upload-and-asset-update-feature-flags-2bf6d73d3650819cb364f0ab69d77dd0) by [Unito](https://www.unito.io) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
643533c572
commit
52e915baf0
@@ -1,5 +1,6 @@
|
|||||||
import { computed, reactive, readonly } from 'vue'
|
import { computed, reactive, readonly } from 'vue'
|
||||||
|
|
||||||
|
import { remoteConfig } from '@/platform/remoteConfig/remoteConfig'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,15 +29,23 @@ export function useFeatureFlags() {
|
|||||||
return api.getServerFeature(ServerFeatureFlag.MANAGER_SUPPORTS_V4)
|
return api.getServerFeature(ServerFeatureFlag.MANAGER_SUPPORTS_V4)
|
||||||
},
|
},
|
||||||
get modelUploadButtonEnabled() {
|
get modelUploadButtonEnabled() {
|
||||||
return api.getServerFeature(
|
// Check remote config first (from /api/features), fall back to websocket feature flags
|
||||||
ServerFeatureFlag.MODEL_UPLOAD_BUTTON_ENABLED,
|
return (
|
||||||
false
|
remoteConfig.value.model_upload_button_enabled ??
|
||||||
|
api.getServerFeature(
|
||||||
|
ServerFeatureFlag.MODEL_UPLOAD_BUTTON_ENABLED,
|
||||||
|
false
|
||||||
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
get assetUpdateOptionsEnabled() {
|
get assetUpdateOptionsEnabled() {
|
||||||
return api.getServerFeature(
|
// Check remote config first (from /api/features), fall back to websocket feature flags
|
||||||
ServerFeatureFlag.ASSET_UPDATE_OPTIONS_ENABLED,
|
return (
|
||||||
false
|
remoteConfig.value.asset_update_options_enabled ??
|
||||||
|
api.getServerFeature(
|
||||||
|
ServerFeatureFlag.ASSET_UPDATE_OPTIONS_ENABLED,
|
||||||
|
false
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -34,4 +34,6 @@ export type RemoteConfig = {
|
|||||||
comfy_platform_base_url?: string
|
comfy_platform_base_url?: string
|
||||||
firebase_config?: FirebaseRuntimeConfig
|
firebase_config?: FirebaseRuntimeConfig
|
||||||
telemetry_disabled_events?: TelemetryEventName[]
|
telemetry_disabled_events?: TelemetryEventName[]
|
||||||
|
model_upload_button_enabled?: boolean
|
||||||
|
asset_update_options_enabled?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user