Skip to content

Commit

Permalink
manager: Disable interactions for uninstalled & disabled module (tian…
Browse files Browse the repository at this point in the history
…n#2380)

Uninstalled module has no enabled interactions (e.g. run action script,
open webui, update).
Disabled module cannot run action script or open webui.
  • Loading branch information
changhuapeng authored and bryanyee33 committed Jan 26, 2025
1 parent ab79a23 commit d3f18e7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ fun ModuleItem(
if (module.hasWebUi) {
toggleable(
value = module.enabled,
enabled = !module.remove && module.enabled,
interactionSource = interactionSource,
role = Role.Button,
indication = indication,
Expand Down Expand Up @@ -637,6 +638,7 @@ fun ModuleItem(
if (module.hasActionScript) {
FilledTonalButton(
modifier = Modifier.defaultMinSize(52.dp, 32.dp),
enabled = !module.remove && module.enabled,
onClick = {
navigator.navigate(ExecuteModuleActionScreenDestination(module.id))
viewModel.markNeedRefresh()
Expand Down Expand Up @@ -664,6 +666,7 @@ fun ModuleItem(
if (module.hasWebUi) {
FilledTonalButton(
modifier = Modifier.defaultMinSize(52.dp, 32.dp),
enabled = !module.remove && module.enabled,
onClick = { onClick(module) },
interactionSource = interactionSource,
contentPadding = ButtonDefaults.TextButtonContentPadding
Expand All @@ -689,6 +692,7 @@ fun ModuleItem(
if (updateUrl.isNotEmpty()) {
Button(
modifier = Modifier.defaultMinSize(52.dp, 32.dp),
enabled = !module.remove,
onClick = { onUpdate(module) },
shape = ButtonDefaults.textShape,
contentPadding = ButtonDefaults.TextButtonContentPadding
Expand Down

0 comments on commit d3f18e7

Please sign in to comment.