Implement unified story generation flow

This commit is contained in:
2026-06-18 14:48:27 +08:00
parent 0ccfd00a23
commit 7ebdfb2582
27 changed files with 1323 additions and 215 deletions

View File

@@ -1,23 +1,26 @@
# Build Stage
FROM node:18-alpine AS build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Production Stage
FROM nginx:alpine AS production-stage
# 复制构建产物到 Nginx
COPY --from=build-stage /app/dist /usr/share/nginx/html
# 复制自定义 Nginx 配置 (处理 SPA 路由)
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# Build Stage
ARG NODE_BASE_IMAGE=node:18-alpine
ARG NGINX_BASE_IMAGE=nginx:alpine
FROM ${NODE_BASE_IMAGE} AS build-stage
WORKDIR /app
ARG NPM_REGISTRY=https://registry.npmjs.org/
COPY package*.json ./
RUN npm ci --registry="${NPM_REGISTRY}" --no-audit --no-fund
COPY . .
RUN npm run build
# Production Stage
FROM ${NGINX_BASE_IMAGE} AS production-stage
# 复制构建产物到 Nginx
COPY --from=build-stage /app/dist /usr/share/nginx/html
# 复制自定义 Nginx 配置 (处理 SPA 路由)
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -157,12 +157,20 @@
<template v-else-if="analytics">
<div class="mt-6 grid grid-cols-2 gap-3 lg:grid-cols-4">
<div class="rounded-xl border border-gray-100 bg-white px-4 py-3">
<div class="text-xs text-gray-500">覆盖故事</div>
<div class="mt-1 text-lg font-semibold text-gray-900">{{ analytics.story_count }}</div>
<div class="text-xs text-gray-500">
{{ analyticsCapability === 'asr' ? '语音会话' : '覆盖故事' }}
</div>
<div class="mt-1 text-lg font-semibold text-gray-900">
{{ analyticsCapability === 'asr' ? analytics.voice_session_count : analytics.story_count }}
</div>
</div>
<div class="rounded-xl border border-gray-100 bg-white px-4 py-3">
<div class="text-xs text-gray-500">覆盖任务</div>
<div class="mt-1 text-lg font-semibold text-gray-900">{{ analytics.job_count }}</div>
<div class="text-xs text-gray-500">
{{ analyticsCapability === 'asr' ? '上传回合' : '覆盖任务' }}
</div>
<div class="mt-1 text-lg font-semibold text-gray-900">
{{ analyticsCapability === 'asr' ? analytics.voice_turn_count : analytics.job_count }}
</div>
</div>
<div class="rounded-xl border border-gray-100 bg-white px-4 py-3">
<div class="text-xs text-gray-500">平均耗时</div>
@@ -581,6 +589,8 @@ type ProviderAnalyticsResponse = {
user_count: number
job_count: number
story_count: number
voice_session_count: number
voice_turn_count: number
by_provider: ProviderAnalyticsBucket[]
by_user: ProviderAnalyticsUserBucket[]
failure_reasons: Array<{