feat: add clone button to site list
Copies the site ID into the add field so users can duplicate an existing site and just change the ID. Useful when autodiscovery is unavailable and multiple sites share the same instance credentials. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ebdf72e2c1
commit
4eef2ac168
2 changed files with 11 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
|||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.Check
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.ContentCopy
|
||||
import androidx.compose.material.icons.filled.Delete
|
||||
import androidx.compose.material.icons.filled.Edit
|
||||
import androidx.compose.material.icons.filled.Language
|
||||
|
|
@ -158,6 +159,12 @@ fun SiteListScreen(
|
|||
style = MaterialTheme.typography.titleMedium,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
IconButton(onClick = { viewModel.cloneSite(site.id) }) {
|
||||
Icon(
|
||||
Icons.Default.ContentCopy,
|
||||
contentDescription = "Clone site"
|
||||
)
|
||||
}
|
||||
IconButton(onClick = { viewModel.startEditing(site.id) }) {
|
||||
Icon(
|
||||
Icons.Default.Edit,
|
||||
|
|
|
|||
|
|
@ -113,4 +113,8 @@ class SiteListViewModel @Inject constructor(
|
|||
fun cancelEdit() {
|
||||
_uiState.update { it.copy(editingSiteId = null, editSiteValue = "") }
|
||||
}
|
||||
|
||||
fun cloneSite(siteId: String) {
|
||||
_uiState.update { it.copy(newSiteId = siteId) }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue