mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 05:56:38 +08:00
fix: 修复 Pages 部署包上传报「请求超时,请稍后重试」
This commit is contained in:
@@ -22,6 +22,8 @@ sidebar: false
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复 Pages 部署包上传报「请求超时,请稍后重试」:上传请求使用独立 10 分钟超时(覆盖默认 15 秒),并在大文件上传完成后提示服务端处理中。
|
||||
|
||||
- 修复应用日志异常膨胀:Agent 配置同步加锁避免并发重复上报,成功且版本/checksum 未变时跳过重复 apply 日志;Server 入库前对相同成功记录去重;Flared 配置未变更时不再上报 apply 日志。
|
||||
|
||||
- 修复应用日志页「清空」无效果:原按钮仅重置筛选;新增「清空日志」入口并对接 `/api/v1/d/apply-logs/cleanup`,支持确认后删除全部记录。
|
||||
|
||||
@@ -141,10 +141,10 @@ export function DeploymentUploadDialog({
|
||||
{uploadProgress !== null ? (
|
||||
<div className="space-y-1.5">
|
||||
<div className="flex justify-between text-xs text-muted-foreground">
|
||||
<span>上传进度</span>
|
||||
<span>{uploadProgress}%</span>
|
||||
<span>{uploadProgress >= 100 ? "服务端处理中" : "上传进度"}</span>
|
||||
<span>{uploadProgress >= 100 ? "请稍候" : `${uploadProgress}%`}</span>
|
||||
</div>
|
||||
<Progress value={uploadProgress} />
|
||||
<Progress value={uploadProgress >= 100 ? 100 : uploadProgress} />
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
|
||||
@@ -21,6 +21,11 @@ export const apiConfig = {
|
||||
baseURL: getApiBaseUrl(),
|
||||
/** 超时时间(毫秒) */
|
||||
timeout: 15000,
|
||||
/**
|
||||
* 文件上传超时(毫秒)。
|
||||
* Pages 部署包上限 100 MiB,需覆盖上传 + 服务端解压校验与入库时间。
|
||||
*/
|
||||
uploadTimeout: 10 * 60 * 1000,
|
||||
/** 携带凭证 */
|
||||
withCredentials: true,
|
||||
} as const;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type {AxiosProgressEvent, InternalAxiosRequestConfig} from 'axios';
|
||||
|
||||
import apiClient from '@/lib/services/core/api-client';
|
||||
import {apiConfig} from '@/lib/services/core/config';
|
||||
import type {ApiResponse} from '@/lib/services/core';
|
||||
|
||||
import {OpenFlareBaseService} from './base.service';
|
||||
@@ -94,6 +95,7 @@ export class PagesService extends OpenFlareBaseService {
|
||||
this.getFullPath(path),
|
||||
formData,
|
||||
{
|
||||
timeout: apiConfig.uploadTimeout,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
onUploadProgress: (event: AxiosProgressEvent) => {
|
||||
if (!onProgress || !event.total) return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type {InternalAxiosRequestConfig} from 'axios';
|
||||
|
||||
import {apiConfig} from '../core/config';
|
||||
import {BaseService} from '../core/base.service';
|
||||
import type {ListUploadsResponse, Upload, UploadImageResponse} from './types';
|
||||
|
||||
@@ -23,6 +24,7 @@ export class UploadService extends BaseService {
|
||||
}
|
||||
|
||||
return this.post<Upload>('', formData, {
|
||||
timeout: apiConfig.uploadTimeout,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
} as InternalAxiosRequestConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user