Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/dashboard/api/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const hosts = ['192.168.0.2', '192.168.0.3', '192.168.0.55']; // Add more hosts here as needed
import { BASE_AP_IP, ROVER_AP_IP, ROVER_IP } from '@/constants';

const hosts = [BASE_AP_IP, ROVER_AP_IP, ROVER_IP];

const ping = require('ping');

Expand Down
3 changes: 2 additions & 1 deletion src/components/ConnectionStatusDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import React, { useState, useEffect } from 'react';
import Cookies from 'js-cookie';
import { useROS } from '@/ros/ROSContext';
import { ROVER_IP } from '@/constants';

const ConnectionStatusDisplay: React.FC = () => {
const { connectionStatus, connect, disconnect } = useROS();
const [url, setUrl] = useState('ws://localhost:9090');
const [url, setUrl] = useState(`ws://${ROVER_IP}:9090`);

// Load url from cookie on mount
useEffect(() => {
Expand Down
5 changes: 0 additions & 5 deletions src/components/ContainerCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import React, { useEffect, useRef, useState } from 'react';
import { useEnvContext } from 'next-runtime-env';



export interface ContainerOption {
key: string;
Expand Down Expand Up @@ -32,8 +29,6 @@ const ContainerCard: React.FC<ContainerCardProps> = ({
const [eventMsg, setEventMsg] = useState<string | null>(externalEventMsg);
const socketRef = useRef<WebSocket | null>(null);
const logBoxRef = useRef<HTMLPreElement>(null);
const { NEXT_PUBLIC_LAUNCHSERVER } = useEnvContext();
const apiBase = NEXT_PUBLIC_LAUNCHSERVER || 'localhost:8080';

// Sync status and clear logs/eventMsg when container ID changes (new container after restart)
useEffect(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/ContainerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ import React, { useEffect, useState, useRef } from 'react';
import ContainerCard, { ContainerOption } from './ContainerCard';
import SetResetPanel from './SetResetPanel';
import toast from "react-hot-toast";
import { ROVER_IP } from '@/constants';


const dockersToPull = [
'cprtsoftware/rover:arm64',
'cprtsoftware/rover:latest',
'cprtsoftware/web-ui:latest',
'cprtsoftware/container-launcher:latest',
];

const DEFAULT_API_BASE = 'http://localhost:8080';
const DEFAULT_API_BASE = `http://${ROVER_IP}:8080`;

const ContainerList: React.FC = () => {
const [options, setOptions] = useState<ContainerOption[]>([]);
Expand Down
Loading
Loading