add functionality and refactor the code

This commit is contained in:
2024-08-31 08:19:41 +00:00
parent 32d9bc96b5
commit be78e17fb9
7 changed files with 207 additions and 76 deletions

View File

@@ -27,15 +27,14 @@ const Console = () => {
const textareaRef = useRef<HTMLTextAreaElement>(null); // Dodajemy referencję do textarea
const setCredentials = async () => {
setApiKey("ptlc_aDGU4VHNQuN5t6dyxNzVon3UZLR5ehuySmdR7xsUbMm");
setApiKey("ptlc_N77A2hEczFmSwGXm4cEXh4Gw3ZP0Ygr5NaBkGlE7pjU");
};
const fetchData = async (apiKey: string) => {
console.log("Fetching data...");
console.log(apiKey);
try {
const response = await fetch(
"https://ptero.przeqpiciel.com/api/client/servers/0bf192ab/websocket",
`${process.env.NEXT_PUBLIC_URL}/api/client/servers/ec46691a/websocket`,
{
method: "GET",
headers: {