From c40a6034adfe4168f152d7c4f26d6108d0851e5a Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Thu, 5 Oct 2023 14:25:04 -0700 Subject: [PATCH] Add more connection logging Troubleshooting react relative resource paths Minor jsx changes --- ovos_gui/bus.py | 3 ++- ovos_gui/page.py | 3 +++ ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx | 12 +++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ovos_gui/bus.py b/ovos_gui/bus.py index 0c82233..f19bcb5 100644 --- a/ovos_gui/bus.py +++ b/ovos_gui/bus.py @@ -221,11 +221,12 @@ def on_message(self, message: str): if framework is None: # mycroft-gui api qt = msg_data.get("qt_version") or default_qt_version + LOG.debug(f"Backwards-compat handling for qt{qt} client") if int(qt) == 6: framework = "qt6" else: framework = "qt5" - + LOG.info(f"New connection for framework: {framework}") self._framework = framework else: # message not in spec diff --git a/ovos_gui/page.py b/ovos_gui/page.py index 64b1faf..36c5664 100644 --- a/ovos_gui/page.py +++ b/ovos_gui/page.py @@ -68,6 +68,9 @@ def get_uri(self, framework: str = "qt5", server_url: str = None) -> str: if server_url.startswith("/"): LOG.debug(f"No schema in server_url, assuming 'file'") server_url = f"file://{server_url}" + elif server_url.startswith("./") or \ + server_url.startswith("../"): + LOG.debug(r'Relative path; assuming no schema expected') else: LOG.debug(f"No schema in server_url, assuming 'http'") server_url = f"http://{server_url}" diff --git a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx index c545109..613ebfa 100644 --- a/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx +++ b/ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx @@ -1,11 +1,12 @@ -import React, { Component } from "react"; +import React from "react"; import { ContentElement } from "core_components/utils"; -export function RenderPage(props) { +function RenderPage(props) { const skill_props = props.skillState; - + console.log(skill_props) return (
+
+
+
+
); } + +export default RenderPage \ No newline at end of file