Feat/node notes (#3014)

This commit is contained in:
DaneEvans 2025-09-09 07:37:56 +10:00 committed by GitHub
parent 363764c5ce
commit f2680d37ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 889 additions and 107 deletions

View file

@ -52,6 +52,7 @@ data class Node(
val powerMetrics: PowerMetrics = PowerMetrics.getDefaultInstance(),
val paxcounter: PaxcountProtos.Paxcount = PaxcountProtos.Paxcount.getDefaultInstance(),
val publicKey: ByteString? = null,
val notes: String = "",
) {
val colors: Pair<Int, Int>
get() { // returns foreground and background @ColorInt for each 'num'

View file

@ -762,6 +762,16 @@ constructor(
}
}
fun setNodeNotes(nodeNum: Int, notes: String) = viewModelScope.launch(Dispatchers.IO) {
try {
nodeDB.setNodeNotes(nodeNum, notes)
} catch (ex: java.io.IOException) {
errormsg("Set node notes IO error: ${ex.message}")
} catch (ex: java.sql.SQLException) {
errormsg("Set node notes SQL error: ${ex.message}")
}
}
// managed mode disables all access to configuration
val isManaged: Boolean
get() = config.device.isManaged || config.security.isManaged