chore: show img_calls num for user profile page

This commit is contained in:
RockYang 2023-08-17 07:09:53 +08:00
parent b78d5b3d03
commit 75ab8552d9
3 changed files with 9 additions and 4 deletions

View File

@ -222,6 +222,7 @@ type userProfile struct {
Avatar string `json:"avatar"`
ChatConfig types.ChatConfig `json:"chat_config"`
Calls int `json:"calls"`
ImgCalls int `json:"img_calls"`
Tokens int64 `json:"tokens"`
}

View File

@ -55,9 +55,12 @@
<el-slider v-model="form.chat_config.temperature" :max="2" :step="0.1"/>
<div class="tip">值越大 AI 回答越发散值越小回答越保守建议保持默认值</div>
</el-form-item>
<el-form-item label="剩余调用次数">
<el-form-item label="剩余对话次数">
<el-tag>{{ form['calls'] }}</el-tag>
</el-form-item>
<el-form-item label="剩余绘图次数">
<el-tag>{{ form['img_calls'] }}</el-tag>
</el-form-item>
<el-form-item label="消耗 Tokens">
<el-tag type="info">{{ form['tokens'] }}</el-tag>
</el-form-item>
@ -81,7 +84,7 @@
<script setup>
import {computed, onMounted, reactive, ref} from "vue"
import {computed, onMounted, ref} from "vue"
import {httpGet, httpPost} from "@/utils/http";
import {ElMessage} from "element-plus";
import {Plus} from "@element-plus/icons-vue";

View File

@ -15,7 +15,8 @@
<el-table-column prop="username" label="用户名"/>
<el-table-column prop="mobile" label="手机号"/>
<el-table-column prop="nickname" label="昵称"/>
<el-table-column prop="calls" label="提问次数" width="100"/>
<el-table-column prop="calls" label="对话次数" width="100"/>
<el-table-column prop="img_calls" label="绘图次数" width="100"/>
<el-table-column label="状态" width="80">
<template #default="scope">
<el-tag v-if="scope.row.status" type="success">正常</el-tag>
@ -79,7 +80,7 @@
<el-form-item label="手机号:" prop="mobile">
<el-input v-model="user.mobile" autocomplete="off"/>
</el-form-item>
<el-form-item label="提问次数:" prop="calls">
<el-form-item label="对话次数:" prop="calls">
<el-input v-model.number="user.calls" autocomplete="off" placeholder="0"/>
</el-form-item>
<el-form-item label="绘图次数:" prop="img_calls">