forked from lugfi/dolly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
migratedb.html
40 lines (33 loc) · 1.18 KB
/
migratedb.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<meta http-equiv="Expires" content="0">
<meta http-equiv="Last-Modified" content="0">
<meta http-equiv="Cache-Control" content="no-cache, mustrevalidate">
<meta http-equiv="Pragma" content="no-cache">
<title>Migración DB de JSON a CSV</title>
<!-- scripts -->
<script src="./js/config.js"></script>
<script src="./js/utils.js"></script>
<script src="./js/jquery-3.3.1.min.js"></script>
</head>
<body>
<script>
function migrate(file){
let str = "doc,mat,cuat,tstamp,asistencia,cumple_horarios,buen_trato,calse_organizada,claridad,fomenta_participacion,panorama_amplio,acepta_critica,responde_mails,comentarios<br/>";
$.ajaxSetup({ cache: false });
$.get(file, function(data){
pooldata = data.split("\n").filter(x => x.length).map(x => JSON.parse(b64_to_utf8(x)));
pooldata.forEach(p => (str+=(printCSV(p) + "<br/>")));
s = str;
$("body").html(str.trim());
});
}
$(function(){
console.log("use migrate('http://dollyfiuba.com/gente.txt')");
})
</script>
</body>
</html>