Added Dockerfile and CI/CD for Imapsync
Added Core Functionality for Imapsync
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
import * as JSPM from 'jsprintmanager'
|
||||
|
||||
let printers = []
|
||||
let scanners = []
|
||||
|
||||
const doScanning = () => {
|
||||
|
||||
}
|
||||
|
||||
const doPrintZPL = () => {
|
||||
/*if(this.selected_printer === '' && !this.print2default) {
|
||||
@@ -44,6 +48,18 @@ const getPrinters = () => {
|
||||
} else { console.warn("JSPM WS not open"); ok(printers); }
|
||||
});
|
||||
}
|
||||
const getScanners = () => {
|
||||
return new Promise((ok, err) => {
|
||||
let scanners = [];
|
||||
if(JSPM.JSPrintManager.websocket_status === JSPM.WSStatus.Open) {
|
||||
JSPM.JSPrintManager.getScanners().then(function (myScanners) {
|
||||
printers = myScanners;
|
||||
console.log(scanners);
|
||||
ok(scanners);
|
||||
}).catch((e)=>err(e));
|
||||
} else { console.warn("JSPM WS not open"); ok(printers); }
|
||||
});
|
||||
}
|
||||
const initJSPM = () => {
|
||||
JSPM.JSPrintManager.auto_reconnect = true
|
||||
JSPM.JSPrintManager.start();
|
||||
@@ -51,6 +67,8 @@ const initJSPM = () => {
|
||||
JSPM.JSPrintManager.WS.onStatusChanged = () => {
|
||||
console.log("Status Changed")
|
||||
getPrinters().then(p => printers = p)
|
||||
getScanners().then(s => scanners = s)
|
||||
|
||||
}
|
||||
}
|
||||
initJSPM()
|
||||
@@ -58,6 +76,7 @@ initJSPM()
|
||||
|
||||
<template>
|
||||
{{printers}}
|
||||
{{scanners}}
|
||||
|
||||
|
||||
<UButton @click="doPrintZPL">Print</UButton>
|
||||
|
||||
Reference in New Issue
Block a user