This commit is contained in:
2026-01-14 02:39:31 -08:00
parent 7a0d226443
commit 883f270f90
6 changed files with 337 additions and 91 deletions

View File

@@ -725,9 +725,15 @@ class ConfigModal(ModalScreen):
if not zt_net.get("port"):
zt_net["port"] = "999"
try:
self.save_all()
from SYS.background_services import ensure_zerotier_server_running
ensure_zerotier_server_running()
self.notify(f"ZeroTier auto-saved: Sharing '{share_name}' on network {net_id}")
except Exception as e:
self.notify(f"Auto-save failed: {e}", severity="error")
self.refresh_view()
self.notify(f"ZeroTier configured to share '{share_name}' on network {net_id}")
self.notify("CLICK 'SAVE' to start the server.")
self.app.push_screen(SelectionModal("Select Local Store to Share", local_stores), callback=on_share_selected)
@@ -756,12 +762,11 @@ class ConfigModal(ModalScreen):
"PORT": "999",
"SERVICE": "remote"
}
self.editing_item_type = "store-zerotier"
self.editing_item_name = new_name
self.refresh_view()
return
peer_options = [f"{p.address} ({p.service_hint or 'service'})" for p in probes]
try:
self.save_all()
self.notify(f"ZeroTier auto-saved: Manual template created.")
except Exception as e:
self.notify(f"Auto-save failed: {e}", severity="error")
def on_peer_selected(peer_choice: str):
if not peer_choice: return
@@ -784,10 +789,16 @@ class ConfigModal(ModalScreen):
new_config["PORT"] = "45869"
store_cfg[new_name] = new_config
try:
self.save_all()
self.notify(f"ZeroTier auto-saved: Store '{new_name}' added.")
except Exception as e:
self.notify(f"Auto-save failed: {e}", severity="error")
self.editing_item_type = "store-zerotier"
self.editing_item_name = new_name
self.refresh_view()
self.notify(f"Configured ZeroTier store '{new_name}'")
self.app.push_screen(SelectionModal("Select Remote Peer", peer_options), callback=on_peer_selected)