import json import os import time from base64 import b64encode from pywebio.input import actions, file_upload, input_group, textarea, select from pywebio.output import put_text, put_code, use_scope, put_markdown, popup, put_image, put_file, put_html, \ put_buttons, put_table from ovos_backend_manager.configuration import CONFIGURATION, DB def _render_ww(rec_id): def on_tag(bt): data["tag"] = bt DB.update_ww_recording(rec_id, tag=bt) _render_ww(rec_id) with use_scope("main_view", clear=True): data = DB.get_ww_recording(rec_id) data["tag"] = data.get("tag") or "untagged" # TODO - get binary_data directly if os.path.isfile(data["path"]): content = open(data["path"], 'rb').read() html = f"""