Skip to content

Commit

Permalink
Florian (#421)
Browse files Browse the repository at this point in the history
* Fetching data from Space-Track, fixing some bugs, adding cron tasks for updating database with tool functions

* Orbital chart done, using backend data without refetching from the backend server

* Clean code of orbitalDataGraph, restore strapi files, adding cronTask to the 3rd of each month.

* Adding package*.json files

* ESLint fixed

* Updating strapi env

* Reseting frontend/package.json

* Prettier checked

* Updating for ESlint check

* Adding backend env file

* Revert "Adding backend env file"

This reverts commit 88a46fb.

* Try fixing cron job, error caused by Strapi reloading after updating db

* Fix cron jobs issue and update Footer info

* Fixing not available satellites
  • Loading branch information
Graulitard authored Aug 13, 2024
1 parent 9d17fd2 commit ea768b3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
1 change: 0 additions & 1 deletion backend/config/functions/satelliteUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ async function fetchOrbitalData(noradId) {

if (authResponse.status === 200) {
// Fetching data from Space-Track

const today = new Date();
const satelliteResponse = await axios.get(`https://www.space-track.org/basicspacedata/query/class/gp_history/NORAD_CAT_ID/${noradId}/orderby/TLE_LINE1%20ASC/orderby/TLE_LINE1%20ASC/format/json`, {
headers: {
Expand Down
17 changes: 8 additions & 9 deletions frontend/src/app/satellites/SatelliteResponsiveTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,14 @@ export default function SatelliteResponsiveTable({
/>
))
: (satellites ?? []).map((satellite) => (
<TableRow
className="cursor-pointer hover:bg-white hover:text-black"
key={satellite.attributes?.catalogNumberNORAD}
onClick={() =>
handleRowClick(
satellite.attributes?.slug ?? "",
)
}
>
<TableRow
className="cursor-pointer hover:bg-white hover:text-black"
key={satellite.attributes?.catalogNumberNORAD}
{...(satellite.attributes?.catalogNumberNORAD ? {
onClick: () =>
handleRowClick(satellite.attributes?.slug ?? "")
} : {})}
>
<TableCell className="px-6">
{satellite.attributes?.name}
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ const OrbitDataGraph: React.FC<OrbitDataProps> = ({
<>
{orbitalData && (
<div ref={svgContainer} className="flex w-full flex-col">
<div className="flex mb-5">
<p>Orbital parameters history (source :</p>
<a className="hover:underline" href="https://www.space-track.org/">Space Track</a>
<p>)</p>
</div>
<div className="zoom-container mb-5 flex items-center">
<h2 className="text-grey-400 mx-5 text-2xl">Zoom : </h2>
{/* Scrollbar thumb represents the zoom period selected, in case it fits bad we don't display
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/app/satellites/[satelliteSlug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ export default async function SatelliteInfoPage({
</div>
</div>

{/* Orbit data */}

{/* Container for graph of historical orbital data */}
<div className="mt-8 flex w-full flex-col items-center">
{/*Pass the satNum and the launchDate as props to OrbitDataGraph*/}
{/*Pass the historicalData and the launchDate as props to OrbitDataGraph*/}
{noradId ? (
satAttributes?.launchDate ? (
<OrbitDataGraph
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function Footer() {

<div className="flex flex-1 justify-end">
<div className="flex flex-col text-center lg:text-right">
<span className="">NTNU Small Satellite Lab</span>
<a className="hover:underline" href="http://ntnu.edu/smallsat">NTNU Small Satellite Lab</a>
<span className="">Trondheim, Norway</span>
<p>Norwegian University of Science and Technology</p>
<p className="lg:hidden">
Expand Down

0 comments on commit ea768b3

Please sign in to comment.