Merge branch 'dev' of http://git.verdnatura.es/salix into dev

This commit is contained in:
Carlos Jimenez 2018-09-03 14:53:04 +02:00
commit 8ab9fd270e
3 changed files with 21 additions and 6 deletions

View File

@ -14,7 +14,7 @@
vn-id="sampleType" vn-id="sampleType"
field="$ctrl.clientSample.typeFk" field="$ctrl.clientSample.typeFk"
model="ClientSample.typeFk" model="ClientSample.typeFk"
select-fields="['id','description','code','hasCompany']" select-fields="['code','hasCompany']"
url="/client/api/Samples" url="/client/api/Samples"
show-field="description" show-field="description"
value-field="id" value-field="id"

View File

@ -22,9 +22,28 @@ router.use('/static/:template/:image', function(request, response) {
let readStream = fs.createReadStream(imagePath); let readStream = fs.createReadStream(imagePath);
readStream.on('open', function() { readStream.on('open', function() {
let contentType = getContentType(imagePath);
if (contentType)
response.setHeader('Content-type', getContentType(imagePath));
readStream.pipe(response); 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; module.exports = router;

View File

@ -7,10 +7,6 @@ img {
margin: 0 margin: 0
} }
p {
text-align: justify
}
.wrapper { .wrapper {
background-color: #EEE background-color: #EEE
} }