Implement profiles management and settings API

- Added Profile and ProfileList structs to manage user profiles with unique IDs and nicknames.
- Introduced endpoints for CRUD operations on profiles: `/api/profiles` for managing profiles and `/api/profiles/switch` for switching active profiles.
- Implemented settings management with an endpoint `/api/settings` to handle user preferences like font size and debug mode.
- Enhanced the server to load and save profiles from a `profiles.json` file.
- Updated the fetcher initialization to respect the active profile's configuration.
- Added comprehensive end-to-end tests for profiles and settings APIs to ensure functionality and persistence.
This commit is contained in:
Sarto
2026-04-03 22:08:54 +03:30
parent d1b3fb94ec
commit 271e6f569e
5 changed files with 1505 additions and 1170 deletions
@@ -65,7 +65,7 @@ class MainActivity : ComponentActivity() {
webView.webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView?, url: String?) {
if (url != null && url.startsWith("http://127.0.0.1")) {
txtStatus.text = "Connected"
txtStatus.text = ""
retryCount = 0
}
}
@@ -128,7 +128,7 @@ class MainActivity : ComponentActivity() {
companion object {
private const val MAX_RETRIES = 25
private const val RETRY_DELAY_MS = 2000L
private const val INITIAL_DELAY_MS = 5000L
private const val RETRY_DELAY_MS = 10000L
private const val INITIAL_DELAY_MS = 15000L
}
}