Merge branch 'dev' of http://git.verdnatura.es/salix into dev
This commit is contained in:
commit
8ab9fd270e
|
@ -14,7 +14,7 @@
|
|||
vn-id="sampleType"
|
||||
field="$ctrl.clientSample.typeFk"
|
||||
model="ClientSample.typeFk"
|
||||
select-fields="['id','description','code','hasCompany']"
|
||||
select-fields="['code','hasCompany']"
|
||||
url="/client/api/Samples"
|
||||
show-field="description"
|
||||
value-field="id"
|
||||
|
|
|
@ -22,9 +22,28 @@ router.use('/static/:template/:image', function(request, response) {
|
|||
let readStream = fs.createReadStream(imagePath);
|
||||
|
||||
readStream.on('open', function() {
|
||||
let contentType = getContentType(imagePath);
|
||||
|
||||
if (contentType)
|
||||
response.setHeader('Content-type', getContentType(imagePath));
|
||||
|
||||
readStream.pipe(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function getContentType(path) {
|
||||
let types = {
|
||||
png: 'image/png',
|
||||
svg: 'image/svg+xml',
|
||||
gif: 'image/gif',
|
||||
jpeg: 'image/jpeg',
|
||||
jpg: 'image/jpeg'
|
||||
};
|
||||
|
||||
let extension = path.split('.')[1];
|
||||
|
||||
return types[extension];
|
||||
}
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
@ -7,10 +7,6 @@ img {
|
|||
margin: 0
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: justify
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
background-color: #EEE
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue