XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Add disable history button in GUI

76ec2064
Heiner Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +14 -4
Modified g4f/gui/client/html/index.html +7 -2
@@ -168,14 +168,19 @@
168 168 </div>
169 169 <div class="field">
170 170 <input type="checkbox" id="switch" />
171 <label for="switch"></label>
171 <label for="switch" title="Add the pages of the first 5 search results to the query."></label>
172 172 <span class="about">Web Access</span>
173 173 </div>
174 174 <div class="field">
175 175 <input type="checkbox" id="patch" />
176 <label for="patch" title="Works only with Bing and some other providers"></label>
176 <label for="patch" title="Enable create images with Bing."></label>
177 177 <span class="about">Image Generator</span>
178 178 </div>
179 <div class="field">
180 <input type="checkbox" id="history" />
181 <label for="history" title="To improve the reaction time or if you have trouble with large conversations."></label>
182 <span class="about">Disable History</span>
183 </div>
179 184 </div>
180 185 </div>
181 186 </div>
Modified g4f/gui/client/js/chat.v1.js +7 -2
@@ -100,6 +100,11 @@ const ask_gpt = async () => {
100 100 delete messages[i]["provider"];
101 101 }
102 102
103 // Remove history, if it is selected
104 if (document.getElementById('history')?.checked) {
105 messages = [messages[messages.length-1]]
106 }
107
103 108 window.scrollTo(0, 0);
104 109 window.controller = new AbortController();
105 110
@@ -491,7 +496,7 @@ document.querySelector(".mobile-sidebar").addEventListener("click", (event) => {
491 496 });
492 497
493 498 const register_settings_localstorage = async () => {
494 for (id of ["switch", "model", "jailbreak", "patch", "provider"]) {
499 for (id of ["switch", "model", "jailbreak", "patch", "provider", "history"]) {
495 500 element = document.getElementById(id);
496 501 element.addEventListener('change', async (event) => {
497 502 switch (event.target.type) {
@@ -509,7 +514,7 @@ const register_settings_localstorage = async () => {
509 514 }
510 515
511 516 const load_settings_localstorage = async () => {
512 for (id of ["switch", "model", "jailbreak", "patch", "provider"]) {
517 for (id of ["switch", "model", "jailbreak", "patch", "provider", "history"]) {
513 518 element = document.getElementById(id);
514 519 value = localStorage.getItem(element.id);
515 520 if (value) {