From 5314272c620d5f9eac086c31c35c92d1d4bccfd9 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Sun, 12 Nov 2023 23:31:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=8C=89=E9=92=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/SiderBar.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/web/src/components/SiderBar.js b/web/src/components/SiderBar.js index fc22b813..95298c9a 100644 --- a/web/src/components/SiderBar.js +++ b/web/src/components/SiderBar.js @@ -15,7 +15,7 @@ import { IconLayers, IconSetting, IconCreditCard, - IconSemiLogo, + IconComment, IconHome, IconImage } from '@douyinfe/semi-icons'; @@ -36,7 +36,13 @@ let headerButtons = [ icon: , className: isAdmin()?'semi-navigation-item-normal':'tableHiddle', }, - + { + text: '聊天', + itemKey: 'chat', + to: '/chat', + icon: , + className: localStorage.getItem('chat_link')?'semi-navigation-item-normal':'tableHiddle', + }, { text: '令牌', itemKey: 'token', @@ -89,14 +95,6 @@ let headerButtons = [ // } ]; -if (localStorage.getItem('chat_link')) { - headerButtons.splice(1, 0, { - name: '聊天', - to: '/chat', - icon: 'comments' - }); -} - const HeaderBar = () => { const [userState, userDispatch] = useContext(UserContext); let navigate = useNavigate(); @@ -134,6 +132,7 @@ const HeaderBar = () => { midjourney: "/midjourney", setting: "/setting", about: "/about", + chat: "/chat", }; return ( Date: Sun, 12 Nov 2023 23:32:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0mj=E6=B8=A0=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/model-ratio.go | 1 + controller/model.go | 9 +++++++++ docker-compose.yml | 2 +- web/src/constants/channel.constants.js | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/common/model-ratio.go b/common/model-ratio.go index bb2adc73..f1cc07da 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -14,6 +14,7 @@ import ( // 1 === $0.002 / 1K tokens // 1 === ¥0.014 / 1k tokens var ModelRatio = map[string]float64{ + "midjourney": 50, "gpt-4": 15, "gpt-4-0314": 15, "gpt-4-0613": 15, diff --git a/controller/model.go b/controller/model.go index f9904330..201d6431 100644 --- a/controller/model.go +++ b/controller/model.go @@ -54,6 +54,15 @@ func init() { }) // https://platform.openai.com/docs/models/model-endpoint-compatibility openAIModels = []OpenAIModels{ + { + Id: "midjourney", + Object: "model", + Created: 1677649963, + OwnedBy: "Midjourney", + Permission: permission, + Root: "midjourney", + Parent: nil, + }, { Id: "dall-e-2", Object: "model", diff --git a/docker-compose.yml b/docker-compose.yml index 9b814a03..6c5350d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.4' services: one-api: - image: justsong/one-api:latest + image: calciumion/neko-api:main container_name: one-api restart: always command: --log-dir /app/logs diff --git a/web/src/constants/channel.constants.js b/web/src/constants/channel.constants.js index 76407745..6da8daff 100644 --- a/web/src/constants/channel.constants.js +++ b/web/src/constants/channel.constants.js @@ -1,5 +1,6 @@ export const CHANNEL_OPTIONS = [ { key: 1, text: 'OpenAI', value: 1, color: 'green' }, + { key: 99, text: 'Midjourney-Proxy', value: 99, color: 'green' }, { key: 14, text: 'Anthropic Claude', value: 14, color: 'black' }, { key: 3, text: 'Azure OpenAI', value: 3, color: 'olive' }, { key: 11, text: 'Google PaLM2', value: 11, color: 'orange' },