feat: openapi supoort -- fix list page

This commit is contained in:
engigu
2026-03-05 22:56:15 +08:00
parent 863a298609
commit 40c3c58312
7 changed files with 99 additions and 61 deletions
+6 -4
View File
@@ -34,10 +34,10 @@ let searchTimer: ReturnType<typeof setTimeout> | null = null
async function loadEnvVars() {
try {
const res = await api.env.list({ page: currentPage.value, page_size: pageSize.value, name: filterName.value || undefined })
envVars.value = res.data
envVars.value = res.list
total.value = res.total
// 初始化显示状态,根据数据库的 hidden 状态同步显示
res.data.forEach(env => {
res.list.forEach(env => {
showValues.value[env.id] = !env.hidden
})
} catch { toast.error('加载环境变量失败') }
@@ -251,7 +251,8 @@ onMounted(loadEnvVars)
<div class="space-y-2">
<div class="flex items-center justify-between px-1">
<p class="text-[11px] font-bold text-muted-foreground uppercase tracking-widest">关联任务 ({{ associatedTasks.length }})</p>
<p class="text-[11px] font-bold text-muted-foreground uppercase tracking-widest">关联任务 ({{
associatedTasks.length }})</p>
</div>
<div class="bg-muted/30 rounded-lg p-1.5 max-h-40 overflow-y-auto space-y-1 border border-border/40">
<div v-for="task in associatedTasks" :key="task.id"
@@ -260,7 +261,8 @@ onMounted(loadEnvVars)
<Terminal class="h-3 w-3 text-primary/70" />
<span class="font-medium truncate">{{ task.name }}</span>
</div>
<code class="text-[10px] text-muted-foreground/70 font-mono bg-muted/50 px-1.5 py-0.5 rounded">{{ task.id }}</code>
<code
class="text-[10px] text-muted-foreground/70 font-mono bg-muted/50 px-1.5 py-0.5 rounded">{{ task.id }}</code>
</div>
</div>
</div>