diff --git a/ui/src/utils/resource-context.ts b/ui/src/utils/resource-context.ts index 481cb1a46ba..e04bd1e0b5b 100644 --- a/ui/src/utils/resource-context.ts +++ b/ui/src/utils/resource-context.ts @@ -25,3 +25,7 @@ export const isSystemResource = () => { export const isSystemSharedResource = () => { return router.currentRoute.value.meta.resourceScope === 'system-shared' } + +export const getResourceScope = () => { + return router.currentRoute.value.meta.resourceScope +} diff --git a/ui/src/views/workflow/application/ApplicationWorkflowView.vue b/ui/src/views/workflow/application/ApplicationWorkflowView.vue index 253a1a85942..8dff1d1e5a5 100644 --- a/ui/src/views/workflow/application/ApplicationWorkflowView.vue +++ b/ui/src/views/workflow/application/ApplicationWorkflowView.vue @@ -15,11 +15,10 @@ import { WorkflowMode } from '@/workflow-canvas/types' import DefaultModelSettingButton from '../components/default-model-setting/DefaultModelSettingButton.vue' import WorkflowViewLayout from '../components/WorkflowViewLayout.vue' import Conversation from '@/components/conversation/index.vue' +import { getResourceScope } from '@/utils/resource-context.ts' defineOptions({ name: 'ApplicationWorkflowView' }) - -// 为画布节点中的 ModelSelect 提供参数表单接口。 -provide('getModelParamsForm', ModelApi.getModelParamsForm) +provide('resourceScope', getResourceScope()) const DEFAULT_WORKFLOW: LogicFlow.GraphConfigData = { nodes: cloneDeep(defaultApplicationNodes), diff --git a/ui/src/workflow-canvas/index.vue b/ui/src/workflow-canvas/index.vue index bc28f34501f..e863f937a1e 100644 --- a/ui/src/workflow-canvas/index.vue +++ b/ui/src/workflow-canvas/index.vue @@ -1,5 +1,5 @@