mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
perf: Model language
This commit is contained in:
@@ -8,11 +8,16 @@ import LOGO_fold from '@/assets/LOGO-fold.svg'
|
||||
import icon_moments_categories_outlined from '@/assets/svg/icon_moments-categories_outlined.svg'
|
||||
import icon_side_fold_outlined from '@/assets/svg/icon_side-fold_outlined.svg'
|
||||
import icon_side_expand_outlined from '@/assets/svg/icon_side-expand_outlined.svg'
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
const collapse = ref(false)
|
||||
|
||||
const handleFoldExpand = () => {
|
||||
collapse.value = !collapse.value
|
||||
}
|
||||
const toWorkspace = () => {
|
||||
router.push('/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -23,7 +28,7 @@ const handleFoldExpand = () => {
|
||||
<Workspace :collapse="collapse"></Workspace>
|
||||
<Menu :collapse="collapse"></Menu>
|
||||
<div class="bottom">
|
||||
<div class="back-to_workspace">
|
||||
<div class="back-to_workspace" @click="toWorkspace">
|
||||
<el-icon size="16">
|
||||
<icon_moments_categories_outlined></icon_moments_categories_outlined>
|
||||
</el-icon>
|
||||
@@ -85,7 +90,12 @@ const handleFoldExpand = () => {
|
||||
border-radius: 6px;
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: #1f23291a;
|
||||
}
|
||||
&:active {
|
||||
background-color: #1f232926;
|
||||
}
|
||||
.ed-icon {
|
||||
margin-right: 4.95px;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,10 @@
|
||||
"text": "文本",
|
||||
"number": "数值",
|
||||
"parameter_type": "参数类型",
|
||||
"verification_successful": "校验成功"
|
||||
"verification_successful": "校验成功",
|
||||
"del_default_tip": "无法删除模型: {msg}",
|
||||
"del_default_warn": "该模型为系统默认模型,请先设置其他模型为系统默认模型,再删除此模型。",
|
||||
"del_warn_tip": "是否删除模型: {msg}?"
|
||||
},
|
||||
"chat": {
|
||||
"chart_type": {
|
||||
@@ -231,4 +234,4 @@
|
||||
"back_community": "还原至社区版",
|
||||
"confirm_tips": "确定还原至社区版?"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ const handleDefaultModelChange = (item: any) => {
|
||||
if (current_default_node?.id === item.id) {
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(`是否设置 ${item.name} 为系统默认模型?`, {
|
||||
ElMessageBox.confirm(t('model.system_default_model', { msg: item.name }), {
|
||||
confirmButtonType: 'primary',
|
||||
tip: '系统默认模型被替换后,智能问数的结果将会受到影响,请谨慎操作。',
|
||||
tip: t('model.operate_with_caution'),
|
||||
confirmButtonText: t('datasource.confirm'),
|
||||
cancelButtonText: t('common.cancel'),
|
||||
customClass: 'confirm-no_icon',
|
||||
@@ -83,7 +83,7 @@ const handleDefaultModelChange = (item: any) => {
|
||||
callback: (val: string) => {
|
||||
if (val === 'confirm') {
|
||||
modelApi.setDefault(item.id).then(() => {
|
||||
ElMessage.success('设置成功')
|
||||
ElMessage.success(t('model.set_successfully'))
|
||||
search()
|
||||
})
|
||||
}
|
||||
@@ -114,12 +114,12 @@ const handleEditModel = (id: any) => {
|
||||
|
||||
const deleteHandler = (item: any) => {
|
||||
if (item.default_model) {
|
||||
ElMessageBox.confirm(`无法删除模型:${item.name}?`, {
|
||||
ElMessageBox.confirm(t('model.del_default_tip', { msg: item.name }), {
|
||||
confirmButtonType: 'primary',
|
||||
tip: '该模型为系统默认模型,请先设置其他模型为系统默认模型,再删除此模型。',
|
||||
tip: t('model.del_default_warn'),
|
||||
showConfirmButton: false,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '知道了',
|
||||
confirmButtonText: t('datasource.confirm'),
|
||||
cancelButtonText: t('datasource.got_it'),
|
||||
customClass: 'confirm-no_icon',
|
||||
autofocus: false,
|
||||
callback: (val: string) => {
|
||||
@@ -128,10 +128,10 @@ const deleteHandler = (item: any) => {
|
||||
})
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(`是否删除模型:${item.name}?`, {
|
||||
ElMessageBox.confirm(t('model.del_warn_tip', { msg: item.name }), {
|
||||
confirmButtonType: 'danger',
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: t('dashboard.delete'),
|
||||
cancelButtonText: t('common.cancel'),
|
||||
customClass: 'confirm-no_icon',
|
||||
autofocus: false,
|
||||
callback: (value: string) => {
|
||||
@@ -139,7 +139,7 @@ const deleteHandler = (item: any) => {
|
||||
modelApi.delete(item.id).then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
message: t('dashboard.delete_success'),
|
||||
})
|
||||
search()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user