File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7373 < section class ="stats " aria-label ="Estatísticas ">
7474 < div class ="scard ">
7575 < div class ="slabel "> Keys geradas (30 dias)</ div >
76- < div class ="sval "> 358 </ div >
76+ < div class ="sval " id =" keys " > Carregando </ div >
7777 < div class ="sunit "> chaves válidas entregues</ div >
7878 </ div >
7979 < div class ="scard ">
@@ -162,6 +162,31 @@ <h2 class="atitle" id="sobre-titulo">O que é o GreenScripts HUB?</h2>
162162
163163 </ div >
164164
165+ < script >
166+ const keysDiv = document . getElementById ( 'keys' )
167+ getNumOfKeys ( ) ;
168+
169+ async function getNumOfKeys ( ) {
170+ const URL = 'https://btdbraicotnkhfkexwyh.supabase.co/functions/v1/ReturnGenerateKeys'
171+ const anomKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJ0ZGJyYWljb3Rua2hma2V4d3loIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc1MDY2MjcsImV4cCI6MjA5MzA4MjYyN30.ftV4X0vN3NRHJhsIyI_z4D0rm8sGPxVtwzhOux1jykA'
172+
173+ const response = await fetch ( URL ,
174+ { method : 'GET' ,
175+ headers : { 'Authorization' : `Bearer ${ anomKey } ` , 'Content-Type' : 'application/json' } }
176+ )
177+
178+ if ( ! response . ok )
179+ {
180+ keysDiv . innerText = '173'
181+ }
182+
183+ const data = await response . json ( )
184+ keysDiv . innerText = data . totalKeys
185+ }
186+
187+ </ script >
188+
189+
165190 < script type ="module ">
166191 import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
167192
You can’t perform that action at this time.
0 commit comments