Skip to content

Commit

Permalink
Corrigiendo la manera de comunicarse con el cliente para inicial el r…
Browse files Browse the repository at this point in the history
…eloj
  • Loading branch information
edelCustodio committed Sep 3, 2018
1 parent d50a344 commit 4f64a8a
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 3 deletions.
303 changes: 303 additions & 0 deletions html/corte.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Skynet</title>

<!-- Vendor CSS -->
<link href="../libs/css/animate.min.css" rel="stylesheet">
<link href="../libs/css/material-design-iconic-font.min.css" rel="stylesheet">
<link href="../libs/css/jquery.mCustomScrollbar.min.css" rel="stylesheet">
<link href="../libs/css/google-material-color/palette.css" rel="stylesheet">
<link href="../libs/css/chosen.min.css" rel="stylesheet">

<!-- CSS -->
<link href="../css/app.min.1.css" rel="stylesheet">
<link href="../css/app.min.2.css" rel="stylesheet">

</head>
<body data-ma-header="teal">
<header id="header" class="media">
<div class="pull-left h-logo">
<a href="index.html" class="hidden-xs">
Skynet
<small>Cyber admin</small>
</a>

<div class="menu-collapse" data-ma-action="sidebar-open" data-ma-target="main-menu">
<div class="mc-wrap">
<div class="mcw-line top palette-White bg"></div>
<div class="mcw-line center palette-White bg"></div>
<div class="mcw-line bottom palette-White bg"></div>
</div>
</div>
</div>

<ul class="pull-right h-menu">
<!--<li class="hm-search-trigger">
<a href="#" data-ma-action="search-open">
<i class="hm-icon zmdi zmdi-search"></i>
</a>
</li>
<li class="dropdown hidden-xs hidden-sm h-apps">
<a data-toggle="dropdown" href="#">
<i class="hm-icon zmdi zmdi-apps"></i>
</a>
<ul class="dropdown-menu pull-right">
<li>
<a href="#">
<i class="palette-Red-400 bg zmdi zmdi-calendar"></i>
<small>Calendar</small>
</a>
</li>
<li>
<a href="#">
<i class="palette-Green-400 bg zmdi zmdi-file-text"></i>
<small>Files</small>
</a>
</li>
<li>
<a href="#">
<i class="palette-Light-Blue bg zmdi zmdi-email"></i>
<small>Mail</small>
</a>
</li>
<li>
<a href="#">
<i class="palette-Orange-400 bg zmdi zmdi-trending-up"></i>
<small>Analytics</small>
</a>
</li>
<li>
<a href="#">
<i class="palette-Purple-300 bg zmdi zmdi-view-headline"></i>
<small>News</small>
</a>
</li>
<li>
<a href="#">
<i class="palette-Blue-Grey bg zmdi zmdi-image"></i>
<small>Gallery</small>
</a>
</li>
</ul>
</li>
<li class="dropdown hidden-xs">
<a data-toggle="dropdown" href="#"><i class="hm-icon zmdi zmdi-more-vert"></i></a>
<ul class="dropdown-menu dm-icon pull-right">
<li class="hidden-xs">
<a data-action="fullscreen" href="#"><i class="zmdi zmdi-fullscreen"></i> Toggle Fullscreen</a>
</li>
<li>
<a data-action="clear-localstorage" href="#"><i class="zmdi zmdi-delete"></i> Clear Local Storage</a>
</li>
<li>
<a href="#"><i class="zmdi zmdi-face"></i> Privacy Settings</a>
</li>
<li>
<a href="#"><i class="zmdi zmdi-settings"></i> Other Settings</a>
</li>
</ul>
</li>
<li class="hm-alerts" data-user-alert="sua-messages" data-ma-action="sidebar-open" data-ma-target="user-alerts">
<a href="#"><i class="hm-icon zmdi zmdi-notifications"></i></a>
</li>-->
<li class="dropdown hm-profile">
<a data-toggle="dropdown" href="#">
<img src="../img/1.jpg" alt="">
</a>

<ul class="dropdown-menu pull-right dm-icon">
<!-- <li>
<a onclick="lockDesktop();" style="cursor: pointer;"><i class="zmdi zmdi-refresh zmdi-hc-fw"></i> bloquear</a>
</li> -->

