feat: 账号列表显示所属分组
- Account模型新增Groups虚拟字段 - 账号列表API预加载Group信息 - 账号管理页面新增分组列,使用GroupBadge展示
This commit is contained in:
@@ -666,6 +666,7 @@ export default {
|
||||
status: 'Status',
|
||||
schedulable: 'Schedule',
|
||||
todayStats: "Today's Stats",
|
||||
groups: 'Groups',
|
||||
usageWindows: 'Usage Windows',
|
||||
priority: 'Priority',
|
||||
lastUsed: 'Last Used',
|
||||
|
||||
@@ -721,6 +721,9 @@ export default {
|
||||
weight: '权重',
|
||||
status: '状态',
|
||||
schedulable: '调度',
|
||||
todayStats: '今日统计',
|
||||
groups: '分组',
|
||||
usageWindows: '用量窗口',
|
||||
lastUsed: '最近使用',
|
||||
actions: '操作',
|
||||
},
|
||||
|
||||
@@ -324,6 +324,7 @@ export interface Account {
|
||||
updated_at: string;
|
||||
proxy?: Proxy;
|
||||
group_ids?: number[]; // Groups this account belongs to
|
||||
groups?: Group[]; // Preloaded group objects
|
||||
|
||||
// Rate limit & scheduling fields
|
||||
schedulable: boolean;
|
||||
|
||||
@@ -123,6 +123,21 @@
|
||||
<AccountTodayStatsCell :account="row" />
|
||||
</template>
|
||||
|
||||
<template #cell-groups="{ row }">
|
||||
<div v-if="row.groups && row.groups.length > 0" class="flex flex-wrap gap-1.5">
|
||||
<GroupBadge
|
||||
v-for="group in row.groups"
|
||||
:key="group.id"
|
||||
:name="group.name"
|
||||
:platform="group.platform"
|
||||
:subscription-type="group.subscription_type"
|
||||
:rate-multiplier="group.rate_multiplier"
|
||||
:show-rate="false"
|
||||
/>
|
||||
</div>
|
||||
<span v-else class="text-sm text-gray-400 dark:text-dark-500">-</span>
|
||||
</template>
|
||||
|
||||
<template #cell-usage="{ row }">
|
||||
<AccountUsageCell :account="row" />
|
||||
</template>
|
||||
@@ -301,6 +316,7 @@ import AccountStatusIndicator from '@/components/account/AccountStatusIndicator.
|
||||
import AccountUsageCell from '@/components/account/AccountUsageCell.vue'
|
||||
import AccountTodayStatsCell from '@/components/account/AccountTodayStatsCell.vue'
|
||||
import AccountTestModal from '@/components/account/AccountTestModal.vue'
|
||||
import GroupBadge from '@/components/common/GroupBadge.vue'
|
||||
import { formatRelativeTime } from '@/utils/format'
|
||||
|
||||
const { t } = useI18n()
|
||||
@@ -314,6 +330,7 @@ const columns = computed<Column[]>(() => [
|
||||
{ key: 'status', label: t('admin.accounts.columns.status'), sortable: true },
|
||||
{ key: 'schedulable', label: t('admin.accounts.columns.schedulable'), sortable: true },
|
||||
{ key: 'today_stats', label: t('admin.accounts.columns.todayStats'), sortable: false },
|
||||
{ key: 'groups', label: t('admin.accounts.columns.groups'), sortable: false },
|
||||
{ key: 'usage', label: t('admin.accounts.columns.usageWindows'), sortable: false },
|
||||
{ key: 'priority', label: t('admin.accounts.columns.priority'), sortable: true },
|
||||
{ key: 'last_used_at', label: t('admin.accounts.columns.lastUsed'), sortable: true },
|
||||
|
||||
Reference in New Issue
Block a user