Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,28 @@ export const ConnectFlow = ({
>
Configure credentials
</Button>
{process.env.NEXT_PUBLIC_EDITION !== "cloud" && (
<div className="flex items-center gap-3 pt-1">
<div className="bg-border h-px flex-1" />
<span className="text-muted-foreground/60 text-[10px] uppercase tracking-widest">
or
</span>
<div className="bg-border h-px flex-1" />
</div>
)}
{process.env.NEXT_PUBLIC_EDITION !== "cloud" && (
<p className="text-muted-foreground text-xs">
Skip setup with{" "}
<a
href="https://app.onecli.sh"
target="_blank"
rel="noopener noreferrer"
className="text-foreground underline decoration-foreground/20 underline-offset-2 transition-colors hover:decoration-foreground/60"
>
OneCLI Cloud
</a>
</p>
)}
</div>
</ConnectLayout>
);
Expand Down
23 changes: 14 additions & 9 deletions apps/web/src/app/(dashboard)/agents/_components/agent-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
renameAgent,
} from "@/lib/actions/agents";
import type { SecretMode } from "@/lib/services/agent-service";
import { ManageSecretsDialog } from "./manage-secrets-dialog";
import { ManageAccessDialog } from "./manage-access-dialog";

interface AgentCardProps {
agent: {
Expand All @@ -55,7 +55,7 @@ interface AgentCardProps {
isDefault: boolean;
secretMode: SecretMode;
createdAt: Date;
_count: { agentSecrets: number };
_count: { agentSecrets: number; agentAppConnections: number };
};
onUpdate: () => void;
}
Expand Down Expand Up @@ -114,10 +114,15 @@ export const AgentCard = ({ agent, onUpdate }: AgentCardProps) => {
}
};

const secretsLabel =
agent.secretMode === "selective"
? `${agent._count.agentSecrets} ${agent._count.agentSecrets === 1 ? "secret" : "secrets"}`
: "All secrets";
const accessLabel = (() => {
if (agent.secretMode !== "selective") return "All credentials";
const s = agent._count.agentSecrets;
const a = agent._count.agentAppConnections;
const parts: string[] = [];
if (s > 0) parts.push(`${s} ${s === 1 ? "secret" : "secrets"}`);
if (a > 0) parts.push(`${a} ${a === 1 ? "app" : "apps"}`);
return parts.length > 0 ? parts.join(", ") : "No credentials";
})();

return (
<Card className="p-5">
Expand Down Expand Up @@ -147,7 +152,7 @@ export const AgentCard = ({ agent, onUpdate }: AgentCardProps) => {
className="text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5 transition-colors"
>
<KeyRound className="size-3" />
{secretsLabel}
{accessLabel}
</button>
</div>
</div>
Expand All @@ -170,7 +175,7 @@ export const AgentCard = ({ agent, onUpdate }: AgentCardProps) => {
</DropdownMenuItem>
<DropdownMenuItem onSelect={() => setSecretsDialogOpen(true)}>
<KeyRound className="size-4" />
Manage secrets
Manage access
</DropdownMenuItem>
<DropdownMenuItem onSelect={() => setRotateDialogOpen(true)}>
<RotateCw className="size-4" />
Expand Down Expand Up @@ -265,7 +270,7 @@ export const AgentCard = ({ agent, onUpdate }: AgentCardProps) => {
</DialogContent>
</Dialog>

<ManageSecretsDialog
<ManageAccessDialog
agent={agent}
open={secretsDialogOpen}
onOpenChange={setSecretsDialogOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Agent {
isDefault: boolean;
secretMode: SecretMode;
createdAt: Date;
_count: { agentSecrets: number };
_count: { agentSecrets: number; agentAppConnections: number };
}

export const AgentsContent = () => {
Expand Down
Loading
Loading