diff --git a/package-lock.json b/package-lock.json index 1b154581..ef7dd320 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "scanservjs", - "version": "2.14.0", + "version": "2.15.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "scanservjs", - "version": "2.14.0", + "version": "2.15.0", "hasInstallScript": true, "license": "GPL-2.0" } diff --git a/package.json b/package.json index e85a3c55..ad4b6d5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scanservjs", - "version": "2.14.0", + "version": "2.15.0", "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", diff --git a/packages/client/package-lock.json b/packages/client/package-lock.json index dc194b99..554b4d10 100644 --- a/packages/client/package-lock.json +++ b/packages/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "scanservjs", - "version": "2.14.0", + "version": "2.15.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "scanservjs", - "version": "2.14.0", + "version": "2.15.0", "license": "GPL-2.0", "dependencies": { "@mdi/font": "^5.9.55", diff --git a/packages/client/package.json b/packages/client/package.json index 429665ab..0d545ffd 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "scanservjs", - "version": "2.14.0", + "version": "2.15.0", "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": { diff --git a/packages/client/src/classes/constants.js b/packages/client/src/classes/constants.js index 2c09e964..81d1f5fc 100644 --- a/packages/client/src/classes/constants.js +++ b/packages/client/src/classes/constants.js @@ -1,6 +1,23 @@ const Constants = { Version: process.env.VUE_APP_VERSION, + DateTimeFormat: { + short: { + year: 'numeric', + month: 'short', + day: 'numeric' + }, + long: { + year: 'numeric', + month: 'long', + day: 'numeric', + weekday: 'long', + hour: 'numeric', + minute: 'numeric', + hourCycle: 'h23' + } + }, + Locales: [ 'cs', 'de', diff --git a/packages/client/src/components/About.vue b/packages/client/src/components/About.vue index fbb1600c..f03a44af 100644 --- a/packages/client/src/components/About.vue +++ b/packages/client/src/components/About.vue @@ -11,10 +11,18 @@ https://github.com/sbs20/scanservjs -
- {{ $t('about.system-info') }} -
-
{{ systemInfo }}
+ {{ $t('about.system-info') }} + + + + + {{ $t('about.system-info') }} + + +
{{ systemInfo }}
+
+
+
@@ -28,19 +36,23 @@ export default { data() { return { version: Constants.Version, - systemInfo: null + systemInfo: null, + systemInfoDialog: false }; }, - mounted() { - this.$emit('mask', 1); - Common.fetch('system').then(data => { - this.systemInfo = data; - this.$emit('mask', -1); - }).catch(error => { - this.$emit('notify', { type: 'e', message: error }); - this.$emit('mask', -1); - }); + methods: { + showSystemInfo() { + this.$emit('mask', 1); + Common.fetch('system').then(data => { + this.systemInfoDialog = true; + this.systemInfo = data; + this.$emit('mask', -1); + }).catch(error => { + this.$emit('notify', { type: 'e', message: error }); + this.$emit('mask', -1); + }); + } } }; diff --git a/packages/client/src/components/Files.vue b/packages/client/src/components/Files.vue index 2a3862d2..af8956e6 100644 --- a/packages/client/src/components/Files.vue +++ b/packages/client/src/components/Files.vue @@ -2,14 +2,16 @@ + {{ $t('files.filename') }} {{ $t('files.date') }} {{ $t('files.size') }} - + mdi-delete + {{ file.name }} {{ $d(new Date(file.lastModified), 'long', $i18n.locale) }} {{ file.sizeString }} @@ -31,7 +33,8 @@ export default { data() { return { - files: [] + files: [], + selectedFiles: [] }; }, @@ -61,8 +64,31 @@ export default { }); }, + async multipleDelete() { + let refresh = false; + while (this.selectedFiles.length > 0) { + refresh = true; + const name = this.selectedFiles[0]; + try { + await Common.fetch(`files/${name}`, { method: 'DELETE' }); + this.$emit('notify', { type: 'i', message: `${this.$t('files.message:deleted')} ${name}` }); + } catch (error) { + this.$emit('notify', { type: 'e', message: error }); + } + this.selectedFiles.splice(0, 1); + } + + if (refresh) { + this.fileList(); + } + }, + open(file) { window.location.href = `files/${file.name}`; + }, + + selectToggle(value) { + this.selectedFiles = value ? this.files.map(f => f.name) : []; } } }; diff --git a/packages/client/src/components/Navigation.vue b/packages/client/src/components/Navigation.vue index 20ed8f6e..61c4a277 100644 --- a/packages/client/src/components/Navigation.vue +++ b/packages/client/src/components/Navigation.vue @@ -5,10 +5,10 @@ {{ $t('global.application-name') }} - mdi-camera{{ $t('navigation.scan') }} - mdi-file-document-multiple{{ $t('navigation.files') }} - mdi-cog{{ $t('navigation.settings') }} - mdi-information{{ $t('navigation.about') }} + mdi-camera{{ $t('navigation.scan') }} + mdi-file-document-multiple{{ $t('navigation.files') }} + mdi-cog{{ $t('navigation.settings') }} + mdi-information{{ $t('navigation.about') }} @@ -18,22 +18,22 @@ - + mdi-camera {{ $t('navigation.scan') }} - + mdi-file-document-multiple {{ $t('navigation.files') }} - + mdi-cog {{ $t('navigation.settings') }} - + mdi-information {{ $t('navigation.about') }} @@ -77,6 +77,14 @@ export default { version: Constants.Version }; }, + + methods: { + go(location) { + if (this.$route.path !== location) { + this.$router.push(location); + } + } + } }; diff --git a/packages/client/src/i18n.js b/packages/client/src/i18n.js index f8269c59..ec31ab10 100644 --- a/packages/client/src/i18n.js +++ b/packages/client/src/i18n.js @@ -6,22 +6,7 @@ Vue.use(VueI18n); const dateTimeFormats = {}; for (const locale of Constants.Locales) { - dateTimeFormats[locale] = { - short: { - year: 'numeric', - month: 'short', - day: 'numeric' - }, - long: { - year: 'numeric', - month: 'long', - day: 'numeric', - weekday: 'long', - hour: 'numeric', - minute: 'numeric', - hour12: false - } - }; + dateTimeFormats[locale] = Constants.DateTimeFormat; } function loadLocaleMessages () { diff --git a/packages/client/src/locales/cs.json b/packages/client/src/locales/cs.json index cce8661d..67c6ad96 100644 --- a/packages/client/src/locales/cs.json +++ b/packages/client/src/locales/cs.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs je jednoduché webové uživatelské rozhraní pro váš skener. Umožňuje vám sdílet jeden nebo více skenerů (s využitím SANE) bez ovladačů nebo komplikované instalace. Umí ukládat do TIF, JPG, PNG, PDF a TXT (využívá Tesseract OCR) s různými nastaveními komprese, vše je možné konfigurovat. Podporuje vícestránkové skenování a všechna zařízení kompatibilní se SANE.", "issue": "Ohlaste chybu nebo se podívejte na zdrojový kód:", - "system-info": "Informace o systému:" + "system-info": "Informace o systému" }, "colors": { diff --git a/packages/client/src/locales/de.json b/packages/client/src/locales/de.json index 23f8b634..36ac7b01 100644 --- a/packages/client/src/locales/de.json +++ b/packages/client/src/locales/de.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs ist ein einfaches, web-basiertes UI für Scanner. Es erlaubt es, einen oder mehrere Scanner (mittels SANE) über das Netzwerk ohne Treiber oder komplizierte Installation freizugeben. Eingescannte Dokumente können als TIF, JPG, PNG, PDF und TXT (mit Tesseract OCR) in verschiedenen, konfigurierbaren Kompressionseinstellungen gespeichert werden. Neben allen SANE-kompatiblen Geräten, wird außerdem mehrseitiges Scannen unterstützt.", "issue": "Melde Fehler oder wirf einen Blick auf den Quelltext:", - "system-info": "System information:" + "system-info": "System information" }, "colors": { diff --git a/packages/client/src/locales/en.json b/packages/client/src/locales/en.json index c5597ce9..de35f036 100644 --- a/packages/client/src/locales/en.json +++ b/packages/client/src/locales/en.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs is a simple web-based UI for your scanner. It allows you to share one or more scanners (using SANE) on a network without the need for drivers or complicated installation. It can save to TIF, JPG, PNG, PDF and TXT (with Tesseract OCR) with varying compression settings, all of which can be configured. It supports multipage scanning and all SANE compatible devices.", "issue": "File an issue or view the source code:", - "system-info": "System information:" + "system-info": "System information" }, "colors": { @@ -154,7 +154,7 @@ }, "locales": { - "cs": "Czech", + "cs": "Čeština", "de": "Deutsche", "en": "English", "es": "Español", @@ -162,7 +162,7 @@ "it": "Italiano", "pt-BR": "Portuguese (Brazilian)", "ru": "Russian", - "zh": "Chinese", + "zh": "简体中文", "test": "Test" } -} \ No newline at end of file +} diff --git a/packages/client/src/locales/es.json b/packages/client/src/locales/es.json index ce95043a..973da9fc 100644 --- a/packages/client/src/locales/es.json +++ b/packages/client/src/locales/es.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs es una interfaz gráfica simple y basada en web. Permite compartir uno o mas escáneres (utilizando SANE) en una red sin la necesidad de controladores adicionales o una instalación complicada. Permite guardar en formato TIF, JPG, PNG, PDF, y TXT (con Tesseract OCR) con varias configuraciones de compresión, todas ellas configurables. Soporta el escaneo multipágina y todos los dispositivos SANE compatibles.", "issue": "Indicar una incidencia o ver el código fuente:", - "system-info": "System information:" + "system-info": "System information" }, "colors": { diff --git a/packages/client/src/locales/fr.json b/packages/client/src/locales/fr.json index 9c151483..8c520337 100644 --- a/packages/client/src/locales/fr.json +++ b/packages/client/src/locales/fr.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs est une simple interface web pour votre scanner. Cette interface permet de partager un ou plusieurs scanners (utilisant SANE) sur un réseau sans avoir besoin de drivers ou d'installation complexe.Cela permet de sauvegarder les images scannées dans les formats de fichiers TIF, JPG, PNG, PDF et TXT (avec Tesseract OCR) avec des compressions paramétrables. Cela supporte les scans avec plusieurs pages et tout matériel compatible avec SANE.", "issue": "Signaler un problème ou afficher le code source:", - "system-info": "System information:" + "system-info": "System information" }, "colors": { diff --git a/packages/client/src/locales/it.json b/packages/client/src/locales/it.json index 2dd7b09c..3a5dd362 100644 --- a/packages/client/src/locales/it.json +++ b/packages/client/src/locales/it.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs è una semplice interfaccia web per il tuo scanner. Permette di condividere uno o più scanner (usando SANE) in una rete, senza necessità di driver o installazioni complicate. Può salvare nei formati TIF, JPG, PNG, PDF e TXT (via Tesseract OCR) con vari livelli di compressione. Supporta la scansione multi-pagina e tutti i dispositivi compatibili con SANE.", "issue": "Segnala problemi o visualizza il codice sorgente:", - "system-info": "Informazioni di sistema:" + "system-info": "Informazioni di sistema" }, "colors": { diff --git a/packages/client/src/locales/pt-BR.json b/packages/client/src/locales/pt-BR.json index e650341e..c54f3353 100644 --- a/packages/client/src/locales/pt-BR.json +++ b/packages/client/src/locales/pt-BR.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs é uma interface via web simplea. Permite compartilhar via rede um ou mais scanners (pelo SANE) sem precisar instalação local. Permite gravar nos formatos TIF, JPG, PNG, PDF, y TXT (com Tesseract OCR) com diversas configurações de compressão, configuráveis. Suporta digitalizar multipágina e todos dispositivos SANE compatíveis.", "issue": "Relatar uma questão ou ver código fonte:", - "system-info": "System information:" + "system-info": "System information" }, "colors": { diff --git a/packages/client/src/locales/ru.json b/packages/client/src/locales/ru.json index 092eb335..5fa1ef05 100644 --- a/packages/client/src/locales/ru.json +++ b/packages/client/src/locales/ru.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs - простой веб-интерфейс для сканеров, который предоставляет общий доступ к сканерам по сети (используя SANE) без необходимости устанавливать драйверы и исключая сложную процедуру настройки. Поддерживаются форматы TIF, JPG, PNG, PDF и TXT (используется Tesseract OCR) с возможностью задать степень сжатия. Доступно сканирование многостраничных документов. Работает со всеми SANE-совместимыми устройствами.", "issue": "Обратная связь, исходный код:", - "system-info": "System information:" + "system-info": "System information" }, "colors": { diff --git a/packages/client/src/locales/zh.json b/packages/client/src/locales/zh.json index f089a346..ea80a562 100644 --- a/packages/client/src/locales/zh.json +++ b/packages/client/src/locales/zh.json @@ -6,7 +6,7 @@ "about": { "main": "scanservjs 是一个基于网页的扫描仪 UI 。 它(使用 SANE )实现了在局域网内共享一个或多个扫描仪而无需繁复的驱动安装。 可以配置多种压缩率将扫描的文件保存为 TIF, JPG, PNG, PDF 和 TXT (使用 Tesseract OCR )等格式。 它亦提供多页扫描功能并支持所有与 SANE 兼容的设备。", "issue": "反馈问题或查看源码:", - "system-info": "系统信息:" + "system-info": "系统信息" }, "colors": { @@ -103,7 +103,7 @@ "uncompressed": "无压缩", "lzw-compressed": "LZW 压缩", "ocr": "OCR文字识别", - "text-file": "文本文件" + "text-file": "文本文档" }, "scan": { @@ -118,7 +118,7 @@ "filters": "滤镜", "format": "格式", "btn-preview": "预览", - "btn-clear": "清除", + "btn-clear": "清除预览", "btn-scan": "扫描", "top": "上边距", "left": "左边距", @@ -129,9 +129,9 @@ "contrast": "对比度", "message:loading-devices": "加载设备 ...", "message:no-devices": "未找到设备", - "message:deleted-preview": "删除预览", - "message:turn-documents": "旋转", - "message:preview-of-page": "预览" + "message:deleted-preview": "已清除预览", + "message:turn-documents": "旋转文件", + "message:preview-of-page": "页面预览" }, "settings": { @@ -149,7 +149,7 @@ "devices": "设备和存储", "reset:description": "清空扫描仪列表并强制重新加载设备", "reset": "重置", - "clear-storage:description": "清空所有已扫描的文件及缓存", + "clear-storage:description": "清空本地缓存", "clear-storage": "清空" } } diff --git a/packages/server/package-lock.json b/packages/server/package-lock.json index d5f41a56..e5399b57 100644 --- a/packages/server/package-lock.json +++ b/packages/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "scanservjs-server", - "version": "2.14.0", + "version": "2.15.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "scanservjs-server", - "version": "2.14.0", + "version": "2.15.0", "license": "GPL-2.0", "dependencies": { "adm-zip": "^0.5.5", diff --git a/packages/server/package.json b/packages/server/package.json index 00a2f2ee..716b600c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "scanservjs-server", - "version": "2.14.0", + "version": "2.15.0", "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", diff --git a/packages/server/scanservjs.service b/packages/server/scanservjs.service index 142a040f..c04c9fad 100644 --- a/packages/server/scanservjs.service +++ b/packages/server/scanservjs.service @@ -7,7 +7,7 @@ ExecStart=/var/www/scanservjs/server/server.js Restart=always User=scanservjs Group=users -Environment=PATH=/usr/bin:/usr/local/bin:/bin +Environment=PATH=/usr/local/bin:/usr/bin:/bin Environment=NODE_ENV=production WorkingDirectory=/var/www/scanservjs