This commit is contained in:
parent
c8d2e0ad66
commit
18290ab18b
|
@ -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
|
||||||
```
|
```
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 $@
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue