diff --git a/src/app/globals.css b/src/app/globals.css index 5a0f197..fd144b2 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -15,7 +15,6 @@ html, body { max-width: 100vw; overflow-x: hidden; - padding: 10px; } body { diff --git a/src/components/SaveFileUploadingDialog.tsx b/src/components/SaveFileUploadingDialog.tsx index 1415731..1201dcd 100644 --- a/src/components/SaveFileUploadingDialog.tsx +++ b/src/components/SaveFileUploadingDialog.tsx @@ -9,6 +9,9 @@ export enum GameEnum { Stellaris = 'stellaris', } +//TODO: move to separate page +//TODO: add redirect to ?id={id} to see status of long parsing save + export default function SaveFileUploadingDialog() { const [error, setError] = useState(null) const [selectedFile, setSelectedFile] = useState(null) @@ -27,7 +30,8 @@ export default function SaveFileUploadingDialog() { } } - const handleUpload = async () => { + const handleUpload = async (e: React.FormEvent) => { + e.preventDefault() setError(null) setUploadDisabled(true) try { @@ -70,40 +74,54 @@ export default function SaveFileUploadingDialog() { return (
-

Select game save file

-
-
Select Game
- {gameEnumOptions} -
-
-
File
- -
+ + - + + - {/* TODO: extract this to a component +
+ {/* TODO: extract this to a component */} - {uploadResult && ( -
- Save Id: {uploadResult.id} -
- )} + {uploadResult && ( +
+ Save Id: {uploadResult.id} +
+ )} - {saveStatus && ( -
- Status: {saveStatus.status} -
- )} + {saveStatus && ( +
+ Status: {saveStatus.status} +
+ )} - {/* add link to /browse?id=${saveStatus.id} */} + {/* add link to /browse?id=${saveStatus.id} */} +
) } diff --git a/src/services/AuthService.ts b/src/services/AuthService.ts index d7ba899..dc3adc0 100644 --- a/src/services/AuthService.ts +++ b/src/services/AuthService.ts @@ -1,3 +1,5 @@ +//TODO: controllable rate limits + class AuthService { private API_BASE = '/api/auth' diff --git a/src/services/SaveParserBackendService.ts b/src/services/SaveParserBackendService.ts index 4a6bf87..879ec26 100644 --- a/src/services/SaveParserBackendService.ts +++ b/src/services/SaveParserBackendService.ts @@ -22,6 +22,7 @@ export class SaveParserBackendService { return '' } + //TODO: save size limit 30 mb async uploadSave(game: string, file: File): Promise { const url = `${this.API_BASE}/uploadSave?game=${encodeURIComponent(game)}` const response = await fetch(url, {