feat: implement osu! installation validation

This commit is contained in:
2025-06-30 23:07:45 +02:00
parent c43fd4395d
commit 1834d8dfb3
12 changed files with 476 additions and 44 deletions

28
src/pages/Login.svelte Normal file
View File

@@ -0,0 +1,28 @@
<script lang="ts">
import { ezppfarm } from '@/api/ezpp';
let username = $state('');
let password = $state('');
let errorMessage = $state('');
let isLoading = $state(false);
const performLogin = async () => {
isLoading = true;
errorMessage = '';
try {
const loginResult = await ezppfarm.login(username, password);
if (loginResult) {
// Handle successful login, e.g., redirect to the main app or store the token
console.log('Login successful:', loginResult);
} else {
errorMessage = 'Invalid username or password.';
}
} catch {
errorMessage = 'Login failed. Please check your credentials.';
} finally {
isLoading = false;
}
};
</script>