diff --git a/jupyter/stock.py b/jupyter/stock.py index 1bf15fa..9f5aeaf 100644 --- a/jupyter/stock.py +++ b/jupyter/stock.py @@ -740,7 +740,7 @@ class WebServer: def __init__(self, logging): self.logging = logging - self.app = Flask(__name__, static_folder='/opt/airc/src/client/dist', static_url_path='') + self.app = Flask(__name__, static_folder='/opt/airc/src/ketr-chat/build', static_url_path='') self.sock = Sock(self.app) self.sessions = {} @@ -756,7 +756,7 @@ class WebServer: "system": system_message, "users": [], "history": [], - "sockets": [socket] + "sockets": [] } logging.info(f"{session['id']} created and added to sessions.") self.sessions[session['id']] = session @@ -770,8 +770,8 @@ class WebServer: user = random_nick() if not session_id in self.sessions: self.generate_session(ws, session_id) - else: - self.sessions[session_id]['sockets'].append(ws) + + self.sessions[session_id]['sockets'].append(ws) while True: try: @@ -831,8 +831,10 @@ class WebServer: ws.send(json.dumps({"type": "error", "error": f"Invalid request type: {data['type']}"})) except Exception as e: logging.error(f"WebSocket error: {str(e)}") - self.sessions[session_id]['users'].remove(user) - self.sessions[session_id]['sockets'].remove(ws) + if user in self.sessions[session_id]['users']: + self.sessions[session_id]['users'].remove(user) + if ws in self.sessions[session_id]['sockets']: + self.sessions[session_id]['sockets'].remove(ws) for socket in self.sessions[session_id]['sockets']: socket.send(json.dumps({"type": "users", "update": self.sessions[session_id]['users']})) diff --git a/src/ketr-chat/favicon.ico b/src/ketr-chat/favicon.ico new file mode 100755 index 0000000..ddf3b88 Binary files /dev/null and b/src/ketr-chat/favicon.ico differ diff --git a/src/ketr-chat/favicon.png b/src/ketr-chat/favicon.png new file mode 100644 index 0000000..9ad6bf3 Binary files /dev/null and b/src/ketr-chat/favicon.png differ diff --git a/src/ketr-chat/public/adaptive-icon.png b/src/ketr-chat/public/adaptive-icon.png new file mode 100755 index 0000000..03d6f6b Binary files /dev/null and b/src/ketr-chat/public/adaptive-icon.png differ diff --git a/src/ketr-chat/public/favicon.ico b/src/ketr-chat/public/favicon.ico index a11777c..ddf3b88 100644 Binary files a/src/ketr-chat/public/favicon.ico and b/src/ketr-chat/public/favicon.ico differ diff --git a/src/ketr-chat/public/favicon.png b/src/ketr-chat/public/favicon.png new file mode 100755 index 0000000..9ad6bf3 Binary files /dev/null and b/src/ketr-chat/public/favicon.png differ diff --git a/src/ketr-chat/public/icon.png b/src/ketr-chat/public/icon.png new file mode 100755 index 0000000..a0b1526 Binary files /dev/null and b/src/ketr-chat/public/icon.png differ diff --git a/src/ketr-chat/public/index.html b/src/ketr-chat/public/index.html index aa069f2..872ee28 100644 --- a/src/ketr-chat/public/index.html +++ b/src/ketr-chat/public/index.html @@ -24,7 +24,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - React App + Ketr-Chat diff --git a/src/ketr-chat/public/logo192.png b/src/ketr-chat/public/logo192.png index fc44b0a..63b1235 100644 Binary files a/src/ketr-chat/public/logo192.png and b/src/ketr-chat/public/logo192.png differ diff --git a/src/ketr-chat/public/logo512.png b/src/ketr-chat/public/logo512.png index a4e47a6..84f69cf 100644 Binary files a/src/ketr-chat/public/logo512.png and b/src/ketr-chat/public/logo512.png differ diff --git a/src/ketr-chat/public/manifest.json b/src/ketr-chat/public/manifest.json index 080d6c7..13a38ce 100644 --- a/src/ketr-chat/public/manifest.json +++ b/src/ketr-chat/public/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "Ketr-Chat", + "name": "Ketrenos AI Chat", "icons": [ { "src": "favicon.ico", diff --git a/src/ketr-chat/public/partial-react-logo.png b/src/ketr-chat/public/partial-react-logo.png new file mode 100755 index 0000000..66fd957 Binary files /dev/null and b/src/ketr-chat/public/partial-react-logo.png differ diff --git a/src/ketr-chat/public/react-logo.png b/src/ketr-chat/public/react-logo.png new file mode 100755 index 0000000..9d72a9f Binary files /dev/null and b/src/ketr-chat/public/react-logo.png differ diff --git a/src/ketr-chat/public/react-logo@2x.png b/src/ketr-chat/public/react-logo@2x.png new file mode 100755 index 0000000..2229b13 Binary files /dev/null and b/src/ketr-chat/public/react-logo@2x.png differ diff --git a/src/ketr-chat/public/react-logo@3x.png b/src/ketr-chat/public/react-logo@3x.png new file mode 100755 index 0000000..a99b203 Binary files /dev/null and b/src/ketr-chat/public/react-logo@3x.png differ diff --git a/src/ketr-chat/public/splash-icon.png b/src/ketr-chat/public/splash-icon.png new file mode 100755 index 0000000..03d6f6b Binary files /dev/null and b/src/ketr-chat/public/splash-icon.png differ diff --git a/src/ketr-chat/src/App.tsx b/src/ketr-chat/src/App.tsx index 0386242..d8897fa 100644 --- a/src/ketr-chat/src/App.tsx +++ b/src/ketr-chat/src/App.tsx @@ -6,7 +6,7 @@ import { createSemanticDiagnosticsBuilderProgram } from 'typescript'; const welcome_message = "Welcome to Ketr-Chat. I have real-time access to a lot of information. Ask things like 'What are the headlines from cnn.com?' or 'What is the weather in Portland, OR?'"; -const url: string = "http://battle-linux.ketrenos.com:5000" +const url: string = "https://ai.ketrenos.com" const App = () => { const [query, setQuery] = useState(''); @@ -185,8 +185,8 @@ const App = () => { } else { new_uri = "ws://"; } - //new_uri += loc.host + `/api/ws/${sessionId}`; - new_uri += `battle-linux.ketrenos.com:5000/api/ws/${sessionId}`; + new_uri += loc.host + `/api/ws/${sessionId}`; + //new_uri += `battle-linux.ketrenos.com:5000/api/ws/${sessionId}`; console.log(`Attempting WebSocket connection to ${new_uri}`); socket = new WebSocket(new_uri) setWs(socket);