fix: 移除1m模型限制和配套的apikey功能

This commit is contained in:
shaw
2026-03-14 12:04:22 +08:00
parent 5c0a1fc276
commit 48c14f4e1b
8 changed files with 3 additions and 128 deletions

View File

@@ -322,32 +322,6 @@
</div>
</div>
<!-- 允许 1M 上下文 -->
<div>
<div class="mb-3 flex items-center gap-4">
<label class="text-sm font-semibold text-gray-700 dark:text-gray-300"
>允许 1M 上下文</label
>
<div class="flex gap-4">
<label class="flex cursor-pointer items-center">
<input v-model="form.allow1mContext" class="mr-2" type="radio" :value="true" />
<span class="text-sm text-gray-700 dark:text-gray-300">启用</span>
</label>
<label class="flex cursor-pointer items-center">
<input v-model="form.allow1mContext" class="mr-2" type="radio" :value="false" />
<span class="text-sm text-gray-700 dark:text-gray-300">禁用</span>
</label>
<label class="flex cursor-pointer items-center">
<input v-model="form.allow1mContext" class="mr-2" type="radio" :value="null" />
<span class="text-sm text-gray-700 dark:text-gray-300">不修改</span>
</label>
</div>
</div>
<p class="ml-0 text-xs text-gray-500 dark:text-gray-400">
启用后允许使用 [1m] 模型需要 Bedrock 账户支持
</p>
</div>
<!-- 服务权限 -->
<div>
<label class="mb-3 block text-sm font-semibold text-gray-700 dark:text-gray-300"
@@ -583,8 +557,7 @@ const form = reactive({
bedrockAccountId: '',
droidAccountId: '',
tags: [],
isActive: null, // null表示不修改
allow1mContext: null // null表示不修改
isActive: null // null表示不修改
})
const UNCHANGED_OPTION_VALUE = '__KEEP_ORIGINAL__'
@@ -869,11 +842,6 @@ const batchUpdateApiKeys = async () => {
updates.isActive = form.isActive
}
// 1M 上下文
if (form.allow1mContext !== null) {
updates.allow1mContext = form.allow1mContext
}
// 标签处理
if (tagOperation.value !== 'none') {
updates.tags = form.tags

View File

@@ -938,27 +938,6 @@
</div>
</div>
<!-- 允许 1M 上下文 -->
<div>
<div class="mb-2 flex items-center">
<input
id="allow1mContext"
v-model="form.allow1mContext"
class="h-4 w-4 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-blue-500"
type="checkbox"
/>
<label
class="ml-2 cursor-pointer text-sm font-semibold text-gray-700 dark:text-gray-300"
for="allow1mContext"
>
允许 1M 上下文
</label>
</div>
<p class="ml-6 text-xs text-gray-500 dark:text-gray-400">
启用后允许使用 [1m] 模型需要 Bedrock 账户支持
</p>
</div>
<div class="flex gap-3 pt-2">
<button
class="flex-1 rounded-lg bg-gray-100 px-4 py-2.5 text-sm font-semibold text-gray-700 transition-colors hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"
@@ -1135,7 +1114,6 @@ const form = reactive({
modelInput: '',
enableClientRestriction: false,
allowedClients: [],
allow1mContext: false,
tags: []
})
@@ -1564,8 +1542,7 @@ const createApiKey = async () => {
enableModelRestriction: form.enableModelRestriction,
restrictedModels: form.restrictedModels,
enableClientRestriction: form.enableClientRestriction,
allowedClients: form.allowedClients,
allow1mContext: form.allow1mContext
allowedClients: form.allowedClients
}
// 处理Claude账户绑定区分OAuth和Console

View File

@@ -776,27 +776,6 @@
</div>
</div>
<!-- 允许 1M 上下文 -->
<div>
<div class="mb-2 flex items-center">
<input
id="editAllow1mContext"
v-model="form.allow1mContext"
class="h-4 w-4 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700"
type="checkbox"
/>
<label
class="ml-2 cursor-pointer text-sm font-semibold text-gray-700 dark:text-gray-300"
for="editAllow1mContext"
>
允许 1M 上下文
</label>
</div>
<p class="ml-6 text-xs text-gray-500 dark:text-gray-400">
启用后允许使用 [1m] 模型需要 Bedrock 账户支持
</p>
</div>
<div class="flex gap-3 pt-4">
<button
class="flex-1 rounded-xl bg-gray-100 px-6 py-3 font-semibold text-gray-700 transition-colors hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"
@@ -969,7 +948,6 @@ const form = reactive({
modelInput: '',
enableClientRestriction: false,
allowedClients: [],
allow1mContext: false,
tags: [],
isActive: true,
ownerId: '' // 新增所有者ID
@@ -1153,9 +1131,6 @@ const updateApiKey = async () => {
data.enableClientRestriction = form.enableClientRestriction
data.allowedClients = form.allowedClients
// 1M 上下文
data.allow1mContext = form.allow1mContext
// 活跃状态
data.isActive = form.isActive
@@ -1473,8 +1448,6 @@ onMounted(async () => {
props.apiKey.enableModelRestriction === true || props.apiKey.enableModelRestriction === 'true'
form.enableClientRestriction =
props.apiKey.enableClientRestriction === true || props.apiKey.enableClientRestriction === 'true'
form.allow1mContext =
props.apiKey.allow1mContext === true || props.apiKey.allow1mContext === 'true'
// 初始化活跃状态,默认为 true强制转换为布尔值因为Redis返回字符串
form.isActive =
props.apiKey.isActive === undefined ||