Subversion Repository Public Repository

gpstest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%  
    String email=session.getAttribute("email").toString();  
    String password=session.getAttribute("password").toString();  
%>
<title>Nrusingh GPS</title>
<link href="css/main.css" rel="stylesheet" />
<link href="css/topmenu.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script type="text/javascript">
	$(function(){
		var eml = '<%= email%>';
		//console.log(eml);
		$('#loader_map').hide();
		var url = '';
		//url = 'http://23.92.61.79:8082/api/devices/';
		var position_url = 'http://23.92.61.79:8082/api/positions/';
		var device_url = 'http://23.92.61.79:8082/api/devices';
		
		var username = "admin";
		var password = "admin";

		$('#loader_left').show();
		$.ajax({
			type: 'get',
			url: device_url,
			headers: {
				"Accept": "application/json",         
				"Content-Type": "application/json",
				"Authorization": "Basic " + btoa(username + ":" + password)
			},
			'dataType': 'json',
			success: function (response) {
				//console.log('Success: '+JSON.stringify(response));
				$.each(response, function(k,v){
					var id = v.id;
					var name = v.name;
					var uniqueId = v.uniqueId;
					var status = v.status;
					console.log('###Deviceid: '+id+'Success: '+JSON.stringify(response));
					
					var html =  '<div><a href="#">'+
								'<div class="device_details_name">'+name+'</div>'+
								'<div class="device_details_othr">'+status+'</div>'+
								'<div class="device_details_othr">'+uniqueId+'</div>'+
								//'<div>'+id+'</div>'+
								'</a></div>';
					$("#ul_device_list").append($(" <li class='device_li_"+status+"' id='"+id+"^"+uniqueId+"^"+name+"^"+status+"'> ").html(html));
				});
				$('#loader_left').hide();
			},
			error: function(response){
				console.log('Error: '+JSON.stringify(response));
				$('#loader_left').hide();
			}
		});
		
		$(document).on("click", "#ul_device_list li", function(event) {
	      var li_id = $(this).attr('id');
	      var id = li_id.split('^')[0];
	      var uniqueId = li_id.split('^')[1];
	      var name = li_id.split('^')[2];
	      var status = li_id.split('^')[3];
	      $('#loader_map').show();
	      $.ajax({
				async:false,
				cache:false,
				dataType:"json",
				type: "POST",  
				url: "map.jsp",
				data:{id:id,uniqueId:uniqueId,name:name,status:status},
				success: function (response) {
					$('#loader_map').hide();
					console.log('Success: ');
					$('#div_map').html("");
					$('#div_map').html(response.responseText);
				},
				error: function (response) {
					$('#loader_map').hide();
					console.log('Error: ');
					$('#div_map').html("");
					$('#div_map').html(response.responseText);
				}
			});
	    });
		
	});
	
	
</script>

</head>
<body>
	<div class="container">
		<!-- top panel -->
		<header>
		<div><img src="images/logo1.png" style="width: 100px;"></div>
		<div style="margin-top: -95px; margin-left: 180px;"><h1><a href="login" style="text-decoration: none;color: white;">NRUSiNGH GPS TRACKER</a></h1></div>
		
		<div style="float: right; margin-top: -40px;">
			<span style="font-weight: 900; text-transform: uppercase; vertical-align: 7px;"><%=session.getAttribute("email")%></span>
			<a href="logout"><img src="images/logout.png" alt="logout" style="width: 22px; margin-right: 15px;"/></a>
		</div>
		<jsp:include page="menu.jsp" />
		</header>
		<!-- top panel ends -->

		<!-- left panel -->
		<nav> 
		<div id="loader_left">
			<img id="loader_img_left" alt="Loding ..." src="images/loader.gif" />
		</div>
		<ul id="ul_device_list"></ul>
		</nav>
		<!-- left panel ends -->

		<!-- right panel -->
		<article> <!-- <p><a href="map.jsp">Map</a></p> -->
		<div id="div_map" style="border: 1px solid grey">
			<div id="loader_map" style="disply: none;">
				<img id="loader_img_map" alt="Loding ..." src="images/loader.gif" />
			</div>
		</div>
		</article>
		<!-- right panel ends -->

		<!-- buttom panel -->
		<footer><div style="text-align: center"> Copyright &copy; Nrusingha nath Nayak</div></footer>
		<!-- buttom panel ends -->
	</div>
</body>
</html>

Commits for gpstest/WebContent/_live_tracking.jsp

Diff revisions: vs.
Revision Author Commited Message
1 lingaraj picture lingaraj Sat 24 Nov, 2018 13:04:59 +0000