refs #4550 Added printers to exclude
gitea/printnatura/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2022-11-17 07:29:35 +01:00
parent c8d2e0ad66
commit 18290ab18b
5 changed files with 16 additions and 13 deletions

View File

@ -29,9 +29,12 @@ salix:
url: http://localhost:3000 url: http://localhost:3000
user: user user: user
password: password password: password
methods: # Printers with cutter (no print)
login: method/login printers:
logout: method/logout - labeler43
- labeler45
- labeler46
- labeler48
reconnectTimeout: 30 reconnectTimeout: 30
refreshRate: 1000 refreshRate: 1000
``` ```

View File

@ -9,8 +9,11 @@ salix:
url: http://localhost:3000 url: http://localhost:3000
user: user user: user
password: password password: password
methods: # Printers with cutter (no print)
login: method/login printers:
logout: method/logout - labeler43
- labeler45
- labeler46
- labeler48
reconnectTimeout: 30 reconnectTimeout: 30
refreshRate: 1000 refreshRate: 1000

View File

@ -3,7 +3,4 @@
echo "root:$CUPS_PASSWORD" | chpasswd echo "root:$CUPS_PASSWORD" | chpasswd
cupsd cupsd
#Printers
lpadmin -p labeler48 -E -v socket://10.1.11.48 -m GoDEX/godex-zx420i.ppd
exec $@ exec $@

View File

@ -31,8 +31,7 @@ class PrintServer {
await this.poll(); await this.poll();
} }
async stop() { async stop() {
const salix = this.conf.salix await axios.post(`${this.conf.salix}/api/Accounts/logout?access_token=${this.token}`);
await axios.post(`${salix.url}/api/${salix.methods.logout}?access_token=${this.token}`);
await this.end(); await this.end();
} }
async end() { async end() {
@ -45,7 +44,7 @@ class PrintServer {
} }
async getToken() { async getToken() {
const salix = this.conf.salix 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, user: salix.user,
password: salix.password password: salix.password
}); });
@ -86,7 +85,7 @@ class PrintServer {
try { try {
await conn.beginTransaction(); await conn.beginTransaction();
[[printJob]] = await conn.query(selectQuery, 'LabelCollection'); [[printJob]] = await conn.query(selectQuery, ['LabelCollection', this.conf.printers]);
if (!printJob) return; if (!printJob) return;
jobId = printJob.id; jobId = printJob.id;

View File

@ -11,5 +11,6 @@ SELECT pq.id,
WHERE r.name = ? WHERE r.name = ?
AND pq.statusCode = 'queued' AND pq.statusCode = 'queued'
AND NOT r.method IS NULL AND NOT r.method IS NULL
AND NOT p.name IN (?)
ORDER BY pq.priorityFk ASC ORDER BY pq.priorityFk ASC
LIMIT 1 LIMIT 1