mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-28 03:44:27 +00:00
feat(upload): increase upload limit and fix folder upload placeholders
This commit is contained in:
@@ -44,6 +44,9 @@ if (process.env.WORKFLOW_EXECUTOR === 'temporal') {
|
||||
const server = Bun.serve({
|
||||
port: 3000,
|
||||
fetch: app.fetch,
|
||||
maxRequestBodySize: process.env.MAX_REQUEST_BODY_SIZE
|
||||
? parseInt(process.env.MAX_REQUEST_BODY_SIZE)
|
||||
: 1024 * 1024 * 1024 * 10, // Default 10GB
|
||||
routes: {
|
||||
// Serve index.html for root
|
||||
'/': index,
|
||||
|
||||
@@ -361,26 +361,36 @@ export function FileBrowser({
|
||||
const isCurrentFolderUpload = variables.json.parentId === assetId
|
||||
|
||||
if (isCurrentFolderUpload) {
|
||||
const newLocalFiles: AssetInfo[] = filesToUpload.map((f) => {
|
||||
const urlInfo = (
|
||||
data.presignedUrls as { id?: string; url?: string; fileId?: string }[] | undefined
|
||||
)?.find((p) => p.id === f.id)
|
||||
const hasUrl = !!urlInfo && !!urlInfo.url
|
||||
return {
|
||||
id: urlInfo?.fileId || f.id,
|
||||
name: f.file.name,
|
||||
sizeByte: f.file.size,
|
||||
fileCount: 0,
|
||||
type: 'file',
|
||||
status: hasUrl ? 'uploading' : 'error',
|
||||
mediaType: f.file.type || null,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
}
|
||||
})
|
||||
const newLocalFiles: AssetInfo[] = filesToUpload
|
||||
.filter((f) => {
|
||||
const path = (f.file.webkitRelativePath || f.file.name).split('/')
|
||||
return path.length === 1
|
||||
})
|
||||
.map((f) => {
|
||||
const urlInfo = (
|
||||
data.presignedUrls as { id?: string; url?: string; fileId?: string }[] | undefined
|
||||
)?.find((p) => p.id === f.id)
|
||||
const hasUrl = !!urlInfo && !!urlInfo.url
|
||||
return {
|
||||
id: urlInfo?.fileId || f.id,
|
||||
name: f.file.name,
|
||||
sizeByte: f.file.size,
|
||||
fileCount: 0,
|
||||
type: 'file',
|
||||
status: hasUrl ? 'uploading' : 'error',
|
||||
mediaType: f.file.type || null,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
}
|
||||
})
|
||||
setLocalUploadingFiles((prev) => [...newLocalFiles, ...prev])
|
||||
}
|
||||
|
||||
// Invalidate queries immediately so any newly created folders appear
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['search', teamId, assetId],
|
||||
})
|
||||
|
||||
// The RPC client returns an object that we cast to the expected type
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
await uploadFiles(filesToUpload, data.presignedUrls as any, data.taskId!)
|
||||
|
||||
Reference in New Issue
Block a user