Correcting some bugs and working on responsive.

This commit is contained in:
charles-gauthereau
2024-11-23 21:15:14 +01:00
parent b22b8a9286
commit d1e98eaa11
3 changed files with 8 additions and 3 deletions
@@ -16,13 +16,17 @@ import {generateEdgeKey} from "@/utils/edge_key";
import {Copy} from "lucide-react";
import {useState} from "react";
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) {
const edge_key = generateEdgeKey('https://ok.com', '1234567');
const edge_key = generateEdgeKey(getServerUrl(), props.agent.id);
const code = `EDGE_KEY = ${edge_key}`;
return (
+1
View File
@@ -4,6 +4,7 @@ export function generateEdgeKey(serverUrl: string, agentId: string): string {
serverUrl,
agentId,
};
console.log(edgeKeyData);
const edgeKeyJson = JSON.stringify(edgeKeyData);
const edgeKeyBuffer = Buffer.from(edgeKeyJson, 'utf-8');
const edgeKeyBase64 = edgeKeyBuffer.toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');