Skip to content
Snippets Groups Projects
Commit 0615b3e9 authored by Otto Zaiser's avatar Otto Zaiser
Browse files

Fix mismo archivo y Botón agregar

parent 04c265ac
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html><html lang=es><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><link href="https://fonts.googleapis.com/css?family=Raleway:400,400i,700,700i" rel=stylesheet><link rel=stylesheet href=static/css/bootstrap.min.css><link rel=stylesheet href=static/css/style.css><link rel=stylesheet href=static/css/tsa2.css><title>Sello de Tiempo - Blockchain Federal Argentina</title><link href=tsa2.js rel=preload as=script></head><body><noscript><b>Lo sentimos pero el sello de tiempo no funciona sin JavaScript. Por favor, habilitalo para continuar.</b></noscript><nav id=navbar role=banner class="navbar navbar-default"><div class=container><div class=navbar-header><a class="logo navbar-btn pull-left" href=/ rel=home><img id=logo src=static/images/logo.svg alt="Blockchain Federal Argentina"></a></div></div></nav><main><div class=container><div class=tsa2><h1>Sello de Tiempo</h1><p>El servicio de Sello de Tiempo de BFA permite demostrar que el contenido de cualquier documento digital existió en un momento y que desde entonces, no ha cambiado. Al sellar un archivo, cualquiera podrá verificar el día y la hora en que su hash fue almacenado en Blockchain Federal Argentina. Tené en cuenta que el documento seleccionado nunca se sube a la red, garantizando su privacidad.</p><p class=font_small><a href=https://bfa.ar/sello>Si tenés un archivo con Recibo Digital (.rd) verificalo aquí</a></p><div id=app apiurl=http://200.108.146.180:3000 lb_00=" El archivo " lb_01=" fue enviado con éxito para ser sellado" lb_02="Se ha producido un error al intentar sellar " lb_03=" se encuentra sellado por: " lb_04=" en el bloque " lb_05="No se ha podido verificar el archivo " lb_06="Volver a Sellar o Verificar" lb_07=Cargando lb_08="Arrastrá archivos aquí<br>ó" lb_09="Seleccioná archivos <span class='sr-only'>para Sellar o Verificar</span>" lb_10="Nombre del archivo: " lb_11="Hash del archivo: " lb_12=Sellar lb_13=Verificar lb_14="Seleccionar otros archivos" lb_15=" Copiar" lb_16="Enlace de verificación"></div></div></div><script src=tsa2.js></script></main></body></html>
\ No newline at end of file
<!DOCTYPE html><html lang=es><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><link href="https://fonts.googleapis.com/css?family=Raleway:400,400i,700,700i" rel=stylesheet><link rel=stylesheet href=static/css/bootstrap.min.css><link rel=stylesheet href=static/css/style.css><link rel=stylesheet href=static/css/tsa2.css><title>Sello de Tiempo - Blockchain Federal Argentina</title><link href=tsa2.js rel=preload as=script></head><body><noscript><b>Lo sentimos pero el sello de tiempo no funciona sin JavaScript. Por favor, habilitalo para continuar.</b></noscript><nav id=navbar role=banner class="navbar navbar-default"><div class=container><div class=navbar-header><a class="logo navbar-btn pull-left" href=/ rel=home><img id=logo src=static/images/logo.svg alt="Blockchain Federal Argentina"></a></div></div></nav><main><div class=container><div class=tsa2><h1>Sello de Tiempo</h1><p>El servicio de Sello de Tiempo de BFA permite demostrar que el contenido de cualquier documento digital existió en un momento y que desde entonces, no ha cambiado. Al sellar un archivo, cualquiera podrá verificar el día y la hora en que su hash fue almacenado en Blockchain Federal Argentina. Tené en cuenta que el documento seleccionado nunca se sube a la red, garantizando su privacidad.</p><p class=font_small><a href=https://bfa.ar/sello>Si tenés un archivo con Recibo Digital (.rd) verificalo aquí</a></p><div id=app apiurl=http://200.108.146.180:3000 lb_00=" El archivo " lb_01=" fue enviado con éxito para ser sellado" lb_02="Se ha producido un error al intentar sellar " lb_03=" se encuentra sellado por: " lb_04=" en el bloque " lb_05="No se ha podido verificar el archivo " lb_06="Volver a Sellar o Verificar" lb_07=Cargando lb_08="Arrastrá archivos aquí<br>ó" lb_09="Seleccioná archivos <span class='sr-only'>para Sellar o Verificar</span>" lb_10="Nombre del archivo: " lb_11="Hash del archivo: " lb_12=Sellar lb_13=Verificar lb_14=" Agregar archivos" lb_15=" Copiar" lb_16="Enlace de verificación" lb_17="Remover archivo" lb_18="Seleccionar otros archivos"></div></div></div><script src=tsa2.js></script></main></body></html>
\ No newline at end of file
......@@ -24,7 +24,7 @@
right: 0;
}
.tsa2 .dropArea ul>li:last-child{
border-bottom: none;
/* border-bottom: none; */
}
.tsa2 .btn-primary:active, .tsa2 .btn-primary:active:hover, .tsa2 .btn-primary:focus, .tsa2 .btn-primary:hover {
background-color: #fff;
......@@ -125,10 +125,14 @@
display: none !important;
}
.tsa2 .btn-lg {
.tsa2 .btn-cta {
min-width: 150px;
margin: 0 5px;
margin-top: 20px;
margin-top: 10px;
}
.tsa2 .cta{
margin-top: 30px;
}
.tsa2 .alert {
margin-top: 15px;
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
......@@ -47,9 +47,11 @@
lb_11="Hash del archivo: "
lb_12="Sellar"
lb_13="Verificar"
lb_14="Seleccionar otros archivos"
lb_14=" Agregar archivos"
lb_15=" Copiar"
lb_16="Enlace de verificación"
lb_17="Remover archivo"
lb_18="Seleccionar otros archivos"
></div>
</div>
......
......@@ -24,7 +24,7 @@
right: 0;
}
.tsa2 .dropArea ul>li:last-child{
border-bottom: none;
/* border-bottom: none; */
}
.tsa2 .btn-primary:active, .tsa2 .btn-primary:active:hover, .tsa2 .btn-primary:focus, .tsa2 .btn-primary:hover {
background-color: #fff;
......@@ -125,10 +125,14 @@
display: none !important;
}
.tsa2 .btn-lg {
.tsa2 .btn-cta {
min-width: 150px;
margin: 0 5px;
margin-top: 20px;
margin-top: 10px;
}
.tsa2 .cta{
margin-top: 30px;
}
.tsa2 .alert {
margin-top: 15px;
......
......@@ -67,6 +67,8 @@
:lb_12="lb_12"
:lb_13="lb_13"
:lb_14="lb_14"
:lb_17="lb_17"
:lb_18="lb_18"
v-if="state == 'visible-drop'"
v-on:stamp="onStamp"
v-on:failed-stamp="onFailedStamp()"
......@@ -100,7 +102,9 @@
'lb_13',
'lb_14',
'lb_15',
'lb_16'
'lb_16',
'lb_17',
'lb_18'
],
computed: {
hash () {
......
......@@ -40,20 +40,31 @@
<span v-html="lb_11"></span>
<b> {{ value.hash }}</b>
</p>
<button class="btn btn-default remover" v-on:click="removeFile"><span class="glyphicon glyphicon-trash text-danger " aria-hidden="true"></span> <span class="sr-only">Remover archivo</span></button>
<button class="btn btn-default remover" v-on:click.stop.prevent="removeFile">
<span class="glyphicon glyphicon-trash text-danger " aria-hidden="true"></span>
<span v-html="lb_17" class="sr-only"></span>
</button>
</li>
</ul>
</div>
<!-- <li v-for="(file,index) in uploadedFiles" v-bind:key="index">{{file.fileName}}: {{file.hash}}</li> -->
</div>
<div>
<button class="btn btn-lg btn-primary btn-pill" v-if="uploadedFiles.length > 0" v-on:click="stamp()" v-html="this.lb_12"></button>
<button class="btn btn-lg btn-success btn-pill" v-if="uploadedFiles.length > 0" v-on:click="verify()" v-html="this.lb_13"></button>
<div class="add-btn" v-if="uploadedFiles.length > 0" >
<a class="btn btn-default btn-pill" href="#" v-on:click.stop.prevent="addFile" >
<span class="glyphicon glyphicon-plus text-primary " aria-hidden="true"></span>
<span v-html="this.lb_14"></span>
</a>
</div>
<div v-if="uploadedFiles.length > 0" class="cta">
<button class="btn btn-lg btn-success btn-pill btn-cta" v-on:click="verify()" v-html="this.lb_13"></button>
<button class="btn btn-lg btn-primary btn-pill btn-cta" v-on:click="stamp()" v-html="this.lb_12"></button>
</div>
<div class="gobackLink font_small" v-if="uploadedFiles.length > 0" >
<a href="#" v-on:click.stop.prevent="goBack" v-html="this.lb_14"></a>
<div class="gobackLink font_small" v-if="uploadedFiles.length > 0" >
<a href="#" v-on:click.stop.prevent="goBack" >
<span v-html="this.lb_18"></span>
</a>
</div>
</div>
</template>
......@@ -72,7 +83,9 @@ export default {
'lb_11',
'lb_12',
'lb_13',
'lb_14'
'lb_14',
'lb_17',
'lb_18'
],
data: function() {
return {
......@@ -114,8 +127,13 @@ export default {
this.uploadedFiles.splice(index, 1);
this.allHashes.splice(index, 1);
},
addFile(){
//this.uploadedFiles = [];
document.getElementById("fileUpload").click()
},
goBack(){
this.uploadedFiles = [];
this.allHashes = [];
document.getElementById("fileUpload").click()
},
verify() {
......@@ -194,7 +212,7 @@ export default {
})
},
uploadFiles: function(f) {
var self = this;
var self = this;
this.loading = true;
function loadFile(file) {
let name = file.name
......@@ -206,12 +224,17 @@ export default {
let hash = SHA256.create()
hash.update(contents)
let hex = hash.hex()
// // replace for time being
self.uploadedFiles.push({
fileName: name,
hash: hex
});
self.allHashes.push (hex);
//Checks if already exists
if(self.allHashes.indexOf(hex) === -1){
self.uploadedFiles.push({
fileName: name,
hash: hex
});
self.allHashes.push(hex)
} else{
//file already uploaded
}
//self.uploadedFiles = self.getUnique(self.uploadedFiles, 'hash')
self.loading = false;
};
reader.readAsArrayBuffer(file, "UTF-8")
......@@ -219,6 +242,19 @@ export default {
for (var i = 0; i < f[0].length; i++) {
loadFile(f[0][i]);
}
},
getUnique(arr, comp) {
const unique = arr
.map(e => e[comp])
// store the keys of the unique objects
.map((e, i, final) => final.indexOf(e) === i && i)
// eliminate the dead keys & store unique objects
.filter(e => arr[e]).map(e => arr[e]);
return unique;
}
},
mounted() {
......
......@@ -40,6 +40,8 @@ new Vue({
lb_14: this.$el.attributes.lb_14.value,
lb_15: this.$el.attributes.lb_15.value,
lb_16: this.$el.attributes.lb_16.value,
lb_17: this.$el.attributes.lb_17.value,
lb_18: this.$el.attributes.lb_18.value,
}
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment