Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
API_URL=https://api-dev.firehosting.com.br
NEXT_PUBLIC_API_URL=https://api-dev.firehosting.com.br
NEXT_PUBLIC_SOCKET_URL=https://firehosting-socket.squareweb.app
API_URL=https://system-api.firehosting.com.br
NEXT_PUBLIC_API_URL=https://system-api.firehosting.com.br
NEXT_PUBLIC_SOCKET_URL=https://socket.firehosting.com.br
NEXT_PUBLIC_CENTRAL_URL=https://central.firehosting.com.br
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"api": {
"baseUrl": "https://api-dev.firehosting.com.br",
"baseUrl": "https://system-api.firehosting.com.br",
"authKey": "CjYYooDNiVgzWBJPNlYyIUfoxJRtLozDFiTAoHdQuPAnxFEAuK"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
13 changes: 9 additions & 4 deletions src/components/dashboard/minecraft/FilesContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,18 @@ 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',
body: formData,
});

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}`);
}
}

Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/services/ServerConsoleWebSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down