Browse Source

Merge branch 'master' of https://gitee.com/godoos/godoos

master
godo 5 months ago
parent
commit
882f2e3eb2
  1. 6
      frontend/src/assets/chat.scss
  2. 3
      frontend/src/components/localchat/AiChatMain.vue
  3. 151
      frontend/src/components/setting/SetSystem.vue
  4. 28
      frontend/src/components/setting/setStyle.css

6
frontend/src/assets/chat.scss

@ -108,11 +108,9 @@
@media screen and (max-width: 768px) {
.chat-bot{
.input-area{
padding: 0;
.file-btn{
margin-left: vw(-20);
}
.websearch-btn{
margin-left: vw(-5);
margin-left: vw(-10);
}
}
}

3
frontend/src/components/localchat/AiChatMain.vue

@ -7,6 +7,7 @@ import { ElScrollbar } from "element-plus";
import { getSystemConfig } from "@/system/config";
import { Vue3Lottie } from "vue3-lottie";
import { file } from "jszip";
import { isMobileDevice } from "@/util/device";
const chatStore = useAiChatStore();
const modelStore = useModelStore();
const isPadding = ref(false); //
@ -242,7 +243,7 @@ const uploadImage = async (event: any) => {
</el-col>
<el-col :span="17">
<el-input v-model="userMessage" :placeholder="t('aichat.askme')" size="large" clearable
@keydown="handleKeydown" autofocus class="ai-input-area" />
@keydown="handleKeydown" :autofocus="isMobileDevice() ? false : true" class="ai-input-area" />
</el-col>
<el-col :span="2">
<el-button v-if="!isPadding" @click="sendMessage" icon="Promotion" type="info" size="large" circle />

151
frontend/src/components/setting/SetSystem.vue

@ -2,87 +2,54 @@
<div class="container">
<div class="nav">
<ul>
<li
v-for="(item, index) in items"
:key="index"
@click="selectItem(index)"
:class="{ active: index === activeIndex }"
>
<li v-for="(item, index) in items" :key="index" @click="selectItem(index)"
:class="{ active: index === activeIndex }">
{{ item }}
</li>
</ul>
</div>
<div class="setting">
<div v-if="1 === activeIndex">
<div
class="setting-item"
style="margin-top: 60px"
>
<div class="setting-item" style="margin-top: 60px">
<label>存储方式</label>
<el-select v-model="config.storeType">
<el-option
v-for="(item, key) in storeList"
:key="key"
:label="item.title"
:value="item.value"
/>
<el-option v-for="(item, key) in storeList" :key="key" :label="item.title"
:value="item.value" />
</el-select>
</div>
<template v-if="config.storeType === 'local'">
<div class="setting-item">
<label>存储地址</label>
<el-input
v-model="config.storePath"
@click="selectFile()"
placeholder="可为空,为空则取系统默认存储地址:/用户目录/.godoos/os"
/>
<el-input v-model="config.storePath" @click="selectFile()"
placeholder="可为空,为空则取系统默认存储地址:/用户目录/.godoos/os" />
</div>
<div class="setting-item">
<label>自定义端口</label>
<el-input
v-model="config.netPort"
placeholder="可为空,为空则取系统默认56780"
/>
<el-input v-model="config.netPort" placeholder="可为空,为空则取系统默认56780" />
</div>
<div class="setting-item">
<label>自定义路径</label>
<el-input
v-model="config.netPath"
placeholder="自定义web访问路径,英文,不要加斜杠,可为空"
/>
<el-input v-model="config.netPath" placeholder="自定义web访问路径,英文,不要加斜杠,可为空" />
</div>
</template>
<template v-if="config.storeType === 'net'">
<div class="setting-item">
<label>服务器地址</label>
<el-input
v-model="config.storenet.url"
placeholder="可访问的地址,例如http://192.168.1.6:56780 不要加斜杠"
/>
<el-input v-model="config.storenet.url" placeholder="可访问的地址,例如http://192.168.1.6:56780 不要加斜杠" />
</div>
<div class="setting-item">
<label>允许跨域</label>
<el-switch
v-model="config.storenet.isCors"
active-text="允许"
inactive-text="不允许"
style="
<el-switch v-model="config.storenet.isCors" active-text="允许" inactive-text="不允许" style="
--el-switch-on-color: #13ce66;
--el-switch-off-color: #ff4949;
"
active-value="1"
inactive-value=""
/>
" active-value="1" inactive-value="" />
</div>
</template>
<template v-if="config.storeType === 'webdav'">
<div class="setting-item">
<label>服务器地址</label>
<el-input
v-model="config.webdavClient.url"
placeholder="https://godoos.com/webdav 不要加斜杠"
/>
<el-input v-model="config.webdavClient.url" placeholder="https://godoos.com/webdav 不要加斜杠" />
</div>
<div class="setting-item">
<label>登陆用户名</label>
@ -90,46 +57,30 @@
</div>
<div class="setting-item">
<label>登陆密码</label>
<el-input
v-model="config.webdavClient.password"
type="password"
/>
<el-input v-model="config.webdavClient.password" type="password" />
</div>
</template>
<div class="setting-item">
<label></label>
<el-button
@click="submitOsInfo"
type="primary"
>
<el-button @click="submitOsInfo" type="primary">
{{ t("confirm") }}
</el-button>
</div>
</div>
<div v-if="2 === activeIndex">
<div
class="setting-item"
style="margin-top: 60px"
>
<div class="setting-item" style="margin-top: 60px">
<label>编辑器类型</label>
<el-select v-model="config.editorType">
<el-option
v-for="(item, key) in editorType"
:key="key"
:label="item.title"
:value="item.value"
/>
<el-option v-for="(item, key) in editorType" :key="key" :label="item.title"
:value="item.value" />
</el-select>
</div>
<template v-if="config.editorType === 'onlyoffice'">
<div class="setting-item">
<label>地址</label>
<el-input
v-model="config.onlyoffice.url"
placeholder="https://godoos.com/onlyoffice 不要加斜杠"
/>
<el-input v-model="config.onlyoffice.url" placeholder="https://godoos.com/onlyoffice 不要加斜杠" />
</div>
<!-- <div class="setting-item">
<label>私钥</label>
@ -138,10 +89,7 @@
</template>
<div class="setting-item">
<label></label>
<el-button
@click="submitEditInfo"
type="primary"
>
<el-button @click="submitEditInfo" type="primary">
{{ t("confirm") }}
</el-button>
</div>
@ -152,10 +100,7 @@
</div>
<div class="setting-item">
<label></label>
<el-button
@click="exportBackup"
type="primary"
>
<el-button @click="exportBackup" type="primary">
导出
</el-button>
</div>
@ -164,73 +109,42 @@
</div>
<div class="setting-item">
<label></label>
<el-button
@click="selectZipfile"
type="primary"
>
<el-button @click="selectZipfile" type="primary">
导入
</el-button>
<input
type="file"
accept=".zip"
style="display: none"
ref="zipFileInput"
/>
<input type="file" accept=".zip" style="display: none" ref="zipFileInput" />
</div>
</div>
<div v-if="0 === activeIndex">
<div
class="setting-item"
style="margin-top: 60px"
>
<div class="setting-item" style="margin-top: 60px">
<label>用户角色</label>
<el-select v-model="config.userType">
<el-option
v-for="(item, key) in userTypes"
:key="key"
:label="item.title"
:value="item.value"
/>
<el-option v-for="(item, key) in userTypes" :key="key" :label="item.title"
:value="item.value" />
</el-select>
</div>
<template v-if="config.userType === 'member'">
<div class="setting-item">
<label>服务器地址</label>
<el-input
v-model="config.userInfo.url"
placeholder="网址或域名,例子:https://godoos.com 不要加斜杠"
/>
<el-input v-model="config.userInfo.url" placeholder="网址或域名,例子:https://godoos.com 不要加斜杠" />
</div>
<div class="setting-item">
<label>用户名</label>
<el-input
v-model="config.userInfo.username"
placeholder="登录用户名"
/>
<el-input v-model="config.userInfo.username" placeholder="登录用户名" />
</div>
<div class="setting-item">
<label>密码</label>
<el-input
v-model="config.userInfo.password"
type="password"
placeholder="登录密码"
/>
<el-input v-model="config.userInfo.password" type="password" placeholder="登录密码" />
</div>
</template>
<div class="setting-item">
<label></label>
<el-button
@click="saveUserInfo"
type="primary"
>
<el-button @click="saveUserInfo" type="primary">
{{ t("confirm") }}
</el-button>
</div>
</div>
<div
v-if="4 === activeIndex"
class="setting-area"
>
<div v-if="4 === activeIndex" class="setting-area">
<SetFilePwd v-if="config.userType === 'person'"></SetFilePwd>
</div>
</div>
@ -277,6 +191,9 @@
"备份还原",
"文件密码箱",
];
if (config.value.userType !== "person") {
items.pop()
}
const editorType = [
{
title: "系统默认",

28
frontend/src/components/setting/setStyle.css

@ -74,8 +74,34 @@
text-align: right;
}
@media screen and (max-width: 768px) {
.container {
flex-direction: column;
}
.nav {
width: 25%;
background-color: #f9f9f9;
width: 100%;
}
.nav ul {
display: flex;
justify-content: space-evenly;
}
.nav li {
flex: 1;
padding: 10px 0;
text-align: center;
}
.nav li.active {
background-color: #fff;
}
.nav li.active:hover {
background-color: #fff;
}
.nav li.active::after {
background-color: #80bbe9;
}
.setting {
margin-top: 20px;
box-sizing: border-box;
}
.setting-item:first-child {
margin-top: 0px !important;

Loading…
Cancel
Save