Feat: show online count

This commit is contained in:
Lazy 2024-04-18 16:49:21 +08:00
parent 9546e4c27d
commit 9774caa316
2 changed files with 5 additions and 2 deletions

View File

@ -235,7 +235,10 @@ defineExpose({
</el-table-column>
<el-table-column prop="role" label="在线状态" width="90">
<template #default="scope">
<el-tag v-if="scope.row.isOnline" type="success"> 在线 </el-tag>
<el-tooltip v-if="scope.row.onlineCount > 0" content="在线设备数" placement="left">
<el-tag type="success"> 在线 ({{ scope.row.onlineCount }}) </el-tag>
</el-tooltip>
<el-tag v-else type="error"> 离线 </el-tag>
</template>
</el-table-column>

View File

@ -194,7 +194,7 @@ export const userListApi = useDefineApi<
username: string;
role: ROLE;
joinAt: number;
isOnline: boolean;
onlineCount: number;
roomId: string;
permissions: number;
adminPermissions: number;