Skip to content

Commit

Permalink
Merge pull request #313 from sbs20/development
Browse files Browse the repository at this point in the history
Documentation; Spanish; Device refresh
  • Loading branch information
sbs20 authored Jul 4, 2021
2 parents 6626917 + c427078 commit 3e899ab
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 19 deletions.
20 changes: 19 additions & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Then, add the following pipeline:
description: 'ocrmypdf (JPG | @:pipeline.high-quality)',
get commands() {
return [
'convert @- -quality 92 tmp-%d.jpg && ls tmp-*.jpg',
'convert @- -quality 92 tmp-%04d.jpg && ls tmp-*.jpg',
'convert @- pdf:-',
`ocrmypdf -l ${config.ocrLanguage} --deskew --rotate-pages - scan_0000.pdf`,
'ls scan_*.*'
Expand All @@ -212,3 +212,21 @@ module.exports = {
}
}
```

### Change default output directory

Exercise caution with this recipe - the app is designed not to allow unsafe
paths by default. If you are happy to disable this check, then go ahead.

```javascript
const dayjs = require('dayjs');
module.exports = {
afterConfig(config) {
// Set your path here
config.outputDirectory = '/home/me/scanned';

// By default paths with `..` or `/` are not allowed
config.allowUnsafePaths = true;
}
}
```
9 changes: 8 additions & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ server{
proxy_send_timeout 300;
...
}
```
```

## Long scan timeout

When scanning files with high resolution, e.g. 1200dpi it is very likely for the
request to timeout. This is because node HTTP times out after 2 minutes by
default. The solution is to increase the default timeout. That's possible by
setting `config.timeout = 600000;` (for 10 minutes for example).
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scanservjs",
"version": "2.16.0",
"version": "2.16.1",
"description": "scanservjs is a simple web-based UI for SANE which allows you to share a scanner on a network without the need for drivers or complicated installation.",
"scripts": {
"clean": "rm -rf ./dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scanservjs",
"version": "2.16.0",
"version": "2.16.1",
"description": "scanservjs is a simple web-based UI for SANE which allows you to share a scanner on a network without the need for drivers or complicated installation.",
"author": "Sam Strachan",
"scripts": {
Expand Down
18 changes: 15 additions & 3 deletions packages/client/src/components/Scan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
<v-spacer/>

<v-col cols="12" md="3" class="mb-10 mb-md-0">
<v-select v-if="context.devices.length > 0"
:label="$t('scan.device')" v-model="device"
:items="context.devices" return-object item-text="name" @change="clear"></v-select>
<div class="d-flex">
<v-select style="min-width: 0px;"
v-if="context.devices.length > 0"
:label="$t('scan.device')" v-model="device"
:items="context.devices" return-object item-text="name" @change="clear"></v-select>
<v-btn class="ml-2 mt-4 pl-1 pr-1" min-width="32" @click="deviceRefresh"><v-icon>mdi-refresh</v-icon></v-btn>
</div>

<v-select v-if="'--source' in device.features"
:label="$t('scan.source')" v-model="request.params.source"
Expand Down Expand Up @@ -443,6 +447,14 @@ export default {
});
},
deviceRefresh() {
this._fetch('context', {
method: 'DELETE'
}).then(() => {
this.readContext();
});
},
readPreview() {
// Gets the preview image as a base64 encoded jpg and updates the UI
this._fetch('preview', {
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"left-aligned": "Alineado a la izquierda",
"centrally-aligned": "Alineado al centro",
"duplex": "Dúplex",
"transparency unit": "Transparency Unit",
"transparency unit": "Unidad de transparencia",

"automatic document feeder": "@:source.adf",
"automatic document feeder(left aligned)": "@:source.adf (@:source.left-aligned)",
Expand Down Expand Up @@ -147,10 +147,10 @@
"theme:dark": "Oscuro",
"color": "Color",
"color:description": "Color. Esto modificará el color de la barra superior.",
"devices": "Devices and storage",
"reset:description": "Clears stored scanner devices and forces a reload",
"devices": "Dispositivos y almacenamiento",
"reset:description": "Limpia los dispositivos almacenados y fuerza la recarga",
"reset": "Reestablecer",
"clear-storage:description": "Clears local storage of any cached parameters",
"clear-storage": "Clear"
"clear-storage:description": "Limpia el almacenamiento local y cualquier parámetro en caché",
"clear-storage": "Limpiar"
}
}
4 changes: 2 additions & 2 deletions packages/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scanservjs-server",
"version": "2.16.0",
"version": "2.16.1",
"description": "scanservjs is a simple web-based UI for SANE which allows you to share a scanner on a network without the need for drivers or complicated installation.",
"scripts": {
"lint": "gulp lint",
Expand Down

0 comments on commit 3e899ab

Please sign in to comment.