forked from Support/sp-hydra-veil-gui
update: new display for hysteria and vless protocols
This commit is contained in:
parent
6e074482ab
commit
5975b2d254
3 changed files with 17 additions and 3 deletions
|
|
@ -781,7 +781,6 @@ class MenuPage(Page):
|
|||
profile_location = None
|
||||
profile_operator = self._location_operator(profile_obj)
|
||||
operator_name = getattr(profile_operator, 'name', '') if profile_operator else ""
|
||||
|
||||
if protocol.lower() == "wireguard" and is_profile_enabled and profile_obj and profile_obj.connection and profile_obj.connection.code == 'wireguard':
|
||||
verification_widget = self.create_verification_widget(
|
||||
profile_obj)
|
||||
|
|
@ -789,7 +788,7 @@ class MenuPage(Page):
|
|||
show_verification_widget = True
|
||||
label_principal = None
|
||||
|
||||
elif operator_name != 'Simplified Privacy' and protocol.lower() == "wireguard":
|
||||
elif operator_name != 'Simplified Privacy' and protocol.lower() in ("wireguard", "hysteria2", "vless"):
|
||||
if isinstance(profile_obj, SessionProfile):
|
||||
text_color = "black"
|
||||
label_background = QLabel(self)
|
||||
|
|
@ -1307,6 +1306,8 @@ class MenuPage(Page):
|
|||
lambda: self.handle_sync_after_verification(profile_id))
|
||||
self.worker_thread.sync_output.connect(
|
||||
self.update_status.update_values)
|
||||
self.worker_thread.sync_error.connect(
|
||||
self.update_status.update_status)
|
||||
self.worker_thread.start()
|
||||
else:
|
||||
self.update_status.update_status("Profile enable aborted")
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ class SyncScreen(Page):
|
|||
self.worker_thread = WorkerThread('SYNC')
|
||||
|
||||
self.worker_thread.sync_output.connect(self.update_output)
|
||||
self.worker_thread.sync_error.connect(
|
||||
self.update_status.update_status)
|
||||
self.worker_thread.start()
|
||||
|
||||
def update_output(self, available_locations, available_browsers, status, is_tor, locations, all_browsers):
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from PyQt6.QtCore import QThread, pyqtSignal
|
|||
from core.controllers.ApplicationVersionController import ApplicationVersionController
|
||||
from core.controllers.ClientController import ClientController
|
||||
from core.controllers.ConfigurationController import ConfigurationController, ConnectionChoice
|
||||
from core.Constants import Constants
|
||||
|
||||
from core.controllers.SyncController import new_sync
|
||||
from core.controllers.InvoiceController import InvoiceController
|
||||
|
|
@ -42,6 +43,7 @@ from gui.v2.infrastructure.setup_observers import (
|
|||
class WorkerThread(QThread):
|
||||
text_output = pyqtSignal(str)
|
||||
sync_output = pyqtSignal(list, list, bool, bool, list, list)
|
||||
sync_error = pyqtSignal(str)
|
||||
invoice_output = pyqtSignal(object, str)
|
||||
invoice_finished = pyqtSignal(bool)
|
||||
profiles_output = pyqtSignal(dict)
|
||||
|
|
@ -334,7 +336,15 @@ class WorkerThread(QThread):
|
|||
ConfigurationController.set_connection('tor')
|
||||
else:
|
||||
ConfigurationController.set_connection('system')
|
||||
self.check_for_update()
|
||||
print(f"[SYNC] Syncing from URL: {Constants.SP_API_BASE_URL}/cachedsync")
|
||||
sync_result = new_sync(
|
||||
client_observer=client_observer,
|
||||
connection_observer=connection_observer)
|
||||
if not sync_result.valid:
|
||||
error_message = sync_result.message or "Connection error or invalid sync URL"
|
||||
self.sync_output.emit([], [], False, False, [], [])
|
||||
self.sync_error.emit(f"Sync failed: {error_message}")
|
||||
return
|
||||
|
||||
locations = LocationController.get_all()
|
||||
|
||||
|
|
@ -350,6 +360,7 @@ class WorkerThread(QThread):
|
|||
except Exception as e:
|
||||
print(f'the error is: {e}')
|
||||
self.sync_output.emit([], [], False, False, [], [])
|
||||
self.sync_error.emit(f"Sync failed: {e}")
|
||||
|
||||
def get_connection(self):
|
||||
connection = ConfigurationController.get_connection()
|
||||
|
|
|
|||
Loading…
Reference in a new issue