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:
2025-02-28 19:39:32 -06:00
committed by GitHub
parent 6b68d42b93
commit 562cb23da3
5 changed files with 22 additions and 7 deletions

View File

@@ -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
# --------------------------------------------