From 8975ab6b621405b2aaa2452e2adfc1c1eb0ff539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BAlio=20Zanella?= Date: Sat, 16 Aug 2025 12:41:08 -0300 Subject: [PATCH 1/4] feat: Update API URLs to point to the production server --- .env | 4 ++-- config.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index ac67a9f..db4cc05 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -API_URL=https://api-dev.firehosting.com.br -NEXT_PUBLIC_API_URL=https://api-dev.firehosting.com.br +API_URL=https://system-api.firehosting.com.br +NEXT_PUBLIC_API_URL=https://system-api.firehosting.com.br NEXT_PUBLIC_SOCKET_URL=https://firehosting-socket.squareweb.app NEXT_PUBLIC_CENTRAL_URL=https://central.firehosting.com.br \ No newline at end of file diff --git a/config.json b/config.json index 50772b9..a1d5d09 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "api": { - "baseUrl": "https://api-dev.firehosting.com.br", + "baseUrl": "https://system-api.firehosting.com.br", "authKey": "CjYYooDNiVgzWBJPNlYyIUfoxJRtLozDFiTAoHdQuPAnxFEAuK" } } From 5e1536308f9d69fe4e0f03a6a124d3634a2d3a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BAlio=20Zanella?= Date: Sun, 17 Aug 2025 15:53:29 -0300 Subject: [PATCH 2/4] feat: Update socket URL in environment configuration --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index db4cc05..de02d31 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ API_URL=https://system-api.firehosting.com.br NEXT_PUBLIC_API_URL=https://system-api.firehosting.com.br -NEXT_PUBLIC_SOCKET_URL=https://firehosting-socket.squareweb.app +NEXT_PUBLIC_SOCKET_URL=https://socket.firehosting.com.br NEXT_PUBLIC_CENTRAL_URL=https://central.firehosting.com.br \ No newline at end of file From 552644460534d1c5c60c9e0da46b42447a3a81be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BAlio=20Zanella?= Date: Sun, 17 Aug 2025 15:58:18 -0300 Subject: [PATCH 3/4] fix: Correct default WebSocket URL in ServerConsoleWebSocket constructor --- src/services/ServerConsoleWebSocket.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ServerConsoleWebSocket.ts b/src/services/ServerConsoleWebSocket.ts index f731691..e7c41ea 100644 --- a/src/services/ServerConsoleWebSocket.ts +++ b/src/services/ServerConsoleWebSocket.ts @@ -26,7 +26,7 @@ export class ServerConsoleWebSocket { private onErrorCallback?: (error: string) => void; constructor(provider: CredentialProvider) { - this.socketUrl = process.env.NEXT_PUBLIC_SOCKET_URL || 'wss://firehosting-socket.squareweb.app'; + this.socketUrl = process.env.NEXT_PUBLIC_SOCKET_URL || 'wss://socket.firehosting.com.br'; this.credentialProvider = provider; } From 12c92cfeb4d6964af1f3e6d0e0b486ca2d6e0c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BAlio=20Zanella?= Date: Sun, 17 Aug 2025 18:53:50 -0300 Subject: [PATCH 4/4] fix: Update form data key from 'file' to 'files' for API compatibility and improve error handling in file uploads --- .../dashboard/minecraft/CustomizationContent.tsx | 2 +- src/components/dashboard/minecraft/FilesContent.tsx | 13 +++++++++---- .../minecraft/MinecraftSettingsContent.tsx | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/dashboard/minecraft/CustomizationContent.tsx b/src/components/dashboard/minecraft/CustomizationContent.tsx index 34576ab..cb4564f 100644 --- a/src/components/dashboard/minecraft/CustomizationContent.tsx +++ b/src/components/dashboard/minecraft/CustomizationContent.tsx @@ -170,7 +170,7 @@ export default function CustomizationContent({ server }: CustomizationContentPro if (uploadUrlResponse.success && uploadUrlResponse.data) { // Upload the file const formData = new FormData(); - formData.append('file', pngFile); + formData.append('files', pngFile); // Changed from 'file' to 'files' to match API expectations const uploadResponse = await fetch(uploadUrlResponse.data.url, { method: 'POST', diff --git a/src/components/dashboard/minecraft/FilesContent.tsx b/src/components/dashboard/minecraft/FilesContent.tsx index e3f30f5..9ca9f60 100644 --- a/src/components/dashboard/minecraft/FilesContent.tsx +++ b/src/components/dashboard/minecraft/FilesContent.tsx @@ -244,7 +244,8 @@ export default function FilesContent({ if (uploadUrl.success && uploadUrl.data) { const formData = new FormData(); - formData.append('file', file); + // Important: Use "files" as the key name, not "file" + formData.append('files', file); const uploadResponse = await fetch(uploadUrl.data.url, { method: 'POST', @@ -252,7 +253,9 @@ export default function FilesContent({ }); if (!uploadResponse.ok) { - throw new Error(`Failed to upload ${file.name}`); + const errorText = await uploadResponse.text(); + console.error("Upload error:", errorText); + throw new Error(`Failed to upload ${file.name}: ${uploadResponse.status} ${errorText}`); } } @@ -261,6 +264,7 @@ export default function FilesContent({ fetchFiles(currentPath); } catch (err: any) { + console.error("Upload error:", err); setFilesError(err.message || "An error occurred during upload"); } finally { setUploadProgress(null); @@ -309,8 +313,9 @@ export default function FilesContent({ e.stopPropagation(); setDragActive(false); - if (e.dataTransfer.files && e.dataTransfer.files.length > 0 && fileInputRef.current) { - fileInputRef.current.files = e.dataTransfer.files; + if (e.dataTransfer.files && e.dataTransfer.files.length > 0) { + // We don't need to assign to fileInputRef.current.files anymore + // Just directly handle the files from dataTransfer handleFileUpload({ target: { files: e.dataTransfer.files } } as any); } }} diff --git a/src/components/dashboard/minecraft/MinecraftSettingsContent.tsx b/src/components/dashboard/minecraft/MinecraftSettingsContent.tsx index 7f16f64..d7bbdec 100644 --- a/src/components/dashboard/minecraft/MinecraftSettingsContent.tsx +++ b/src/components/dashboard/minecraft/MinecraftSettingsContent.tsx @@ -214,9 +214,9 @@ export default function MinecraftSettingsContent({ server }: MinecraftSettingsCo try { const response = await fetch( - `${config.api.baseUrl}/client/servers/${server.identifier}/settings/rename`, + `${config.api.baseUrl}/v1/users/me/servers/games/${server.identifier}/settings?action=rename`, { - method: "POST", + method: "PATCH", headers: { Authorization: `Bearer ${accessKey}`, "Content-Type": "application/json",