mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 03:40:14 +01:00
Rolled back to v0.0.2
This commit is contained in:
parent
57d3025717
commit
72ff47e204
20 changed files with 87 additions and 142 deletions
|
|
@ -23,8 +23,8 @@ export default function Conversation({
|
|||
const { modelMap } = useSelector((state) => state.models);
|
||||
const inputRef = useRef(null);
|
||||
const dispatch = useDispatch();
|
||||
const { trigger } = manualSWR(`/api/messages/${id}`, 'get');
|
||||
const rename = manualSWR(`/api/convos/update`, 'post');
|
||||
const { trigger } = manualSWR(`http://localhost:3080/api/messages/${id}`, 'get');
|
||||
const rename = manualSWR(`http://localhost:3080/api/convos/update`, 'post');
|
||||
|
||||
const clickHandler = async () => {
|
||||
if (conversationId === id) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { setMessages } from '~/store/messageSlice';
|
|||
export default function DeleteButton({ conversationId, renaming, cancelHandler }) {
|
||||
const dispatch = useDispatch();
|
||||
const { trigger } = manualSWR(
|
||||
`/api/convos/clear`,
|
||||
`http://localhost:3080/api/convos/clear`,
|
||||
'post',
|
||||
() => {
|
||||
dispatch(setMessages([]));
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
import React from 'react';
|
||||
|
||||
export default function TabLink(a) {
|
||||
return (
|
||||
<a
|
||||
href={a.href}
|
||||
title={a.title}
|
||||
className={a.className}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{a.children}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
|
@ -2,22 +2,10 @@ import React from 'react';
|
|||
import Markdown from 'markdown-to-jsx';
|
||||
import Embed from './Embed';
|
||||
import Highlight from './Highlight';
|
||||
import TabLink from './TabLink';
|
||||
import regexSplit from '~/utils/regexSplit';
|
||||
import { wrapperRegex } from '~/utils';
|
||||
const { codeRegex, inLineRegex, markupRegex, languageMatch, newLineMatch } = wrapperRegex;
|
||||
const mdOptions = {
|
||||
wrapper: React.Fragment,
|
||||
forceWrapper: true,
|
||||
overrides: {
|
||||
a: {
|
||||
component: TabLink,
|
||||
// props: {
|
||||
// className: 'foo'
|
||||
// }
|
||||
}
|
||||
}
|
||||
};
|
||||
const mdOptions = { wrapper: React.Fragment, forceWrapper: true };
|
||||
|
||||
const inLineWrap = (parts) => {
|
||||
let previousElement = null;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default function ModelDialog({ mutate, setModelSave, handleSaveState }) {
|
|||
const [saveText, setSaveText] = useState('Save');
|
||||
const [required, setRequired] = useState(false);
|
||||
const inputRef = useRef(null);
|
||||
const updateCustomGpt = manualSWR(`/api/customGpts/`, 'post');
|
||||
const updateCustomGpt = manualSWR(`http://localhost:3080/api/customGpts/`, 'post');
|
||||
|
||||
const submitHandler = (e) => {
|
||||
if (chatGptLabel.length === 0) {
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ export default function ModelItem({ modelName, value, onSelect }) {
|
|||
const [currentName, setCurrentName] = useState(modelName);
|
||||
const [modelInput, setModelInput] = useState(modelName);
|
||||
const inputRef = useRef(null);
|
||||
const rename = manualSWR(`/api/customGpts`, 'post');
|
||||
const deleteCustom = manualSWR(`/api/customGpts/delete`, 'post');
|
||||
const rename = manualSWR(`http://localhost:3080/api/customGpts`, 'post');
|
||||
const deleteCustom = manualSWR(`http://localhost:3080/api/customGpts/delete`, 'post');
|
||||
|
||||
if (value === 'chatgptCustom') {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export default function ModelMenu() {
|
|||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
const { model, customModel } = useSelector((state) => state.submit);
|
||||
const { models, modelMap, initial } = useSelector((state) => state.models);
|
||||
const { trigger } = manualSWR(`/api/customGpts`, 'get', (res) => {
|
||||
const { trigger } = manualSWR(`http://localhost:3080/api/customGpts`, 'get', (res) => {
|
||||
const fetchedModels = res.map((modelItem) => ({
|
||||
...modelItem,
|
||||
name: modelItem.chatGptLabel
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ export default function ClearConvos() {
|
|||
const dispatch = useDispatch();
|
||||
const { mutate } = useSWRConfig();
|
||||
|
||||
const { trigger } = manualSWR(`/api/convos/clear`, 'post', () => {
|
||||
const { trigger } = manualSWR(`http://localhost:3080/api/convos/clear`, 'post', () => {
|
||||
dispatch(setMessages([]));
|
||||
dispatch(setNewConvo());
|
||||
mutate(`/api/convos`);
|
||||
mutate(`http://localhost:3080/api/convos`);
|
||||
});
|
||||
|
||||
const clickHandler = () => {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export default function Nav() {
|
|||
};
|
||||
|
||||
const { data, isLoading, mutate } = swr(
|
||||
`/api/convos?pageNumber=${pageNumber}`,
|
||||
`http://localhost:3080/api/convos?pageNumber=${pageNumber}`,
|
||||
onSuccess
|
||||
);
|
||||
const containerRef = useRef(null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue