mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-31 00:24:38 +00:00
fix: restrict batch image groups to gemini
This commit is contained in:
@@ -2314,6 +2314,7 @@ export default {
|
||||
batchHoldMultiplier: 'Batch hold price ratio',
|
||||
batchSectionHint: 'Batch image settings only apply to batch jobs: settlement applies the batch discount, and the upfront hold is normal image price × batch hold price ratio. Reference images also create upstream input-token usage, so a batch image discount above 0.5 is recommended.',
|
||||
batchDisabledHint: 'Enable image generation for this group before enabling batch image generation.',
|
||||
batchGeminiOnlyHint: 'Batch image generation is currently available only for Gemini groups.',
|
||||
modeHint: 'By default, image billing uses image price × current effective group multiplier. Independent mode uses image price × image multiplier.',
|
||||
finalPricePreview: 'Final per-image price preview',
|
||||
notConfigured: 'Not configured'
|
||||
|
||||
@@ -2396,6 +2396,7 @@ export default {
|
||||
batchHoldMultiplier: '批量冻结价格比例',
|
||||
batchSectionHint: '批量生图仅影响批量任务:结算价格会叠加批量折扣倍率,提交时冻结金额按普通生图原价 × 批量冻结价格比例计算。参考图也会产生上游输入 token 消耗,建议批量生图折扣倍率设置大于 0.5。',
|
||||
batchDisabledHint: '请先开启当前分组生图,才能开启批量生图。',
|
||||
batchGeminiOnlyHint: '批量生图当前仅支持 Gemini 分组。',
|
||||
modeHint: '默认关闭独立倍率时,图片费用 = 图片价格 × 当前分组有效倍率;开启独立倍率后,图片费用 = 图片价格 × 生图独立倍率。',
|
||||
finalPricePreview: '最终单张价格预览',
|
||||
notConfigured: '未配置'
|
||||
|
||||
@@ -889,25 +889,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 border-t border-dashed border-gray-200 pt-4 dark:border-dark-700">
|
||||
<div v-if="createForm.platform === 'gemini' && createForm.allow_image_generation" class="mt-4 border-t border-dashed border-gray-200 pt-4 dark:border-dark-700">
|
||||
<label
|
||||
class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
:class="!createForm.allow_image_generation ? 'cursor-not-allowed opacity-50' : ''"
|
||||
>
|
||||
<input
|
||||
v-model="createForm.allow_batch_image_generation"
|
||||
type="checkbox"
|
||||
:disabled="!createForm.allow_image_generation"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
||||
/>
|
||||
{{ t("admin.groups.imagePricing.allowBatchImageGeneration") }}
|
||||
</label>
|
||||
<p
|
||||
v-if="!createForm.allow_image_generation"
|
||||
class="mt-2 text-xs text-gray-500 dark:text-gray-400"
|
||||
>
|
||||
{{ t("admin.groups.imagePricing.batchDisabledHint") }}
|
||||
</p>
|
||||
<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ t("admin.groups.imagePricing.batchSectionHint") }}
|
||||
</p>
|
||||
@@ -943,6 +935,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p
|
||||
v-else-if="createForm.platform !== 'gemini'"
|
||||
class="mt-4 border-t border-dashed border-gray-200 pt-4 text-xs text-gray-500 dark:border-dark-700 dark:text-gray-400"
|
||||
>
|
||||
{{ t("admin.groups.imagePricing.batchGeminiOnlyHint") }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- 高峰时段倍率配置(仅订阅类型分组) -->
|
||||
@@ -2282,25 +2280,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 border-t border-dashed border-gray-200 pt-4 dark:border-dark-700">
|
||||
<div v-if="editForm.platform === 'gemini' && editForm.allow_image_generation" class="mt-4 border-t border-dashed border-gray-200 pt-4 dark:border-dark-700">
|
||||
<label
|
||||
class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
:class="!editForm.allow_image_generation ? 'cursor-not-allowed opacity-50' : ''"
|
||||
>
|
||||
<input
|
||||
v-model="editForm.allow_batch_image_generation"
|
||||
type="checkbox"
|
||||
:disabled="!editForm.allow_image_generation"
|
||||
class="rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
||||
/>
|
||||
{{ t("admin.groups.imagePricing.allowBatchImageGeneration") }}
|
||||
</label>
|
||||
<p
|
||||
v-if="!editForm.allow_image_generation"
|
||||
class="mt-2 text-xs text-gray-500 dark:text-gray-400"
|
||||
>
|
||||
{{ t("admin.groups.imagePricing.batchDisabledHint") }}
|
||||
</p>
|
||||
<p class="mt-2 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ t("admin.groups.imagePricing.batchSectionHint") }}
|
||||
</p>
|
||||
@@ -2336,6 +2326,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p
|
||||
v-else-if="editForm.platform !== 'gemini'"
|
||||
class="mt-4 border-t border-dashed border-gray-200 pt-4 text-xs text-gray-500 dark:border-dark-700 dark:text-gray-400"
|
||||
>
|
||||
{{ t("admin.groups.imagePricing.batchGeminiOnlyHint") }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- 高峰时段倍率配置(仅订阅类型分组) -->
|
||||
@@ -4036,6 +4032,7 @@ const editForm = reactive({
|
||||
});
|
||||
|
||||
type ImagePricingFormState = {
|
||||
platform: GroupPlatform;
|
||||
allow_image_generation: boolean;
|
||||
allow_batch_image_generation: boolean;
|
||||
rate_multiplier: number;
|
||||
@@ -4103,10 +4100,10 @@ const editImageFinalPricePreview = computed(() =>
|
||||
const resetDisabledBatchImagePricing = (
|
||||
form: Pick<
|
||||
ImagePricingFormState,
|
||||
"allow_image_generation" | "allow_batch_image_generation" | "batch_image_discount_multiplier" | "batch_image_hold_multiplier"
|
||||
"platform" | "allow_image_generation" | "allow_batch_image_generation" | "batch_image_discount_multiplier" | "batch_image_hold_multiplier"
|
||||
>,
|
||||
) => {
|
||||
if (!form.allow_image_generation) {
|
||||
if (form.platform !== "gemini" || !form.allow_image_generation) {
|
||||
form.allow_batch_image_generation = false;
|
||||
}
|
||||
if (!form.allow_batch_image_generation) {
|
||||
@@ -4683,6 +4680,7 @@ watch(
|
||||
createForm.require_oauth_only = false;
|
||||
createForm.require_privacy_set = false;
|
||||
}
|
||||
resetDisabledBatchImagePricing(createForm);
|
||||
resetModelsListState(createModelsListState);
|
||||
loadModelsListCandidates("create", 0, newVal);
|
||||
},
|
||||
@@ -4715,6 +4713,7 @@ watch(
|
||||
editForm.require_oauth_only = false;
|
||||
editForm.require_privacy_set = false;
|
||||
}
|
||||
resetDisabledBatchImagePricing(editForm);
|
||||
if (editingGroup.value) {
|
||||
resetModelsListState(editModelsListState, editForm.platform === editingGroup.value.platform ? editingGroup.value.models_list_config : undefined);
|
||||
loadModelsListCandidates("edit", editingGroup.value.id, newVal);
|
||||
|
||||
Reference in New Issue
Block a user