From da912d4a588c33b9cb664c719ccdf6d5daaa5297 Mon Sep 17 00:00:00 2001 From: yhy <31311038+yhy0@users.noreply.github.com> Date: Sat, 20 Jan 2024 23:35:32 +0800 Subject: [PATCH] =?UTF-8?q?ws=20=E7=AB=AF=E5=8F=A3=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SCopilot/templates/SCopilot.html | 3 ++- SCopilot/templates/index.html | 3 ++- SCopilot/web.go | 12 +++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/SCopilot/templates/SCopilot.html b/SCopilot/templates/SCopilot.html index eb25f0d..bf73092 100644 --- a/SCopilot/templates/SCopilot.html +++ b/SCopilot/templates/SCopilot.html @@ -446,7 +446,8 @@

const host = window.location.hostname; const t = new URLSearchParams(window.location.search).get('host'); - const socket = new WebSocket(`ws://${host}:9088/ws?host=${t}`); + const port = "{{ .webPort }}"; + const socket = new WebSocket(`ws://${host}:${port}/ws?host=${t}`); socket.addEventListener('message', (event) => { var toastElList = [].slice.call(document.querySelectorAll('.toast')) diff --git a/SCopilot/templates/index.html b/SCopilot/templates/index.html index 2229da4..33eab22 100644 --- a/SCopilot/templates/index.html +++ b/SCopilot/templates/index.html @@ -130,7 +130,8 @@

清空所有数据