feat(hooks): add get_indicator_state and verify thinking/live markers
This commit is contained in:
10
api_hooks.py
10
api_hooks.py
@@ -41,6 +41,16 @@ class HookHandler(BaseHTTPRequestHandler):
|
||||
if hasattr(app, 'perf_monitor'):
|
||||
metrics = app.perf_monitor.get_metrics()
|
||||
self.wfile.write(json.dumps({'performance': metrics}).encode('utf-8'))
|
||||
elif self.path.startswith('/api/gui/state/'):
|
||||
tag = self.path.replace('/api/gui/state/', '')
|
||||
import dearpygui.dearpygui as dpg
|
||||
shown = False
|
||||
if dpg.does_item_exist(tag):
|
||||
shown = dpg.is_item_shown(tag)
|
||||
self.send_response(200)
|
||||
self.send_header('Content-Type', 'application/json')
|
||||
self.end_headers()
|
||||
self.wfile.write(json.dumps({'tag': tag, 'shown': shown}).encode('utf-8'))
|
||||
else:
|
||||
self.send_response(404)
|
||||
self.end_headers()
|
||||
|
||||
Reference in New Issue
Block a user