Feat : console log

This commit is contained in:
decolua
2026-03-02 09:31:16 +07:00
parent 50990e84b4
commit 4903a9b2cb
15 changed files with 323 additions and 30 deletions

View File

@@ -19,7 +19,8 @@ const navItems = [
// Debug items (only show when ENABLE_REQUEST_LOGS=true)
const debugItems = [
{ href: "/dashboard/translator", label: "Translator", icon: "translate" },
// { href: "/dashboard/translator", label: "Translator", icon: "translate" },
{ href: "/dashboard/console-log", label: "Console Log", icon: "terminal" },
];
const systemItems = [
@@ -31,17 +32,8 @@ export default function Sidebar({ onClose }) {
const [showShutdownModal, setShowShutdownModal] = useState(false);
const [isShuttingDown, setIsShuttingDown] = useState(false);
const [isDisconnected, setIsDisconnected] = useState(false);
const [showDebug, setShowDebug] = useState(false);
const [updateInfo, setUpdateInfo] = useState(null);
// Check if debug mode is enabled
useEffect(() => {
fetch("/api/settings")
.then(res => res.json())
.then(data => setShowDebug(data?.enableRequestLogs === true))
.catch(() => {});
}, []);
// Lazy check for new npm version on mount
useEffect(() => {
fetch("/api/version")
@@ -130,9 +122,8 @@ export default function Sidebar({ onClose }) {
</Link>
))}
{/* Debug section (only show when ENABLE_REQUEST_LOGS=true) */}
{showDebug && (
<div className="pt-4 mt-2">
{/* Debug section */}
<div className="pt-4 mt-2">
<p className="px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2">
Debug
</p>
@@ -160,7 +151,6 @@ export default function Sidebar({ onClose }) {
</Link>
))}
</div>
)}
{/* System section */}
<div className="pt-4 mt-2">