mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-10 11:41:04 +08:00
Show more stats in leaderboard table
This commit is contained in:
@@ -7,7 +7,7 @@ import { LeaderboardTimeFrame } from "src/types/Leaderboard";
|
||||
*/
|
||||
const handler = withoutRole("banned", async (req, res) => {
|
||||
const time_frame = (req.query.time_frame as LeaderboardTimeFrame) ?? LeaderboardTimeFrame.day;
|
||||
const info = await oasstApiClient.fetch_leaderboard(time_frame);
|
||||
const info = await oasstApiClient.fetch_leaderboard(time_frame, { limit: req.query.limit as unknown as number });
|
||||
res.status(200).json(info);
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Flex } from "@chakra-ui/react";
|
||||
import Head from "next/head";
|
||||
import { useTranslation } from "next-i18next";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { LeaderboardTable, TaskOption, WelcomeCard } from "src/components/Dashboard";
|
||||
import { LeaderboardWidget, TaskOption, WelcomeCard } from "src/components/Dashboard";
|
||||
import { getDashboardLayout } from "src/components/Layout";
|
||||
import { TaskCategory } from "src/components/Tasks/TaskTypes";
|
||||
import { get } from "src/lib/api";
|
||||
@@ -42,7 +42,7 @@ const Dashboard = () => {
|
||||
<Flex direction="column" gap="10">
|
||||
<WelcomeCard />
|
||||
<TaskOption content={availableTaskTypes} />
|
||||
<LeaderboardTable />
|
||||
<LeaderboardWidget />
|
||||
</Flex>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Box, Card, CardBody, Heading, Tab, TabList, TabPanel, TabPanels, Tabs }
|
||||
import Head from "next/head";
|
||||
import { useTranslation } from "next-i18next";
|
||||
import { getDashboardLayout } from "src/components/Layout";
|
||||
import { LeaderboardGridCell } from "src/components/LeaderboardGridCell";
|
||||
export { getDefaultStaticProps as getStaticProps } from "src/lib/default_static_props";
|
||||
import { LeaderboardTable } from "src/components/LeaderboardTable";
|
||||
import { LeaderboardTimeFrame } from "src/types/Leaderboard";
|
||||
|
||||
const Leaderboard = () => {
|
||||
@@ -30,16 +30,16 @@ const Leaderboard = () => {
|
||||
|
||||
<TabPanels>
|
||||
<TabPanel p="0">
|
||||
<LeaderboardGridCell timeFrame={LeaderboardTimeFrame.day} />
|
||||
<LeaderboardTable timeFrame={LeaderboardTimeFrame.day} limit={20} />
|
||||
</TabPanel>
|
||||
<TabPanel p="0">
|
||||
<LeaderboardGridCell timeFrame={LeaderboardTimeFrame.week} />
|
||||
<LeaderboardTable timeFrame={LeaderboardTimeFrame.week} limit={20} />
|
||||
</TabPanel>
|
||||
<TabPanel p="0">
|
||||
<LeaderboardGridCell timeFrame={LeaderboardTimeFrame.month} />
|
||||
<LeaderboardTable timeFrame={LeaderboardTimeFrame.month} limit={20} />
|
||||
</TabPanel>
|
||||
<TabPanel p="0">
|
||||
<LeaderboardGridCell timeFrame={LeaderboardTimeFrame.total} />
|
||||
<LeaderboardTable timeFrame={LeaderboardTimeFrame.total} limit={20} />
|
||||
</TabPanel>
|
||||
</TabPanels>
|
||||
</Tabs>
|
||||
|
||||
Reference in New Issue
Block a user