mirror of
https://github.com/blw1138/Zordon.git
synced 2026-06-09 13:39:24 -05:00
Delete engine API cleanup
This commit is contained in:
@@ -291,19 +291,20 @@ class RenderServerProxy:
|
||||
"""
|
||||
return self.request_data(f'engines/{engine_name}?response_type={response_type}', timeout)
|
||||
|
||||
def delete_engine(self, engine_name:str, version:str, system_cpu=None):
|
||||
def delete_engine(self, engine_name:str, version:str, system_os=None, cpu=None):
|
||||
"""
|
||||
Sends a request to the server to delete a specific engine.
|
||||
|
||||
Args:
|
||||
engine_name (str): The name of the engine to delete.
|
||||
version (str): The version of the engine to delete.
|
||||
system_cpu (str, optional): The system CPU type. Defaults to None.
|
||||
system_os (str, optional): The system OS. Defaults to None.
|
||||
cpu (str, optional): The system CPU type. Defaults to None.
|
||||
|
||||
Returns:
|
||||
Response: The response from the server.
|
||||
"""
|
||||
form_data = {'engine': engine_name, 'version': version, 'system_cpu': system_cpu}
|
||||
form_data = {'engine': engine_name, 'version': version, 'system_os': system_os, 'cpu': cpu}
|
||||
return requests.post(f'http://{self.hostname}:{self.port}/api/delete_engine', json=form_data)
|
||||
|
||||
# --------------------------------------------
|
||||
|
||||
@@ -158,7 +158,9 @@ class EngineBrowserWindow(QMainWindow):
|
||||
if reply is not QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
|
||||
result = RenderServerProxy(self.hostname).delete_engine(engine_info['engine'], engine_info['version'])
|
||||
result = RenderServerProxy(self.hostname).delete_engine(
|
||||
engine_info['engine'], engine_info['version'], engine_info.get('system_os'), engine_info.get('cpu'),
|
||||
)
|
||||
if result.ok:
|
||||
self.update_table()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user