fix select key
This commit is contained in:
@@ -11,7 +11,7 @@ if (import.meta.env.DEV) { // Vite 的方式判断开发环境
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: baseURL,
|
||||
timeout: 5000,
|
||||
timeout: 6000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
|
||||
@@ -12,17 +12,6 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div v-if="error" role="alert" class="alert shadow-lg bg-rose-100">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
<div>
|
||||
<span>Error! {{ error }}</span>
|
||||
</div>
|
||||
<button class="btn btn-sm" @click="error = null">X</button>
|
||||
</div>
|
||||
|
||||
<div class="card border border-base-300/40 shadow-sm">
|
||||
<form @submit.prevent="createApiKey" class="card-body space-y-5 p-3 sm:p-8">
|
||||
<div class="space-y-4">
|
||||
@@ -147,7 +136,7 @@
|
||||
<!-- <textarea id="support_models" v-model="newApiKey.support_models_text"
|
||||
placeholder='["model1", "model2"]' class="textarea textarea-sm textarea-bordered w-full"></textarea> -->
|
||||
<el-input-tag v-model="newApiKey.support_models_array" :trigger="'Enter'" clearable
|
||||
placeholder="Please input" @change="onchange_supportmodel"/>
|
||||
placeholder="Please input" @change="onchange_supportmodel" />
|
||||
</div>
|
||||
|
||||
<div class="form-control">
|
||||
@@ -165,10 +154,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="error" role="alert" class="alert shadow-lg bg-rose-100">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current" fill="none"
|
||||
viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
<div>
|
||||
<span>{{ error }}</span>
|
||||
</div>
|
||||
<button class="btn btn-sm" @click="error = null">X</button>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end pt-4 items-center gap-2">
|
||||
<button @click="cancel" class="btn btn-sm btn-outline">Cancel</button>
|
||||
<button type="submit" class="btn btn-outline btn-sm px-4 text-sm font-medium btn-success" :disabled="!isFormValid">
|
||||
<button type="submit" class="btn btn-outline btn-sm px-4 text-sm font-medium btn-success"
|
||||
:disabled="!isFormValid">
|
||||
Create
|
||||
</button>
|
||||
</div>
|
||||
@@ -249,7 +251,7 @@ const apiKeyImageMap = {
|
||||
'gemini': '/assets/gemini.svg',
|
||||
'azure': '/assets/azure.svg',
|
||||
'github': '/assets/github.svg'
|
||||
|
||||
|
||||
};
|
||||
|
||||
const apiKeyImageUrl = (keytype) => {
|
||||
@@ -261,7 +263,7 @@ const createApiKey = async () => {
|
||||
setToast('Please fill in all required fields (Name, Type, API Key).', 'error')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
try {
|
||||
if (!Array.isArray(newApiKey.value.support_models_array)) {
|
||||
|
||||
Reference in New Issue
Block a user