Skip to content

Commit

Permalink
Merge branch 'FEAT/web-dashboard' of https://github.com/bisohns/saido
Browse files Browse the repository at this point in the history
…into FEAT/web-dashboard
  • Loading branch information
silvareal committed Nov 22, 2022
2 parents 369b045 + f45a5db commit 5a9153b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import AppHeader from './AppHeader';
import useSocket from 'hooks/useSocket';

function App() {
const { servicesGroupedByName, serversGroupedByHost, updateCount } =
const { servicesGroupedByName, serversGroupedByHost, updateCount ,connectionStatus,sendJsonMessage} =
useSocket();

const [servicesGroupByName, setServicesGroupByName] = React.useState<any>({});
Expand All @@ -26,11 +26,11 @@ function App() {
const router = createBrowserRouter([
{
path: '/',
element: <ServerList serversGroupedByHost={servicesGroupByHost} />,
element: <ServerList serversGroupedByHost={servicesGroupByHost} connectionStatus={connectionStatus} sendJsonMessage={sendJsonMessage}/>,
},
{
path: '/:host',
element: <ServerDetail servicesGroupedByName={servicesGroupByName} />,
element: <ServerDetail servicesGroupedByName={servicesGroupByName} connectionStatus={connectionStatus} sendJsonMessage={sendJsonMessage} />,
},
]);

Expand Down
5 changes: 4 additions & 1 deletion web/src/server/ServerDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ import {

export default function ServerDetail({
servicesGroupedByName,
connectionStatus,
sendJsonMessage
}: {
servicesGroupedByName: ServerGroupedByNameResponseType;
connectionStatus: string;
sendJsonMessage:(arg0: any)=>void;
}) {
const { host } = useParams<{ host: string }>();

const [tabIndex, setTabIndex] = React.useState<number>(0);
const { connectionStatus, sendJsonMessage } = useSocket();
sendJsonMessage({ FilterBy: host });

const handleChangeTabIndex = (
Expand Down
5 changes: 4 additions & 1 deletion web/src/server/ServerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import { ServerGroupedByHostResponseType } from './ServerType';

export default function ServerList({
serversGroupedByHost,
connectionStatus,
sendJsonMessage
}: {
serversGroupedByHost: ServerGroupedByHostResponseType;
connectionStatus: string;
sendJsonMessage:(arg0: any)=>void;
}) {
const navigate = useNavigate();

const { connectionStatus, sendJsonMessage } = useSocket();

useEffect(() => {
sendJsonMessage({ FilterBy: '' });
Expand Down

0 comments on commit 5a9153b

Please sign in to comment.