mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 07:03:45 +08:00
feat: add empty ui
This commit is contained in:
parent
6ce6fed10d
commit
e0fa308984
@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { closeAllConnections, getInformation } from "@/services/api";
|
import { closeAllConnections, getInformation } from "@/services/api";
|
||||||
import BasePage from "@/components/base/base-page";
|
import BasePage from "@/components/base/base-page";
|
||||||
import ConnectionItem from "@/components/connection/connection-item";
|
import ConnectionItem from "@/components/connection/connection-item";
|
||||||
|
import BaseEmpty from "@/components/base/base-empty";
|
||||||
|
|
||||||
const initConn = { uploadTotal: 0, downloadTotal: 0, connections: [] };
|
const initConn = { uploadTotal: 0, downloadTotal: 0, connections: [] };
|
||||||
|
|
||||||
@ -122,10 +123,14 @@ const ConnectionsPage = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box height="calc(100% - 50px)">
|
<Box height="calc(100% - 50px)">
|
||||||
<Virtuoso
|
{filterConn.length > 0 ? (
|
||||||
data={filterConn}
|
<Virtuoso
|
||||||
itemContent={(index, item) => <ConnectionItem value={item} />}
|
data={filterConn}
|
||||||
/>
|
itemContent={(index, item) => <ConnectionItem value={item} />}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<BaseEmpty text="No Connections" />
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
</BasePage>
|
</BasePage>
|
||||||
|
@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { atomLogData } from "@/services/states";
|
import { atomLogData } from "@/services/states";
|
||||||
import BasePage from "@/components/base/base-page";
|
import BasePage from "@/components/base/base-page";
|
||||||
import LogItem from "@/components/log/log-item";
|
import LogItem from "@/components/log/log-item";
|
||||||
|
import BaseEmpty from "@/components/base/base-empty";
|
||||||
|
|
||||||
const LogPage = () => {
|
const LogPage = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -75,12 +76,16 @@ const LogPage = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box height="calc(100% - 50px)">
|
<Box height="calc(100% - 50px)">
|
||||||
<Virtuoso
|
{filterLogs.length > 0 ? (
|
||||||
initialTopMostItemIndex={999}
|
<Virtuoso
|
||||||
data={filterLogs}
|
initialTopMostItemIndex={999}
|
||||||
itemContent={(index, item) => <LogItem value={item} />}
|
data={filterLogs}
|
||||||
followOutput={"smooth"}
|
itemContent={(index, item) => <LogItem value={item} />}
|
||||||
/>
|
followOutput={"smooth"}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<BaseEmpty text="No Logs" />
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
</BasePage>
|
</BasePage>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user