chatGPT部分完成
This commit is contained in:
@@ -13,10 +13,10 @@
|
||||
<el-form-item label="API KEY">
|
||||
<el-input v-model="settings.model.apiKey" clearable @change="v=>settings.model.setApiKey(v),getModelAccount()"/>
|
||||
</el-form-item>
|
||||
<el-button type="text" @click="getModelAccount">刷新账号信息</el-button>
|
||||
<el-row>
|
||||
<el-form-item label="账号用户" class="fill color-999">{{ account.username }}</el-form-item>
|
||||
<el-form-item label="账户余额" class="fill color-999">{{ [account.usage, account.total].join(" / ") }}</el-form-item>
|
||||
<el-row v-loading="loadingAccount" element-loading-background="#272A37">
|
||||
<el-form-item label="账号用户" class="fill">{{ account.username }}</el-form-item>
|
||||
<el-form-item label="账户余额" class="fill">{{ [account.usage, account.total].join(" / ") }}</el-form-item>
|
||||
<el-button type="text" @click="getModelAccount">刷新</el-button>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</section>
|
||||
@@ -26,7 +26,6 @@
|
||||
import AiModel from "../ui/AiModel";
|
||||
import AiSelect from "../ui/AiSelect";
|
||||
import * as models from "../utils/models";
|
||||
import {scopy} from "../utils/tools";
|
||||
|
||||
|
||||
export default {
|
||||
@@ -38,14 +37,15 @@ export default {
|
||||
emits: ["update:modelValue"],
|
||||
data() {
|
||||
return {
|
||||
settings: {}
|
||||
settings: {},
|
||||
loadingAccount: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue: {
|
||||
immediate: true,
|
||||
handler(v) {
|
||||
this.settings = scopy(v)
|
||||
this.settings = v
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -55,8 +55,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getModelAccount() {
|
||||
console.log(this.settings.model)
|
||||
this.settings.model.getAccount?.().then(v => this.settings.account = v)
|
||||
const ai = this.settings.model
|
||||
if (ai.getAccount) {
|
||||
this.loadingAccount = true
|
||||
ai.getAccount().then(v => this.settings.account = v).finally(() => this.loadingAccount = false)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -70,6 +73,10 @@ export default {
|
||||
|
||||
:deep(.el-form) {
|
||||
.el-form-item__label {
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user