feat: refine admin shell and model fallback

This commit is contained in:
2026-06-22 02:46:21 +08:00
parent 705cfe47e8
commit 1dd7805712
9 changed files with 23 additions and 9 deletions
@@ -435,5 +435,5 @@ class IntentNode(BaseNode):
'default': 'intent_result',
},
},
'required': ['model_id', 'intents'],
'required': ['intents'],
}
@@ -1065,5 +1065,5 @@ class LLMNode(BaseNode):
'default': 'llm_response',
},
},
'required': ['model_id'],
'required': [],
}
@@ -241,8 +241,6 @@ class AgentService:
if not model:
return None
agent.model_id = model.id
await self._db.flush()
logger.info(
"Agent %s has no active model, fallback to default chat model %s",
getattr(agent, "code", agent.id),
@@ -66,7 +66,7 @@ const getWidget = (i: string) => {
const getAnimationDelay = (i: string) => {
if (!dashboardConfig.value) return 0;
const index = dashboardConfig.value.widgets.findIndex((w) => w.i === i);
return index * 80; // 每个组件延迟 80ms
return index * 20;
};
</script>
@@ -249,7 +249,7 @@ const animationClass = computed(() => {
<!-- 加载状态 -->
<div
v-if="isLoading"
class="absolute inset-0 z-10 flex items-center justify-center bg-white/50"
class="widget-loading-mask absolute inset-0 z-10 flex items-center justify-center"
>
<Loader2 class="text-primary h-6 w-6 animate-spin" />
</div>
@@ -296,7 +296,9 @@ const animationClass = computed(() => {
.widget-enter {
opacity: 0;
transform: translateY(20px) scale(0.95);
transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
transition:
opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.widget-entered {
@@ -310,4 +312,8 @@ const animationClass = computed(() => {
}
/* 入场动画 */
.widget-loading-mask {
background: color-mix(in srgb, var(--el-bg-color) 78%, transparent);
}
</style>
+1 -1
View File
@@ -17,7 +17,7 @@ export const overridesPreferences = defineOverridesPreferences({
accessMode: 'mixed',
authPageLayout: 'panel-center',
defaultHomePath: '/page-render/main_home',
layout: 'sidebar-nav',
layout: 'header-sidebar-nav',
preferencesButtonPosition: 'header',
},
sidebar: {
@@ -784,6 +784,7 @@ onMounted(() => {
</template>
<ElSelect
v-model="formData.model_id"
clearable
filterable
:placeholder="$t('ai-platform.agent.model.placeholder')"
style="width: 100%"
@@ -795,6 +796,9 @@ onMounted(() => {
:value="model.id"
/>
</ElSelect>
<div class="text-muted-foreground mt-1 text-xs">
留空时发布和运行会自动使用当前启用的默认 chat 模型。
</div>
</ElFormItem>
<ElFormItem>
@@ -124,7 +124,8 @@ const removeExample = (intentIndex: number, exampleIndex: number) => {
<ElFormItem :label="$t('ai-platform.workflow.panels.common.model')">
<ElSelect
v-model="form.model_id"
placeholder="{{ $t('ai-platform.workflow.panels.intent.selectModelHint') }}"
clearable
:placeholder="$t('ai-platform.workflow.panels.intent.selectModelHint')"
>
<ElOption
v-for="m in models"
@@ -135,6 +136,7 @@ const removeExample = (intentIndex: number, exampleIndex: number) => {
</ElSelect>
<div class="text-muted-foreground mt-1 text-xs">
{{ $t('ai-platform.workflow.panels.intent.modelHint') }}
留空时运行会自动使用当前启用的默认 chat 模型
</div>
</ElFormItem>
@@ -174,6 +174,7 @@ watch(
<ElFormItem :label="$t('ai-platform.workflow.panels.common.model')">
<ElSelect
v-model="form.model_id"
clearable
:placeholder="$t('ai-platform.workflow.panels.common.selectModel')"
>
<ElOption
@@ -183,6 +184,9 @@ watch(
:value="m.id"
/>
</ElSelect>
<div class="text-muted-foreground mt-1 text-xs">
留空时运行会自动使用当前启用的默认 chat 模型
</div>
</ElFormItem>
<ElFormItem>