diff --git a/app/src/main/java/com/m57/hermescontrol/data/local/AuthManager.kt b/app/src/main/java/com/m57/hermescontrol/data/local/AuthManager.kt index 4e964759..15e59835 100644 --- a/app/src/main/java/com/m57/hermescontrol/data/local/AuthManager.kt +++ b/app/src/main/java/com/m57/hermescontrol/data/local/AuthManager.kt @@ -35,7 +35,6 @@ object AuthManager { private const val PREFS_FILE = "hermes_secure_prefs" private const val KEY_TOKEN = "auth_token" - private const val KEY_SELECTED_PROFILE_ID = "selected_profile_id" private const val KEY_SESSION_COOKIE = "session_cookie" @Volatile diff --git a/app/src/main/java/com/m57/hermescontrol/theme/Theme.kt b/app/src/main/java/com/m57/hermescontrol/theme/Theme.kt index 6723ed51..c7afb6eb 100644 --- a/app/src/main/java/com/m57/hermescontrol/theme/Theme.kt +++ b/app/src/main/java/com/m57/hermescontrol/theme/Theme.kt @@ -26,11 +26,6 @@ enum class BottomNavDisplayMode { ICON_AND_TEXT, ICON_ONLY, TEXT_ONLY } val LocalThemePreference = compositionLocalOf { ThemePreference.SYSTEM } val LocalThemePreset = compositionLocalOf { ThemePreset.DEFAULT } -/** - * Set to true to opt into Material You dynamic color (Android 12+). - */ -private const val ENABLE_DYNAMIC_COLOR = true - private val HermesDarkColorScheme = darkColorScheme( primary = HermesPurple, diff --git a/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatViewModel.kt b/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatViewModel.kt index aaf403b9..8c069c4b 100644 --- a/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatViewModel.kt +++ b/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatViewModel.kt @@ -836,93 +836,6 @@ class ChatViewModel( } } - private fun fetchAndDisplayStatus() { - viewModelScope.launch { - val result = - withContext(Dispatchers.IO) { - safeApiCall { ApiClient.hermesApi.getStatus() } - } - when (result) { - is NetworkResult.Success -> { - val body = result.data - val platformsStr = - body.gateway_platforms?.entries?.joinToString("\n") { (k, v) -> - val status = v?.state ?: "Unknown" - val err = v?.error_code?.let { " (Error: $it)" } ?: "" - " • **$k**: $status$err" - } ?: "No active platforms" - addAssistantMessage( - """ - **Hermes Gateway Status:** - • **Version:** ${body.version ?: "Unknown"} - • **Gateway Running:** ${body.gateway_running ?: false} - • **Active Sessions:** ${body.active_sessions ?: 0} - • **Auth Required:** ${body.auth_required ?: false} - - **Platforms:** - $platformsStr - """.trimIndent(), - ) - } - - is NetworkResult.Failure -> { - addAssistantMessage("Failed to retrieve status: ${result.error.message}") - } - } - } - } - - private fun fetchAndDisplaySessions() { - viewModelScope.launch { - val result = - withContext(Dispatchers.IO) { - safeApiCall { ApiClient.hermesApi.getSessions() } - } - when (result) { - is NetworkResult.Success -> { - val body = result.data - val sessionsStr = - body.sessions.joinToString("\n") { s -> - "• **${s.title ?: "Untitled"}** (ID: `${s.id}`, Messages: ${s.message_count ?: 0})" - } - addAssistantMessage("**Sessions List:**\n$sessionsStr") - } - - is NetworkResult.Failure -> { - addAssistantMessage("Failed to list sessions: ${result.error.message}") - } - } - } - } - - private fun fetchAndDisplayStats() { - viewModelScope.launch { - val result = - withContext(Dispatchers.IO) { - safeApiCall { ApiClient.hermesApi.getSystemStats() } - } - when (result) { - is NetworkResult.Success -> { - val body = result.data - val cpuPct = body.cpu_percent?.let { String.format("%.1f%%", it) } ?: "N/A" - val memPct = body.memory?.percent?.let { String.format("%.1f%%", it) } ?: "N/A" - addAssistantMessage( - """ - **System Resource Stats:** - • **CPU Usage:** $cpuPct - • **Memory Usage:** $memPct - • **Uptime:** ${body.uptime_seconds?.let { "${it.toLong()}s" } ?: "N/A"} - """.trimIndent(), - ) - } - - is NetworkResult.Failure -> { - addAssistantMessage("Failed to retrieve system stats: ${result.error.message}") - } - } - } - } - private fun addAssistantMessage(text: String) { val msg = ChatMessage(role = MessageRole.ASSISTANT, content = text) _uiState.update { it.copy(messages = it.messages + msg) }