From b84f35f4e4c431cc49a16e1cc1fe47db45407c31 Mon Sep 17 00:00:00 2001 From: hlohaus <983577+hlohaus@users.noreply.github.com> Date: Sat, 22 Feb 2025 03:33:12 +0100 Subject: Improve model list in HuggingFace WakeLook and disable count tokens for performance Export and import settings in UI Some styling improvments in UI Fix curl_cffi updated bugs --- g4f/gui/client/demo.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'g4f/gui/client/demo.html') diff --git a/g4f/gui/client/demo.html b/g4f/gui/client/demo.html index fa237ef8..1d75135f 100644 --- a/g4f/gui/client/demo.html +++ b/g4f/gui/client/demo.html @@ -183,13 +183,21 @@ const isIframe = window.self !== window.top; const backendUrl = "{{backend_url}}"; let url = new URL(window.location.href) + let params = new URLSearchParams(url.search); if (isIframe && backendUrl) { - window.location.replace(url.search ? `${backendUrl}?${url.search}` : backendUrl); + if (params.get("get_gpu_token")) { + window.addEventListener('DOMContentLoaded', async function() { + const link = document.getElementById("new_window"); + link.href = `${backendUrl}${url.search}`; + link.click(); + }); + } else { + window.location.replace(`${backendUrl}${url.search}`); + } return; } - let params = new URLSearchParams(url.search); if (params.get("__sign")) { - localStorage.setItem("zerogpu_token", params.get("__sign")); + localStorage.setItem("HuggingSpace-api_key", params.get("__sign")); if (!isIframe) { window.location.replace("/"); } @@ -226,7 +234,7 @@