thecore_print_commons 3.0.6 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 076d9d7ebc40292dec54e2700103d7ab47ac30193027753705f26194d2fe19da
|
4
|
+
data.tar.gz: 5ecb12c7813bd402e25f3a09bb599269a3b8ed97437e733a975896f142f28c7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d3ce496a19a3539c5bbb5d83c417e064566b8001202084a48bd3e5d0c4d83db6e98adc309ed9ab5e3e167bd9b7d6f6dda3b357cddba66122b28cf45a7fa9f69
|
7
|
+
data.tar.gz: 6117494a568f48bd0a445b50c5c8f2664526e2e3a43ba310b8d640ecfe2a6cad87335cfab808fbbb7573ce954ea19777c6b0ff2cc55227dd8bfefd9ed17fc34d
|
@@ -46,37 +46,5 @@ module Api::Printer
|
|
46
46
|
::PrintWorker.perform_async(printer.ip, printer.port, result)
|
47
47
|
{ info: "Print job sent in background to #{printer.ip} on port #{printer.port}" }
|
48
48
|
end
|
49
|
-
|
50
|
-
def self.custom_action_printer_status params
|
51
|
-
printer = Printer.find(params[:id])
|
52
|
-
ip = printer.ip
|
53
|
-
port = printer.port
|
54
|
-
begin
|
55
|
-
s = Socket.tcp ip, port, connect_timeout: 0.5
|
56
|
-
# Must create intepolation between item and template
|
57
|
-
# Printer.template può essere anche
|
58
|
-
# una parola di comando epr chiedere lo stato della stampante, solo nel caso sia ok,
|
59
|
-
# Allora mando la stampa
|
60
|
-
s.puts("~hs")
|
61
|
-
# Attende per la risposta (si mette in wait)
|
62
|
-
response = []
|
63
|
-
while (response_text = s.gets)
|
64
|
-
response << response_text
|
65
|
-
break if response.count == 3
|
66
|
-
end
|
67
|
-
s.close
|
68
|
-
# Rails.logger.info "PrintIt: RESPONSE: #{response.inspect}"
|
69
|
-
first = response[0].split(",")
|
70
|
-
second = response[1].split(",")
|
71
|
-
return "HEAD UP" if second[2].to_i == 1
|
72
|
-
return "RIBBON OUT" if second[3].to_i == 1
|
73
|
-
return "PAPER OUT" if first[1].to_i == 1
|
74
|
-
return "PAUSE" if first[2].to_i == 1
|
75
|
-
return "OK"
|
76
|
-
rescue
|
77
|
-
Rails.logger.info "PrintIt: STATUS: UNREACHABLE"
|
78
|
-
return "UNREACHABLE"
|
79
|
-
end
|
80
|
-
end
|
81
49
|
end
|
82
50
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class AddPrintTemplateIdToPrinter < ActiveRecord::Migration[7.0]
|
2
2
|
def change
|
3
|
-
add_column :printers, :print_template_id, :bigint,
|
4
|
-
add_index :printers, :print_template_id,
|
3
|
+
add_column :printers, :print_template_id, :bigint, if_not_exists: true
|
4
|
+
add_index :printers, :print_template_id, if_not_exists: true
|
5
5
|
end
|
6
6
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_print_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_background_jobs
|