Skip to content

Commit 5575c9f

Browse files
committed
updating to react 19 and nextjs 16 - security patching
1 parent 8b3e376 commit 5575c9f

File tree

13 files changed

+74
-63
lines changed

13 files changed

+74
-63
lines changed

app/api/slurm/job/[...id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { fetchSlurmData } from "@/lib/slurm-api";
33

44
export async function GET(
55
req: Request,
6-
{ params }: { params: { id: string } }
6+
{ params }: { params: Promise<{ id: string[] }> }
77
) {
8-
const { data, error, status } = await fetchSlurmData(`/job/${params.id[0]}`, {
8+
const { id } = await params;
9+
const { data, error, status } = await fetchSlurmData(`/job/${id[0]}`, {
910
revalidate: 0
1011
});
1112

app/api/slurm/job/completed/[...id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { fetchSlurmData } from "@/lib/slurm-api";
33

44
export async function GET(
55
req: Request,
6-
{ params }: { params: { id: string } }
6+
{ params }: { params: Promise<{ id: string[] }> }
77
) {
8-
const { data, error, status } = await fetchSlurmData(`/job/${params.id[0]}`, {
8+
const { id } = await params;
9+
const { data, error, status } = await fetchSlurmData(`/job/${id[0]}`, {
910
type: 'slurmdb',
1011
revalidate: 0
1112
});

app/api/slurm/jobs/node/[...id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { fetchSlurmData } from "@/lib/slurm-api";
33

44
export async function GET(
55
req: Request,
6-
{ params }: { params: { id: string } }
6+
{ params }: { params: Promise<{ id: string[] }> }
77
) {
8-
const { data, error, status } = await fetchSlurmData(`/jobs?node=${params.id[0]}&state=running`, {
8+
const { id } = await params;
9+
const { data, error, status } = await fetchSlurmData(`/jobs?node=${id[0]}&state=running`, {
910
type: 'slurmdb',
1011
revalidate: 0
1112
});

app/api/slurm/jobs/user/[...id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { fetchSlurmData } from "@/lib/slurm-api";
33

44
export async function GET(
55
req: Request,
6-
{ params }: { params: { id: string } }
6+
{ params }: { params: Promise<{ id: string[] }> }
77
) {
8-
const { data, error, status } = await fetchSlurmData(`/jobs?users=${params.id[0]}&state=running`, {
8+
const { id } = await params;
9+
const { data, error, status } = await fetchSlurmData(`/jobs?users=${id[0]}&state=running`, {
910
type: 'slurmdb'
1011
});
1112

app/api/slurm/nodes/state/[...id]/route.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { fetchSlurmData } from "@/lib/slurm-api";
33

44
export async function GET(
55
req: Request,
6-
{ params }: { params: { id: string } }
6+
{ params }: { params: Promise<{ id: string[] }> }
77
) {
8-
const { data, error, status } = await fetchSlurmData(`/node/${params.id[0]}`, {
8+
const { id } = await params;
9+
const { data, error, status } = await fetchSlurmData(`/node/${id[0]}`, {
910
revalidate: 0
1011
});
1112

@@ -18,16 +19,17 @@ export async function GET(
1819

1920
export async function POST(
2021
req: Request,
21-
{ params }: { params: { id: string } }
22+
{ params }: { params: Promise<{ id: string[] }> }
2223
) {
2324
try {
25+
const { id } = await params;
2426
const body = await req.json();
2527
const requestBody = {
2628
state: `${body.state}`,
2729
reason: `${body.reason}`,
2830
};
2931

30-
const { data, error, status } = await fetchSlurmData(`/node/${params.id[0]}`, {
32+
const { data, error, status } = await fetchSlurmData(`/node/${id[0]}`, {
3133
method: 'POST',
3234
body: requestBody,
3335
revalidate: 0

app/api/slurm/partitions/[name]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { fetchSlurmData } from "@/lib/slurm-api";
55

66
export async function GET(
77
request: Request,
8-
{ params }: { params: { name: string } }
8+
{ params }: { params: Promise<{ name: string }> }
99
) {
10-
const name = params.name;
10+
const { name } = await params;
1111
const { data, error, status } = await fetchSlurmData(`/partition/${name}`);
1212

1313
if (error) {

app/api/slurm/qos/[name]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { fetchSlurmData } from "@/lib/slurm-api";
55

66
export async function GET(
77
request: Request,
8-
{ params }: { params: { name: string } }
8+
{ params }: { params: Promise<{ name: string }> }
99
) {
10-
const name = params.name;
10+
const { name } = await params;
1111
const { data, error, status } = await fetchSlurmData(`/qos/${name}`, 'slurmdb');
1212

1313
if (error) {

app/api/slurm/reservations/[name]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { fetchSlurmData } from "@/lib/slurm-api";
55

66
export async function GET(
77
request: Request,
8-
{ params }: { params: { name: string } }
8+
{ params }: { params: Promise<{ name: string }> }
99
) {
10-
const name = params.name;
10+
const { name } = await params;
1111
const { data, error, status } = await fetchSlurmData(`/reservation/${name}`);
1212

1313
if (error) {

components/rewind/dashboard-history.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { format } from "date-fns";
44
import useSWR from "swr";
55
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
66
import { NodeCard } from "@/components/nodeCard/node-card";
7-
import { ThreeCircles } from "react-loader-spinner";
7+
import { RingLoader } from "react-spinners";
88
import { DateTimePicker } from "@/components/date-time";
99

1010
const fetcher = async (url: string) => {
@@ -68,15 +68,7 @@ const DashboardHistory = () => {
6868
if (!isMounted) {
6969
return (
7070
<div className="flex justify-center items-center w-full h-full">
71-
<ThreeCircles
72-
visible={true}
73-
height="64"
74-
width="64"
75-
color="white"
76-
ariaLabel="three-circles-loading"
77-
wrapperStyle={{}}
78-
wrapperClass=""
79-
/>
71+
<RingLoader color="white" size={64} />
8072
</div>
8173
);
8274
}

components/theme-provider.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use client";
22

33
import * as React from "react";
4-
import { ThemeProvider as NextThemesProvider } from "next-themes";
5-
import { type ThemeProviderProps } from "next-themes/dist/types";
4+
import { ThemeProvider as NextThemesProvider, type ThemeProviderProps } from "next-themes";
65

76
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
87
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;

0 commit comments

Comments
 (0)