f
This commit is contained in:
@@ -168,14 +168,24 @@ class ConfigModal(ModalScreen):
|
||||
if not stores:
|
||||
container.mount(Static("No stores configured."))
|
||||
else:
|
||||
# stores is structured as: {type: {name: config}}
|
||||
# stores is structured as: {type: {name_key: config}}
|
||||
for stype, instances in stores.items():
|
||||
if isinstance(instances, dict):
|
||||
for name, conf in instances.items():
|
||||
for name_key, conf in instances.items():
|
||||
# Use the name field from the config if it exists, otherwise use the key
|
||||
display_name = name_key
|
||||
if isinstance(conf, dict):
|
||||
display_name = (
|
||||
conf.get("NAME")
|
||||
or conf.get("name")
|
||||
or conf.get("Name")
|
||||
or name_key
|
||||
)
|
||||
|
||||
row = Horizontal(
|
||||
Static(f"{name} ({stype})", classes="item-label"),
|
||||
Button("Edit", id=f"edit-store-{stype}-{name}"),
|
||||
Button("Delete", variant="error", id=f"del-store-{stype}-{name}"),
|
||||
Static(f"{display_name} ({stype})", classes="item-label"),
|
||||
Button("Edit", id=f"edit-store-{stype}-{name_key}"),
|
||||
Button("Delete", variant="error", id=f"del-store-{stype}-{name_key}"),
|
||||
classes="item-row"
|
||||
)
|
||||
container.mount(row)
|
||||
|
||||
Reference in New Issue
Block a user