mirror of
https://github.com/blw1138/Zordon.git
synced 2026-02-05 13:46:10 +00:00
Feature/112 api version (#119)
* Add api_version to status api and server_proxy.py * Add api_version to Zeroconf and filter out incompatible versions when finding available servers * Filter incompatible versions from the UI
This commit is contained in:
@@ -46,6 +46,7 @@ class RenderServerProxy:
|
||||
self.system_cpu_count = None
|
||||
self.system_os = None
|
||||
self.system_os_version = None
|
||||
self.system_api_version = None
|
||||
|
||||
# --------------------------------------------
|
||||
# Basics / Connection:
|
||||
@@ -100,8 +101,10 @@ class RenderServerProxy:
|
||||
return None
|
||||
|
||||
def request(self, payload, timeout=5):
|
||||
from src.api.api_server import API_VERSION
|
||||
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://{hostname}:{self.port}/api/{payload}', timeout=timeout,
|
||||
headers={"X-API-Version": str(API_VERSION)})
|
||||
|
||||
# --------------------------------------------
|
||||
# Background Updates:
|
||||
@@ -162,6 +165,7 @@ class RenderServerProxy:
|
||||
self.system_cpu_count = status['cpu_count']
|
||||
self.system_os = status['system_os']
|
||||
self.system_os_version = status['system_os_version']
|
||||
self.system_api_version = status['api_version']
|
||||
return status
|
||||
|
||||
# --------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user