@cybermem/dashboard 0.8.5 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +1 -1
- package/app/api/environment/route.ts +73 -0
- package/app/api/settings/route.ts +53 -13
- package/app/layout.tsx +2 -0
- package/app/page.tsx +2 -37
- package/components/dashboard/login-modal.tsx +108 -36
- package/components/dashboard/mcp-config-modal.tsx +17 -18
- package/components/dashboard/settings-modal.tsx +142 -239
- package/components/ui/confirmation-modal.tsx +116 -0
- package/components/ui/tint-button.tsx +91 -0
- package/middleware.ts +1 -1
- package/next.config.mjs +7 -2
- package/package.json +1 -1
- package/components/dashboard/password-alert-modal.tsx +0 -72
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
|
|
6
|
+
type TintColor = "emerald" | "yellow" | "red" | "sky" | "neutral";
|
|
7
|
+
|
|
8
|
+
interface TintButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
tint?: TintColor;
|
|
10
|
+
variant?: "solid" | "outline" | "ghost";
|
|
11
|
+
size?: "sm" | "md" | "lg" | "icon";
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const tintStyles: Record<TintColor, Record<string, string>> = {
|
|
16
|
+
emerald: {
|
|
17
|
+
solid:
|
|
18
|
+
"bg-emerald-500/20 hover:bg-emerald-500/30 border-emerald-500/20 text-emerald-400",
|
|
19
|
+
outline:
|
|
20
|
+
"bg-transparent hover:bg-emerald-500/10 border-emerald-500/20 text-emerald-400",
|
|
21
|
+
ghost:
|
|
22
|
+
"bg-transparent hover:bg-emerald-500/10 border-transparent text-emerald-400",
|
|
23
|
+
},
|
|
24
|
+
yellow: {
|
|
25
|
+
solid:
|
|
26
|
+
"bg-yellow-500/20 hover:bg-yellow-500/30 border-yellow-500/20 text-yellow-400",
|
|
27
|
+
outline:
|
|
28
|
+
"bg-transparent hover:bg-yellow-500/10 border-yellow-500/20 text-yellow-400",
|
|
29
|
+
ghost:
|
|
30
|
+
"bg-transparent hover:bg-yellow-500/10 border-transparent text-yellow-400",
|
|
31
|
+
},
|
|
32
|
+
red: {
|
|
33
|
+
solid: "bg-red-500/20 hover:bg-red-500/30 border-red-500/20 text-red-400",
|
|
34
|
+
outline:
|
|
35
|
+
"bg-transparent hover:bg-red-500/10 border-red-500/20 text-red-400",
|
|
36
|
+
ghost: "bg-transparent hover:bg-red-500/10 border-transparent text-red-400",
|
|
37
|
+
},
|
|
38
|
+
sky: {
|
|
39
|
+
solid: "bg-sky-500/20 hover:bg-sky-500/30 border-sky-500/20 text-sky-400",
|
|
40
|
+
outline:
|
|
41
|
+
"bg-transparent hover:bg-sky-500/10 border-sky-500/20 text-sky-400",
|
|
42
|
+
ghost: "bg-transparent hover:bg-sky-500/10 border-transparent text-sky-400",
|
|
43
|
+
},
|
|
44
|
+
neutral: {
|
|
45
|
+
solid: "bg-white/10 hover:bg-white/20 border-white/10 text-white",
|
|
46
|
+
outline: "bg-transparent hover:bg-white/5 border-white/10 text-neutral-300",
|
|
47
|
+
ghost:
|
|
48
|
+
"bg-transparent hover:bg-white/5 border-transparent text-neutral-400 hover:text-white",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const sizeStyles = {
|
|
53
|
+
sm: "h-8 px-3 text-xs",
|
|
54
|
+
md: "h-10 px-4 text-sm",
|
|
55
|
+
lg: "h-11 px-6 text-base",
|
|
56
|
+
icon: "h-9 w-9 p-0",
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const TintButton = forwardRef<HTMLButtonElement, TintButtonProps>(
|
|
60
|
+
(
|
|
61
|
+
{
|
|
62
|
+
tint = "emerald",
|
|
63
|
+
variant = "solid",
|
|
64
|
+
size = "md",
|
|
65
|
+
className,
|
|
66
|
+
children,
|
|
67
|
+
...props
|
|
68
|
+
},
|
|
69
|
+
ref,
|
|
70
|
+
) => {
|
|
71
|
+
return (
|
|
72
|
+
<button
|
|
73
|
+
ref={ref}
|
|
74
|
+
className={cn(
|
|
75
|
+
"inline-flex items-center justify-center gap-2 rounded-lg border font-medium transition-all",
|
|
76
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0B1116]",
|
|
77
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
78
|
+
"[&_svg]:shrink-0",
|
|
79
|
+
tintStyles[tint][variant],
|
|
80
|
+
sizeStyles[size],
|
|
81
|
+
className,
|
|
82
|
+
)}
|
|
83
|
+
{...props}
|
|
84
|
+
>
|
|
85
|
+
{children}
|
|
86
|
+
</button>
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
TintButton.displayName = "TintButton";
|
package/middleware.ts
CHANGED
|
@@ -60,6 +60,6 @@ export const config = {
|
|
|
60
60
|
// - Next.js internals
|
|
61
61
|
// - Static files
|
|
62
62
|
// - Health check (for monitoring)
|
|
63
|
-
"/((?!api/auth|api/health|_next|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
|
|
63
|
+
"/((?!api/auth|api/health|api/environment|_next|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
|
|
64
64
|
],
|
|
65
65
|
};
|
package/next.config.mjs
CHANGED
|
@@ -5,10 +5,15 @@ const nextConfig = {
|
|
|
5
5
|
},
|
|
6
6
|
output: "standalone",
|
|
7
7
|
transpilePackages: ["recharts"],
|
|
8
|
-
serverExternalPackages: ["dockerode", "ssh2"],
|
|
8
|
+
serverExternalPackages: ["dockerode", "ssh2", "sqlite3"],
|
|
9
9
|
experimental: {},
|
|
10
10
|
webpack: (config) => {
|
|
11
|
-
config.externals = [
|
|
11
|
+
config.externals = [
|
|
12
|
+
...(config.externals || []),
|
|
13
|
+
"ssh2",
|
|
14
|
+
"dockerode",
|
|
15
|
+
"sqlite3",
|
|
16
|
+
];
|
|
12
17
|
return config;
|
|
13
18
|
},
|
|
14
19
|
async rewrites() {
|
package/package.json
CHANGED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { Button } from "@/components/ui/button"
|
|
4
|
-
import { AlertTriangle, Settings, X } from "lucide-react"
|
|
5
|
-
|
|
6
|
-
interface PasswordAlertModalProps {
|
|
7
|
-
onChangePassword: () => void
|
|
8
|
-
onDismiss: () => void
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default function PasswordAlertModal({
|
|
12
|
-
onChangePassword,
|
|
13
|
-
onDismiss
|
|
14
|
-
}: PasswordAlertModalProps) {
|
|
15
|
-
const handleDontShowAgain = () => {
|
|
16
|
-
localStorage.setItem("hidePasswordWarning", "true")
|
|
17
|
-
onDismiss()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4">
|
|
22
|
-
<div
|
|
23
|
-
className="bg-[#0B1116]/90 backdrop-blur-xl border border-amber-500/30 rounded-2xl shadow-2xl max-w-md w-full overflow-hidden animate-in fade-in zoom-in-95 duration-200"
|
|
24
|
-
style={{
|
|
25
|
-
backgroundImage: `
|
|
26
|
-
radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.05) 0%, transparent 50%),
|
|
27
|
-
radial-gradient(circle at 100% 100%, rgba(251, 191, 36, 0.05) 0%, transparent 50%)
|
|
28
|
-
`
|
|
29
|
-
}}
|
|
30
|
-
>
|
|
31
|
-
{/* Header */}
|
|
32
|
-
<div className="px-6 pt-6 pb-4 flex items-start gap-4">
|
|
33
|
-
<div className="p-3 bg-amber-500/10 rounded-full border border-amber-500/20 shrink-0">
|
|
34
|
-
<AlertTriangle className="w-6 h-6 text-amber-400 drop-shadow-[0_0_10px_rgba(251,191,36,0.5)]" />
|
|
35
|
-
</div>
|
|
36
|
-
<div className="flex-1">
|
|
37
|
-
<h2 className="text-lg font-semibold text-white">Default Password Detected</h2>
|
|
38
|
-
<p className="text-neutral-400 text-sm mt-1">
|
|
39
|
-
You're using the default admin password. For security, we recommend changing it now.
|
|
40
|
-
</p>
|
|
41
|
-
</div>
|
|
42
|
-
<Button
|
|
43
|
-
variant="ghost"
|
|
44
|
-
size="icon"
|
|
45
|
-
onClick={onDismiss}
|
|
46
|
-
className="text-neutral-400 hover:text-white hover:bg-white/10 rounded-full -mt-1 -mr-2"
|
|
47
|
-
>
|
|
48
|
-
<X className="w-4 h-4" />
|
|
49
|
-
</Button>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
{/* Actions */}
|
|
53
|
-
<div className="px-6 pb-6 flex flex-col gap-3">
|
|
54
|
-
<Button
|
|
55
|
-
onClick={onChangePassword}
|
|
56
|
-
className="w-full bg-emerald-500/20 hover:bg-emerald-500/30 border border-emerald-500/20 text-emerald-400 font-medium transition-colors gap-2"
|
|
57
|
-
>
|
|
58
|
-
<Settings className="w-4 h-4" />
|
|
59
|
-
Change Password
|
|
60
|
-
</Button>
|
|
61
|
-
<Button
|
|
62
|
-
variant="ghost"
|
|
63
|
-
onClick={handleDontShowAgain}
|
|
64
|
-
className="w-full text-neutral-400 hover:text-white hover:bg-white/10"
|
|
65
|
-
>
|
|
66
|
-
Don't show again
|
|
67
|
-
</Button>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
)
|
|
72
|
-
}
|