-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from sbs20/staging
Improved browser support; translations; graceful upgrade
- Loading branch information
Showing
13 changed files
with
145 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Troubleshooting | ||
|
||
## JSON.parse error | ||
|
||
This happens when the browser received a string from the server which is not a | ||
valid JSON string. Most likely you're running a proxy server (e.g. nginx) which | ||
is timing out prior to the completion of the request. Scanservjs can sometimes | ||
take a little while to fulfil its requests - usually because it's waiting for a | ||
scanner, but sometimes because it's having to do a fair amount of image | ||
processing and you're | ||
[running on a low power CPU (e.g. RPi)](https://github.com/sbs20/scanservjs/issues/224). | ||
|
||
The solution is to increase the proxy timeout. For nginx that might look like: | ||
|
||
``` | ||
server{ | ||
... | ||
proxy_read_timeout 300; | ||
proxy_connect_timeout 300; | ||
proxy_send_timeout 300; | ||
... | ||
} | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ | |
"vuetify-loader": "^1.7.2" | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"> 0.2%", | ||
"last 2 versions", | ||
"not dead" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,49 @@ | ||
import Constants from './constants'; | ||
|
||
export default { | ||
create(request, device, pipeline) { | ||
if (request === null) { | ||
request = { | ||
version: Constants.Version, | ||
params: { | ||
deviceId: device.id, | ||
top: device.features['-t'].default, | ||
left: device.features['-l'].default, | ||
width: device.features['-x'].default, | ||
height: device.features['-y'].default, | ||
resolution: device.features['--resolution'].default, | ||
mode: device.features['--mode'].default | ||
}, | ||
filters: [], | ||
pipeline: pipeline, | ||
batch: 'none', | ||
index: 1 | ||
}; | ||
} | ||
export default class Request { | ||
/** | ||
* @param {Request} request | ||
* @param {Device} device | ||
* @param {string} pipeline | ||
* @param {string} batchMode | ||
* @returns | ||
*/ | ||
static create(request, device, pipeline, batchMode) { | ||
request = request || {}; | ||
request.params = request.params || {}; | ||
|
||
const obj = { | ||
version: Constants.Version, | ||
params: { | ||
deviceId: device.id, | ||
top: request.params.top || device.features['-t'].default, | ||
left: request.params.left || device.features['-l'].default, | ||
width: request.params.width || device.features['-x'].default, | ||
height: request.params.height || device.features['-y'].default, | ||
resolution: request.params.resolution || device.features['--resolution'].default, | ||
mode: request.params.mode || device.features['--mode'].default | ||
}, | ||
filters: request.filters || [], | ||
pipeline: request.pipeline || pipeline, | ||
batch: request.batch || batchMode === undefined ? 'none' : batchMode, | ||
index: 1 | ||
}; | ||
|
||
if ('--source' in device.features) { | ||
request.params.source = request.params.source || device.features['--source'].default; | ||
obj.params.source = request.params.source || device.features['--source'].default; | ||
} | ||
if ('--brightness' in device.features) { | ||
request.params.brightness = request.params.brightness || device.features['--brightness'].default; | ||
obj.params.brightness = request.params.brightness || device.features['--brightness'].default; | ||
} | ||
if ('--contrast' in device.features) { | ||
request.params.contrast = request.params.contrast || device.features['--contrast'].default; | ||
obj.params.contrast = request.params.contrast || device.features['--contrast'].default; | ||
} | ||
if ('--disable-dynamic-lineart' in device.features) { | ||
request.params.dynamicLineart = request.params.dynamicLineart !== undefined | ||
obj.params.dynamicLineart = request.params.dynamicLineart !== undefined | ||
? request.params.dynamicLineart | ||
: true; | ||
} | ||
|
||
return request; | ||
return obj; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.