update some web details
This commit is contained in:
parent
9e082e8ab1
commit
613b33251b
4
run.sh
4
run.sh
@ -4,7 +4,7 @@
|
|||||||
stop_services() {
|
stop_services() {
|
||||||
echo "Stopping services..."
|
echo "Stopping services..."
|
||||||
pkill -f "npm run server"
|
pkill -f "npm run server"
|
||||||
pkill -f "flask --app=api run"
|
pkill -f "python api.py"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ trap stop_services SIGINT SIGTERM
|
|||||||
|
|
||||||
# Start the server
|
# Start the server
|
||||||
cd src
|
cd src
|
||||||
python api.py
|
python api.py &
|
||||||
|
|
||||||
# Start the frontend service
|
# Start the frontend service
|
||||||
cd ../web
|
cd ../web
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
<div class="nav-btn text" @click="state.showPanel = !state.showPanel">
|
<div class="nav-btn text" @click="state.showPanel = !state.showPanel">
|
||||||
<component :is="state.showPanel ? SettingFilled : SettingOutlined" /> <span class="text">选项</span>
|
<component :is="state.showPanel ? FolderOpenOutlined : FolderOutlined" /> <span class="text">选项</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="state.showPanel" class="my-panal" ref="panel">
|
<div v-if="state.showPanel" class="my-panal" ref="panel">
|
||||||
<div class="graphbase flex-center">
|
<div class="graphbase flex-center">
|
||||||
@ -122,7 +122,7 @@
|
|||||||
<template #icon> <SendOutlined v-if="!isStreaming" /> <LoadingOutlined v-else/> </template>
|
<template #icon> <SendOutlined v-if="!isStreaming" /> <LoadingOutlined v-else/> </template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
<p class="note">即便强如雅典娜也可能会出错,请注意辨别内容的可靠性</p>
|
<p class="note">即便强如雅典娜也可能会出错,请注意辨别内容的可靠性 模型供应商:{{ configStore.config?.model_provider }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -142,8 +142,11 @@ import {
|
|||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
SettingFilled,
|
SettingFilled,
|
||||||
PlusCircleOutlined,
|
PlusCircleOutlined,
|
||||||
|
FolderOutlined,
|
||||||
|
FolderOpenOutlined,
|
||||||
} from '@ant-design/icons-vue'
|
} from '@ant-design/icons-vue'
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
|
import { useConfigStore } from '@/stores/config'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
conv: Object,
|
conv: Object,
|
||||||
@ -151,6 +154,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['renameTitle'])
|
const emit = defineEmits(['renameTitle'])
|
||||||
|
const configStore = useConfigStore()
|
||||||
|
|
||||||
const { conv, state } = toRefs(props)
|
const { conv, state } = toRefs(props)
|
||||||
const chatContainer = ref(null)
|
const chatContainer = ref(null)
|
||||||
@ -666,6 +670,22 @@ button:disabled {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
padding: 0.5rem 0.5rem;
|
||||||
|
|
||||||
|
.input-box {
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 0.5rem;
|
||||||
|
|
||||||
|
textarea.user-input {
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.note {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,10 +7,11 @@ import {
|
|||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
SettingFilled,
|
SettingFilled,
|
||||||
BookOutlined,
|
BookOutlined,
|
||||||
BookFilled
|
BookFilled,
|
||||||
|
GithubOutlined,
|
||||||
} from '@ant-design/icons-vue'
|
} from '@ant-design/icons-vue'
|
||||||
import { themeConfig } from '@/assets/theme'
|
import { themeConfig } from '@/assets/theme'
|
||||||
import { useConfigStore } from '@/stores/counter'
|
import { useConfigStore } from '@/stores/config'
|
||||||
|
|
||||||
const configStore = useConfigStore()
|
const configStore = useConfigStore()
|
||||||
|
|
||||||
@ -39,18 +40,26 @@ console.log(route)
|
|||||||
<div class="nav">
|
<div class="nav">
|
||||||
<RouterLink to="/chat" class="nav-item" active-class="active">
|
<RouterLink to="/chat" class="nav-item" active-class="active">
|
||||||
<component class="icon" :is="route.path === '/chat' ? MessageFilled : MessageOutlined" />
|
<component class="icon" :is="route.path === '/chat' ? MessageFilled : MessageOutlined" />
|
||||||
<span class="text">对话</span>
|
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<RouterLink to="/database" class="nav-item" active-class="active">
|
<RouterLink to="/database" class="nav-item" active-class="active">
|
||||||
<component class="icon" :is="route.path.startsWith('/database') ? BookFilled : BookOutlined" />
|
<component class="icon" :is="route.path.startsWith('/database') ? BookFilled : BookOutlined" />
|
||||||
<span class="text">知识</span>
|
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="fill" style="flex-grow: 1;"></div>
|
<div class="fill" style="flex-grow: 1;"></div>
|
||||||
|
<div class="github nav-item">
|
||||||
|
<a href="https://github.com/xerrors/ProjectAthena" target="_blank">
|
||||||
|
<GithubOutlined class="icon" style="color: #222;"/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<RouterLink class="nav-item setting" to="/setting" active-class="active">
|
<RouterLink class="nav-item setting" to="/setting" active-class="active">
|
||||||
<component class="icon" :is="route.path === '/setting' ? SettingFilled : SettingOutlined" />
|
<component class="icon" :is="route.path === '/setting' ? SettingFilled : SettingOutlined" />
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="header-mobile">
|
||||||
|
<RouterLink to="/chat" class="nav-item" active-class="active">对话</RouterLink>
|
||||||
|
<RouterLink to="/database" class="nav-item" active-class="active">知识</RouterLink>
|
||||||
|
<RouterLink to="/setting" class="nav-item" active-class="active">设置</RouterLink>
|
||||||
|
</div>
|
||||||
<a-config-provider :theme="themeConfig">
|
<a-config-provider :theme="themeConfig">
|
||||||
<router-view v-slot="{ Component }" id="app-router-view">
|
<router-view v-slot="{ Component }" id="app-router-view">
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
@ -70,6 +79,10 @@ console.log(route)
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
min-width: var(--min-width);
|
min-width: var(--min-width);
|
||||||
|
|
||||||
|
.header-mobile {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div.header, #app-router-view {
|
div.header, #app-router-view {
|
||||||
@ -112,6 +125,28 @@ div.header, #app-router-view {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-item {
|
||||||
|
padding: 8px 16px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: transparent;
|
||||||
|
color: #222;
|
||||||
|
font-size: 20px;
|
||||||
|
transition: background-color 0.2s ease-in-out;
|
||||||
|
margin: 0 10px;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--main-color);
|
||||||
|
background-color: var(--main-light-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--main-light-2);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.setting {
|
.setting {
|
||||||
width: auto;
|
width: auto;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
@ -132,95 +167,38 @@ div.header, #app-router-view {
|
|||||||
position: relative;
|
position: relative;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
|
|
||||||
.nav-item {
|
|
||||||
padding: 8px 16px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: transparent;
|
|
||||||
color: #222;
|
|
||||||
font-size: 20px;
|
|
||||||
transition: background-color 0.2s ease-in-out;
|
|
||||||
margin: 0 10px;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--main-color);
|
|
||||||
background-color: var(--main-light-2);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--main-light-2);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 520px) {
|
@media (max-width: 520px) {
|
||||||
.app-layout {
|
.app-layout {
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
|
|
||||||
|
div.header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-layout div.header {
|
.app-layout div.header-mobile {
|
||||||
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40px;
|
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
justify-content: space-between;
|
justify-content: space-around;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex: 0 0 60px;
|
flex: 0 0 60px;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
border-top: 1px solid var(--main-light-2);
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
display: none;
|
|
||||||
flex-shrink: 0;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting {
|
|
||||||
margin: 0;
|
|
||||||
width: 60px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.app-layout .nav {
|
|
||||||
flex-direction: row;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 0;
|
|
||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
width: 40px;
|
||||||
span.text {
|
color: var(--c-text-light-2);
|
||||||
display: block;
|
font-size: 1rem;
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
span.icon {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item:hover {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item.active {
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: transparent;
|
transition: color 0.1s ease-in-out, font-size 0.1s ease-in-out;
|
||||||
|
|
||||||
span.text {
|
&.active {
|
||||||
font-weight: bold;
|
color: black;
|
||||||
|
font-size: 1.1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -222,4 +222,13 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 520px) {
|
||||||
|
.conversations {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 101;
|
||||||
|
width: 300px;
|
||||||
|
border-radius: 0 16px 16px 0;
|
||||||
|
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<ReloadOutlined />需要重启
|
<ReloadOutlined />需要重启
|
||||||
</a-button>
|
</a-button>
|
||||||
</span>
|
</span>
|
||||||
<a-select ref="select" style="width: 220px"
|
<a-select ref="select" style="width: 160px"
|
||||||
:value="configStore.config?.model_provider"
|
:value="configStore.config?.model_provider"
|
||||||
@change="handleChange('model_provider', $event)"
|
@change="handleChange('model_provider', $event)"
|
||||||
>
|
>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<ReloadOutlined />需要重启
|
<ReloadOutlined />需要重启
|
||||||
</a-button>
|
</a-button>
|
||||||
</span>
|
</span>
|
||||||
<a-select style="width: 220px"
|
<a-select style="width: 160px"
|
||||||
:value="configStore.config?.embed_model"
|
:value="configStore.config?.embed_model"
|
||||||
@change="handleChange('embed_model', $event)"
|
@change="handleChange('embed_model', $event)"
|
||||||
>
|
>
|
||||||
@ -43,7 +43,7 @@
|
|||||||
<ReloadOutlined />需要重启
|
<ReloadOutlined />需要重启
|
||||||
</a-button>
|
</a-button>
|
||||||
</span>
|
</span>
|
||||||
<a-select style="width: 220px"
|
<a-select style="width: 160px"
|
||||||
:value="configStore.config?.reranker"
|
:value="configStore.config?.reranker"
|
||||||
@change="handleChange('reranker', $event)"
|
@change="handleChange('reranker', $event)"
|
||||||
>
|
>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
import { useConfigStore } from '@/stores/counter';
|
import { useConfigStore } from '@/stores/config';
|
||||||
import { ReloadOutlined } from '@ant-design/icons-vue';
|
import { ReloadOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
const configStore = useConfigStore()
|
const configStore = useConfigStore()
|
||||||
@ -113,13 +113,12 @@ const handleChange = (key, e) => {
|
|||||||
}
|
}
|
||||||
const sendRestart = () => {
|
const sendRestart = () => {
|
||||||
console.log('Restarting...')
|
console.log('Restarting...')
|
||||||
state.loading = true
|
message.loading({ content: '重新加载模型中', key: "restart", duration: 0 });
|
||||||
fetch('/api/restart', {
|
fetch('/api/restart', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.log('Restarted')
|
console.log('Restarted')
|
||||||
state.loading = false
|
message.success({ content: '重新加载完成!', key: "restart", duration: 2 });
|
||||||
message.success('重载成功')
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
@ -143,7 +142,7 @@ const sendRestart = () => {
|
|||||||
|
|
||||||
.section {
|
.section {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
background-color: #FAFCFD;
|
background-color: var(--main-light-4);
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user