Skip to content

Commit

Permalink
feat(version): release 0.24.3 version
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Dec 20, 2023
1 parent 1d43d19 commit 98bd089
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui",
"version": "0.24.2",
"version": "0.24.3",
"private": true,
"scripts": {
"dev": "react-scripts start",
Expand Down
8 changes: 4 additions & 4 deletions src/components/VersionViewer/VersionViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { ReactElement } from "react";
export default function VersionViewer(): ReactElement {
return (
<div className="fixed bottom-0 right-1 z-50 cursor-crosshair">
<p className="text-light-700 flex gap-1 text-[0.64rem]">
<span>{isProduction ? "P" : "D"}</span>
<span>{packageJSON?.version}</span>
<span>{envApplication ? "A" : "R"}</span>
<p className="flex gap-1 text-[0.64rem] text-light-700">
{isProduction ? "P" : "D"}
{envApplication ? "A" : "R"}
{" - "}v{packageJSON?.version}
</p>
</div>
);
Expand Down
40 changes: 40 additions & 0 deletions src/contexts/RobotContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export default ({ children }: any) => {
const [topicList, setTopicList] = useState<any>([]);
const [isRosConnected, setIsRosConnected] = useState<boolean | null>(null);

const [isVDIConnected, setIsVDIConnected] = useState<boolean | null>(null);

// Main Functions
useEffect(() => {
if (
Expand Down Expand Up @@ -248,6 +250,44 @@ export default ({ children }: any) => {
}
// ROS Topic Setter

// VDI Test Connection
useEffect(() => {
const vdiClient =
responseRobot?.vdiIngressEndpoint &&
isRobotReady &&
isSettedCookie &&
isVDIConnected === null
? new WebSocket(
responseRobot?.vdiIngressEndpoint + "ws?password=admin" || "",
)
: null;

vdiClient?.addEventListener("open", () => {
setIsVDIConnected(true);
});

vdiClient?.addEventListener("error", () => {
setIsVDIConnected(false);
});

vdiClient?.addEventListener("close", () => {
setIsVDIConnected(false);
});

function closeConnection() {
typeof isVDIConnected === "boolean" && vdiClient?.close();
}

closeConnection();

return closeConnection();
}, [isRobotReady, isSettedCookie, isVDIConnected, responseRobot]);

useEffect(() => {
console.log("isVDIConnected", isVDIConnected);
}, [isVDIConnected]);
// VDI Test Connection

function handleGetOrganization() {
getOrganization(
{
Expand Down

0 comments on commit 98bd089

Please sign in to comment.