mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Correcting some bugs and working on responsive.
This commit is contained in:
@@ -86,7 +86,7 @@ export default async function RoutePage(props: PageParams<{ agentId: string }>)
|
|||||||
href={`/dashboard/agents/${agent.id}/edit`}>
|
href={`/dashboard/agents/${agent.id}/edit`}>
|
||||||
<GearIcon className="w-7 h-7"/>
|
<GearIcon className="w-7 h-7"/>
|
||||||
</Link>
|
</Link>
|
||||||
<AgentModalKey>
|
<AgentModalKey agent={agent}>
|
||||||
<Button variant="outline">
|
<Button variant="outline">
|
||||||
<KeyRound/>
|
<KeyRound/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -16,13 +16,17 @@ import {generateEdgeKey} from "@/utils/edge_key";
|
|||||||
import {Copy} from "lucide-react";
|
import {Copy} from "lucide-react";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
import {CopyButton} from "@/components/wrappers/copy-button";
|
import {CopyButton} from "@/components/wrappers/copy-button";
|
||||||
|
import {Agent} from "@prisma/client";
|
||||||
|
import {getServerUrl} from "@/utils/get-server-url";
|
||||||
|
|
||||||
export type agentRegistrationDialogProps = PropsWithChildren<{}>
|
export type agentRegistrationDialogProps = PropsWithChildren<{
|
||||||
|
agent: Agent
|
||||||
|
}>
|
||||||
|
|
||||||
|
|
||||||
export function AgentModalKey(props: agentRegistrationDialogProps) {
|
export function AgentModalKey(props: agentRegistrationDialogProps) {
|
||||||
|
|
||||||
const edge_key = generateEdgeKey('https://ok.com', '1234567');
|
const edge_key = generateEdgeKey(getServerUrl(), props.agent.id);
|
||||||
const code = `EDGE_KEY = ${edge_key}`;
|
const code = `EDGE_KEY = ${edge_key}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export function generateEdgeKey(serverUrl: string, agentId: string): string {
|
|||||||
serverUrl,
|
serverUrl,
|
||||||
agentId,
|
agentId,
|
||||||
};
|
};
|
||||||
|
console.log(edgeKeyData);
|
||||||
const edgeKeyJson = JSON.stringify(edgeKeyData);
|
const edgeKeyJson = JSON.stringify(edgeKeyData);
|
||||||
const edgeKeyBuffer = Buffer.from(edgeKeyJson, 'utf-8');
|
const edgeKeyBuffer = Buffer.from(edgeKeyJson, 'utf-8');
|
||||||
const edgeKeyBase64 = edgeKeyBuffer.toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');
|
const edgeKeyBase64 = edgeKeyBuffer.toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');
|
||||||
|
|||||||
Reference in New Issue
Block a user