refactor: 提取正则工具模块并清理废弃代码

前端:
- 新增 model-mapping-regex.ts 工具模块,统一正则验证和 LRU 缓存
- ModelMappingsTab/RoutingTab 重构为使用 computed 缓存匹配结果
- 移除多个组件中未使用的变量和函数
- 添加 HTMLImageElement/HTMLIFrameElement 到 ESLint 全局类型
- 修复 vitest 需要 --experimental-require-module 的问题

后端:
- 移除废弃的异步数据库支持 (get_async_db, AsyncSession)
- 将 async_utils 从 database/ 迁移到 utils/
- 改进 database.py 类型标注
- 修复 email 模块的 aiosmtplib 可选导入类型问题
This commit is contained in:
fawney19
2026-01-15 17:03:19 +08:00
parent bc16c0eec8
commit a223819dd7
25 changed files with 526 additions and 688 deletions
-1
View File
@@ -479,7 +479,6 @@ const filters = ref({
})
const filtersDaysString = ref('7')
const filtersLimitString = ref('50')
const currentPage = ref(1)
const pageSize = ref(20)
+1 -1
View File
@@ -808,7 +808,7 @@
</template>
<script setup lang="ts">
import { ref, computed, onMounted, watch } from 'vue'
import { ref, computed, onMounted } from 'vue'
import { Download, Upload } from 'lucide-vue-next'
import Button from '@/components/ui/button.vue'
import Input from '@/components/ui/input.vue'
-5
View File
@@ -868,11 +868,6 @@ function formatNumber(value?: number | null): string {
return numericValue.toLocaleString()
}
function formatCurrency(value?: number | null, fractionDigits = 4): string {
const numericValue = typeof value === 'number' && Number.isFinite(value) ? value : 0
return numericValue.toFixed(fractionDigits)
}
async function toggleUserStatus(user: any) {
const action = user.is_active ? '禁用' : '启用'
const confirmed = await confirmDanger(