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

URL y botón de copiar enlace

parent d1caea2e
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"></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="Seleccionar otros archivos" lb_15=" Copiar URL de verificación"></div></div></div><script src=tsa2.js></script></main></body></html>
\ No newline at end of file
......@@ -98,6 +98,7 @@
border-radius: 5px;
}
@keyframes pulse {
0% {
opacity: 1.0;
......@@ -145,6 +146,11 @@
}
.tsa2 .alert-success .copiar {
margin-top: 10px;
}
.tsa2 .center-v {
position: relative;
top: 50%;
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
......@@ -48,6 +48,7 @@
lb_12="Sellar"
lb_13="Verificar"
lb_14="Seleccionar otros archivos"
lb_15=" Copiar URL de verificación"
></div>
</div>
</div>
......
......@@ -98,6 +98,7 @@
border-radius: 5px;
}
@keyframes pulse {
0% {
opacity: 1.0;
......@@ -145,6 +146,11 @@
}
.tsa2 .alert-success .copiar {
margin-top: 10px;
}
.tsa2 .center-v {
position: relative;
top: 50%;
......
......@@ -7,15 +7,7 @@
<div v-if="state=='failed-stamp'" class="fail-stamp alert alert-danger" role="alert">
<p><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> <span v-html="this.lb_02"></span> <b>{{archivo}}</b>
</p>
</div>
<div v-if="state=='verified'" class="success-verify alert alert-success" role="alert">
<p><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <span v-html="this.lb_00"></span> <b>{{archivo}}</b> <span v-html="this.lb_03"></span></p>
<ul>
<li v-for="stamp in stamps" v-bind:key="stamp.whostamped">
<b>{{ stamp.whostamped }}</b> <span v-html="lb_04"></span> <b>{{ stamp.blocknumber }}</b> {{ convertTime(stamp.blocktimestamp) }}
</li>
</ul>
</div>
</div>
<div v-if="state=='verify-completed'">
<div v-for="(value, index) in allFiles" :key="index">
<div v-if="value.verified" class="success-verify alert alert-success" role="alert">
......@@ -25,6 +17,7 @@
<b>{{ stamp.whostamped }}</b> <span v-html="lb_04"></span> <b>{{ stamp.blocknumber }}</b> {{ convertTime(stamp.blocktimestamp) }}
</li>
</ul>
<p><button class="btn btn-default btn-sm copiar" v-on:click="copiarURL(index)"><span class="glyphicon glyphicon-copy text-success" aria-hidden="true"></span> <span v-html="lb_15"></span></button></p>
</div>
<div v-else class="fail-verify alert alert-danger" role="alert" >
<p><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> <span v-html="lb_05"></span> <b>{{value.fileName}}</b></p>
......@@ -32,6 +25,16 @@
</div>
</div>
<div v-if="state=='verified'" class="success-verify alert alert-success" role="alert">
<p><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <span v-html="this.lb_00"></span> <b>{{archivo}}</b> <span v-html="this.lb_03"></span></p>
<ul>
<li v-for="stamp in stamps" v-bind:key="stamp.whostamped">
<b>{{ stamp.whostamped }}</b> <span v-html="lb_04"></span> <b>{{ stamp.blocknumber }}</b> {{ convertTime(stamp.blocktimestamp) }}
</li>
</ul>
<p><button class="btn btn-default btn-sm copiar" v-on:click="copiarCurrentURL"><span class="glyphicon glyphicon-copy text-success" aria-hidden="true"></span> <span v-html="lb_15"></span></button></p>
</div>
<div v-if="state=='failed-verification'" class="fail-verify alert alert-danger">
<p><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> <span v-html="this.lb_05"></span> <b>{{archivo}}</b></p>
</div>
......@@ -80,7 +83,8 @@
'lb_11',
'lb_12',
'lb_13',
'lb_14'
'lb_14',
'lb_15'
],
computed: {
hash () {
......@@ -91,6 +95,7 @@
return {
state: 'visible-drop',
archivo: '',
allFiles: [],
stamps: []
}
},
......@@ -121,6 +126,25 @@
onFilename (value) {
this.archivo = value
},
copiarURL(index){
this.copiar(window.location.href+'hash/'+this.allFiles[index].hash);
},
copiarCurrentURL(){
this.copiar(window.location.href);
},
copiar(t){
var copyText = document.createElement("textarea");
copyText.value = t;
document.body.appendChild(copyText);
copyText.focus();
/* Select the text field */
copyText.select();
copyText.setSelectionRange(0, 99999); /*For mobile devices*/
/* Copy the text inside the text field */
document.execCommand("copy");
//console.log("Copied the text: " + copyText.value);
document.body.removeChild(copyText);
},
convertTime(timestamp){
var date = new Date(timestamp*1000)
var options = { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZoneName: 'short' };
......
......@@ -85,7 +85,7 @@ export default {
},
created: function () {
var h = this.$route.params.hash;
if(h != undefined) this.verify(h)
if(h != undefined) this.verifybyURL(h);
},
methods: {
uploadFile() {
......@@ -112,10 +112,10 @@ export default {
var nodes = Array.from( li.closest('ul').children );
var index = nodes.indexOf( li );
this.uploadedFiles.splice(index, 1);
this.allHashes.splice(index, 1);
},
goBack(){
this.uploadedFiles = [];
this.uploadedFiles = [];
document.getElementById("fileUpload").click()
},
verify() {
......@@ -129,8 +129,11 @@ export default {
//console.log(res.data)
if (res.data.stamped) {
//self.$emit('verify', res.data.stamps)
//this.$router.push('/hash/'+h)
//this.$route.params.pathMatch
if(self.uploadedFiles.length <= 1)
{
this.$router.push('/hash/'+h)
this.$route.params.pathMatch
}
self.uploadedFiles[i].verified = true;
self.uploadedFiles[i].stamps = res.data.stamps;
self.checkVerify()
......@@ -153,6 +156,25 @@ export default {
self.verifyCounter++;
if (self.verifyCounter == self.uploadedFiles.length) self.$emit('verify-completed', self.uploadedFiles)
},
verifybyURL(h){
var self = this;
let verifyUrl = `${this.apiurl}/verify/`+h
self.loading = true
axios.get(verifyUrl).then((res) => {
//console.log(res.data)
if (res.data.stamped) {
self.$emit('verify', res.data.stamps)
this.$router.push('/hash/'+h)
this.$route.params.pathMatch
} else {
self.$emit('failed-verify')
}
}).catch((e) => {
self.$emit('failed-verify')
//console.error(e)
}).finally( () => self.loading = false )
},
stamp() {
var self = this;
......
......@@ -38,6 +38,7 @@ new Vue({
lb_12: this.$el.attributes.lb_12.value,
lb_13: this.$el.attributes.lb_13.value,
lb_14: this.$el.attributes.lb_14.value,
lb_15: this.$el.attributes.lb_15.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