mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-03 00:26:40 +08:00
commit
db8a10943a
4
.github/workflows/dockerToHub-dev.yml
vendored
4
.github/workflows/dockerToHub-dev.yml
vendored
@ -62,15 +62,13 @@ jobs:
|
||||
script: |
|
||||
mkdir -p /data/test/ChatGPT-Next-Web
|
||||
cd /data/test/ChatGPT-Next-Web
|
||||
echo "${{ secrets.DOCKER_ENV }}" >> .env
|
||||
echo "${{ secrets.DOCKER_ENV }}" > .env
|
||||
echo "PORT=23001" >> .env
|
||||
# 测试分支,
|
||||
echo "COMPOSE_PROJECT_NAME=test-chatgpt-web" >> .env
|
||||
sed -i 's@image: registry.cn-hangzhou.aliyuncs.com/si-private/chatgpt-next-web@image: registry.cn-hangzhou.aliyuncs.com/si-private/chatgpt-next-web:test@g' docker-compose.yml
|
||||
echo ${{ secrets.ALY_DOCKER_PASSWORD }} | docker login registry.cn-hangzhou.aliyuncs.com -u ${{ secrets.ALY_DOCKER_USERNAME }} --password-stdin
|
||||
#sed -i 's|23000:|23001:|g' docker-compose.yml
|
||||
sed -i 's|container_name:|#container_name:|g' docker-compose.yml
|
||||
#docker network ls | grep -qw chatgpt-ns || docker network create chatgpt-ns
|
||||
docker-compose pull && docker-compose up -d
|
||||
yes | docker image prune
|
||||
rm -rf /www/server/nginx/proxy_cache_dir/* || true
|
||||
|
@ -48,7 +48,7 @@ export default function SetPasswordPage() {
|
||||
if (result["result"] == "ok") {
|
||||
signOut({ redirect: true, callbackUrl: "/login" });
|
||||
}
|
||||
console.log("--------", result);
|
||||
// console.log("--------", result);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -205,6 +205,6 @@ export function useGetMidjourneySelfProxyUrl(url: string) {
|
||||
const accessStore = useAccessStore.getState();
|
||||
console.log("useMjImgSelfProxy", accessStore.useMjImgSelfProxy);
|
||||
|
||||
console.log("---------", url);
|
||||
// console.log("---------", url);
|
||||
return url.replace("cdn.discordapp.com", "cdnig.duckagi.com");
|
||||
}
|
||||
|
@ -105,6 +105,8 @@ import { useAllModels } from "../utils/hooks";
|
||||
import { MultimodalContent } from "../client/api";
|
||||
// import { getTokenLength } from "@/lib/utils";
|
||||
import VoiceInput from "./voice-input";
|
||||
import { Progress, Tooltip } from "antd";
|
||||
import { white } from "kleur/colors";
|
||||
// import GptPrompts from "./gpt-prompts";
|
||||
// const VoiceInput = dynamic(
|
||||
// () => import('@/app/components/voice-input'), { ssr: false });
|
||||
@ -1281,7 +1283,7 @@ function _Chat() {
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
console.log("请求成功,", result);
|
||||
// console.log("请求成功,", result);
|
||||
localStorage.setItem(
|
||||
"current_day_token",
|
||||
result["result"]["current_token"],
|
||||
@ -1333,11 +1335,29 @@ function _Chat() {
|
||||
{!session.topic ? DEFAULT_TOPIC : session.topic}
|
||||
</div>
|
||||
<div className="window-header-sub-title">
|
||||
{Locale.Chat.SubTitle(session.messages.length)}
|
||||
<span>
|
||||
当天使用:
|
||||
{localStorage.getItem("current_day_token") ?? 0}
|
||||
{/*{Locale.Chat.SubTitle(session.messages.length)} */}
|
||||
<Tooltip
|
||||
title={
|
||||
<span style={{ color: "black" }}>
|
||||
{localStorage.getItem("current_day_token") ?? 0}{" "}
|
||||
<span style={{ color: "black" }}>/ 100000</span>
|
||||
</span>
|
||||
}
|
||||
color={"var(--second)"}
|
||||
placement="bottom"
|
||||
>
|
||||
当天使用:
|
||||
<Progress
|
||||
percent={
|
||||
(parseInt(localStorage.getItem("current_day_token") ?? "0") /
|
||||
100000) *
|
||||
100
|
||||
}
|
||||
size="small"
|
||||
showInfo={false}
|
||||
strokeColor={{ from: "green", to: "red" }}
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div className="window-actions">
|
||||
|
@ -514,6 +514,26 @@ export const useChatStore = createPersistStore(
|
||||
botMessage,
|
||||
]);
|
||||
});
|
||||
|
||||
const current_day_token = parseInt(
|
||||
localStorage.getItem("current_day_token") ?? "0",
|
||||
);
|
||||
// console.log('---------', current_day_token)
|
||||
if (current_day_token >= 100000) {
|
||||
botMessage.content +=
|
||||
"\n\n" +
|
||||
prettyObject({
|
||||
error: true,
|
||||
message: "当日请求过多。",
|
||||
});
|
||||
botMessage.streaming = false;
|
||||
get().onNewMessage(botMessage);
|
||||
set(() => ({}));
|
||||
extAttr?.setAutoScroll(true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
content.toLowerCase().startsWith("/mj") ||
|
||||
content.toLowerCase().startsWith("/MJ")
|
||||
|
@ -24,6 +24,10 @@
|
||||
|
||||
.window-header-sub-title {
|
||||
font-size: 14px;
|
||||
width: 150px;
|
||||
.ant-progress {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ async function existUser(user: Partial<User> ) {
|
||||
}
|
||||
|
||||
export async function insertUser(user: Partial<User> ) {
|
||||
console.log('------------', user)
|
||||
// console.log('------------', user)
|
||||
try {
|
||||
return await prisma.user.create({
|
||||
data: user
|
||||
|
Loading…
Reference in New Issue
Block a user