mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
Merge branch 'main' of github.com:maxkb-dev/maxkb
This commit is contained in:
commit
724f1cc7c5
|
|
@ -41,8 +41,13 @@
|
|||
<div class="flex-between w-full">
|
||||
<el-input class="code-input" v-model="resetPasswordForm.code" placeholder="请输入验证码">
|
||||
</el-input>
|
||||
<el-button class="send-email-button ml-8" @click="sendEmail" :loading="loading"
|
||||
>获取验证码</el-button
|
||||
<el-button
|
||||
:disabled="isDisabled"
|
||||
class="send-email-button ml-8"
|
||||
@click="sendEmail"
|
||||
:loading="loading"
|
||||
>
|
||||
{{ isDisabled ? `重新发送(${time}s)` : '获取验证码' }}</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
|
@ -77,6 +82,8 @@ const resetPasswordForm = ref<ResetCurrentUserPasswordRequest>({
|
|||
const resetPasswordFormRef = ref<FormInstance>()
|
||||
|
||||
const loading = ref<boolean>(false)
|
||||
const isDisabled = ref<boolean>(false)
|
||||
const time = ref<number>(60)
|
||||
|
||||
const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
|
||||
code: [{ required: true, message: '请输入验证码' }],
|
||||
|
|
@ -123,9 +130,23 @@ const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
|
|||
const sendEmail = () => {
|
||||
UserApi.sendEmailToCurrent(loading).then(() => {
|
||||
MsgSuccess('发送验证码成功')
|
||||
isDisabled.value = true
|
||||
handleTimeChange()
|
||||
})
|
||||
}
|
||||
|
||||
const handleTimeChange = () => {
|
||||
if (time.value <= 0) {
|
||||
isDisabled.value = false
|
||||
time.value = 60
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
time.value--
|
||||
handleTimeChange()
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
const open = () => {
|
||||
resetPasswordForm.value = {
|
||||
code: '',
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
{{ datetimeFormat(row.create_time) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="80">
|
||||
<el-table-column label="操作" align="left" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<el-button type="primary" text @click="deleteApiKey(row)">
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
type="textarea"
|
||||
placeholder="描述该应用的应用场景及用途,如:MaxKB 小助手回答用户提出的 MaxKB 产品使用问题"
|
||||
:rows="3"
|
||||
maxlength="500"
|
||||
maxlength="256"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -109,6 +109,7 @@
|
|||
v-model="applicationForm.model_setting.prompt"
|
||||
:rows="6"
|
||||
type="textarea"
|
||||
maxlength="2048"
|
||||
:placeholder="defaultPrompt"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
v-model="form.desc"
|
||||
type="textarea"
|
||||
placeholder="描述知识库的内容,详尽的描述将帮助AI能深入理解该知识库的内容,能更准确的检索到内容,提高该知识库的命中率。"
|
||||
maxlength="500"
|
||||
maxlength="256"
|
||||
show-word-limit
|
||||
:autosize="{ minRows: 3 }"
|
||||
@blur="form.desc = form.desc.trim()"
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
|
||||
<el-button type="primary" @click="submit" :loading="loading"> 确定 </el-button>
|
||||
<el-button type="primary" @click="submit(webFormRef)" :loading="loading"> 确定 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
|
@ -42,6 +42,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import documentApi from '@/api/document'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
|
||||
|
|
@ -51,6 +52,7 @@ const {
|
|||
} = route as any
|
||||
|
||||
const emit = defineEmits(['refresh'])
|
||||
const webFormRef = ref()
|
||||
const loading = ref<boolean>(false)
|
||||
const isImport = ref<boolean>(false)
|
||||
const form = ref<any>({
|
||||
|
|
@ -86,27 +88,34 @@ const open = (row: any) => {
|
|||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const submit = () => {
|
||||
if (isImport.value) {
|
||||
const obj = {
|
||||
source_url_list: form.value.source_url.split('\n'),
|
||||
selector: form.value.selector
|
||||
const submit = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
await formEl.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
if (isImport.value) {
|
||||
const obj = {
|
||||
source_url_list: form.value.source_url.split('\n'),
|
||||
selector: form.value.selector
|
||||
}
|
||||
documentApi.postWebDocument(id, obj, loading).then((res: any) => {
|
||||
MsgSuccess('导入成功')
|
||||
emit('refresh')
|
||||
dialogVisible.value = false
|
||||
})
|
||||
} else {
|
||||
const obj = {
|
||||
meta: form.value
|
||||
}
|
||||
documentApi.putDocument(id, documentId.value, obj, loading).then((res) => {
|
||||
MsgSuccess('设置成功')
|
||||
emit('refresh')
|
||||
dialogVisible.value = false
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!', fields)
|
||||
}
|
||||
documentApi.postWebDocument(id, obj, loading).then((res: any) => {
|
||||
MsgSuccess('导入成功')
|
||||
emit('refresh')
|
||||
dialogVisible.value = false
|
||||
})
|
||||
} else {
|
||||
const obj = {
|
||||
meta: form.value
|
||||
}
|
||||
documentApi.putDocument(id, documentId.value, obj, loading).then((res) => {
|
||||
MsgSuccess('设置成功')
|
||||
emit('refresh')
|
||||
dialogVisible.value = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
{{ datetimeFormat(row.update_time) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<el-table-column label="操作" align="left">
|
||||
<template #default="{ row }">
|
||||
<div v-if="datasetDetail.type === '0'">
|
||||
<span v-if="row.status === '2'" class="mr-4">
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<template #icon>
|
||||
<AppAvatar :name="index + 1 + ''" class="mr-12 avatar-light" :size="22" />
|
||||
</template>
|
||||
<div class="active-button primary">{{ item.similarity.toFixed(3) }}</div>
|
||||
<div class="active-button primary">{{ item.similarity?.toFixed(3) }}</div>
|
||||
<template #footer>
|
||||
<div class="footer-content flex-between">
|
||||
<el-text>
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="mb-16">
|
||||
<div class="title mb-8">返回分段数 Top</div>
|
||||
<div class="title mb-8">返回分段数 TOP</div>
|
||||
|
||||
<el-input-number
|
||||
v-model="cloneForm.top_number"
|
||||
|
|
@ -226,8 +226,9 @@ function getHitTestList() {
|
|||
|
||||
function refresh(data: any) {
|
||||
if (data) {
|
||||
const index = paragraphDetail.value.findIndex((v) => v.id === data.id)
|
||||
paragraphDetail.value.splice(index, 1, data)
|
||||
const obj = paragraphDetail.value.filter((v) => v.id === data.id)[0]
|
||||
obj.content = data.content
|
||||
obj.title = data.title
|
||||
} else {
|
||||
paragraphDetail.value = []
|
||||
getHitTestList()
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@
|
|||
<el-table-column prop="chat_record_count" label="对话提问数" align="right" />
|
||||
<el-table-column prop="star_num" align="right">
|
||||
<template #header>
|
||||
<div class="flex align-center">
|
||||
<div>
|
||||
<span>用户反馈</span>
|
||||
<el-popover :width="160" trigger="click" :visible="popoverVisible">
|
||||
<el-popover :width="190" trigger="click" :visible="popoverVisible">
|
||||
<template #reference>
|
||||
<el-button
|
||||
style="margin-top: -2px;"
|
||||
style="margin-top: -2px"
|
||||
:type="filter.min_star || filter.min_trample ? 'primary' : ''"
|
||||
link
|
||||
@click="popoverVisible = !popoverVisible"
|
||||
|
|
@ -55,8 +55,9 @@
|
|||
:min="0"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
style="width: 70px"
|
||||
style="width: 100px"
|
||||
size="small"
|
||||
step-strictly
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -68,8 +69,9 @@
|
|||
:min="0"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
style="width: 70px"
|
||||
style="width: 100px"
|
||||
size="small"
|
||||
step-strictly
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -102,7 +104,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="70" align="center">
|
||||
<el-table-column label="操作" width="70" align="left">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<el-button type="primary" text @click.stop="deleteLog(row)">
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ const sendEmail = () => {
|
|||
if (v) {
|
||||
UserApi.sendEmit(CheckEmailForm.value.email, 'reset_password', loading).then(() => {
|
||||
MsgSuccess('发送验证码成功')
|
||||
isDisabled.value = true
|
||||
handleTimeChange()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue