@@ -32,25 +32,33 @@ function removeField(button) {
3232
3333( async ( ) => {
3434
35+ document . querySelectorAll ( ".close.icon" ) . forEach ( link => {
36+ link . addEventListener ( "click" , function ( event ) {
37+ event . preventDefault ( ) ; // Prevent default navigation if needed
38+ this . parentElement . remove ( ) ; // Remove the parent container
39+ } ) ;
40+ } ) ;
41+
42+
3543 const data = await fetchData ( ) ;
3644
3745 data . forEach ( item => {
3846 document . querySelector ( '#websites' ) . insertAdjacentHTML (
3947 'beforeend' ,
40- `<div class="ui yellow segment"><a class="ui label" href="https://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } ">${ item [ 1 ] } <i class="link icon"></i></a> (${ ( new Date ( item [ 4 ] ) ) . toLocaleDateString ( 'de-DE' , { year : 'numeric' , month : 'short' , day : 'numeric' , hour : 'numeric' , minute : 'numeric' } ) } )
48+ `<div class="ui yellow segment"><a class="ui label" href="https://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } ">${ item [ 1 ] } - (${ ( new Date ( item [ 4 ] ) ) . toLocaleDateString ( navigator . language , { year : 'numeric' , month : 'short' , day : 'numeric' } ) } ) <i class="external alternate icon"></i></a>
4149 <hr>
4250 <div class="badge-container">
43- <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } ">
44- <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=cpu_energy_rapl_msr_component" loading="lazy">
51+ <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } #RUNTIME__Browse%20to%20and%20idle ">
52+ <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=cpu_energy_rapl_msr_component&phase=Browse%20to%20and%20idle " loading="lazy">
4553 </a>
46- <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } ">
47- <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=network_energy_formula_global" loading="lazy">
54+ <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } #RUNTIME__Browse%20to%20and%20idle ">
55+ <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=network_energy_formula_global&phase=Browse%20to%20and%20idle " loading="lazy">
4856 </a>
49- <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } ">
50- <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=cpu_power_rapl_msr_component" loading="lazy">
57+ <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } #RUNTIME__Browse%20to%20and%20idle ">
58+ <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=cpu_power_rapl_msr_component&phase=Browse%20to%20and%20idle " loading="lazy">
5159 </a>
52- <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } ">
53- <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=network_carbon_formula_global" loading="lazy">
60+ <a href="http://metrics.green-coding.io/stats.html?id=${ item [ 0 ] } #RUNTIME__Browse%20to%20and%20idle ">
61+ <img src="https://api.green-coding.io/v1/badge/single/${ item [ 0 ] } ?metric=network_carbon_formula_global&phase=Browse%20to%20and%20idle " loading="lazy">
5462 </a>
5563 </div>
5664 </div>` ,
0 commit comments