mirror of
https://github.com/aclist/dztui.git
synced 2026-11-12 13:00:37 +01:00
Merge pull request #539 from aclist/fix/remove-from-history
fix: restore missing route
This commit is contained in:
2 files changed
+13
No files matched your search
@@ -46,6 +46,15 @@ class ConfigManager:
|
|||||||
ips.append(record)
|
ips.append(record)
|
||||||
self.update_config(Preferences.IP_LIST, ips)
|
self.update_config(Preferences.IP_LIST, ips)
|
||||||
|
|
||||||
|
def remove_from_history_file(self, fqip: str) -> None:
|
||||||
|
try:
|
||||||
|
history = self.prefs.paths.history
|
||||||
|
ips = [line.rstrip() for line in history.read_text().splitlines()]
|
||||||
|
ips.remove(fqip)
|
||||||
|
history.write_text("\n".join(ips))
|
||||||
|
except Exception as e:
|
||||||
|
logger.critical(e)
|
||||||
|
|
||||||
def update_history_file(self, fqip: str) -> None:
|
def update_history_file(self, fqip: str) -> None:
|
||||||
try:
|
try:
|
||||||
with open(self.prefs.paths.history, "r") as f:
|
with open(self.prefs.paths.history, "r") as f:
|
||||||
|
|||||||
@@ -281,6 +281,10 @@ class ServerModelManager:
|
|||||||
def remove_from_history(self, record: Servers.Record) -> None:
|
def remove_from_history(self, record: Servers.Record) -> None:
|
||||||
proxy_man = self._get_proxy_man()
|
proxy_man = self._get_proxy_man()
|
||||||
proxy_man.remove_row_from_control(record)
|
proxy_man.remove_row_from_control(record)
|
||||||
|
|
||||||
|
fqip = Servers.record_to_fqip(record)
|
||||||
|
config_man = self.controller.get_config_man()
|
||||||
|
config_man.remove_from_history_file(fqip)
|
||||||
self.update_history()
|
self.update_history()
|
||||||
|
|
||||||
@call_on_thread(dialog.querying)
|
@call_on_thread(dialog.querying)
|
||||||
|
|||||||
Reference in new issue
Block a user