diff --git a/api/core/types/config.go b/api/core/types/config.go index c32318d9..d3822345 100644 --- a/api/core/types/config.go +++ b/api/core/types/config.go @@ -131,7 +131,8 @@ type SystemConfig struct { Title string `json:"title,omitempty"` // 网站标题 Slogan string `json:"slogan,omitempty"` // 网站 slogan AdminTitle string `json:"admin_title,omitempty"` // 管理后台标题 - Logo string `json:"logo,omitempty"` // 方形 Logo + Logo string `json:"logo,omitempty"` // 圆形 Logo + BarLogo string `json:"bar_logo,omitempty"` // 条形 Logo InitPower int `json:"init_power,omitempty"` // 新用户注册赠送算力值 DailyPower int `json:"daily_power,omitempty"` // 每日签到赠送算力 InvitePower int `json:"invite_power,omitempty"` // 邀请新用户赠送算力值 diff --git a/api/handler/chat_openai_handler.go b/api/handler/chat_openai_handler.go index 14e58194..df4a8637 100644 --- a/api/handler/chat_openai_handler.go +++ b/api/handler/chat_openai_handler.go @@ -92,6 +92,8 @@ func (h *ChatHandler) sendOpenAiMessage( if strings.HasPrefix(req.Model, "o1-") { content := fmt.Sprintf("AI 思考结束,耗时:%d 秒。\n\n", time.Now().Unix()-session.Start) + contents = append(contents, "> AI 正在思考中...\n") + contents = append(contents, content) utils.SendChunkMsg(ws, content) } diff --git a/api/handler/ws_handler.go b/api/handler/ws_handler.go index bac48ad3..95fe87bb 100644 --- a/api/handler/ws_handler.go +++ b/api/handler/ws_handler.go @@ -134,6 +134,7 @@ func (h *WebsocketHandler) Client(c *gin.Context) { if err != nil { logger.Error(err, chatModel) } + session.Model.Id = chatModel.Id ctx, cancel := context.WithCancel(context.Background()) h.chatHandler.ReqCancelFunc.Put(clientId, cancel) err = h.chatHandler.sendMessage(ctx, session, chatRole, chatMessage.Content, client) diff --git a/web/.env.development b/web/.env.development index a07651f1..847a0947 100644 --- a/web/.env.development +++ b/web/.env.development @@ -8,4 +8,7 @@ VUE_APP_KEY_PREFIX=GeekAI_DEV_ VUE_APP_TITLE="Geek-AI 创作系统" VUE_APP_VERSION=v4.1.9 VUE_APP_DOCS_URL=https://docs.geekai.me -VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai +VUE_APP_GITHUB_URL=https://github.com/yangjian102621/geekai +VUE_APP_GITEE_URL=https://gitee.com/blackfox/geekai +VUE_APP_GITCODE_URL=https://gitcode.com/yangjian102621/geekai + diff --git a/web/.env.production b/web/.env.production index 90af446e..fe27ab9d 100644 --- a/web/.env.production +++ b/web/.env.production @@ -3,4 +3,6 @@ VUE_APP_WS_HOST= VUE_APP_KEY_PREFIX=GeekAI_ VUE_APP_VERSION=v4.1.9 VUE_APP_DOCS_URL=https://docs.geekai.me -VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai +VUE_APP_GITHUB_URL=https://github.com/yangjian102621/geekai +VUE_APP_GITEE_URL=https://gitee.com/blackfox/geekai +VUE_APP_GITCODE_URL=https://gitcode.com/yangjian102621/geekai diff --git a/web/public/images/bar_logo.png b/web/public/images/bar_logo.png new file mode 100644 index 00000000..3795565c Binary files /dev/null and b/web/public/images/bar_logo.png differ diff --git a/web/src/assets/css/chat-plus.styl b/web/src/assets/css/chat-plus.styl index 42c724fb..ab4a566a 100644 --- a/web/src/assets/css/chat-plus.styl +++ b/web/src/assets/css/chat-plus.styl @@ -30,14 +30,6 @@ margin-bottom: 10px } - // 隐藏滚动条 - - ::-webkit-scrollbar { - width: 0; - height: 0; - background-color: transparent; - } - .content { width: 100% overflow-y: scroll @@ -130,9 +122,9 @@ .chat-container { min-width: 0; flex: 1; - background-color: var(--el-bg-color) + background-color: var(--chat-bg) color var(--text-fb) - + .chat-config { height 50px padding 10px 30px @@ -186,54 +178,33 @@ width: 100%; position relative background: var(--chat-bg) - - ::-webkit-scrollbar { - width: 12px /* 滚动条宽度 */ - background #F1F1F1 - } - - ::-webkit-scrollbar-track { - background-color: #e1e1e1; - } - - ::-webkit-scrollbar-thumb { - background-color: #c1c1c1; - border-radius 12px - } - - ::-webkit-scrollbar-thumb:hover { - background-color: #A8A8A8; - } + display: flex; + justify-content: center; + padding 0 20px + max-width: 960px; .chat-box { overflow-y: auto; - //border-bottom: 1px solid #4f4f4f - scrollbar-width: none; /* 隐藏滚动条(Firefox) */ - -ms-overflow-style: none; /* 隐藏滚动条(IE、Edge) */ - // 变量定义 --content-font-size: 16px; --content-color: #c1c1c1; font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif; - padding: 0 0 50px 0; + //padding: 0 0 50px 0; + width: 100%; .chat-line { font-size: 14px; display: flex; align-items: flex-start; - - } - ::-webkit-scrollbar { - display: none; /* 隐藏滚动条(Webkit 浏览器) */ -} } .input-box { position absolute bottom 0 width 100% + max-width: 800px; .input-box-inner { display flex @@ -363,11 +334,6 @@ } } - - #container::-webkit-scrollbar { - width: 0; - height: 0; - } } } } diff --git a/web/src/assets/css/home.styl b/web/src/assets/css/home.styl index 6eb7497e..0aa0e27f 100644 --- a/web/src/assets/css/home.styl +++ b/web/src/assets/css/home.styl @@ -1,24 +1,30 @@ -.layout{ +.layout { display: flex; position: relative; height: 100vh; - .big-top-title{ + + .big-top-title { padding-top: 10px; } - .top-collapse{ + + .top-collapse { padding-top: 10px - img{ + + img { width 24px !important height: 24px !important } } - .tab-box{ + + .tab-box { align-items: center background-color: var(--card-bg) + border-right: 1px solid var(--line-box); // height: 100% // position: fixed; height: 100vh; - .title{ + + .title { font-size: 28px height: 40px width 120px @@ -26,106 +32,100 @@ word-wrap break-all; overflow hidden font-weight: 700 - color:var(--text-theme-color) + color: var(--text-theme-color) } - img{ + + img { height: 44px object-fit: cover border-radius: 50% border: 2px solid #754ff6; background: #fff } - .marr{ + + .marr { margin-right: 4px; } - + } - + } -.flex-center-col{ + +.flex-center-col { display flex align-items center flex-direction column .iconfont { - font-size 22px - } - - .icon-expand { font-size 24px - margin-bottom 10px cursor pointer color var(--text-color) } - .icon-colspan { - font-size 18px - margin-left 3px - cursor pointer - color var(--text-color) + .icon-new-chat { + color #ffffff } } -.menu-list-collapse{ - .flex-center-col{ + +.menu-list-collapse { + .flex-center-col { flex-direction: row; } - .menu-list-item{ - + + .menu-list-item { + height: 38px; line-height: 38px; .iconfont { font-size 16px } - + } + .menu-list-item:hover, - .active{ + .active { background: rgba(79, 89, 102, .122); border-radius: 8px; - .el-icon{ + + .el-icon { background: transparent !important; } } - .menu-title{ + + .menu-title { font-size: 15px !important; margin-bottom: 0 !important; } } +.menu-list { + width: 65px; -.openicon{ - font-size: 40px; - color: #754ff6; -} -.menuIcon{ - .openicon{ - font-size: 28px; - color: #754ff6; -} - } -.menu-list{ - margin-top: 20px; - .svg-icon{ - svg{ + .svg-icon { + svg { width: 30px; height: 30px; } } - .menu-list-item{ + + .menu-list-item { // margin-bottom: 10px; margin: 0 8px 8px; cursor: pointer; font-weight: 550; - &:hover{ - .el-icon{ + color: var(--text-theme-color); + + &:hover { + .el-icon { background: rgba(79, 89, 102, .122); } - + } - .el-icon{ + + .el-icon { width: 24px; height: 24px; padding: 4px; @@ -136,96 +136,99 @@ // width: 24px; // height: 24px; // } - + } - &.active{ - color: var(--text-color); + + &.active { + color: var(--text-theme-color); font-weight: 700; - filter: none !important; - .el-icon{ - background: rgba(79, 89, 102, .122); - filter: invert(100%); - } } - - + + } - .bot{ + + .bot { position: absolute; bottom: 6px; - - - } - .bot-line{ - - width : 100%; + width 65px; + + } + + .bot-line { + + width: 100%; height: 1px; background: var(--line-box) margin: 20px 0 10px 0; - } - .menu-title{ + } + + .menu-title { font-size: 12px; margin-bottom: 6px; - + } + .icon-house, - .icon-github{ - font-size: 20px; - color: #754ff6; - cursor pointer + .icon-github { + font-size: 20px; + color: #754ff6; + cursor pointer } - .menu-bot-item{ - display: flex; - align-items: center; - justify-content: space-around; - align-items: center; - a{ - // margin-right: 46px; - } + + .menu-bot-item { + display: flex; + align-items: center; + justify-content: space-around; } } -::v-deep(.theme-box){ + +::v-deep(.theme-box) { position: relative !important; right: initial; bottom: initial; width: 20px; height: 20px; - line-height: 20px; - .iconfont{ - font-size: 15px !important;} + line-height: 18px; + + .iconfont { + font-size: 15px !important; + } } -.right-main{ + +.right-main { height: 100%; // background: #f5f7fd; background: var(--theme-bg-all); // background-image: linear-gradient(180deg, rgba(247, 232, 255, .54), rgba(191, 223, 255, .35)); width: 100%; - .loginMask{ + + .loginMask { position: absolute; top: 0; width: 100%; height: 100%; z-index: 999; - } - .topheader{ + } + + .topheader { display: flex; position: fixed; right: 8px; - z-index : 999; - top:0; + z-index: 999; + top: 0; // width 100%; align-items: center; justify-content: flex-end; } - .btn-go{ + + .btn-go { background: #754ff6; margin: 10px 10px 0; } } - .el-popper { .more-menus { li { @@ -251,41 +254,48 @@ background: rgba(79, 89, 102, 0.1); } } - .setting-menus{ - .title{ + + .setting-menus { + .title { color: #222226; } + .el-icon, - .iconfont{ + .iconfont { font-size: 18px margin-right: 6px } color: #222226; } - .username{ - display: -webkit-box; - -webkit-box-orient: vertical; - overflow: hidden; - -webkit-line-clamp: 1; + + .username { + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + -webkit-line-clamp: 1; } - + } -.rightHeightMax{ + +.rightHeightMax { height: 100vh; max-height: 100vh; overflow: hidden; - + } -.rightHeight{ + +.rightHeight { height: calc(100vh - 42px); max-height: calc(100vh - 42px); overflow: hidden; - .content{ + + .content { padding-top: 42px; } } -.content{ + +.content { height: 100%; overflow: scroll; } \ No newline at end of file diff --git a/web/src/assets/css/theme-dark.styl b/web/src/assets/css/theme-dark.styl index 5fd767e0..c8304f95 100644 --- a/web/src/assets/css/theme-dark.styl +++ b/web/src/assets/css/theme-dark.styl @@ -43,7 +43,7 @@ --el-bg-color-overlay: rgba(17, 28, 68, 1); --el-border-color-light: rgba(255, 255, 255, 0.2); --chat-content-bg:rgba(86, 86, 95, .2); - --chat-content-bg-list:rgba(86, 86, 95, .2); + --chat-user-content-bg: #762AA4; --hover-deep-color:#30323c; //layout .more-menus li.moreTitle, @@ -52,7 +52,7 @@ .setting-menus li .el-icon, .setting-menus li .iconfont, .layout .tab-box .menu-list-item{ - filter: invert(100%); + //filter: invert(100%); } .more-menus span.title{ color:#000; diff --git a/web/src/assets/css/theme-light.styl b/web/src/assets/css/theme-light.styl index bab46cf6..0d971bd7 100644 --- a/web/src/assets/css/theme-light.styl +++ b/web/src/assets/css/theme-light.styl @@ -31,8 +31,8 @@ --theme-text-primary: #000; --theme-text-color-secondary: #666; --chat-content-bg:#f5f7fc; + --chat-user-content-bg: #e0dfff; --chat-list-bg: #0302020a; - --chat-content-bg-list:#fff; --chat-wel-bg:rgba(247, 247, 248, 1); --hover-deep-color:#fff; --el-bg-color-overlay: #fff; diff --git a/web/src/assets/iconfont/iconfont.css b/web/src/assets/iconfont/iconfont.css index 238136d4..70a25eb6 100644 --- a/web/src/assets/iconfont/iconfont.css +++ b/web/src/assets/iconfont/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 4125778 */ - src: url('iconfont.woff2?t=1734934068681') format('woff2'), - url('iconfont.woff?t=1734934068681') format('woff'), - url('iconfont.ttf?t=1734934068681') format('truetype'); + src: url('iconfont.woff2?t=1736144380052') format('woff2'), + url('iconfont.woff?t=1736144380052') format('woff'), + url('iconfont.ttf?t=1736144380052') format('truetype'); } .iconfont { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-gitee:before { + content: "\e6d0"; +} + .icon-redeem:before { content: "\e61a"; } diff --git a/web/src/assets/iconfont/iconfont.js b/web/src/assets/iconfont/iconfont.js index e6627dab..59572919 100644 --- a/web/src/assets/iconfont/iconfont.js +++ b/web/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_4125778='',(a=>{var l=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,t,i,o,p,z=function(l,c){c.parentNode.insertBefore(l,c)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,c=document.createElement("div");c.innerHTML=a._iconfont_svg_string_4125778,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?z(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,o=a.document,p=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,m())})}function m(){p||(p=!0,i())}function s(){try{o.documentElement.doScroll("left")}catch(l){return void setTimeout(s,50)}m()}})(window); \ No newline at end of file +window._iconfont_svg_string_4125778='',(a=>{var l=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,t,i,o,p,z=function(l,c){c.parentNode.insertBefore(l,c)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,c=document.createElement("div");c.innerHTML=a._iconfont_svg_string_4125778,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?z(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,o=a.document,p=!1,s(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,m())})}function m(){p||(p=!0,i())}function s(){try{o.documentElement.doScroll("left")}catch(l){return void setTimeout(s,50)}m()}})(window); \ No newline at end of file diff --git a/web/src/assets/iconfont/iconfont.json b/web/src/assets/iconfont/iconfont.json index 74a9807a..5d41e167 100644 --- a/web/src/assets/iconfont/iconfont.json +++ b/web/src/assets/iconfont/iconfont.json @@ -5,6 +5,13 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "6905420", + "name": "码云", + "font_class": "gitee", + "unicode": "e6d0", + "unicode_decimal": 59088 + }, { "icon_id": "3624396", "name": "兑换码", diff --git a/web/src/assets/iconfont/iconfont.ttf b/web/src/assets/iconfont/iconfont.ttf index b1a3f061..3f316ff3 100644 Binary files a/web/src/assets/iconfont/iconfont.ttf and b/web/src/assets/iconfont/iconfont.ttf differ diff --git a/web/src/assets/iconfont/iconfont.woff b/web/src/assets/iconfont/iconfont.woff index ecfb44bc..e655b7e2 100644 Binary files a/web/src/assets/iconfont/iconfont.woff and b/web/src/assets/iconfont/iconfont.woff differ diff --git a/web/src/assets/iconfont/iconfont.woff2 b/web/src/assets/iconfont/iconfont.woff2 index 52ac580f..49734aad 100644 Binary files a/web/src/assets/iconfont/iconfont.woff2 and b/web/src/assets/iconfont/iconfont.woff2 differ diff --git a/web/src/components/ChatPrompt.vue b/web/src/components/ChatPrompt.vue index e042df68..d9517cca 100644 --- a/web/src/components/ChatPrompt.vue +++ b/web/src/components/ChatPrompt.vue @@ -2,22 +2,25 @@
- User + User
- +
- +
- {{ file.name }} + {{ + file.name + }} +
{{ GetFileType(file.ext) }} @@ -30,7 +33,7 @@
{{ dateFormat(data.created_at) }} {{ dateFormat(data.created_at) }} tokens: {{ finalTokens }}
@@ -41,22 +44,25 @@
- User + User
- +
- +
- {{ file.name }} + {{ + file.name + }} +
{{ GetFileType(file.ext) }} @@ -71,7 +77,7 @@
{{ dateFormat(data.created_at) }} {{ dateFormat(data.created_at) }}
@@ -81,12 +87,12 @@