|
|
|
@ -30,7 +30,12 @@
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<el-table v-loading="loading" :data="usageRecordList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table v-loading="loading" :data="usageRecordList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table-column label="调用时间" align="center" prop="createTime" />
|
|
|
|
<el-table-column label="调用时间" align="center" prop="createTime" />
|
|
|
|
<el-table-column label="调用ID" align="center" prop="secretKey" />
|
|
|
|
<el-table-column label="调用KEY" align="center" prop="secretKey" />
|
|
|
|
|
|
|
|
<el-table-column label="KEY备注" align="center" prop="secretKey" >
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
|
|
<el-tag class="ml-2" type="success">{{ getRemark(scope.row.secretKey) }}</el-tag>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="模型" align="center" prop="model" />
|
|
|
|
<el-table-column label="模型" align="center" prop="model" />
|
|
|
|
<el-table-column label="prompt" align="center" prop="promptTokens" />
|
|
|
|
<el-table-column label="prompt" align="center" prop="promptTokens" />
|
|
|
|
<el-table-column label="completion" align="center" prop="completionTokens" />
|
|
|
|
<el-table-column label="completion" align="center" prop="completionTokens" />
|
|
|
|
@ -55,11 +60,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script setup name="usage">
|
|
|
|
<script setup name="usage">
|
|
|
|
import { currentUserListUsageRecord } from "@/api/cert/usageRecord";
|
|
|
|
import { currentUserListUsageRecord } from "@/api/cert/usageRecord";
|
|
|
|
import { getUserProfile } from "@/api/system/user";
|
|
|
|
import { getKeyList } from "@/api/cert/apiToken";
|
|
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
|
|
|
|
|
|
const usageRecordList = ref([]);
|
|
|
|
const usageRecordList = ref([]);
|
|
|
|
|
|
|
|
const keyList = ref([]);
|
|
|
|
const loading = ref(true);
|
|
|
|
const loading = ref(true);
|
|
|
|
const total = ref(0);
|
|
|
|
const total = ref(0);
|
|
|
|
|
|
|
|
|
|
|
|
@ -76,9 +82,20 @@ const data = reactive({
|
|
|
|
|
|
|
|
|
|
|
|
const { queryParams } = toRefs(data);
|
|
|
|
const { queryParams } = toRefs(data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getRemark(key) {
|
|
|
|
|
|
|
|
for(let i=0;i<keyList.value.length;i++) {
|
|
|
|
|
|
|
|
if('AK-'+keyList.value[i].id == key) {
|
|
|
|
|
|
|
|
return keyList.value[i].remark;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** 查询使用记录列表 */
|
|
|
|
/** 查询使用记录列表 */
|
|
|
|
function getList() {
|
|
|
|
function getList() {
|
|
|
|
loading.value = true;
|
|
|
|
loading.value = true;
|
|
|
|
|
|
|
|
getKeyList().then(response => {
|
|
|
|
|
|
|
|
keyList.value = response.data
|
|
|
|
|
|
|
|
})
|
|
|
|
currentUserListUsageRecord(queryParams.value).then(response => {
|
|
|
|
currentUserListUsageRecord(queryParams.value).then(response => {
|
|
|
|
usageRecordList.value = response.rows;
|
|
|
|
usageRecordList.value = response.rows;
|
|
|
|
total.value = response.total;
|
|
|
|
total.value = response.total;
|
|
|
|
|