move setting button to top, lg:w-2/3
This commit is contained in:
@@ -175,10 +175,54 @@ export default (props: {
|
|||||||
const importFileRef = createRef();
|
const importFileRef = createRef();
|
||||||
const [totalCost, setTotalCost] = useState(getTotalCost());
|
const [totalCost, setTotalCost] = useState(getTotalCost());
|
||||||
return (
|
return (
|
||||||
<div className="left-0 top-0 overflow-scroll flex justify-center absolute w-screen h-full bg-black bg-opacity-50 z-10">
|
<div
|
||||||
<div className="m-2 p-2 bg-white rounded-lg h-fit">
|
onClick={() => props.setShow(false)}
|
||||||
<h3 className="text-xl">Settings</h3>
|
className="left-0 top-0 overflow-scroll flex justify-center absolute w-screen h-full bg-black bg-opacity-50 z-10"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
onClick={(event: any) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
}}
|
||||||
|
className="m-2 p-2 bg-white rounded-lg h-fit lg:w-2/3 z-20"
|
||||||
|
>
|
||||||
|
<h3 className="text-xl text-center">Settings</h3>
|
||||||
<hr />
|
<hr />
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<button
|
||||||
|
className="p-2 m-2 rounded bg-purple-600 text-white"
|
||||||
|
onClick={() => {
|
||||||
|
navigator.clipboard.writeText(link);
|
||||||
|
alert(`Copied link: ${link}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Copy Link
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="p-2 m-2 rounded bg-rose-600 text-white"
|
||||||
|
onClick={() => {
|
||||||
|
if (
|
||||||
|
!confirm(
|
||||||
|
`Are you sure to clear all ${props.chatStore.history.length} messages?`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
props.chatStore.history = [];
|
||||||
|
props.chatStore.postBeginIndex = 0;
|
||||||
|
props.chatStore.totalTokens = 0;
|
||||||
|
props.setChatStore({ ...props.chatStore });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Clear History
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="p-2 m-2 rounded bg-cyan-600 text-white"
|
||||||
|
onClick={() => {
|
||||||
|
props.setShow(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Close
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<p className="m-2 p-2">
|
<p className="m-2 p-2">
|
||||||
Accumulated cost in all sessions ${totalCost.toFixed(4)}
|
Accumulated cost in all sessions ${totalCost.toFixed(4)}
|
||||||
@@ -196,6 +240,7 @@ export default (props: {
|
|||||||
<p className="m-2 p-2">
|
<p className="m-2 p-2">
|
||||||
Total cost in this session ${props.chatStore.cost.toFixed(4)}
|
Total cost in this session ${props.chatStore.cost.toFixed(4)}
|
||||||
</p>
|
</p>
|
||||||
|
<hr />
|
||||||
<div className="box">
|
<div className="box">
|
||||||
<LongInput
|
<LongInput
|
||||||
field="systemMessageContent"
|
field="systemMessageContent"
|
||||||
@@ -341,42 +386,6 @@ export default (props: {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div className="flex justify-between">
|
|
||||||
<button
|
|
||||||
className="p-2 m-2 rounded bg-purple-600 text-white"
|
|
||||||
onClick={() => {
|
|
||||||
navigator.clipboard.writeText(link);
|
|
||||||
alert(`Copied link: ${link}`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Copy Link
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="p-2 m-2 rounded bg-rose-600 text-white"
|
|
||||||
onClick={() => {
|
|
||||||
if (
|
|
||||||
!confirm(
|
|
||||||
`Are you sure to clear all ${props.chatStore.history.length} messages?`
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
props.chatStore.history = [];
|
|
||||||
props.chatStore.postBeginIndex = 0;
|
|
||||||
props.chatStore.totalTokens = 0;
|
|
||||||
props.setChatStore({ ...props.chatStore });
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Clear History
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="p-2 m-2 rounded bg-cyan-600 text-white"
|
|
||||||
onClick={() => {
|
|
||||||
props.setShow(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Close
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user