Upsert Service Screen View Model

The UpsertServiceScreenViewModel class is the support class used by the com.tecknobit.brownie.ui.screens.upsertservice.presenter.UpsertServiceScreen screen

Author

N7ghtm4r3 - Tecknobit

Parameters

hostId

The identifier of the host owner of the service

serviceId

The identifier of the service

See also

Retriever
EquinoxViewModel

Constructors

Link copied to clipboard
constructor(hostId: String, serviceId: String?)

Properties

Link copied to clipboard

autoRunAfterHostReboot whether the service must be automatically restarted after the host start or the host restart

Link copied to clipboard
val item: StateFlow<HostService?>
Link copied to clipboard
lateinit var name: MutableState<String>

name the name of the item

Link copied to clipboard

nameError whether the name field is not valid

Link copied to clipboard

programArguments the arguments of the program

Link copied to clipboard

purgeNohupOutAfterReboot whether the nohup.out file related to the service must be deleted at each service start

Link copied to clipboard
lateinit var sessionFlowState: SessionFlowState

sessionFlowState the state used to manage the session lifecycle in the screen

Link copied to clipboard

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open override fun canRetrieverStart(): Boolean
Link copied to clipboard
open override fun continueToRetrieve(currentContext: KClass<*>): Boolean
Link copied to clipboard
fun deleteService(onSuccess: () -> Unit)

Method used to delete a service

Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun removeService(onSuccess: () -> Unit)

Method used to remove a service

Link copied to clipboard
open override fun restartRetriever()
Link copied to clipboard
open fun restartRetrieverIf(condition: Boolean)
Link copied to clipboard
open override fun retrieve(currentContext: KClass<*>, routine: suspend () -> Unit, repeatRoutine: Boolean, refreshDelay: Long)
Link copied to clipboard
open override fun retrieveItem()

Method used to retrieve the information of the item to display

Link copied to clipboard
open fun setActiveContext(currentContext: KClass<*>)
Link copied to clipboard
fun showSnackbarMessage(message: String, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(response: JsonObject, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(message: StringResource, actionLabel: StringResource?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
Link copied to clipboard
open override fun suspendRetriever()
Link copied to clipboard
open fun suspendRetrieverIf(condition: Boolean)
Link copied to clipboard
fun upsert()

Method used to insert or update an item