mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 08:48:13 +00:00
Compare commits
1 Commits
github-act
...
loopback_f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82e50d80bc |
@@ -77,8 +77,7 @@ class RenderServerProxy:
|
||||
return None
|
||||
|
||||
def request(self, payload, timeout=5):
|
||||
hostname = LOOPBACK if self.is_localhost else self.hostname
|
||||
return requests.get(f'http://{hostname}:{self.port}/api/{payload}', timeout=timeout)
|
||||
return requests.get(f'http://{self.optimized_hostname()}:{self.port}/api/{payload}', timeout=timeout)
|
||||
|
||||
def start_background_update(self):
|
||||
if self.__update_in_background:
|
||||
@@ -143,8 +142,7 @@ class RenderServerProxy:
|
||||
return self.request_data('all_engines')
|
||||
|
||||
def notify_parent_of_status_change(self, parent_id, subjob):
|
||||
hostname = LOOPBACK if self.is_localhost else self.hostname
|
||||
return requests.post(f'http://{hostname}:{self.port}/api/job/{parent_id}/notify_parent_of_status_change',
|
||||
return requests.post(f'http://{self.optimized_hostname()}:{self.port}/api/job/{parent_id}/notify_parent_of_status_change',
|
||||
json=subjob.json())
|
||||
|
||||
def post_job_to_server(self, file_path, job_list, callback=None):
|
||||
@@ -172,8 +170,7 @@ class RenderServerProxy:
|
||||
return requests.post(f'http://{self.hostname}:{self.port}/api/add_job', data=monitor, headers=headers)
|
||||
|
||||
def get_job_files(self, job_id, save_path):
|
||||
hostname = LOOPBACK if self.is_localhost else self.hostname
|
||||
url = f"http://{hostname}:{self.port}/api/job/{job_id}/download_all"
|
||||
url = f"http://{self.optimized_hostname()}:{self.port}/api/job/{job_id}/download_all"
|
||||
return self.download_file(url, filename=save_path)
|
||||
|
||||
@staticmethod
|
||||
@@ -193,5 +190,7 @@ class RenderServerProxy:
|
||||
|
||||
def delete_engine(self, engine, version, system_cpu=None):
|
||||
form_data = {'engine': engine, 'version': version, 'system_cpu': system_cpu}
|
||||
hostname = LOOPBACK if self.is_localhost else self.hostname
|
||||
return requests.post(f'http://{hostname}:{self.port}/api/delete_engine', json=form_data)
|
||||
return requests.post(f'http://{self.optimized_hostname()}:{self.port}/api/delete_engine', json=form_data)
|
||||
|
||||
def optimized_hostname(self):
|
||||
return LOOPBACK if self.is_localhost else self.hostname
|
||||
@@ -477,7 +477,7 @@ class MainWindow(QMainWindow):
|
||||
"""
|
||||
selected_job_ids = self.selected_job_ids()
|
||||
if selected_job_ids:
|
||||
url = f'http://{self.current_server_proxy.hostname}:{self.current_server_proxy.port}/api/job/{selected_job_ids[0]}/logs'
|
||||
url = f'http://{self.current_server_proxy.optimized_hostname()}:{self.current_server_proxy.port}/api/job/{selected_job_ids[0]}/logs'
|
||||
self.log_viewer_window = LogViewer(url)
|
||||
self.log_viewer_window.show()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user