From 4f64a8a5ce7c366947121c47271299ca92213144 Mon Sep 17 00:00:00 2001 From: edelCustodio Date: Sun, 2 Sep 2018 20:52:49 -0500 Subject: [PATCH] Corrigiendo la manera de comunicarse con el cliente para inicial el reloj --- html/corte.html | 303 ++++++++++++++++++++++++++++++++ html/index.html | 1 + html/punto-venta.html | 1 + js/common.js | 12 ++ js/server_side/cyber-control.js | 2 + main.js | 4 +- package.json | 2 +- 7 files changed, 322 insertions(+), 3 deletions(-) create mode 100644 html/corte.html diff --git a/html/corte.html b/html/corte.html new file mode 100644 index 0000000..dea5917 --- /dev/null +++ b/html/corte.html @@ -0,0 +1,303 @@ + + + + + + + + Skynet + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+

Corte de caja

+
+ + +
+
+ + + +
+ + +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/index.html b/html/index.html index ca2f5b0..ac70cde 100644 --- a/html/index.html +++ b/html/index.html @@ -233,6 +233,7 @@
  • Computadora
  • --> +
  • Corte de caja
  • diff --git a/html/punto-venta.html b/html/punto-venta.html index bed32b8..eefd4d2 100644 --- a/html/punto-venta.html +++ b/html/punto-venta.html @@ -165,6 +165,7 @@ Principal
  • Punto de venta
  • +
  • Corte de caja
  • diff --git a/js/common.js b/js/common.js index 3707028..fde6b7b 100644 --- a/js/common.js +++ b/js/common.js @@ -1097,6 +1097,18 @@ ipcRenderer.on('requestDesktopInfo', (event, arg) => { } }); +/** + * Comunicacion entre el cliente y la maquina de cobro para + * solicitar informacion de los registros de uso, + */ +ipcRenderer.on('requestDesktopRecord', (event, arg) => { + const desktop = getDesktopInfoByNameFromStorage(arg); + const record = Enumerable.from(_recordsNoPay).where(w => w.idComputadora === desktop.idComputadora && w.fechaFin === null).firstOrDefault(); + var client = getClient(desktop.nombre); + var j = { init: true, record: record }; + client.sock.write(JSON.stringify(j)); +}); + function lockDesktop() { var client = _arrClients[0]; diff --git a/js/server_side/cyber-control.js b/js/server_side/cyber-control.js index 16c31a9..d3a1977 100644 --- a/js/server_side/cyber-control.js +++ b/js/server_side/cyber-control.js @@ -90,6 +90,8 @@ var CyberControl = { main.getMainWindow().webContents.send('clientClosed', jsonData.hostname); } else if (jsonData !== null && jsonData.requestDesktopInfo) { main.getMainWindow().webContents.send('requestDesktopInfo', jsonData.client); + } else if (jsonData !== null && jsonData.init) { + main.getMainWindow().webContents.send('requestDesktopRecord', jsonData.client); } }); } catch (e) { diff --git a/main.js b/main.js index 1234c12..b8e457a 100644 --- a/main.js +++ b/main.js @@ -67,10 +67,10 @@ var Main = { slashes: true })); - // mainWindow.setMenu(null); + mainWindow.setMenu(null); // Open the DevTools. - mainWindow.webContents.openDevTools(); + // mainWindow.webContents.openDevTools(); // Emitted when the window is closed. mainWindow.on('closed', function () { diff --git a/package.json b/package.json index a5940e3..abeaab4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cyber-server", "main": "main.js", - "version": "0.1.10", + "version": "0.1.11", "license": "MIT", "description": "Aplicacion de escritorio para control de un cyber cafe asi como un punto de venta.", "author": "Edel Custodio Frias",