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"
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"

View File

@ -20,11 +20,30 @@ router.use('/static/:template/:image', function(request, response) {
return response.json({message: 'Image not found'});
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;

View File

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