<li>
<a id="logout" style="cursor: pointer;"><i class="zmdi zmdi-block zmdi-hc-fw"></i> Cerrar sesion</a>
</li>
</ul>
</li>
</ul>
<!--
<div class="media-body h-search">
<form class="p-relative">
<input type="text" class="hs-input" placeholder="Search for people, files & reports">
<i class="zmdi zmdi-search hs-reset" data-ma-action="search-clear"></i>
</form>
</div>
-->
</header>

<section id="main">
<aside id="s-user-alerts" class="sidebar">
<ul class="tab-nav tn-justified tn-icon m-t-10" data-tab-color="teal">
<!--<li><a class="sua-messages" href="#sua-messages" data-toggle="tab"><i class="zmdi zmdi-email"></i></a></li>-->
<li><a class="sua-notifications" href="#sua-notifications" data-toggle="tab"><i class="zmdi zmdi-notifications"></i></a></li>
</ul>

<div class="tab-content">

<div class="tab-pane fade" id="sua-notifications">
<ul class="sua-menu list-inline list-unstyled palette-Orange bg">
<li><a href="#"><i class="zmdi zmdi-volume-off"></i> Mute</a></li>
<li><a href="#"><i class="zmdi zmdi-long-arrow-tab"></i> View all</a></li>
<li><a href="#" data-ma-action="sidebar-close"><i class="zmdi zmdi-close"></i> Close</a></li>
</ul>

<div class="list-group lg-alt c-overflow">
<a href="#" class="list-group-item media">
<div class="pull-left">
<img class="avatar-img" src="../img/1.jpg" alt="">
</div>

<div class="media-body">
<div class="lgi-heading">David Villa Jacobs</div>
<small class="lgi-text">Sorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam mattis lobortis sapien non posuere</small>
</div>
</a>

<a href="#" class="list-group-item media">
<div class="pull-left">
<img class="avatar-img" src="../img/5.jpg" alt="">
</div>
<div class="media-body">
<div class="lgi-heading">Candice Barnes</div>
<small class="lgi-text">Quisque non tortor ultricies, posuere elit id, lacinia purus curabitur.</small>
</div>
</a>

<a href="#" class="list-group-item media">
<div class="pull-left">
<img class="avatar-img" src="../img/3.jpg" alt="">
</div>
<div class="media-body">
<div class="lgi-heading">Jeannette Lawson</div>
<small class="lgi-text">Donec congue tempus ligula, varius hendrerit mi hendrerit sit amet. Duis ac quam sit amet leo feugiat iaculis</small>
</div>
</a>

<a href="#" class="list-group-item media">
<div class="pull-left">
<img class="avatar-img" src="../img/4.jpg" alt="">
</div>
<div class="media-body">
<div class="lgi-heading">Darla Mckinney</div>
<small class="lgi-text">Duis tincidunt augue nec sem dignissim scelerisque. Vestibulum rhoncus sapien sed nulla aliquam lacinia</small>
</div>
</a>

<a href="#" class="list-group-item media">
<div class="pull-left">
<img class="avatar-img" src="../img/2.jpg" alt="">
</div>
<div class="media-body">
<div class="lgi-heading">Rudolph Perez</div>
<small class="lgi-text">Phasellus a ullamcorper lectus, sit amet viverra quam. In luctus tortor vel nulla pharetra bibendum</small>
</div>
</a>
</div>
</div>

</div>
</aside>

<aside id="s-main-menu" class="sidebar">
<div class="smm-header">
<i class="zmdi zmdi-long-arrow-left" data-ma-action="sidebar-close"></i>
</div>

<ul class="smm-alerts">
<li class="active" style="visibility: hidden;" data-user-alert="sua-notifications" data-ma-action="sidebar-open" data-ma-target="user-alerts">
<i class="zmdi zmdi-notifications"></i>
</li>
</ul>

