Add nano pro (#286)

This commit is contained in:
Germey authored and GitHub committed 2025-11-23 03:26:01 +08:00
1 parent e1d4d4522d
commit 11dbe26ae0
24 files changed
+430 -47

No files matched your search

+4 -1
View File
@@ -1,6 +1,7 @@
<template>
<div class="flex flex-col h-full">
<div class="flex-1 overflow-y-auto p-[15px]">
<model-selector class="mb-4" />
<action-selector class="mb-4" />
<prompt-input class="mb-4" />
<aspect-ratio-selector v-if="config?.action === 'generate'" class="mb-4" />
@@ -26,6 +27,7 @@ import ImageUrlsInput from './config/ImageUrlsInput.vue';
import AspectRatioSelector from './config/AspectRatioSelector.vue';
import Consumption from '../common/Consumption.vue';
import { getConsumption } from '@/utils';
import ModelSelector from './config/ModelSelector.vue';
export default defineComponent({
name: 'ConfigPanel',
@@ -36,7 +38,8 @@ export default defineComponent({
Consumption,
ActionSelector,
ImageUrlsInput,
AspectRatioSelector
AspectRatioSelector,
ModelSelector
},
emits: ['generate'],
computed: {
@@ -0,0 +1,73 @@
<template>
<div class="field">
<h2 class="title font-bold">{{ $t('nanobanana.name.model') }}</h2>
<el-select v-model="value" class="value" :placeholder="$t('nanobanana.placeholder.select')">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ElSelect, ElOption } from 'element-plus';
import { NANOBANANA_DEFAULT_MODEL, NANOBANANA_MODEL_NANO_BANANA, NANOBANANA_MODEL_NANO_BANANA_PRO } from '@/constants';
export default defineComponent({
name: 'NanobananaModelSelector',
components: {
ElSelect,
ElOption
},
data() {
return {
options: [
{
value: NANOBANANA_MODEL_NANO_BANANA,
label: this.$t('nanobanana.model.nanoBanana')
},
{
value: NANOBANANA_MODEL_NANO_BANANA_PRO,
label: this.$t('nanobanana.model.nanoBananaPro')
}
]
};
},
computed: {
value: {
get() {
return this.$store.state.nanobanana?.config?.model;
},
set(val: string) {
this.$store.commit('nanobanana/setConfig', {
...this.$store.state.nanobanana?.config,
model: val
});
}
}
},
mounted() {
if (!this.value) {
this.value = NANOBANANA_DEFAULT_MODEL;
}
}
});
</script>
<style lang="scss" scoped>
.field {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.title {
font-size: 14px;
margin: 0;
width: 30%;
}
.value {
width: 160px;
}
}
</style>