update instances button

This commit is contained in:
Jordan Blasenhauer 2024-08-09 14:11:34 +02:00
parent 4ad0596ad6
commit b2b54965f8
2 changed files with 4 additions and 20 deletions

View file

@ -19,16 +19,8 @@ def instances_builder(instances: List[Instance]) -> str:
for instance in instances:
# setup actions buttons
actions = (
["restart", "stop"]
if instance.hostname in ("localhost", "127.0.0.1") and instance.status == "up"
else (
["reload", "stop"]
if instance.hostname not in ("localhost", "127.0.0.1") and instance.status == "up"
else ["start"] if instance.hostname in ("localhost", "127.0.0.1") and instance.status != "up" else []
)
)
actions = ["reload", "stop"] if instance.status == "up" else ["start"]
buttons = [
{
"attrs": {

View file

@ -9,16 +9,8 @@ def instances_builder(instances: List[Instance]) -> str:
for instance in instances:
# setup actions buttons
actions = (
["restart", "stop"]
if instance.hostname in ("localhost", "127.0.0.1") and instance.status == "up"
else (
["reload", "stop"]
if instance.hostname not in ("localhost", "127.0.0.1") and instance.status == "up"
else ["start"] if instance.hostname in ("localhost", "127.0.0.1") and instance.status != "up" else []
)
)
actions = ["reload", "stop"] if instance.status == "up" else ["start"]
buttons = [
{
"attrs": {