@@ -6,7 +6,7 @@ import { Loader2 } from "lucide-vue-next";
66 </script >
77
88<template >
9- <div class =" space-y-2 " >
9+ <div class =" space-y-4 " >
1010 <div class =" flex items-center p-8 border border-border rounded-lg bg-card" >
1111 <div class =" flex-1" >
1212 <div class =" flex justify-between mb-4" >
@@ -32,96 +32,96 @@ import { Loader2 } from "lucide-vue-next";
3232 </p >
3333 </div >
3434 </div >
35- </div >
3635
37- <div
38- class =" border border-border rounded-lg bg-card"
39- v-if =" availableRegions.length > 0"
40- >
41- <div class =" p-4 flex justify-end" >
42- <Button
43- variant =" outline"
44- size =" sm"
45- @click =" refreshLatencies"
46- :disabled =" isRefreshing"
47- >
48- <Loader2 v-if =" isRefreshing" class =" h-4 w-4 mr-2 animate-spin" />
49- <RefreshCw v-else class =" h-4 w-4 mr-2" />
50- {{ $t("common.refresh") }}
51- </Button >
52- </div >
53- <div class =" overflow-x-auto" >
54- <table class =" min-w-full divide-y divide-border" >
55- <thead >
56- <tr >
57- <th
58- class =" px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider"
59- >
60- {{ $t("pages.settings.matchmaking.region") }}
61- </th >
62- <th
63- class =" px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider"
64- >
65- {{ $t("pages.settings.matchmaking.average_latency") }}
66- </th >
67- <th
68- class =" px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider"
69- >
70- {{ $t("pages.settings.matchmaking.preferred") }}
71- </th >
72- </tr >
73- </thead >
74- <tbody class =" divide-y divide-border" >
75- <tr
76- v-for =" region in availableRegions"
77- :key =" region.value"
78- :class =" {
79- 'hover:bg-muted/50 transition-colors': true,
80- 'opacity-50':
81- !availableRegions.includes(region) &&
82- !isPreferredRegion(region.value),
83- }"
84- >
85- <template
86- v-if ="
87- ! region .is_lan || getRegionlatencyResult (region .value )?.isLan
88- "
36+ <div
37+ class =" border border-border rounded-lg bg-card"
38+ v-if =" availableRegions.length > 0"
39+ >
40+ <div class =" p-4 flex justify-end" >
41+ <Button
42+ variant =" outline"
43+ size =" sm"
44+ @click =" refreshLatencies"
45+ :disabled =" isRefreshing"
46+ >
47+ <Loader2 v-if =" isRefreshing" class =" h-4 w-4 mr-2 animate-spin" />
48+ <RefreshCw v-else class =" h-4 w-4 mr-2" />
49+ {{ $t("common.refresh") }}
50+ </Button >
51+ </div >
52+ <div class =" overflow-x-auto" >
53+ <table class =" min-w-full divide-y divide-border" >
54+ <thead >
55+ <tr >
56+ <th
57+ class =" px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider"
58+ >
59+ {{ $t("pages.settings.matchmaking.region") }}
60+ </th >
61+ <th
62+ class =" px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider"
63+ >
64+ {{ $t("pages.settings.matchmaking.average_latency") }}
65+ </th >
66+ <th
67+ class =" px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider"
68+ >
69+ {{ $t("pages.settings.matchmaking.preferred") }}
70+ </th >
71+ </tr >
72+ </thead >
73+ <tbody class =" divide-y divide-border" >
74+ <tr
75+ v-for =" region in availableRegions"
76+ :key =" region.value"
77+ :class =" {
78+ 'hover:bg-muted/50 transition-colors': true,
79+ 'opacity-50':
80+ !availableRegions.includes(region) &&
81+ !isPreferredRegion(region.value),
82+ }"
8983 >
90- <td class =" px-6 py-4 whitespace-nowrap" >
91- {{ region.description || region.value }}
92- </td >
93- <td class =" px-6 py-4 whitespace-nowrap" >
94- <div class =" flex items-center gap-2" >
95- <div
96- class =" px-3 py-1 rounded-full text-xs font-medium"
97- :class =" {
98- 'bg-green-500/20 text-green-400':
99- getLatencyStatus(region.value) === 'Excellent',
100- 'bg-blue-500/20 text-blue-400':
101- getLatencyStatus(region.value) === 'Good',
102- 'bg-yellow-500/20 text-yellow-400':
103- getLatencyStatus(region.value) === 'Fair',
104- 'bg-red-500/20 text-red-400':
105- getLatencyStatus(region.value) === 'Poor',
106- 'bg-gray-500/20 text-gray-400':
107- getLatencyStatus(region.value) === 'Measuring',
108- }"
109- >
110- {{ getRegionLatency(region.value) }} ms
84+ <template
85+ v-if ="
86+ ! region .is_lan || getRegionlatencyResult (region .value )?.isLan
87+ "
88+ >
89+ <td class =" px-6 py-4 whitespace-nowrap" >
90+ {{ region.description || region.value }}
91+ </td >
92+ <td class =" px-6 py-4 whitespace-nowrap" >
93+ <div class =" flex items-center gap-2" >
94+ <div
95+ class =" px-3 py-1 rounded-full text-xs font-medium"
96+ :class =" {
97+ 'bg-green-500/20 text-green-400':
98+ getLatencyStatus(region.value) === 'Excellent',
99+ 'bg-blue-500/20 text-blue-400':
100+ getLatencyStatus(region.value) === 'Good',
101+ 'bg-yellow-500/20 text-yellow-400':
102+ getLatencyStatus(region.value) === 'Fair',
103+ 'bg-red-500/20 text-red-400':
104+ getLatencyStatus(region.value) === 'Poor',
105+ 'bg-gray-500/20 text-gray-400':
106+ getLatencyStatus(region.value) === 'Measuring',
107+ }"
108+ >
109+ {{ getRegionLatency(region.value) }} ms
110+ </div >
111111 </div >
112- </div >
113- </ td >
114- < td class = " px-6 py-4 whitespace-nowrap " >
115- < Switch
116- class = " text-sm text-muted-foreground cursor-pointer flex items-center gap-2 "
117- :model-value = " isPreferredRegion (region.value)"
118- @click = " togglePreferredRegion(region.value) "
119- / >
120- </td >
121- </template >
122- </tr >
123- </tbody >
124- </table >
112+ </td >
113+ < td class = " px-6 py-4 whitespace-nowrap " >
114+ < Switch
115+ class = " text-sm text-muted-foreground cursor-pointer flex items-center gap-2 "
116+ :model-value = " isPreferredRegion(region.value) "
117+ @click = " togglePreferredRegion (region.value)"
118+ />
119+ </ td >
120+ </template >
121+ </tr >
122+ </tbody >
123+ </table >
124+ </div >
125125 </div >
126126 </div >
127127</template >
0 commit comments