<ul class="main-menu">
<li class="active">
<a href="index.html"><i class="zmdi zmdi-home"></i> Principal</a>
</li>
<li><a href="punto-venta.html"><i class="zmdi zmdi-money"></i> Punto de venta</a></li>
<!-- <li class="sub-menu">
<a data-ma-action="submenu-toggle"><i class="zmdi zmdi-collection-plus zmdi-hc-fw"></i> Catalogos</a>
<ul>
<li><a href="usuario.html"><i class="zmdi zmdi-account-add zmdi-hc-fw"></i> Usuario</a></li>
<li><a href="producto.html"><i class="zmdi zmdi-truck zmdi-hc-fw"></i> Producto</a></li>
<li><a href="computadora.html"><i class="zmdi zmdi-desktop-mac zmdi-hc-fw"></i> Computadora</a></li>
</ul>
</li> -->
<li><a href="corte.html"><i class="zmdi zmdi-storage" ></i> Corte de caja</a></li>
<!-- <li><a href="widgets.html"><i class="zmdi zmdi-storage" ></i> Inventario</a></li>
<li><a href="widgets.html"><i class="zmdi zmdi-card"></i> Creditos</a></li>
<li><a href="invoice.html"><i class="zmdi zmdi-storage"></i> Facturas</a></li> -->
</ul>
</aside>

<section id="content">
<div class="container">
<div class="c-header">
<h2>Corte de caja</h2>
</div>


</div>
</section>

<footer id="footer">
Copyright &copy; 2017 friasoftIt

<ul class="f-menu">
<li><a href="#">Home</a></li>
<li><a href="#">Dashboard</a></li>
<li><a href="#">Reports</a></li>
<li><a href="#">Support</a></li>
<li><a href="#">Contact</a></li>
</ul>
</footer>

</section>

<!-- Page Loader -->
<div class="page-loader palette-Teal bg">
<div class="preloader pl-xl pls-white">
<svg class="pl-circular" viewBox="25 25 50 50">
<circle class="plc-path" cx="50" cy="50" r="20"/>
</svg>
</div>
</div>

<!-- Javascript Libraries -->
<script src="../libs/js/bootstrap.min.js"></script>

<!--<script src="./vendors/bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>-->
<script src="../libs/js/waves.min.js"></script>
<script src="../libs/js/bootstrap-growl.min.js"></script>
<script src="../libs/js/moment.min.js"></script>
<script src="../libs/js/jquery.simpleWeather.min.js"></script>
<script src="../libs/js/salvattore.min.js"></script>

<script src="../libs/js/jquery.flot.js"></script>
<script src="../libs/js/jquery.flot.resize.js"></script>
<script src="../libs/js/curvedLines.js"></script>
<script src="../libs/js/jquery.sparkline.min.js"></script>
<script src="../libs/js/mfb.min.js"></script>
<script src="../libs/js/typeahead.bundle.min.js"></script>
<script src="../libs/js/chosen.jquery.min.js"></script>



<!-- Placeholder for IE9 -->
<!--[if IE 9 ]>
<script src="vendors/bower_components/jquery-placeholder/jquery.placeholder.min.js"></script>
<![endif]-->

<script src="../js/functions.js"></script>
<script src="../js/actions.js"></script>
<script src="../js/demo.js"></script>

</body>
</html>
1 change: 1 addition & 0 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
<li><a href="computadora.html"><i class="zmdi zmdi-desktop-mac zmdi-hc-fw"></i> Computadora</a></li>
</ul>
</li> -->
<li><a href="corte.html"><i class="zmdi zmdi-storage" ></i> Corte de caja</a></li>
<!-- <li><a href="widgets.html"><i class="zmdi zmdi-storage" ></i> Inventario</a></li>
<li><a href="widgets.html"><i class="zmdi zmdi-card"></i> Creditos</a></li>
<li><a href="invoice.html"><i class="zmdi zmdi-storage"></i> Facturas</a></li> -->
Expand Down
1 change: 1 addition & 0 deletions html/punto-venta.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<a href="index.html"><i class="zmdi zmdi-home"></i> Principal</a>
</li>
<li class="active"><a href="punto-venta.html"><i class="zmdi zmdi-money"></i> Punto de venta</a></li>
<li><a href="corte.html"><i class="zmdi zmdi-storage" ></i> Corte de caja</a></li>
<!-- <li><a href="widgets.html"><i class="zmdi zmdi-storage"></i> Inventario</a></li>
<li><a href="widgets.html"><i class="zmdi zmdi-card"></i> Creditos</a></li>
<li><a href="invoice.html"><i class="zmdi zmdi-storage"></i> Facturas</a></li> -->
Expand Down
12 changes: 12 additions & 0 deletions js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 2 additions & 0 deletions js/server_side/cyber-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 4f64a8a

Please sign in to comment.