mirror of
https://github.com/vimagick/dockerfiles.git
synced 2024-11-28 09:08:50 +02:00
webkit render quality
This commit is contained in:
parent
7e74bcab84
commit
e6ba069f84
@ -1,8 +1,12 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
RUN apt-get update && apt-get install -y wget collectd nodejs supervisor
|
||||
|
||||
RUN wget https://raw.githubusercontent.com/bpaquet/collectd-influxdb-proxy/master/proxy.js -P /usr/local/bin
|
||||
RUN wget http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb -P /tmp
|
||||
RUN wget http://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz -P /var/www
|
||||
|
||||
RUN dpkg -i /tmp/influxdb_latest_amd64.deb
|
||||
RUN tar xzf /var/www/grafana-1.9.1.tar.gz -C /var/www
|
||||
|
||||
CMD supervisord -n
|
||||
|
@ -212,7 +212,7 @@ function urlopen(req, callback) {
|
||||
case 'png':
|
||||
case 'gif':
|
||||
var name = req.requestId + '.' + req.requestType;
|
||||
page.render('/data/' + name, {format: req.requestType, quality: 50});
|
||||
page.render('/data/' + name, {format: req.requestType, quality: req.renderQuality});
|
||||
result.pageCapture = name;
|
||||
pdata = page.content;
|
||||
break
|
||||
|
@ -24,6 +24,7 @@ var setDefaults = function(req) {
|
||||
req.timeout = checkNumber('timeout', req.timeout, 1000, 300000, 60000);
|
||||
req.userAgent = checkString('userAgent', req.userAgent, 'Mozilla/5.0 PhantomJS/1.9.8');
|
||||
req.viewportSize = checkObject('viewportSize', req.viewportSize, {width: 800, height: 600, zoomFactor: 1});
|
||||
req.renderQuality = checkNumber('renderQuality', req.renderQuality, 0, 100, 50);
|
||||
return req;
|
||||
}
|
||||
|
||||
@ -38,7 +39,7 @@ function checkNumber(name, value, min, max, defaultValue) {
|
||||
} else if(!_.isNumber(value)) {
|
||||
throw _s.sprintf('TypeError: `%s` is not a number', name);
|
||||
} else if(value < min || value > max) {
|
||||
throw _s.sprintf('ValueError: `%s` is out of range []', name);
|
||||
throw _s.sprintf('ValueError: `%s` is out of range [%d, %d]', name, min, max);
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user