+ className="flex flex-col rounded-md w-full p-2 text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-800 duration-200">
名称: {selectedItem.name}
类型: {selectedItem.is_directory ? "文件夹" : "文件"}
大小: {showFileSize(selectedItem.size)}
@@ -140,7 +140,7 @@ const Index = ({path, getFileList, items, handlerNextPath}) => {
<>
>
@@ -150,7 +150,7 @@ const Index = ({path, getFileList, items, handlerNextPath}) => {
<>
>
@@ -158,7 +158,7 @@ const Index = ({path, getFileList, items, handlerNextPath}) => {
{
}
diff --git a/src/main.jsx b/src/main.jsx
index 9527f48..b6b9d01 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -7,14 +7,11 @@ import {Provider} from "react-redux";
import router from "@/router/index.jsx";
import store from "@/store/index.js";
-import {ConfigProvider} from "antd";
createRoot(document.getElementById('root')).render(
-
-
-
-
-
+
+
+
)
diff --git a/src/pages/App.jsx b/src/pages/App.jsx
index ca3bd43..75fa98e 100644
--- a/src/pages/App.jsx
+++ b/src/pages/App.jsx
@@ -1,10 +1,33 @@
-import React from 'react';
+import React, {useEffect, useState} from 'react';
import {Outlet} from "react-router-dom";
+import {ConfigProvider, FloatButton, theme} from "antd";
+import {MoonStar, Sun} from "lucide-react";
const App = () => {
+
+ const [darkMode, setDarkMode] = useState(localStorage.getItem("darkMode") === "true");
+
+ useEffect(() => {
+ if (darkMode) {
+ document.documentElement.classList.add('dark');
+ } else {
+ document.documentElement.classList.remove('dark');
+ }
+ localStorage.setItem('darkMode', darkMode.toString());
+ }, [darkMode]);
+
return (
<>
-
+
+
+
+
:
}
+ tooltip={
深色模式
}
+ onClick={() => setDarkMode(!darkMode)}/>
+
+
>
);
};
diff --git a/src/pages/Dashboard/Folder/index.jsx b/src/pages/Dashboard/Folder/index.jsx
index a101dac..b65c7a6 100644
--- a/src/pages/Dashboard/Folder/index.jsx
+++ b/src/pages/Dashboard/Folder/index.jsx
@@ -29,14 +29,14 @@ const Index = () => {
return (
<>
-
+
-
+
{
return (
<>
-
-
官方文档:
-
- [打开]
-
+
>
);
diff --git a/src/pages/Dashboard/Log/index.jsx b/src/pages/Dashboard/Log/index.jsx
index baeb834..4056edd 100644
--- a/src/pages/Dashboard/Log/index.jsx
+++ b/src/pages/Dashboard/Log/index.jsx
@@ -153,7 +153,7 @@ const Index = () => {
return (
<>
{contextHolder}
-
+
@@ -183,7 +183,7 @@ const Index = () => {
+ className="flex-1 mt-8 bg-black dark:bg-gray-800 text-white overflow-auto min-h-[calc(100vh-160px)] max-h-[calc(100vh-160px)]">
{
logs.map((item, index) => {
return (
diff --git a/src/pages/Dashboard/Overview/index.jsx b/src/pages/Dashboard/Overview/index.jsx
index 716c369..ff56a95 100644
--- a/src/pages/Dashboard/Overview/index.jsx
+++ b/src/pages/Dashboard/Overview/index.jsx
@@ -17,7 +17,7 @@ const Index = () => {
return (
<>
-
+
磁盘使用量
{
return (
<>
{contextHolder}
-