version stable

anis
Viicious 6 years ago
commit 11929a80b8

@ -56,7 +56,7 @@ app.use('/home', express.static(path.join(__dirname, 'dist')));
app.use('/main/:id', express.static(path.join(__dirname, 'dist')));
app.use('/login', express.static(path.join(__dirname, 'dist')));
app.use('/signup', express.static(path.join(__dirname, 'dist')));
app.use('/download/:id', express.static(path.join(__dirname, 'dist')));
app.use('/api', api);
app.set('view engine', 'pug');

@ -35,8 +35,8 @@ var credentials = {
passphrase: 'titi'
};
//var server = https.createServer(credentials, app);
var server = http.createServer(app);
var server = https.createServer(credentials, app);
//var server = http.createServer(app);

@ -249,6 +249,15 @@ router.post('/getUserById', function(req, res) {
});
});
router.post('/getFileById', function(req, res) {
console.log('yaa' + req.body.id);
FileMongo.find({
_id: req.body.id
}, function (err, file) {
res.json(file);
});
});
/* Login */
router.post('/signin', function(req, res) {
User.findOne({

@ -68,7 +68,7 @@ const appRoutes: Routes = [
data: { title: 'Sign Up' }
},
{
path: 'download',
path: 'download/:id',
component: DownloadLinkComponent ,
data: { title: 'download' }
},

@ -345,14 +345,14 @@
<i class="fa unlock-alt" aria-hidden="true"></i>
<i class="fa unlock" aria-hidden="true"></i>
<div class="md-form">
<input value="http://localhost:3000/{{file.url}}" disabled="disabled" type="text" id="shareLink" class="form-control" mdbInputDirective>
<input value="https://localhost:3000/download/{{file._id.toString()}}" disabled="disabled" type="text" id="shareLink" class="form-control" mdbInputDirective>
<label for="shareLink">Link</label>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-center">
<a type="button" class="btn btn-secondary waves-light" (click)="copyLink(file.url)" mdbWavesEffect>Copy Link <i class="fa fa-copy ml-1" aria-hidden="true"></i></a>
<a type="button" class="btn btn-secondary waves-light" (click)="copyLink(file._id.toString())" mdbWavesEffect>Copy Link <i class="fa fa-copy ml-1" aria-hidden="true"></i></a>
</div>
</div>
</div>

@ -95,7 +95,7 @@ export class BookComponent implements OnInit, OnDestroy {
selBox.style.left = '0';
selBox.style.top = '0';
selBox.style.opacity = '0';
selBox.value = 'http://localhost:3000/' + val;
selBox.value = 'https://localhost:3000/download/' + val;
document.body.appendChild(selBox);
selBox.focus();
@ -264,7 +264,6 @@ export class BookComponent implements OnInit, OnDestroy {
f.data = f.url;
f.urlSafe = this.sanitizer.bypassSecurityTrustResourceUrl(f.url);
}
}
} else {
this.allUserFile = [];

@ -3,6 +3,10 @@
<logo>
<a class="logo navbar-brand waves-light" mdbWavesEffect href="#"><strong>SupFile</strong></a>
</logo>
<links>
<ul class="navbar-nav mr-auto">
</ul>
</links>
</mdb-navbar>
<section class="view intro-2 mask rgba-gradient">
@ -29,16 +33,15 @@
<i class="fa fa-file fa-4x" aria-hidden="true"></i>
</div>
<div class="col-md-6">
<p><strong>Name</strong></p>
<p>Lenght</p>
<p><strong>{{file?.name}}</strong></p>
<p>{{ file?.taille / ( 1024 * 1024 ) | number : '1.2-2'}} Mo</p>
</div>
</div>
</div>
<hr class="hr-light mb-3 mt-4">
<button class="btn btn-outline-white wow fadeInleft waves-light">Download</button>
<button class="btn btn-outline-white wow fadeInleft waves-light"><a class="text-white" href="{{file?.url}}" download="{{ file?.name.toString()}}">Download</a></button>
</div>
<!--/.Card content-->
</div>

@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import {HttpClient} from '@angular/common/http';
@Component({
selector: 'app-download-link',
@ -6,8 +9,30 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./download-link.component.scss']
})
export class DownloadLinkComponent implements OnInit {
idFile: String;
urlFile: String;
file: any;
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute) {
this.idFile = '';
this.urlFile = '';
this.route.params.subscribe(params => {
this.idFile = params['id'];
this.urlFile = 'http://localhost:3000/' + this.idFile;
console.log('this.idFile : ' + this.idFile );
this.http.post('/api/getFileById', {id: this.idFile.toString()}).subscribe(file => {
constructor() { }
if (file) {
this.file = file[0];
console.log(this.file)
} else {
this.file = [];
}
});
});
}
ngOnInit() {
}

@ -73,8 +73,8 @@ export class HomeComponent implements OnInit {
ngOnInit() {
setTimeout(() =>
{
this.showCookies(););
}, 1000);
this.showCookies();
}, 1000); ;
}
}

@ -13,7 +13,7 @@
<!-- Logo -->
<li>
<div class="logo-wrapper flex-center waves-light" style="padding-bottom: 5%">
<a href="#"><img style="height: 90px; margin-left: 13%;"src="../../assets/logo%20supfile.png" class="img-fluid flex-center"></a>
<a href="#"><img style="height: 90px; margin-left: 13%;"src="../../assets/logoSupfile.png" class="img-fluid flex-center"></a>
</div>
</li>
<!--/. Logo -->

Loading…
Cancel
Save