-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
194 lines (176 loc) · 10 KB
/
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
initial-scale=1, shrink-to-fit=no" />
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800" rel="stylesheet">
<!-- Bootstrap and FontAwesome -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="./style.css" />
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet" />
<script defer src="./js/fontawesome/all.js"></script>
<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})
</script>
<!-- PubNub SDK -->
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.7.6.1.min.js"></script>
<!-- Application logic -->
<script src="./js/constants.js"></script>
<script src="./js/keys.js"></script>
<script src="./js/device_edit.js"></script>
<script src="./js/pubnub_setup.js"></script>
<!-- Interactive Demo Framework -->
<script type="text/javascript"
src="https://darryncampbell-pubnub.github.io/pubnub-demo-utils/js/interactive-demo-interface/v2/demo-interface.js"></script>
</head>
<!-- Interactive demo hosts this content in a window 824 pixels wide -->
<body id="body" onload="onload();">
<!--script src="/reload/reload.js"></script-->
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
<!-- Shown if no PubNub keys found in setup.js -->
<div class="container alert alert-danger alert-dismissible fade show" style="display:none" id="noKeysAlert"
role="alert">
<i class="fa-solid fa-triangle-exclamation"></i>
<strong>Cannot find PubNub keys.</strong> Please specify your PubNub keys in keys.js.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<!-- Main app body -->
<div class="container-fluid">
<div class="row gy-2">
<div class="col-lg-8 col-md-7 nopadding">
<div style="height:100%;height: 700px;" id="map-canvas">.</div>
</div>
<div class="col">
<div class="row gy-2">
<div style="" id="" class="px-0">
<div style="" id="" class="px-0">
<div class="card text-dark bg-light mb-3" style="width:100%;">
<div class="card-header text-center emphasised-body">Registered Vehicles</div>
<button type="button" class="btn pn-btn" id="btnDispatchVehicle"
onclick="dispatchVehicle_click()">Dispatch Vehicle</button>
<div class="form-check" style="margin:5px">
<input type="checkbox" class="form-check-input" id="chkFindMyLocation"
onchange="handleChkFindMyLocation();">
<label class="form-check-label text-body-2" for="chkFindMyLocation">Localize:
Dispatch Vehicles from Near Me</label>
<span class="location-span text-body-3" id="spanDetectedLocation">[Not
Requested]</span>
</div>
<ul class="list-group list-group-flush" id="registeredVehiclesList">
</ul>
</div>
<div id="developer-note" class="text-label developer-message developer-message-info">
<img id="developer-note-icon" class="login-message-icon login-message-icon-info">
<span id="login-message-text"><b>Getting Started:</b> Please dispatch a vehicle to start the demo</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer pt-3" style="display:none">
<div class="container-fluid">
<div class="row align-items-center justify-content-lg-between">
<div class="col-lg-3 mb-lg-0 mb-4">
<div class="copyright text-center text-sm text-muted text-lg-start">
©
<script>
document.write(new Date().getFullYear())
</script> PubNub
</div>
</div>
<div class="col-lg-6">
</div>
<div class="col-lg-3">
<ul class="nav nav-footer justify-content-center justify-content-lg-end">
<li class="nav-item">
<a href="https://www.pubnub.com" class="nav-link text-muted"
target="_blank">PubNub.com</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<!-- Modal: Edit Device -->
<div class="modal" id="editModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content p-2">
<div class="modal-header">
<h5 class="modal-title" id="editModalTitle">Vehicle: </h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="editModalPushMessage" class="form-label" id="editModalPushMessageLabel">Send
Push Message to Driver: </label>
<div class="alert alert-primary alert-dismissible fade show" role="alert">
You can send Push Messages, FCM on Android & APNS on Apple using PubNub to simplify
your
application logic and avoid platform-specific code. This demo simulates Push, but you
can see a real Push Message being
exchanged over PubNub using our dedicated <a href="https://www.pubnub.com/demos/push/"
target="_blank">Push demo</a>
<button type="button" class="btn-close" data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
<div class="buttonRow">
<input type="text" class="form-control" placeholder="Push Message to Send to Driver"
id="editModalPushMessage">
<span class="">
<button type="button" class="btn pn-btn" style="margin-left:5px"
id="editModalPushMessageBtn">Send</button>
</span>
</div>
<HR width="100%">
</div>
<div class="buttonRow">
<label class="form-label" style="margin-bottom:0px">Restart the onboard temperature sensor:</label>
<button type="button" class="btn pn-btn" id="editModalReboot"><nobr>Reboot Sensor</nobr></button>
</div>
<HR width="100%">
<div class="buttonRow">
<label class="form-label" style="margin-bottom:0px">Change the next delivery location:</label>
<button type="button" class="btn pn-btn" style="margin-top: 5px" id="editModalReroute"><nobr>Redirect Vehicle</nobr></button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn pn-btn-white" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</main>
<!-- Bootstrap -->
<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
integrity="sha384-5AkRS45j4ukf+JbWAfHL8P4onPA9p0KwwP7pUdjSQA3ss9edbJUJc/XcYAiheSSz"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"></script>
<!-- Application logic -->
<script src="./js/dispatch_helper.js"></script>
<script src="./js/simulation/mocked_server.js"></script>
<script src="./js/pubnub_handler.js"></script>
<script src="./js/table_ui.js"></script>
<script>
// Map
var jsElem = window.document.createElement('script');
jsElem.src = "https://maps.googleapis.com/maps/api/js?key=" + GOOGLE_MAP_KEY + "&callback=initialize&loading=async";
jsElem.type = 'text/javascript';
document.getElementById('body').append(jsElem);
</script>
<script src="./js/map.js"></script>
</body>
</html>