1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-06-21 13:54:07 +08:00

feat: 添加 RunAPI 支持的 AI 翻译功能及相关样式

This commit is contained in:
zclzone
2026-06-17 17:23:30 +08:00
parent 23eb592269
commit 3a09be229b
2 changed files with 93 additions and 0 deletions

View File

@@ -16,6 +16,9 @@
> [!Tip] > [!Tip]
> 我们提供WebPC+H5+小程序)的技术支持服务及定制开发,不限前后端,详细需求可联系作者,微信: isme-admin邮箱: admin@isme.top > 我们提供WebPC+H5+小程序)的技术支持服务及定制开发,不限前后端,详细需求可联系作者,微信: isme-admin邮箱: admin@isme.top
> [!Tip]
> 项目内置 AI 翻译功能,体验模型由 [RunAPI](https://runapi.co/register?aff=Da0v) 提供支持。如需稳定、快速、实惠的中转模型 API 服务可前往注册使用RunAPI 为本项目的用户提供了特别福利,通过此链接注册并联系客服可领取 ¥14 免费额度。
## 简介 ## 简介
Vue Naive Admin 是一款极简风格的后台管理模板,包含前后端解决方案,前端使用 Vite + Vue3 + Pinia + Unocss后端使用 Nestjs + TypeOrm + MySql简单易用赏心悦目历经十几次重构和细节打磨诚意满满 Vue Naive Admin 是一款极简风格的后台管理模板,包含前后端解决方案,前端使用 Vite + Vue3 + Pinia + Unocss后端使用 Nestjs + TypeOrm + MySql简单易用赏心悦目历经十几次重构和细节打磨诚意满满
@@ -83,6 +86,8 @@ npx degit zclzone/vue-naive-admin
本项目开发测试及运行环境由 [野草云](https://my.yecaoyun.com/aff.php?aff=3162) 提供支持。 本项目开发测试及运行环境由 [野草云](https://my.yecaoyun.com/aff.php?aff=3162) 提供支持。
本项目 AI 翻译体验模型由 [RunAPI](https://runapi.co/register?aff=Da0v) 提供支持。
## 版权说明 ## 版权说明
本项目使用 `MIT协议`,默认授权给任何人,被授权人可免费地无限制的使用、复制、修改、合并、发布、发行、再许可、售卖本软件拷贝、并有权向被供应人授予同等的权利,但必须满足以下条件: 本项目使用 `MIT协议`,默认授权给任何人,被授权人可免费地无限制的使用、复制、修改、合并、发布、发行、再许可、售卖本软件拷贝、并有权向被供应人授予同等的权利,但必须满足以下条件:

View File

@@ -20,6 +20,7 @@ const resultText = ref('')
const errorText = ref('') const errorText = ref('')
const loading = ref(false) const loading = ref(false)
const showSettings = ref(false) const showSettings = ref(false)
const runApiUrl = 'https://runapi.co/register?aff=Da0v'
const settings = useStorage(STORE_KEY, { ...DEFAULT_SETTINGS }) const settings = useStorage(STORE_KEY, { ...DEFAULT_SETTINGS })
const draftSettings = reactive({ ...settings.value }) const draftSettings = reactive({ ...settings.value })
@@ -138,6 +139,18 @@ async function handleCopy() {
</div> </div>
<div class="flex items-center gap-10"> <div class="flex items-center gap-10">
<a
v-if="isUsingExperienceKey"
class="runapi-badge"
:href="runApiUrl"
target="_blank"
rel="noopener noreferrer"
title="打开 RunAPI"
>
<i class="i-fe:zap" />
<span>默认体验模型由中转站平台 RunAPI 提供支持</span>
<i class="i-fe:external-link" />
</a>
<n-button quaternary circle title="模型配置" @click="openSettings"> <n-button quaternary circle title="模型配置" @click="openSettings">
<template #icon> <template #icon>
<i class="i-fe:settings" /> <i class="i-fe:settings" />
@@ -227,6 +240,14 @@ async function handleCopy() {
当前是体验 Key所有人每天共享使用约 1000 次翻译单次最多支持 {{ EXPERIENCE_KEY_MAX_TEXT_LENGTH }} 字符 当前是体验 Key所有人每天共享使用约 1000 次翻译单次最多支持 {{ EXPERIENCE_KEY_MAX_TEXT_LENGTH }} 字符
</n-alert> </n-alert>
<a class="runapi-card" :href="runApiUrl" target="_blank" rel="noopener noreferrer">
<span class="min-w-0 flex-1">
<strong>默认体验模型由中转站平台 RunAPI 提供支持</strong>
<span>点击获取稳定快速且实惠的模型 API 服务</span>
</span>
<i class="i-fe:external-link" />
</a>
<div> <div>
<div class="mb-8 text-13 text-#5f6665"> <div class="mb-8 text-13 text-#5f6665">
API Key API Key
@@ -321,6 +342,69 @@ async function handleCopy() {
font-size: 20px; font-size: 20px;
} }
.runapi-badge {
height: 34px;
display: inline-flex;
align-items: center;
gap: 8px;
padding: 0 12px;
border: 1px solid rgba(var(--primary-color), 0.22);
border-radius: 8px;
color: rgb(var(--primary-color));
background: rgba(var(--primary-color), 0.08);
text-decoration: none;
font-size: 13px;
font-weight: 600;
white-space: nowrap;
transition:
background 0.2s ease,
border-color 0.2s ease;
}
.runapi-badge:hover {
border-color: rgba(var(--primary-color), 0.38);
background: rgba(var(--primary-color), 0.13);
}
.runapi-card {
display: flex;
align-items: center;
gap: 12px;
padding: 14px;
border: 1px solid rgba(var(--primary-color), 0.18);
border-radius: 8px;
color: #1f2322;
background: linear-gradient(135deg, rgba(var(--primary-color), 0.1), rgba(255, 255, 255, 0.9));
text-decoration: none;
}
.runapi-card strong,
.runapi-card span span {
display: block;
}
.runapi-card strong {
color: rgb(var(--primary-color));
font-size: 14px;
}
.runapi-card span span {
margin-top: 4px;
color: #7a807f;
font-size: 12px;
}
.runapi-card-icon {
width: 34px;
height: 34px;
display: grid;
place-items: center;
flex: none;
border-radius: 8px;
color: rgb(var(--primary-color));
background: rgba(var(--primary-color), 0.12);
}
.translate-workspace { .translate-workspace {
min-height: 0; min-height: 0;
display: grid; display: grid;
@@ -431,5 +515,9 @@ async function handleCopy() {
.translate-workspace { .translate-workspace {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.runapi-badge {
white-space: normal;
}
} }
</style> </style>