mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 10:01:53 +08:00
basic redfish api
This commit is contained in:
@@ -117,13 +117,14 @@ def make_json_response(
|
||||
result: Optional[Dict]=None,
|
||||
status: int=200,
|
||||
set_cookies: Optional[Dict[str, str]]=None,
|
||||
wrap_result: bool=True,
|
||||
) -> aiohttp.web.Response:
|
||||
|
||||
response = aiohttp.web.Response(
|
||||
text=json.dumps({
|
||||
text=json.dumps(({
|
||||
"ok": (status == 200),
|
||||
"result": (result or {}),
|
||||
}, sort_keys=True, indent=4),
|
||||
} if wrap_result else result), sort_keys=True, indent=4),
|
||||
status=status,
|
||||
content_type="application/json",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user