Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 25, 2023
2 parents 33529d5 + b3fd56c commit df3ff3d
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 37 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,18 @@ yarn dev
docker pull yidadaa/chatgpt-next-web

docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="your-password" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=your-password \
yidadaa/chatgpt-next-web
```

You can start service behind a proxy:

```shell
docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="your-password" \
-e PROXY_URL="http://localhost:7890" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=your-password \
-e PROXY_URL=http://localhost:7890 \
yidadaa/chatgpt-next-web
```

Expand Down
10 changes: 5 additions & 5 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,19 @@ BASE_URL=https://chatgpt1.nextweb.fun/api/proxy
docker pull yidadaa/chatgpt-next-web

docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="页面访问密码" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=页面访问密码 \
yidadaa/chatgpt-next-web
```

你也可以指定 proxy:

```shell
docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="页面访问密码" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=页面访问密码 \
--net=host \
-e PROXY_URL="http://127.0.0.1:7890" \
-e PROXY_URL=http://127.0.0.1:7890 \
yidadaa/chatgpt-next-web
```

Expand Down
10 changes: 5 additions & 5 deletions README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ Antes de empezar a escribir código, debe crear uno nuevo en la raíz del proyec
docker pull yidadaa/chatgpt-next-web

docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="页面访问密码" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=your-password \
yidadaa/chatgpt-next-web
```

También puede especificar proxy:

```shell
docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="页面访问密码" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=your-password \
--net=host \
-e PROXY_URL="http://127.0.0.1:7890" \
-e PROXY_URL=http://127.0.0.1:7890 \
yidadaa/chatgpt-next-web
```

Expand Down
10 changes: 5 additions & 5 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,18 @@ yarn dev
docker pull yidadaa/chatgpt-next-web

docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="your-password" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=your-password \
yidadaa/chatgpt-next-web
```

プロキシの後ろでサービスを開始することができる:

```shell
docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="your-password" \
-e PROXY_URL="http://localhost:7890" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=your-password \
-e PROXY_URL=http://localhost:7890 \
yidadaa/chatgpt-next-web
```

Expand Down
10 changes: 5 additions & 5 deletions README_KO.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,19 @@ BASE_URL=https://chatgpt1.nextweb.fun/api/proxy
docker pull yidadaa/chatgpt-next-web

docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="페이지 접근 비밀번호" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=페이지 접근 비밀번호 \
yidadaa/chatgpt-next-web
```

프록시를 지정하려면 다음을 사용하세요:

```shell
docker run -d -p 3000:3000 \
-e OPENAI_API_KEY="sk-xxxx" \
-e CODE="페이지 접근 비밀번호" \
-e OPENAI_API_KEY=sk-xxxx \
-e CODE=페이지 접근 비밀번호 \
--net=host \
-e PROXY_URL="http://127.0.0.1:7890" \
-e PROXY_URL=http://127.0.0.1:7890 \
yidadaa/chatgpt-next-web
```

Expand Down
2 changes: 1 addition & 1 deletion app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ function _Chat() {

const isTouchTopEdge = e.scrollTop <= edgeThreshold;
const isTouchBottomEdge = bottomHeight >= e.scrollHeight - edgeThreshold;
const isHitBottom = bottomHeight >= e.scrollHeight - 10;
const isHitBottom = bottomHeight >= e.scrollHeight - (isMobileScreen ? 0 : 10);

const prevPageMsgIndex = msgRenderIndex - CHAT_PAGE_SIZE;
const nextPageMsgIndex = msgRenderIndex + CHAT_PAGE_SIZE;
Expand Down
33 changes: 22 additions & 11 deletions app/components/exporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,34 +565,45 @@ export function MarkdownPreviewer(props: {
);
}

// modified by BackTrackZ now it's looks better

export function JsonPreviewer(props: {
messages: ChatMessage[];
topic: string;
}) {
const msgs = props.messages.map((m) => ({
role: m.role,
content: m.content,
}));
const mdText = "\n" + JSON.stringify(msgs, null, 2) + "\n";
const msgs = {
messages: [
{
role: "system",
content: "You are an assistant that " + props.topic,
},
...props.messages.map((m) => ({
role: m.role,
content: m.content,
})),
],
};
const mdText = "```json\n" + JSON.stringify(msgs, null, 2) + "\n```";
const minifiedJson = JSON.stringify(msgs);

const copy = () => {
copyToClipboard(JSON.stringify(msgs, null, 2));
copyToClipboard(minifiedJson);
};
const download = () => {
downloadAs(JSON.stringify(msgs, null, 2), `${props.topic}.json`);
downloadAs(JSON.stringify(msgs), `${props.topic}.json`);
};

return (
<>
<PreviewActions
copy={copy}
download={download}
showCopy={true}
showCopy={false}
messages={props.messages}
/>
<div className="markdown-body">
<pre className={styles["export-content"]}>{mdText}</pre>
<div className="markdown-body" onClick={copy}>
<Markdown content={mdText} />
</div>
</>
);
}
}

0 comments on commit df3ff3d

Please sign in to comment.