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">
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ export const API_ENDPOINTS = {
|
|||
auth: "/api/auth",
|
||||
};
|
||||
|
||||
export const CONSOLE_LOG_CONFIG = {
|
||||
maxLines: 200,
|
||||
pollIntervalMs: 1000,
|
||||
};
|
||||
|
||||
// Provider API endpoints (for display only)
|
||||
export const PROVIDER_ENDPOINTS = {
|
||||
openrouter: "https://openrouter.ai/api/v1/chat/completions",
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const APIKEY_PROVIDERS = {
|
|||
kimi: { id: "kimi", alias: "kimi", name: "Kimi", icon: "psychology", color: "#1E3A8A", textIcon: "KM", website: "https://kimi.moonshot.cn" },
|
||||
minimax: { id: "minimax", alias: "minimax", name: "Minimax Coding", icon: "memory", color: "#7C3AED", textIcon: "MM", website: "https://www.minimaxi.com" },
|
||||
"minimax-cn": { id: "minimax-cn", alias: "minimax-cn", name: "Minimax (China)", icon: "memory", color: "#DC2626", textIcon: "MC", website: "https://www.minimaxi.com" },
|
||||
alicode: { id: "alicode", alias: "alicode", name: "Aliyun Bailian", icon: "cloud", color: "#FF6A00", textIcon: "ALi" },
|
||||
alicode: { id: "alicode", alias: "alicode", name: "Alibaba", icon: "cloud", color: "#FF6A00", textIcon: "ALi" },
|
||||
openai: { id: "openai", alias: "openai", name: "OpenAI", icon: "auto_awesome", color: "#10A37F", textIcon: "OA", website: "https://platform.openai.com" },
|
||||
anthropic: { id: "anthropic", alias: "anthropic", name: "Anthropic", icon: "smart_toy", color: "#D97757", textIcon: "AN", website: "https://console.anthropic.com" },
|
||||
gemini: { id: "gemini", alias: "gemini", name: "Gemini", icon: "diamond", color: "#4285F4", textIcon: "GE", website: "https://ai.google.dev" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue