forked from logo94/WikiPlayground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.html
139 lines (119 loc) · 5.44 KB
/
stats.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="it">
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="https://upload.wikimedia.org/wikipedia/commons/8/82/Wikidata-logo-black-en.svg">
<!-- Descrizione pagina -->
<title>Statistiche | WikiPlayground</title>
<meta name="description" content="Pagina statistiche WikiPlayground">
<meta name="keywords" content="SBN, Wikidata, Wiki, Gaming">
<meta name="author" content="https://github.com/logo94">
<!-- Includi Librerie CSS e stile -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<style>
html, body {
height: 100%;
margin: 0;
}
h1 {
font-size: 7em;
}
h2 {
font-size: 6em;
}
.flex-container {
display: flex;
flex-direction: column;
height: 100%;
}
.half-height {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<div class="flex-container p-5">
<div class="row half-height">
<div class="col-2"></div>
<div class="col-8 my-auto mb-3">
<div class="card">
<div class="card-content">
<div class="card-body my-4 py-0 text-center">
<h3>Entità rimanenti</h3>
<hr>
<h1 id="missing" class="text-secondary"><div class="spinner-border mb-4" role="status"></div></h1>
</div>
</div>
</div>
</div>
<div class="col-2 px-5" style="margin-bottom: -27%;">
<button type="button" id="reload" class="btn btn-outline-secondary menu-btn my-auto mx-auto shadow" style="width: 5em; height: 5em;">
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-arrow-repeat" viewBox="0 0 16 16">
<path d="M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41m-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9"/>
<path fill-rule="evenodd" d="M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5 5 0 0 0 8 3M3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9z"/>
</svg>
</button>
</div>
</div>
<div class="row half-height">
<div class="col-2"></div>
<div class="col-8 my-auto mt-3">
<div class="row">
<div class="col">
<div class="card">
<div class="card-content">
<div class="card-body my-4 py-0 text-center">
<h4>Edits</h4>
<hr>
<h2 id="match" class="text-success"><div class="spinner-border mb-4" role="status"></div></h2>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card">
<div class="card-content">
<div class="card-body my-4 py-0 text-center">
<h4>No Match</h4>
<hr>
<h2 id="nomatch" class="text-danger"><div class="spinner-border mb-4" role="status"></div></h2>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-2"></div>
</div>
</div>
<script type="module">
import { allItemQuery, allEditsQuery, allNoMatchQuery } from "./js/sparql.js"
import { sparqlQuery } from "./js/wiki.js";
const missingValue = document.getElementById('missing');
const matchValue = document.getElementById('match');
const noMatchValue = document.getElementById('nomatch');
const reloadBtn = document.getElementById('reload');
const getStats = async () => {
let allItemCountQuery = await allItemQuery();
let allItemCount = await sparqlQuery(allItemCountQuery)
missingValue.innerHTML = allItemCount.results.bindings[0].itemCount.value
let allEditsCountQuery = await allEditsQuery();
let allEditsCount = await sparqlQuery(allEditsCountQuery)
matchValue.innerHTML = allEditsCount.results.bindings[0].itemCount.value
let allNoMatchCountQuery = await allNoMatchQuery();
let allNoMatchCount = await sparqlQuery(allNoMatchCountQuery);
noMatchValue.innerHTML = allNoMatchCount.results.bindings[0].itemCount.value
}
getStats()
// Bottone ricarica
reloadBtn.addEventListener('click', async() => { location.reload() });
</script>
</body>
</html>