Skip to content

Commit

Permalink
propagation ui, docker dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JochimMaene committed Feb 9, 2025
1 parent 018e0b0 commit 7c6eda0
Show file tree
Hide file tree
Showing 39 changed files with 956 additions and 677 deletions.
4 changes: 4 additions & 0 deletions deploy/docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ ARG VITE_USE_SERVER_LIFESPAN="true"
ARG VITE_DEV_MODE="true"
ARG VITE_HOT_RELOAD="true"
ARG SAQ_USE_SERVER_LIFESPAN="false"
ARG UV_INDEX_SPACE_CODEV_USERNAME
ARG UV_INDEX_SPACE_CODEV_PASSWORD
## --------------------------- standardize execution env ----------------------------- ##
ENV PATH="/workspace/app/.venv/bin:/usr/local/bin:/opt/nodeenv/bin:$PATH" \
VIRTUAL_ENV="/workspace/app/.venv" \
Expand All @@ -46,6 +48,8 @@ ENV PATH="/workspace/app/.venv/bin:/usr/local/bin:/opt/nodeenv/bin:$PATH" \
VITE_DEV_MODE="${VITE_DEV_MODE}" \
VITE_HOT_RELOAD="${VITE_HOT_RELOAD}" \
SAQ_USE_SERVER_LIFESPAN="${SAQ_USE_SERVER_LIFESPAN}" \
UV_INDEX_SPACE_CODEV_USERNAME="${UV_INDEX_SPACE_CODEV_USERNAME}" \
UV_INDEX_SPACE_CODEV_PASSWORD="${UV_INDEX_SPACE_CODEV_PASSWORD}" \
PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ services:
build:
context: .
dockerfile: deploy/docker/dev/Dockerfile
args:
UV_INDEX_SPACE_CODEV_USERNAME: ${UV_INDEX_SPACE_CODEV_USERNAME}
UV_INDEX_SPACE_CODEV_PASSWORD: ${UV_INDEX_SPACE_CODEV_PASSWORD}
ports:
- "8000:8000"
- "3006:3006"
Expand All @@ -39,6 +42,9 @@ services:
build:
context: .
dockerfile: deploy/docker/dev/Dockerfile
args:
UV_INDEX_SPACE_CODEV_USERNAME: ${UV_INDEX_SPACE_CODEV_USERNAME}
UV_INDEX_SPACE_CODEV_PASSWORD: ${UV_INDEX_SPACE_CODEV_PASSWORD}
command: litestar workers run
tty: true
restart: always
Expand All @@ -55,6 +61,9 @@ services:
build:
context: .
dockerfile: deploy/docker/dev/Dockerfile
args:
UV_INDEX_SPACE_CODEV_USERNAME: ${UV_INDEX_SPACE_CODEV_USERNAME}
UV_INDEX_SPACE_CODEV_PASSWORD: ${UV_INDEX_SPACE_CODEV_PASSWORD}
command: litestar database upgrade --no-prompt
restart: "no"
<<: *development-volumes
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 39 additions & 32 deletions resources/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import { Outlet } from "react-router-dom"
import GroundStationPage from "@/pages/ground-station/GroundStation"
import OrbitPage from "@/pages/orbit/Orbit"
import UtilPage from "@/pages/utilities/Utilities"
import PropagationRequestPage from "@/pages/orbit/PropagationRequest";
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const queryClient = new QueryClient();

const App: React.FC = () => {
const navigate = useNavigate()
Expand All @@ -33,43 +37,46 @@ const App: React.FC = () => {
}, [auth, pathname])

