More cleanup and history added
This commit is contained in:
@@ -28,7 +28,8 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
history.push({
|
||||
id: slot.nzo_id,
|
||||
name: slot.name,
|
||||
size: slot.bytes * 1000,
|
||||
size: slot.bytes,
|
||||
time: slot.download_time,
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
@@ -36,7 +36,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
eta: eta.asSeconds(),
|
||||
name: slot.filename,
|
||||
progress: parseFloat(slot.percentage),
|
||||
size: parseFloat(slot.mb),
|
||||
size: parseFloat(slot.mb) * 1000 * 1000,
|
||||
state: slot.status.toLowerCase() as any,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,8 @@ import { GetServerSidePropsContext } from 'next';
|
||||
import { useEffect } from 'react';
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
||||
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
|
||||
import AppShelf from '../components/AppShelf/AppShelf';
|
||||
import LoadConfigComponent from '../components/Config/LoadConfig';
|
||||
import { Config } from '../tools/types';
|
||||
@@ -62,6 +64,8 @@ export async function getServerSideProps({
|
||||
return getConfig(configName as string, translations);
|
||||
}
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
export default function HomePage(props: any) {
|
||||
const { config: initialConfig }: { config: Config } = props;
|
||||
const { setConfig } = useConfig();
|
||||
@@ -73,9 +77,11 @@ export default function HomePage(props: any) {
|
||||
setConfig(migratedConfig);
|
||||
}, [initialConfig]);
|
||||
return (
|
||||
<Layout>
|
||||
<AppShelf />
|
||||
<LoadConfigComponent />
|
||||
</Layout>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Layout>
|
||||
<AppShelf />
|
||||
<LoadConfigComponent />
|
||||
</Layout>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user