feat: 全球地图、暗黑模式适配、用户总数修复
This commit is contained in:
@@ -8,6 +8,14 @@ const { teams } = defineProps<{
|
||||
}>()
|
||||
|
||||
const activeTeam = ref<Team>(teams[0])
|
||||
|
||||
function getAssetUrl(path: string) {
|
||||
if (!path)
|
||||
return ''
|
||||
if (path.startsWith('http'))
|
||||
return path
|
||||
return `${import.meta.env.VITE_API_BASE || 'http://localhost:8080'}${path}`
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -15,13 +23,14 @@ const activeTeam = ref<Team>(teams[0])
|
||||
<UiSidebarMenuItem>
|
||||
<UiSidebarMenuButton size="lg" class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground">
|
||||
<div
|
||||
class="flex items-center justify-center rounded-lg aspect-square size-8 bg-sidebar-primary text-sidebar-primary-foreground"
|
||||
class="flex items-center justify-center rounded-lg aspect-square size-8 overflow-hidden"
|
||||
:class="typeof activeTeam.logo === 'string' && activeTeam.logo ? '' : 'bg-sidebar-primary text-sidebar-primary-foreground'"
|
||||
>
|
||||
<component :is="activeTeam.logo" v-if="activeTeam.logo" class="size-4" />
|
||||
<img v-if="typeof activeTeam.logo === 'string' && activeTeam.logo" :src="getAssetUrl(activeTeam.logo)" class="size-full object-contain" alt="" />
|
||||
<component v-else-if="typeof activeTeam.logo === 'function'" :is="activeTeam.logo" class="size-4" />
|
||||
</div>
|
||||
<div class="grid flex-1 text-sm leading-tight">
|
||||
<span class="font-semibold truncate">{{ activeTeam.name }}</span>
|
||||
<span class="text-xs truncate text-muted-foreground">{{ activeTeam.plan }}</span>
|
||||
</div>
|
||||
</UiSidebarMenuButton>
|
||||
</UiSidebarMenuItem>
|
||||
|
||||
@@ -32,8 +32,7 @@ export interface User {
|
||||
|
||||
export interface Team {
|
||||
name: string
|
||||
logo: NavIcon
|
||||
plan: string
|
||||
logo: NavIcon | string
|
||||
}
|
||||
|
||||
export interface SidebarData {
|
||||
|
||||
Reference in New Issue
Block a user