This commit is contained in:
Daniela Arcese 2017-06-20 15:52:01 -04:00
parent 8bc1cb4e63
commit ae3e18c443
5 changed files with 52 additions and 40 deletions

View File

@ -16,7 +16,9 @@ $(document).ready(function() {
$('.send-new').hide();
$('#download-progress').show();
// update progress bar
document.querySelector('#progress-bar').style.setProperty('--progress', percentComplete+'%');
document
.querySelector('#progress-bar')
.style.setProperty('--progress', percentComplete + '%');
$('#progress-text').html(`${percentComplete}%`);
//on complete
if (percentComplete === 100) {

View File

@ -21,7 +21,7 @@ $(document).ready(function() {
document.execCommand('copy');
document.body.removeChild(aux);
//disable button for 3s
$copyBtn.attr('disabled', true)
$copyBtn.attr('disabled', true);
$copyBtn.html('Copied!');
window.setTimeout(() => {
$copyBtn.attr('disabled', false);
@ -90,7 +90,9 @@ $(document).ready(function() {
$('#upload-progress').show();
$('#upload-filename').innerHTML += file.name;
// update progress bar
document.querySelector('#progress-bar').style.setProperty('--progress', percentComplete+'%');
document
.querySelector('#progress-bar')
.style.setProperty('--progress', percentComplete + '%');
$('#progress-text').html(`${percentComplete}%`);
});
fileSender.upload().then(info => {

View File

@ -155,7 +155,12 @@ td {
#progress-bar {
width: 300px;
height: 5px;
background: linear-gradient(90deg, #FD9800, #D73000 var(--progress), white var(--progress));
background: linear-gradient(
90deg,
#FD9800,
#D73000 var(--progress),
white var(--progress)
);
border: 0.5px solid;
border-radius: 5px;
}

View File

@ -71,11 +71,14 @@ app.get('/assets/download/:id', (req, res) => {
const file_stream = storage.get(id);
file_stream.on(notLocalHost ? 'finish' : 'close', () => {
storage.forceDelete(id).then(err => {
storage
.forceDelete(id)
.then(err => {
if (!err) {
log.info('Deleted:', id);
}
}).catch(err => {
})
.catch(err => {
log.info('DeleteError:', id);
});
});
@ -104,7 +107,7 @@ app.post('/delete/:id', (req, res) => {
storage
.delete(id, delete_token)
.then((err) => {
.then(err => {
if (!err) {
log.info('Deleted:', id);
res.sendStatus(200);