feat: resource-group-management
This commit is contained in:
1 parent
c5a020c65c
commit
5d30306ad7
8 files changed
+60
-17
No files matched your search
@@ -12,6 +12,7 @@ import { ServiceData } from "@/shared/types/marketplace";
|
||||
|
||||
interface ProductDetailClientProps {
|
||||
product: ServiceData;
|
||||
visitor?: boolean;
|
||||
breadcrumbs?: {
|
||||
link: string;
|
||||
name: string;
|
||||
@@ -24,6 +25,7 @@ interface ProductDetailClientProps {
|
||||
|
||||
export const ProductDetailClient: React.FC<ProductDetailClientProps> = ({
|
||||
product,
|
||||
visitor,
|
||||
breadcrumbs,
|
||||
mcpName,
|
||||
url,
|
||||
@@ -71,7 +73,7 @@ export const ProductDetailClient: React.FC<ProductDetailClientProps> = ({
|
||||
</div>
|
||||
|
||||
{/* Right side - Server Config */}
|
||||
<ServerConfig mcpName={mcpName} url={url} can_invoke={can_invoke} />
|
||||
<ServerConfig mcpName={mcpName} url={url} can_invoke={can_invoke} visitor={visitor} />
|
||||
</div>
|
||||
|
||||
{/* SEO-friendly: Simple text content for search engines */}
|
||||
|
||||
@@ -15,6 +15,7 @@ interface ServerConfigProps {
|
||||
url?: string;
|
||||
className?: string;
|
||||
can_invoke?: boolean;
|
||||
visitor?: boolean;
|
||||
}
|
||||
|
||||
type McpType = "sse" | "streamable-http";
|
||||
@@ -24,6 +25,7 @@ export const ServerConfig: React.FC<ServerConfigProps> = ({
|
||||
url = process.env.NEXT_PUBLIC_MCP_URL,
|
||||
className = "md:min-w-[40%] w-[40%] max-w-100 mt-12",
|
||||
can_invoke,
|
||||
visitor,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { handleLogin } = useAuth();
|
||||
@@ -64,11 +66,22 @@ export const ServerConfig: React.FC<ServerConfigProps> = ({
|
||||
return (
|
||||
<div className={`min-w-full ${className} flex-shrink-0`}>
|
||||
<div className="mb-2 mt-1">
|
||||
<FlipButton
|
||||
className="w-full rounded-md"
|
||||
text={t("Sign up to get the auth key")}
|
||||
onPress={handleLogin}
|
||||
/>
|
||||
{
|
||||
visitor || can_invoke ? <>
|
||||
<FlipButton
|
||||
className="w-full rounded-md"
|
||||
text={t("Sign up to get the auth key")}
|
||||
onPress={handleLogin}
|
||||
/>
|
||||
</> : <>
|
||||
<div className="w-full rounded-lg bg-[#F3126033] md:pr-2 h-[40px] md:h-[50px] shadow-lg flex items-center justify-center">
|
||||
<p className="text-[#C20E4D] text-center font-bold text-lg leading-none">
|
||||
{t("You don't have permission to access this MCP server.")}
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
{/* MCP Type Selection */}
|
||||
@@ -135,15 +148,6 @@ export const ServerConfig: React.FC<ServerConfigProps> = ({
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
{/* Permission Overlay */}
|
||||
{can_invoke === false && (
|
||||
<div className="absolute inset-0 bg-gray-300/70 backdrop-blur-sm rounded-lg flex items-center justify-center z-20">
|
||||
<p className="text-black text-center font-semibold text-lg px-8">
|
||||
{t("You don't have permission to access this MCP server.")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user