fix(web): correct monitoring empty states and Space request headers

This commit is contained in:
Hyu
2026-10-12 13:36:26 +08:00
parent 11ed8a2306
commit 417c552694
4 changed files with 47 additions and 9 deletions
@@ -340,16 +340,12 @@ export default function PipelineMigration({
return (
<>
{(count > 0 || previewError || results.length > 0) && (
{(count > 0 || results.length > 0) && (
<Alert className="mb-4 shrink-0 border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200">
<AlertTriangle aria-hidden="true" />
<AlertTitle>{t('pipelineMigration.title')}</AlertTitle>
<AlertDescription className="flex items-center justify-between gap-3 text-amber-800 dark:text-amber-200">
<span>
{previewError
? t('pipelineMigration.previewError')
: t('pipelineMigration.detected', { count })}
</span>
<span>{t('pipelineMigration.detected', { count })}</span>
<Button
variant="outline"
size="sm"
+7
View File
@@ -4,6 +4,7 @@ import axios, {
AxiosResponse,
AxiosError,
} from 'axios';
import i18n from 'i18next';
import {
clearActiveWorkspaceUuid,
getActiveWorkspaceUuid,
@@ -79,6 +80,12 @@ export abstract class BaseHttpClient {
// 请求拦截
this.instance.interceptors.request.use(
async (config) => {
// Account-only endpoints have no selected Workspace. Workspace routes
// resolve their persisted language and override this presentation hint.
// This is a LangBot backend hint, not part of the public Space API.
if (!this.disableToken) {
config.headers['X-LangBot-Language'] = i18n.language || 'en-US';
}
// 客户端添加认证头
if (typeof window !== 'undefined' && !this.disableToken) {
const session = this.getSessionSync();