Feat : console log
This commit is contained in:
parent
50990e84b4
commit
4903a9b2cb
15 changed files with 323 additions and 30 deletions
|
|
@ -33,6 +33,8 @@ const getPageInfo = (pathname) => {
|
|||
if (pathname.includes("/cli-tools")) return { title: "CLI Tools", description: "Configure CLI tools", breadcrumbs: [] };
|
||||
if (pathname.includes("/endpoint")) return { title: "Endpoint", description: "API endpoint configuration", breadcrumbs: [] };
|
||||
if (pathname.includes("/profile")) return { title: "Settings", description: "Manage your preferences", breadcrumbs: [] };
|
||||
if (pathname.includes("/translator")) return { title: "Translator", description: "Debug translation flow between formats", breadcrumbs: [] };
|
||||
if (pathname.includes("/console-log")) return { title: "Console Log", description: "Live server console output", breadcrumbs: [] };
|
||||
if (pathname === "/dashboard") return { title: "Endpoint", description: "API endpoint configuration", breadcrumbs: [] };
|
||||
return { title: "", description: "", breadcrumbs: [] };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue