summaryrefslogtreecommitdiffstats
path: root/g4f/gui
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-03-25 21:21:09 +0100
committerGitHub <noreply@github.com>2024-03-25 21:21:09 +0100
commitcf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291 (patch)
tree217e6fd1d3440d7e5fe1ce6907c2273d16567827 /g4f/gui
parent~ (diff)
parentUpdate min requirements, Add pycryptodome (diff)
downloadgpt4free-cf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291.tar
gpt4free-cf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291.tar.gz
gpt4free-cf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291.tar.bz2
gpt4free-cf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291.tar.lz
gpt4free-cf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291.tar.xz
gpt4free-cf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291.tar.zst
gpt4free-cf3f8cc6bd7cf7eb0dca1afca4937066c1c1f291.zip
Diffstat (limited to '')
-rw-r--r--g4f/gui/client/index.html4
-rw-r--r--g4f/gui/client/static/css/style.css14
-rw-r--r--g4f/gui/client/static/js/chat.v1.js2
-rw-r--r--g4f/gui/server/api.py3
4 files changed, 19 insertions, 4 deletions
diff --git a/g4f/gui/client/index.html b/g4f/gui/client/index.html
index 6b9b1ab9..5d40b70e 100644
--- a/g4f/gui/client/index.html
+++ b/g4f/gui/client/index.html
@@ -133,11 +133,11 @@
<div class="box input-box">
<textarea id="message-input" placeholder="Ask a question" cols="30" rows="10"
style="white-space: pre-wrap;resize: none;"></textarea>
- <label class="file-label" for="image" title="Works with Bing, Gemini, OpenaiChat and You">
+ <label class="file-label image-label" for="image" title="Works with Bing, Gemini, OpenaiChat and You">
<input type="file" id="image" name="image" accept="image/*" required/>
<i class="fa-regular fa-image"></i>
</label>
- <label class="file-label" for="camera">
+ <label class="file-label image-label" for="camera">
<input type="file" id="camera" name="camera" accept="image/*" capture="camera" required/>
<i class="fa-solid fa-camera"></i>
</label>
diff --git a/g4f/gui/client/static/css/style.css b/g4f/gui/client/static/css/style.css
index 28064159..0aa28ac9 100644
--- a/g4f/gui/client/static/css/style.css
+++ b/g4f/gui/client/static/css/style.css
@@ -1020,3 +1020,17 @@ a:-webkit-any-link {
padding: var(--inner-gap) var(--section-gap);
resize: vertical;
}
+
+::-webkit-scrollbar {
+ width: 10px;
+}
+::-webkit-scrollbar-track {
+ background: var(--colour-3);
+}
+::-webkit-scrollbar-thumb {
+ background: var(--blur-bg);
+ border-radius: 5px;
+}
+::-webkit-scrollbar-thumb:hover {
+ background: var(--accent)
+} \ No newline at end of file
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js
index f9bc4568..a3a1cccf 100644
--- a/g4f/gui/client/static/js/chat.v1.js
+++ b/g4f/gui/client/static/js/chat.v1.js
@@ -955,7 +955,7 @@ async function api(ressource, args=null, file=null) {
}
const url = `/backend-api/v2/${ressource}`;
if (ressource == "conversation") {
- const body = JSON.stringify(args);
+ let body = JSON.stringify(args);
const headers = {
accept: 'text/event-stream'
}
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index e7683812..11b28dda 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -135,6 +135,7 @@ class Api():
camera.take_picture(filename=filename, on_complete=self.on_camera)
def on_image_selection(self, filename):
+ filename = filename[0] if isinstance(filename, list) else filename
if filename is not None and os.path.exists(filename):
self.image = filename
else:
@@ -152,7 +153,7 @@ class Api():
window = webview.windows[0]
if window is not None:
window.evaluate_js(
- f"document.querySelector(`.file-label.selected`)?.classList.remove(`selected`);"
+ f"document.querySelector(`.image-label.selected`)?.classList.remove(`selected`);"
)
if input_id is not None and input_id in ("image", "camera"):
window.evaluate_js(