final set of updates for the upgrade
This commit is contained in:
BIN
llm-fe/public/favicon.jpg
Normal file
BIN
llm-fe/public/favicon.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 130 KiB |
@@ -1,21 +1,19 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
<head>
|
||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<link rel="icon" href="%PUBLIC_URL%/favicon.jpg" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta
|
<meta name="theme-color" content="#000000" />
|
||||||
name="description"
|
<meta name="description" content="Chat app by AI ML Operations, LLC" />
|
||||||
content="Chat app by AI ML Operations, LLC"
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
/>
|
<!--
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
||||||
<!--
|
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
manifest.json provides metadata used when your web app is installed on a
|
||||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||||
-->
|
-->
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
<!--
|
<!--
|
||||||
Notice the use of %PUBLIC_URL% in the tags above.
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
It will be replaced with the URL of the `public` folder during the build.
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
Only files inside the `public` folder can be referenced from the HTML.
|
Only files inside the `public` folder can be referenced from the HTML.
|
||||||
@@ -24,11 +22,12 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
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`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>Chat by AI ML Operations. LCC</title>
|
<title>Chat by AI ML Operations. LCC</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
<body>
|
||||||
<!--
|
<div id="root"></div>
|
||||||
|
<!--
|
||||||
This HTML file is a template.
|
This HTML file is a template.
|
||||||
If you open it directly in the browser, you will see an empty page.
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|
||||||
@@ -38,5 +37,6 @@
|
|||||||
To begin the development, run `npm start` or `yarn start`.
|
To begin the development, run `npm start` or `yarn start`.
|
||||||
To create a production bundle, use `npm run build` or `yarn build`.
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
-->
|
-->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -9,12 +9,12 @@ type ConversationCardProps = {
|
|||||||
title: string,
|
title: string,
|
||||||
conversation_id: number | undefined,
|
conversation_id: number | undefined,
|
||||||
setSelectConversation: Dispatch<SetStateAction<number | undefined>>; // state function to set the selected conversation
|
setSelectConversation: Dispatch<SetStateAction<number | undefined>>; // state function to set the selected conversation
|
||||||
deleteConversation: (conversation_id: number | undefined)=>void;
|
deleteConversation: (conversation_id: number | undefined) => void;
|
||||||
selectedConversation: number | undefined;
|
selectedConversation: number | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ConversationCard = ({title, conversation_id, setSelectConversation, deleteConversation, selectedConversation}: ConversationCardProps): JSX.Element => {
|
const ConversationCard = ({ title, conversation_id, setSelectConversation, deleteConversation, selectedConversation }: ConversationCardProps): JSX.Element => {
|
||||||
const backgroundColor = selectedConversation===conversation_id ? '#ffffff' : 'lightgray';
|
const backgroundColor = selectedConversation === conversation_id ? '#ffffff' : 'lightgray';
|
||||||
return (
|
return (
|
||||||
// <Row>
|
// <Row>
|
||||||
|
|
||||||
@@ -32,37 +32,37 @@ const ConversationCard = ({title, conversation_id, setSelectConversation, delete
|
|||||||
<Col className="col-8">
|
<Col className="col-8">
|
||||||
|
|
||||||
|
|
||||||
<MDTypography
|
<MDTypography
|
||||||
onClick={() => {setSelectConversation(conversation_id)}}
|
onClick={() => { setSelectConversation(conversation_id) }}
|
||||||
key={conversation_id}
|
key={conversation_id}
|
||||||
color={'white'}
|
color={'white'}
|
||||||
fontWeight={selectedConversation===conversation_id ? 'bold' : 'regular'}
|
fontWeight={selectedConversation === conversation_id ? 'bold' : 'regular'}
|
||||||
display="block"
|
display="block"
|
||||||
variant="caption"
|
variant="caption"
|
||||||
textTransform="uppercase"
|
textTransform="uppercase"
|
||||||
mt={2}
|
mt={2}
|
||||||
mb={1}
|
mb={1}
|
||||||
ml={1}
|
ml={1}
|
||||||
noWrap
|
noWrap
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</MDTypography>
|
</MDTypography>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Col>
|
</Col>
|
||||||
<Col className="col-4">
|
<Col className="col-4">
|
||||||
<IconButton
|
<IconButton
|
||||||
aria-label="delete ${conversation_id}"
|
aria-label="delete ${conversation_id}"
|
||||||
onClick={() => deleteConversation(conversation_id)}
|
onClick={() => deleteConversation(conversation_id)}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
>
|
>
|
||||||
<Delete sx={{color:backgroundColor}}/>
|
<Delete sx={{ color: backgroundColor }} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
// <Card style={{width: "100%", margin:'0px'}}
|
// <Card style={{width: "100%", margin:'0px'}}
|
||||||
|
|||||||
@@ -69,13 +69,15 @@ function WebSocketProvider({ children }) {
|
|||||||
/* WS initialization and cleanup */
|
/* WS initialization and cleanup */
|
||||||
if (account) {
|
if (account) {
|
||||||
ws.current = new WebSocket(`ws://localhost:8011/ws/chat_again/`);
|
ws.current = new WebSocket(`ws://localhost:8011/ws/chat_again/`);
|
||||||
|
//ws.current = new WebSocket(`ws://localhost:8011/ws/conditional_chat/`);
|
||||||
//ws.current = new WebSocket('wss://chatbackend.aimloperations.com/ws/chat_again/')
|
//ws.current = new WebSocket('wss://chatbackend.aimloperations.com/ws/chat_again/')
|
||||||
|
//ws.current = new WebSocket('wss://chatbackend.aimloperations.com/ws/conditional_chat/')
|
||||||
//ws.current = process.env.REACT_APP_BACKEND_WS_API_BASE_URL;
|
//ws.current = process.env.REACT_APP_BACKEND_WS_API_BASE_URL;
|
||||||
|
|
||||||
ws.current.onopen = () => {
|
ws.current.onopen = () => {
|
||||||
setSocket(ws.current);
|
setSocket(ws.current);
|
||||||
};
|
};
|
||||||
ws.current.onclose = () => {};
|
ws.current.onclose = () => { };
|
||||||
ws.current.onmessage = (message) => {
|
ws.current.onmessage = (message) => {
|
||||||
const data = message.data;
|
const data = message.data;
|
||||||
// lookup for an existing chat in which this message belongs
|
// lookup for an existing chat in which this message belongs
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useRef, useState } from "react";
|
|||||||
import styled, { ThemeContext } from "styled-components";
|
import styled, { ThemeContext } from "styled-components";
|
||||||
import { Formik, Form, Field, ErrorMessage } from "formik";
|
import { Formik, Form, Field, ErrorMessage } from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import { AttachFile, Send } from "@mui/icons-material"; // Keeping icons for now, can replace later if needed
|
import { AttachFile, Delete, Send } from "@mui/icons-material"; // Keeping icons for now, can replace later if needed
|
||||||
import Markdown from "markdown-to-jsx";
|
import Markdown from "markdown-to-jsx";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -155,10 +155,10 @@ const ConversationItem = styled.div<{ $active: boolean }>`
|
|||||||
background: ${(props) => (props.$active ? props.theme.main + "33" : "transparent")};
|
background: ${(props) => (props.$active ? props.theme.main + "33" : "transparent")};
|
||||||
color: ${(props) => (props.$active ? props.theme.colors.text : props.theme.darkMode ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.7)")};
|
color: ${(props) => (props.$active ? props.theme.colors.text : props.theme.darkMode ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.7)")};
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
border: 1px solid ${(props) => (props.$active ? props.theme.main + "66" : "transparent")};
|
border: 1px solid ${(props) => (props.$active ? props.theme.main + "66" : "transparent")};
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: ${({ theme }) => theme.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'};
|
background: ${({ theme }) => theme.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'};
|
||||||
@@ -166,6 +166,15 @@ const ConversationItem = styled.div<{ $active: boolean }>`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const ConversationTitle = styled.span`
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
margin-right: 8px;
|
||||||
|
`;
|
||||||
|
|
||||||
const NewChatButton = styled.button`
|
const NewChatButton = styled.button`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.8rem;
|
padding: 0.8rem;
|
||||||
@@ -221,7 +230,7 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
|
|||||||
useContext(WebSocketContext);
|
useContext(WebSocketContext);
|
||||||
const { account } = useContext(AccountContext);
|
const { account } = useContext(AccountContext);
|
||||||
|
|
||||||
const { conversations, selectedConversation, setSelectedConversation } =
|
const { conversations, selectedConversation, setSelectedConversation, deleteConversation } =
|
||||||
useContext(ConversationContext);
|
useContext(ConversationContext);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -284,7 +293,19 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
|
|||||||
$active={convo.id === selectedConversation}
|
$active={convo.id === selectedConversation}
|
||||||
onClick={() => setSelectedConversation(convo.id)}
|
onClick={() => setSelectedConversation(convo.id)}
|
||||||
>
|
>
|
||||||
{convo.title || "New Conversation"}
|
<ConversationTitle>{convo.title || "New Conversation"}</ConversationTitle>
|
||||||
|
{convo.id === selectedConversation && (
|
||||||
|
<IconButton
|
||||||
|
as="div"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
deleteConversation(convo.id);
|
||||||
|
}}
|
||||||
|
style={{ padding: 4, width: 'auto', height: 'auto' }}
|
||||||
|
>
|
||||||
|
<Delete fontSize="small" />
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
</ConversationItem>
|
</ConversationItem>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -345,7 +366,7 @@ const AsyncDashboardInner = ({ }): JSX.Element => {
|
|||||||
<VisuallyHiddenInput
|
<VisuallyHiddenInput
|
||||||
id="file-upload"
|
id="file-upload"
|
||||||
type="file"
|
type="file"
|
||||||
accept=".csv,.xlsx,.txt"
|
accept=".csv,.xlsx,.txt,.pdf,.PDF"
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
const file = event.target.files?.[0];
|
const file = event.target.files?.[0];
|
||||||
if (file) {
|
if (file) {
|
||||||
|
|||||||
Reference in New Issue
Block a user