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