return (
<ThemeProvider defaultTheme="light" storageKey="dma-ui-theme">
<Toaster />
<Routes>
<Route path="/" element={<ProtectedRoutes />}>
<Route element={<MainLayout>
<div className="hidden flex-col md:flex">
<div className="border-b">
<div className="flex h-16 items-center px-4">
<MainNav className="mx-6" />
<div className="ml-auto flex items-center space-x-4">
<UserNav />
<QueryClientProvider client={queryClient}>
<ThemeProvider defaultTheme="light" storageKey="dma-ui-theme">
<Toaster />
<Routes>
<Route path="/" element={<ProtectedRoutes />}>
<Route element={<MainLayout>
<div className="hidden flex-col md:flex">
<div className="border-b">
<div className="flex h-16 items-center px-4">
<MainNav className="mx-6" />
<div className="ml-auto flex items-center space-x-4">
<UserNav />
</div>
</div>
</div>
</div>
</div>
<div className="p-4">
<Outlet />
</div>
</MainLayout>}>
<Route index element={<Home />} />
<Route path="dynamics" element={<DynamicsPage />} />
<Route path="fds-data" element={<FdsDataPage />} />
<Route path="satellites" element={<SatellitesPage />} />
<Route path="ground-stations" element={<GroundStationPage />} />
<Route path="orbits" element={<OrbitPage />} />
<Route path="utils" element={<UtilPage />} />
<div className="p-4">
<Outlet />
</div>
</MainLayout>}>
<Route index element={<Home />} />
<Route path="dynamics" element={<DynamicsPage />} />
<Route path="fds-data" element={<FdsDataPage />} />
<Route path="satellites" element={<SatellitesPage />} />
<Route path="ground-stations" element={<GroundStationPage />} />
<Route path="orbits" element={<OrbitPage />} />
<Route path="propagation" element={<PropagationRequestPage />} />
<Route path="utils" element={<UtilPage />} />
</Route>
</Route>
</Route>

<Route path="/landing" element={<Placeholder />} />
<Route path="/terms" element={<Placeholder />} />
<Route path="/privacy" element={<Placeholder />} />
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
<Route path="*" element={<PageNotFound />} />
</Routes>
</ThemeProvider>
<Route path="/landing" element={<Placeholder />} />
<Route path="/terms" element={<Placeholder />} />
<Route path="/privacy" element={<Placeholder />} />
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
<Route path="*" element={<PageNotFound />} />
</Routes>
</ThemeProvider>
</QueryClientProvider>
)
}

Expand Down
4 changes: 4 additions & 0 deletions resources/components/main-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const navItems = [
title: "Orbits",
href: "/orbits",
},
{
title: "Propagation",
href: "/propagation",
},
{
title: "Utils",
href: "/utils",
Expand Down
12 changes: 7 additions & 5 deletions resources/pages/dynamics/components/dynamics-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ const DynamicsList: React.FC<DynamicsListProps> = ({ refresh, onRefresh }) => {
}, [refresh]);

if (loading) {
return <div>Loading dynamics...</div>;
}

if (dynamics.length === 0) {
return <div>No dynamics available.</div>;
return (
<Card className="w-full">
<CardContent className="flex items-center justify-center h-32">
<div className="text-muted-foreground">Loading dynamics...</div>
</CardContent>
</Card>
);
}

const handleEdit = (dyn: Dynamics) => {
Expand Down
26 changes: 26 additions & 0 deletions resources/pages/orbit/PropagationRequest.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import MainLayout from "../../layouts/MainLayout";
import PropagationForm from "./components/propagation-form";

const PropagationRequestPage: React.FC = () => {
const handleSuccess = (queueId: string) => {
// Handle success, e.g., show a success message or redirect
console.log("Propagation request submitted successfully with Queue ID:", queueId);
};

return (
<MainLayout
title="Orbit Propagation Request"
description="Submit a request for numerical orbit propagation."
keywords="Orbit, Propagation, Request"
>
<div className="w-full h-full flex flex-col items-center px-4 md:px-8 py-8 space-y-8">
<div className="w-full max-w-[1400px]">
<PropagationForm onSuccess={handleSuccess} />
</div>
</div>
</MainLayout>
);
};

export default PropagationRequestPage;
Loading

0 comments on commit 7c6eda0

Please sign in to comment.