Skip to content

Commit

Permalink
Add more connection logging
Browse files Browse the repository at this point in the history
Troubleshooting react relative resource paths
Minor jsx changes
  • Loading branch information
Daniel McKnight committed Oct 5, 2023
1 parent d42304c commit c40a603
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ovos_gui/bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ovos_gui/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
12 changes: 9 additions & 3 deletions ovos_gui/res/gui/react/SYSTEM_TextFrame.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="v-aligned-container text-center">
<div className="v-aligned-container text-center">
<ContentElement
elementType={"TextFrame"}
id={"title"}
Expand All @@ -14,6 +15,8 @@ export function RenderPage(props) {
display={skill_props.display}
duration={15000}
/>
</div>
<div className="v-aligned-container text-center">
<ContentElement
elementType={"TextFrame"}
id={"text"}
Expand All @@ -22,6 +25,9 @@ export function RenderPage(props) {
display={skill_props.display}
duration={15000}
/>
</div>
</div>
);
}

export default RenderPage

0 comments on commit c40a603

Please sign in to comment.