|
| 1 | +<script setup> |
| 2 | +import {Head, Link} from "@inertiajs/vue3"; |
| 3 | +import Card from 'primevue/card'; |
| 4 | +import Button from 'primevue/button'; |
| 5 | +import { capitalize } from 'vue'; |
| 6 | +
|
| 7 | +const props = defineProps({ |
| 8 | + overview: Object, |
| 9 | + badges: Object, |
| 10 | + fursuits: Object, |
| 11 | + fcea: Object, |
| 12 | + species: Object, |
| 13 | + users: Object, |
| 14 | + timeline: Object, |
| 15 | + currentEvent: String, |
| 16 | +}); |
| 17 | +
|
| 18 | +</script> |
| 19 | + |
| 20 | +<template> |
| 21 | + <Head> |
| 22 | + <title>Fursuit Statistics</title> |
| 23 | + </Head> |
| 24 | + |
| 25 | + <div class="p-4"> |
| 26 | + <!-- Header --> |
| 27 | + <div class="mb-6"> |
| 28 | + <Card class="shadow-lg border-0 bg-gradient-to-r from-green-600 to-green-700 text-white"> |
| 29 | + <template #content> |
| 30 | + <div class="p-6"> |
| 31 | + <div class="flex items-center justify-between"> |
| 32 | + <div> |
| 33 | + <h1 class="text-3xl font-bold mb-2">Fursuit Statistics</h1> |
| 34 | + <p class="text-green-100 text-lg"> |
| 35 | + Event: {{ currentEvent }} |
| 36 | + </p> |
| 37 | + </div> |
| 38 | + <div class="text-right"> |
| 39 | + <div class="text-6xl opacity-20"> |
| 40 | + <i class="pi pi-chart-bar"></i> |
| 41 | + </div> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + </template> |
| 46 | + </Card> |
| 47 | + </div> |
| 48 | + |
| 49 | + <!-- Overview Stats --> |
| 50 | + <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6"> |
| 51 | + <Card class="text-center"> |
| 52 | + <template #content> |
| 53 | + <div class="p-4"> |
| 54 | + <div class="text-2xl font-bold text-blue-600">{{ overview.total_users }}</div> |
| 55 | + <div class="text-sm text-gray-600">Total Users</div> |
| 56 | + </div> |
| 57 | + </template> |
| 58 | + </Card> |
| 59 | + |
| 60 | + <Card class="text-center"> |
| 61 | + <template #content> |
| 62 | + <div class="p-4"> |
| 63 | + <div class="text-2xl font-bold text-purple-600">{{ overview.total_badges }}</div> |
| 64 | + <div class="text-sm text-gray-600">Total Badges</div> |
| 65 | + </div> |
| 66 | + </template> |
| 67 | + </Card> |
| 68 | + |
| 69 | + <Card class="text-center"> |
| 70 | + <template #content> |
| 71 | + <div class="p-4"> |
| 72 | + <div class="text-2xl font-bold text-green-600">{{ overview.total_fursuits }}</div> |
| 73 | + <div class="text-sm text-gray-600">Total Fursuits</div> |
| 74 | + </div> |
| 75 | + </template> |
| 76 | + </Card> |
| 77 | + |
| 78 | + <Card class="text-center"> |
| 79 | + <template #content> |
| 80 | + <div class="p-4"> |
| 81 | + <div class="text-2xl font-bold text-orange-600">{{ overview.total_catches }}</div> |
| 82 | + <div class="text-sm text-gray-600">Total Catches</div> |
| 83 | + </div> |
| 84 | + </template> |
| 85 | + </Card> |
| 86 | + |
| 87 | + <Card class="text-center"> |
| 88 | + <template #content> |
| 89 | + <div class="p-4"> |
| 90 | + <div class="text-2xl font-bold text-red-600">{{ overview.total_events }}</div> |
| 91 | + <div class="text-sm text-gray-600">Total Events</div> |
| 92 | + </div> |
| 93 | + </template> |
| 94 | + </Card> |
| 95 | + |
| 96 | + <Card class="text-center"> |
| 97 | + <template #content> |
| 98 | + <div class="p-4"> |
| 99 | + <div class="text-2xl font-bold text-teal-600">{{ overview.current_event_badges }}</div> |
| 100 | + <div class="text-sm text-gray-600">Current Event Badges</div> |
| 101 | + </div> |
| 102 | + </template> |
| 103 | + </Card> |
| 104 | + |
| 105 | + <Card class="text-center"> |
| 106 | + <template #content> |
| 107 | + <div class="p-4"> |
| 108 | + <div class="text-2xl font-bold text-indigo-600">{{ overview.current_event_participants }}</div> |
| 109 | + <div class="text-sm text-gray-600">Current Event Participants</div> |
| 110 | + </div> |
| 111 | + </template> |
| 112 | + </Card> |
| 113 | + </div> |
| 114 | + |
| 115 | + <!-- Charts and Tables Row --> |
| 116 | + <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6"> |
| 117 | + <!-- Badges --> |
| 118 | + <Card> |
| 119 | + <template #title> |
| 120 | + <h3 class="text-lg font-semibold">Badges of {{ currentEvent }}</h3> |
| 121 | + </template> |
| 122 | + <template #content> |
| 123 | + <div class="space-y-3"> |
| 124 | + <div class="flex justify-between"> |
| 125 | + <span>Total Badges</span> |
| 126 | + <span class="font-semibold text-blue-600">{{ badges.total }}</span> |
| 127 | + </div> |
| 128 | + <div v-for="(value, key) in badges.by_state" class="flex justify-between"> |
| 129 | + <span>State: {{ capitalize(key) }}</span> |
| 130 | + <span class="font-semibold text-blue-600">{{ value }}</span> |
| 131 | + </div> |
| 132 | + <div class="flex justify-between"> |
| 133 | + <span>Double-Sided</span> |
| 134 | + <span class="font-semibold text-blue-600">{{ badges.upgrades.double_sided }}</span> |
| 135 | + </div> |
| 136 | + <div class="flex justify-between"> |
| 137 | + <span>Spare Copies</span> |
| 138 | + <span class="font-semibold text-blue-600">{{ badges.upgrades.spare_copies }}</span> |
| 139 | + </div> |
| 140 | + </div> |
| 141 | + </template> |
| 142 | + </Card> |
| 143 | + |
| 144 | + <!-- Fursuits --> |
| 145 | + <Card> |
| 146 | + <template #title> |
| 147 | + <h3 class="text-lg font-semibold">Fursuits of {{ currentEvent }}</h3> |
| 148 | + </template> |
| 149 | + <template #content> |
| 150 | + <div class="space-y-3"> |
| 151 | + <div class="flex justify-between"> |
| 152 | + <span>Total Fursuits</span> |
| 153 | + <span class="font-semibold text-purple-600">{{ fursuits.total }}</span> |
| 154 | + </div> |
| 155 | + <div class="flex justify-between"> |
| 156 | + <span>Unique Fursuits</span> |
| 157 | + <span class="font-semibold text-purple-600">{{ fursuits.unique_fursuiters }}</span> |
| 158 | + </div> |
| 159 | + <div v-for="(value, key) in fursuits.by_state" class="flex justify-between"> |
| 160 | + <span>State: {{ capitalize(key) }}</span> |
| 161 | + <span class="font-semibold text-purple-600">{{ value }}</span> |
| 162 | + </div> |
| 163 | + <div class="flex justify-between"> |
| 164 | + <span>Published Fursuits</span> |
| 165 | + <span class="font-semibold text-purple-600">{{ fursuits.published }}</span> |
| 166 | + </div> |
| 167 | + <div class="flex justify-between"> |
| 168 | + <span>Catch-Em-All Fursuits</span> |
| 169 | + <span class="font-semibold text-purple-600">{{ fursuits.catch_em_all_enabled }}</span> |
| 170 | + </div> |
| 171 | + <div class="flex justify-between"> |
| 172 | + <span>Approval Rate</span> |
| 173 | + <span class="font-semibold text-purple-600">{{ fursuits.approval_rate }}%</span> |
| 174 | + </div> |
| 175 | + <div v-for="(value, key) in fursuits.top_owners" class="flex justify-between"> |
| 176 | + <span>#{{ key + 1 }} Most Fursuit Owner: {{ value.name }}</span> |
| 177 | + <span class="font-semibold text-red-600">{{ value.fursuits_count }}</span> |
| 178 | + </div> |
| 179 | + </div> |
| 180 | + </template> |
| 181 | + </Card> |
| 182 | + |
| 183 | + <!-- fcea --> |
| 184 | + <Card> |
| 185 | + <template #title> |
| 186 | + <h3 class="text-lg font-semibold">Catch-Em-All of {{ currentEvent }}</h3> |
| 187 | + </template> |
| 188 | + <template #content> |
| 189 | + <div class="space-y-3"> |
| 190 | + <div class="flex justify-between"> |
| 191 | + <span>Total Catches</span> |
| 192 | + <span class="font-semibold text-orange-600">{{ fcea.total_catches }}</span> |
| 193 | + </div> |
| 194 | + <div class="flex justify-between"> |
| 195 | + <span>Total Players</span> |
| 196 | + <span class="font-semibold text-orange-600">{{ fcea.total_players }}</span> |
| 197 | + </div> |
| 198 | + <div class="flex justify-between"> |
| 199 | + <span>Catchable Fursuits</span> |
| 200 | + <span class="font-semibold text-orange-600">{{ fcea.catchable_fursuits }}</span> |
| 201 | + </div> |
| 202 | + <div class="flex justify-between"> |
| 203 | + <span>Average Catches per Player</span> |
| 204 | + <span class="font-semibold text-orange-600">{{ fcea.average_catches_per_player }}</span> |
| 205 | + </div> |
| 206 | + <div class="flex justify-between"> |
| 207 | + <span>Most Active Day</span> |
| 208 | + <span class="font-semibold text-orange-600">{{ fcea.most_active_day }}</span> |
| 209 | + </div> |
| 210 | + <div v-for="(value, key) in fcea.top_catchers" class="flex justify-between"> |
| 211 | + <span>#{{ key + 1 }} Top Catcher: {{ value.name }} </span> |
| 212 | + <span class="font-semibold text-purple-600">{{ value.catches }}</span> |
| 213 | + </div> |
| 214 | + <div v-for="(value, key) in fcea.most_caught_fursuits" class="flex justify-between"> |
| 215 | + <span>#{{ key + 1 }} Most Caught Fursuit: {{ value.name }} {{ value.species }} of {{ value.owner }} </span> |
| 216 | + <span class="font-semibold text-blue-600">{{ value.catches }}</span> |
| 217 | + </div> |
| 218 | + <div class="flex justify-between"> |
| 219 | + <span>Average Completion</span> |
| 220 | + <span class="font-semibold text-orange-600">{{ fcea.completion_stats.average_completion }}</span> |
| 221 | + </div> |
| 222 | + <div class="flex justify-between"> |
| 223 | + <span>Average Completion</span> |
| 224 | + <span class="font-semibold text-orange-600">{{ fcea.completion_stats.median_completion }}</span> |
| 225 | + </div> |
| 226 | + <div class="flex justify-between"> |
| 227 | + <span>Players with 100% compleation</span> |
| 228 | + <span class="font-semibold text-orange-600">{{ fcea.completion_stats.players_with_100_percent }}</span> |
| 229 | + </div> |
| 230 | + <div class="flex justify-between"> |
| 231 | + <span>Players with 50%</span> |
| 232 | + <span class="font-semibold text-orange-600">{{ fcea.completion_stats.players_with_50_percent }}</span> |
| 233 | + </div> |
| 234 | + </div> |
| 235 | + </template> |
| 236 | + </Card> |
| 237 | + |
| 238 | + <!-- species --> |
| 239 | + <Card> |
| 240 | + <template #title> |
| 241 | + <h3 class="text-lg font-semibold">Species of {{ currentEvent }}</h3> |
| 242 | + </template> |
| 243 | + <template #content> |
| 244 | + <div class="space-y-3"> |
| 245 | + <div class="flex justify-between"> |
| 246 | + <span>Total Species</span> |
| 247 | + <span class="font-semibold text-teal-600">{{ species.total }}</span> |
| 248 | + </div> |
| 249 | + <div v-for="(value, key) in species.most_popular" class="flex justify-between"> |
| 250 | + <span>#{{ key + 1 }} Species: {{ value.name }}</span> |
| 251 | + <span class="font-semibold text-blue-600">Fursuits: {{ value.fursuits_count }}<br>Badges: {{ value.badges_count }}</span> |
| 252 | + </div> |
| 253 | + </div> |
| 254 | + </template> |
| 255 | + </Card> |
| 256 | + |
| 257 | + <!-- Users --> |
| 258 | + <Card> |
| 259 | + <template #title> |
| 260 | + <h3 class="text-lg font-semibold">Users of {{ currentEvent }}</h3> |
| 261 | + </template> |
| 262 | + <template #content> |
| 263 | + <div class="space-y-3"> |
| 264 | + <div class="flex justify-between"> |
| 265 | + <span>Total Users</span> |
| 266 | + <span class="font-semibold text-green-600">{{ users.total }}</span> |
| 267 | + </div> |
| 268 | + <div class="flex justify-between"> |
| 269 | + <span>Participating in current Event</span> |
| 270 | + <span class="font-semibold text-green-600">{{ users.participating_in_current_event }}</span> |
| 271 | + </div> |
| 272 | + <div class="flex justify-between"> |
| 273 | + <span>Average Badges per User</span> |
| 274 | + <span class="font-semibold text-green-600">{{ users.average_badges_per_user }}</span> |
| 275 | + </div> |
| 276 | + <div class="flex justify-between"> |
| 277 | + <span>New Users this Month</span> |
| 278 | + <span class="font-semibold text-green-600">{{ users.new_users_this_month }}</span> |
| 279 | + </div> |
| 280 | + <div v-for="(value, key) in users.most_active_users" class="flex justify-between"> |
| 281 | + <span>#{{ key + 1 }} Most Badges: {{ value.name }}</span> |
| 282 | + <span class="font-semibold text-blue-600">{{ value.badges }}</span> |
| 283 | + </div> |
| 284 | + </div> |
| 285 | + </template> |
| 286 | + </Card> |
| 287 | + |
| 288 | + <!-- Timeline --> |
| 289 | + <Card> |
| 290 | + <template #title> |
| 291 | + <h3 class="text-lg font-semibold">Timeline of {{ currentEvent }}</h3> |
| 292 | + </template> |
| 293 | + <template #content> |
| 294 | + <div class="space-y-3"> |
| 295 | + <div v-for="(value, key) in timeline.daily_catches" class="flex justify-between"> |
| 296 | + <span>#{{ key + 1 }} Daily Catches: {{ value.date }}</span> |
| 297 | + <span class="font-semibold text-teal-600">{{ value.catches }}</span> |
| 298 | + </div> |
| 299 | + <div class="flex justify-between"> |
| 300 | + <span>Peak Hour</span> |
| 301 | + <span class="font-semibold text-red-600">{{ timeline.peak_activity.peak_hour }}</span> |
| 302 | + </div> |
| 303 | + <div class="flex justify-between"> |
| 304 | + <span>Peak Day</span> |
| 305 | + <span class="font-semibold text-red-600">{{ timeline.peak_activity.peak_day }}</span> |
| 306 | + </div> |
| 307 | + </div> |
| 308 | + </template> |
| 309 | + </Card> |
| 310 | + </div> |
| 311 | + |
| 312 | + <!-- Back Button --> |
| 313 | + <div class="mt-6 flex justify-center"> |
| 314 | + <Link :href="route('gallery.index')"> |
| 315 | + <Button |
| 316 | + label="Back to Gallery" |
| 317 | + icon="pi pi-arrow-left" |
| 318 | + severity="secondary" |
| 319 | + /> |
| 320 | + </Link> |
| 321 | + </div> |
| 322 | + </div> |
| 323 | +</template> |
0 commit comments