-
Notifications
You must be signed in to change notification settings - Fork 0
/
old_index.html
150 lines (127 loc) · 4.86 KB
/
old_index.html
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
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 Contact Form</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
var socket = io.connect('http://localhost:3000');
$('#btnSubmit').click(function(e){
var obj = {
name: $("#name").val(),
version: $("#version").val(),
package: $("#package").val(),
image_url: $("#image_url").val(),
active: $('input[name="active"]:checked').val(),
apks: {
apk_name: $("#apk_name").val(),
apk_url: $("#apk_url").val(),
}
};
JSON.stringify(obj);
socket.emit("addApp", obj);
$('#form').submit();
setTimeout(function(){window.location.reload();},20);
});
$('#btnUpdate').click(function(e){
e.preventDefault();
var obj = {
device_id: "590a2a9d6dbd498539abfb9e",
app_id : "5903a16d4882f4e6e8a2cc02",
date: "02/05/2017",
status: "INSTALL"
};
JSON.stringify(obj);
socket.emit("updateStatusApp", obj, function(status) {
document.getElementById('resultado').innerText = 'Resultado = ' + status;
});
//$('#formUpdate').submit();
//setTimeout(function(){window.location.reload();},20);
});
$('#btnCheck').click(function(e){
e.preventDefault();
var obj = {
android_id: "4823748374",
imei: "2815476582934",
imsi: "42934029123",
iccid: "1948234",
sim_operator: "12874",
rooted: "CyanogenMod",
model: "Xperia Z3 D6643",
manufacturer: "Sony",
version_sdk: "5.1.1",
version_os: "CyanogenMod"
};
JSON.stringify(obj);
socket.emit("checkApps", obj, function(retorno) {
//console.log(retorno);
//JSON.stringify(retorno);
document.getElementById('resultado').innerText = 'Resultado = ' + retorno.apps.app_id;
});
//$('#formCheck').submit();
//setTimeout(function(){window.location.reload();},20);
});
});
</script>
</head>
<body>
<form class="cadastro_app" action="/" name="cadastro_app" id="form">
<ul>
<li>
<h2>APP Registration</h2>
</li>
<li>
<label for="name">Name:</label>
<input type="text" name="name" id="name"/>
</li>
<li>
<label for="version">Version:</label>
<input type="text" name="version" id="version"/>
</li>
<li>
<label for="package">Package:</label>
<input type="text" name="package" id="package"/>
</li>
<li>
<label for="image_url">Image URL:</label>
<input type="text" name="image_url" id="image_url"/>
</li>
<li>
<label>Active:</label>
<br/>
<input type="radio" name="active" value="true"> True<br>
<input type="radio" name="active" value="false"> False<br>
</li>
<br/>
<label>APK</label>
<li>
<label for="apk_name">APK name:</label>
<input type="text" name="apk_name" id="apk_name"/>
</li>
<li>
<label for="apk_url">APK URL:</label>
<input type="text" name="apk_url" id="apk_url"/>
</li>
<li>
<button id="btnSubmit" class="btnSubmit" type="submit">Register APP</button>
</li>
</ul>
</form>
<form action="" name="update_app" id="formUpdate">
<li>
<button id="btnUpdate" class="btnUpdate" type="submit">Update Status App</button>
</li>
</form>
<form action="" name="check_app" id="formCheck">
<li>
<button id="btnCheck" class="btnCheck" type="submit">Check App</button>
</li>
</form>
<b/>
<label id="resultado"></label>
</body>
</html>