From 18290ab18b9b2333311103caef62b76b6af462c1 Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 17 Nov 2022 07:29:35 +0100 Subject: [PATCH] refs #4550 Added printers to exclude --- README.md | 9 ++++++--- config.yml | 9 ++++++--- entrypoint.sh | 3 --- print-server.js | 7 +++---- sql/selectQueued.sql | 1 + 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d9a6fd3..510ff49 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,12 @@ salix: url: http://localhost:3000 user: user password: password - methods: - login: method/login - logout: method/logout +# Printers with cutter (no print) +printers: + - labeler43 + - labeler45 + - labeler46 + - labeler48 reconnectTimeout: 30 refreshRate: 1000 ``` diff --git a/config.yml b/config.yml index 2f1605a..764f6c0 100644 --- a/config.yml +++ b/config.yml @@ -9,8 +9,11 @@ salix: url: http://localhost:3000 user: user password: password - methods: - login: method/login - logout: method/logout +# Printers with cutter (no print) +printers: + - labeler43 + - labeler45 + - labeler46 + - labeler48 reconnectTimeout: 30 refreshRate: 1000 diff --git a/entrypoint.sh b/entrypoint.sh index a0d3858..eba9cbf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,7 +3,4 @@ echo "root:$CUPS_PASSWORD" | chpasswd cupsd -#Printers -lpadmin -p labeler48 -E -v socket://10.1.11.48 -m GoDEX/godex-zx420i.ppd - exec $@ diff --git a/print-server.js b/print-server.js index 1517898..3e2abd8 100644 --- a/print-server.js +++ b/print-server.js @@ -31,8 +31,7 @@ class PrintServer { await this.poll(); } async stop() { - const salix = this.conf.salix - await axios.post(`${salix.url}/api/${salix.methods.logout}?access_token=${this.token}`); + await axios.post(`${this.conf.salix}/api/Accounts/logout?access_token=${this.token}`); await this.end(); } async end() { @@ -45,7 +44,7 @@ class PrintServer { } async getToken() { const salix = this.conf.salix - let response = await axios.post(`${salix.url}/api/${salix.methods.login}`, { + let response = await axios.post(`${salix.url}/api/Accounts/login`, { user: salix.user, password: salix.password }); @@ -86,7 +85,7 @@ class PrintServer { try { await conn.beginTransaction(); - [[printJob]] = await conn.query(selectQuery, 'LabelCollection'); + [[printJob]] = await conn.query(selectQuery, ['LabelCollection', this.conf.printers]); if (!printJob) return; jobId = printJob.id; diff --git a/sql/selectQueued.sql b/sql/selectQueued.sql index e5ac781..e7eba20 100644 --- a/sql/selectQueued.sql +++ b/sql/selectQueued.sql @@ -11,5 +11,6 @@ SELECT pq.id, WHERE r.name = ? AND pq.statusCode = 'queued' AND NOT r.method IS NULL + AND NOT p.name IN (?) ORDER BY pq.priorityFk ASC LIMIT 1 \ No newline at end of file