77
88 <td
99 :class =" getHeaderClass('totalMinutes')"
10- @click =" setSort('totalMinutes')"
11- >
10+ @click =" setSort('totalMinutes')" >
1211 Total Time
1312 </td >
1413
1514 <td
1615 v-if =" !isMobile"
1716 :class =" getHeaderClass('topLanguage')"
18- @click =" setSort('topLanguage')"
19- >
17+ @click =" setSort('topLanguage')" >
2018 Top Language
2119 </td >
2220
2321 <td
2422 v-if =" !isMobile"
2523 :class =" getHeaderClass('topEditor')"
26- @click =" setSort('topEditor')"
27- >
24+ @click =" setSort('topEditor')" >
2825 Top Editor
2926 </td >
3027
3128 <td
3229 v-if =" !isMobile"
3330 :class =" getHeaderClass('topOS')"
34- @click =" setSort('topOS')"
35- >
31+ @click =" setSort('topOS')" >
3632 Top OS
3733 </td >
3834 </tr >
3935 </thead >
4036 <tbody >
4137 <tr v-for =" user in sortedLeaderboard" :key =" user.userId" class =" row" >
4238 <td class =" userid" >{{ user.userId }}</td >
43- <td :class =" getCellClass('totalMinutes')" >{{ formatMinutes(user.totalMinutes) }}</td >
44- <td v-if =" !isMobile" :class =" getCellClass('topLanguage')" >{{ user.topLanguage || "Unknown" }}</td >
45- <td v-if =" !isMobile" :class =" getCellClass('topEditor')" >{{ user.topEditor || "Unknown" }}</td >
46- <td v-if =" !isMobile" :class =" getCellClass('topOS')" >{{ user.topOS || "Unknown" }}</td >
39+ <td :class =" getCellClass('totalMinutes')" >
40+ {{ formatMinutes(user.totalMinutes) }}
41+ </td >
42+ <td v-if =" !isMobile" :class =" getCellClass('topLanguage')" >
43+ {{ user.topLanguage || "Unknown" }}
44+ </td >
45+ <td v-if =" !isMobile" :class =" getCellClass('topEditor')" >
46+ {{ user.topEditor || "Unknown" }}
47+ </td >
48+ <td v-if =" !isMobile" :class =" getCellClass('topOS')" >
49+ {{ user.topOS || "Unknown" }}
50+ </td >
4751 </tr >
4852 </tbody >
4953 </table >
5054 </NuxtLayout >
5155</template >
5256
53-
5457<script setup lang="ts">
55- import { Key } from " @waradu/keyboard" ;
5658import { ref , onMounted , onUnmounted } from " vue" ;
5759
5860interface LeaderboardUser {
@@ -63,8 +65,9 @@ interface LeaderboardUser {
6365 topOS? : string ;
6466}
6567
66- const { data : leaderboard } =
67- await useFetch <LeaderboardUser []>(" /api/public/leaderboard" );
68+ const { data : leaderboard } = await useFetch <LeaderboardUser []>(
69+ " /api/public/leaderboard"
70+ );
6871
6972const isMobile = ref (false );
7073
@@ -128,17 +131,17 @@ function formatMinutes(minutes: number): string {
128131 return ` ${h }h ${m }m ` ;
129132}
130133
131- useKeybind (
132- [ Key . Alt , Key . L ],
133- async () => {
134+ useKeybind ({
135+ keys: [ " alt_l " ],
136+ run() {
134137 try {
135138 window .location .href = " /api/auth/logout" ;
136139 } catch (e : any ) {
137140 useToast ().error (e .data ?.message || " Logout failed" );
138141 }
139142 },
140- { prevent: true , ignoreIfEditable: true }
141- );
143+ config: { prevent: true , ignoreIfEditable: true },
144+ } );
142145
143146useSeoMeta ({
144147 title: " Ziit - Leaderboard" ,
0 commit comments