NodeDetailViewModel

class NodeDetailViewModel(savedStateHandle: SavedStateHandle, nodeManagementActions: NodeManagementActions, nodeRequestActions: NodeRequestActions, serviceRepository: ServiceRepository, getNodeDetailsUseCase: GetNodeDetailsUseCase, ensureRemoteAdminSession: EnsureRemoteAdminSessionUseCase, observeRemoteAdminSessionStatus: ObserveRemoteAdminSessionStatusUseCase, snackbarManager: SnackbarManager) : ViewModel(source)

ViewModel for the Node Details screen, coordinating data from the node database, mesh logs, and radio configuration.

Constructors

Link copied to clipboard
constructor(savedStateHandle: SavedStateHandle, nodeManagementActions: NodeManagementActions, nodeRequestActions: NodeRequestActions, serviceRepository: ServiceRepository, getNodeDetailsUseCase: GetNodeDetailsUseCase, ensureRemoteAdminSession: EnsureRemoteAdminSessionUseCase, observeRemoteAdminSessionStatus: ObserveRemoteAdminSessionStatusUseCase, snackbarManager: SnackbarManager)

Properties

Link copied to clipboard
Link copied to clipboard
val uiState: StateFlow<NodeDetailUiState>

Primary UI state stream, combining identity, metrics, and global device metadata.

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun getDirectMessageRoute(node: Node, ourNode: Node?): String

Returns the type-safe navigation route for a direct message to this node.

Link copied to clipboard
fun handleNodeMenuAction(action: NodeMenuAction, onAfterRemove: () -> Unit = {})

Dispatches high-level node management actions like removal, muting, or favoriting.

Link copied to clipboard
fun onServiceAction(action: ServiceAction): Job
Link copied to clipboard
fun openRemoteAdmin(destNum: Int)

Ensure a remote-admin session passkey is fresh, then request navigation to the remote-admin screen. Surfaces a snackbar with the appropriate guidance on EnsureSessionResult.Disconnected or EnsureSessionResult.Timeout.

Link copied to clipboard
fun refreshMetadata(destNum: Int): Job

Re-fetch device metadata (firmware/edition/role) for destNum. Refreshes the session passkey as a side effect.

Link copied to clipboard
fun setNodeNotes(nodeNum: Int, notes: String)
Link copied to clipboard
fun start(nodeId: Int)