Reconnect dialog added

This commit is contained in:
jeffser 2024-10-10 22:30:52 -06:00
parent ef8ec59977
commit 32df119c60

View File

@ -666,7 +666,6 @@ Generate a title following these rules:
def connection_error(self): def connection_error(self):
logger.error("Connection error") logger.error("Connection error")
if self.ollama_instance.remote: if self.ollama_instance.remote:
#dialogs.reconnect_remote(self)
options = { options = {
_("Close Alpaca"): { _("Close Alpaca"): {
"callback": lambda *_: self.get_application().quit(), "callback": lambda *_: self.get_application().quit(),
@ -692,8 +691,7 @@ Generate a title following these rules:
"placeholder": _('Bearer Token (Optional)') "placeholder": _('Bearer Token (Optional)')
} }
] ]
dialog_widget.Entry(_('Connection Error'), _('The remote instance has disconnected'), list(options)[0], options, entries)
else: else:
self.ollama_instance.reset() self.ollama_instance.reset()
self.show_toast(_("There was an error with the local Ollama instance, so it has been reset"), self.main_overlay) self.show_toast(_("There was an error with the local Ollama instance, so it has been reset"), self.main_overlay)