11<template >
2-
3- <div v-if =" data.vf" class =" mx-8 mt-4 max-w-4xl md:mx-auto" >
4-
5- <h1 class =" my-4 text-center text-4xl font-semibold" >
6- Stats of the FTTx.gr Database
2+ <div v-if =" data.vf" class =" max-w-4xl mx-8 mt-4 md:mx-auto" >
3+ <h1 class =" my-4 text-4xl font-semibold text-center" >
4+ Stats of the FTTx.gr Database
75 </h1 >
8-
9- <div class =" mx-auto grid max-w-md grid-cols-1 gap-4 md:grid-cols-2" >
10-
6+ <div class =" grid max-w-md grid-cols-1 gap-4 mx-auto md:grid-cols-2" >
117 <div
12- class =" flex flex-col items-center justify-center rounded-md border border-red-500 bg-red-500/25 p-2 "
8+ class =" flex flex-col items-center justify-center p-2 border border-red-500 rounded-md bg-red-500/25"
139 >
14-
15- <h1 class =" py-2 text-center font-bold uppercase text-red-500" >
16- Vodafone
10+ <h1 class =" py-2 font-bold text-center text-red-500 uppercase" >
11+ Vodafone
1712 </h1 >
18-
1913 <img
20- class =" my-2 w-6"
14+ class =" w-6 my-2 "
2115 src =" @/static/img/vf-marker-minified.png"
2216 alt =" Vodafone Cabinets"
2317 />
24-
2518 <span class =" font-semibold" >{{ data.vf }}</span >
26-
2719 </div >
28-
2920 <div
30- class =" flex flex-col items-center justify-center rounded-md border border-blue-500 bg-blue-500/25 p-2 "
21+ class =" flex flex-col items-center justify-center p-2 border border-blue-500 rounded-md bg-blue-500/25"
3122 >
32-
33- <h1 class =" py-2 text-center font-bold uppercase text-blue-500" >
34- COSMOTE
23+ <h1 class =" py-2 font-bold text-center text-blue-500 uppercase" >
24+ COSMOTE
3525 </h1 >
36-
3726 <img
38- class =" my-2 w-6"
27+ class =" w-6 my-2 "
3928 src =" @/static/img/ote-marker-minified.png"
4029 alt =" COSMOTE Cabinets"
4130 />
42-
4331 <span class =" font-semibold" >{{ data.ote }}</span >
44-
4532 </div >
46-
4733 <div
48- class =" flex flex-col items-center justify-center rounded-md border border-blue-600 bg-blue-600/30 p-2 "
34+ class =" flex flex-col items-center justify-center p-2 border border-blue-600 rounded-md bg-blue-600/30"
4935 >
50-
51- <h1 class =" py-2 text-center font-bold uppercase text-blue-600" >
52- WIND
36+ <h1 class =" py-2 font-bold text-center text-blue-600 uppercase" >
37+ WIND
5338 </h1 >
54-
5539 <img
56- class =" my-2 w-6"
40+ class =" w-6 my-2 "
5741 src =" @/static/img/wind-marker-minified.png"
5842 alt =" WIND Cabinets"
5943 />
60-
6144 <span class =" font-semibold" >{{ data.wind }}</span >
62-
6345 </div >
64-
6546 <div
66- class =" flex flex-col items-center justify-center rounded-md border border-orange-500 bg-orange-500/25 p-2 "
47+ class =" flex flex-col items-center justify-center p-2 border border-orange-500 rounded-md bg-orange-500/25"
6748 >
68-
69- <h1 class =" py-2 text-center font-bold uppercase text-orange-500" >
70- RURAL CONNECT
49+ <h1 class =" py-2 font-bold text-center text-orange-500 uppercase" >
50+ RURAL CONNECT
7151 </h1 >
72-
7352 <img
74- class =" my-2 w-6"
53+ class =" w-6 my-2 "
7554 src =" @/static/img/rurcon-marker-minified.png"
7655 alt =" Rural Connect Cabinets"
7756 />
78-
7957 <span class =" font-semibold" >{{ data.rurcon }}</span >
80-
8158 </div >
82-
8359 <div
84- class =" flex flex-col items-center justify-center rounded-md border border-gray-500 bg-gray-500/25 p-2 "
60+ class =" flex flex-col items-center justify-center p-2 border border-gray-500 rounded-md bg-gray-500/25"
8561 >
86-
87- <h1 class =" py-2 text-center font-bold uppercase text-gray-500" >
88- UNKNOWN
62+ <h1 class =" py-2 font-bold text-center text-gray-500 uppercase" >
63+ UNKNOWN
8964 </h1 >
90-
91- <img class =" my-2 w-6" src =" @/static/img/g-marker.png" alt =" Unknown" />
92-
65+ <img class =" w-6 my-2" src =" @/static/img/g-marker.png" alt =" Unknown" />
9366 <span class =" font-semibold" >{{ data.unknown }}</span >
94-
9567 </div >
96-
9768 <div
98- class =" flex flex-col items-center justify-center rounded-md border border-sky-500 bg-sky-500/25 p-2 "
69+ class =" flex flex-col items-center justify-center p-2 border rounded-md bg-sky-500/25 border-sky-500 "
9970 >
100-
101- <h1 class =" py-2 text-center font-bold uppercase text-sky-500" >
102- CENTERS
71+ <h1 class =" py-2 font-bold text-center uppercase text-sky-500" >
72+ CENTERS
10373 </h1 >
104-
10574 <img
106- class =" my-2 w-6"
75+ class =" w-6 my-2 "
10776 src =" @/static/img/ote-marker-center-minified.png"
10877 alt =" A.K Centers"
10978 />
110-
11179 <span class =" font-semibold" >{{ data.centers }}</span >
112-
11380 </div >
114-
115- <div class =" col-span-full flex justify-between" >
116-
81+ <div class =" flex justify-between col-span-full" >
11782 <div >
118- ADSL:
119- <span class =" font-semibold" >{{ data.adsl }}</span >
120-
83+ ADSL: <span class =" font-semibold" >{{ data.adsl }}</span >
12184 </div >
122-
12385 <div >
124- VDSL:
125- <span class =" font-semibold" >{{ data.vdsl }}</span >
126-
86+ VDSL: <span class =" font-semibold" >{{ data.vdsl }}</span >
12787 </div >
128-
12988 <div >
130- FTTH:
131- <span class =" font-semibold" >{{ data.ftth }}</span >
132-
89+ FTTH: <span class =" font-semibold" >{{ data.ftth }}</span >
13390 </div >
134-
13591 </div >
136-
13792 </div >
138-
13993 </div >
140-
14194</template >
14295
14396<script >
14497import { supabase } from " @/utils/supabase-client" ;
145- import LRU from " lru-cache" ;
146-
147- const options = {
148- max: 500 ,
149- ttl: 1000 * 60 * 60 * 2
150- };
151-
152- const cache = new LRU (options);
15398export default {
15499 data () {
155100 return {
156101 data: null
157102 };
158103 },
159104 async fetch () {
160- const check = cache .get (" stats" );
161- if (check) return (this .data = check);
162-
163105 const { data } = await supabase
164106 .from (" cabinets" )
165107 .select (" *" , { count: " exact" });
166108 const { count: centers } = await supabase
167109 .from (" centers" )
168110 .select (" *" , { count: " exact" });
169111
170- const payload = {
112+ this . data = {
171113 vf: data .filter (c => c .isp === " Vodafone" ).length .toLocaleString (),
172114 ote: data .filter (c => c .isp === " OTE" ).length .toLocaleString (),
173115 rurcon: data
@@ -180,11 +122,8 @@ export default {
180122 adsl: data .filter (c => c .type === " ADSL" ).length .toLocaleString (),
181123 ftth: data .filter (c => c .type === " FTTH" ).length .toLocaleString ()
182124 };
183- cache .set (" stats" , payload);
184- this .data = payload;
185125 }
186126};
187127 </script >
188128
189129<style ></style >
190-
0 commit comments