|
|
|
@ -6,11 +6,47 @@
|
|
|
|
|
|
|
|
|
|
function openTrackingInfoPage(id) {
|
|
|
|
|
if (typeof id == "undefined" || id == null || id == "") {
|
|
|
|
|
app.input.validate("#deviceid");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
router.navigate("/track/" + id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addClientMachineSuggestions() {
|
|
|
|
|
$("#client-link-account-message").addClass("display-none");
|
|
|
|
|
$("#client-machine-suggestion-list").addClass("display-none");
|
|
|
|
|
$("#client-machine-suggestion-list-preloader").addClass("display-none");
|
|
|
|
|
$("#client-machine-suggestion-list ul").html("");
|
|
|
|
|
if (inStorage("client_uuid")) {
|
|
|
|
|
$("#client-machine-suggestion-list-preloader").removeClass("display-none");
|
|
|
|
|
apirequest(
|
|
|
|
|
SETTINGS.apis.getmachines,
|
|
|
|
|
{
|
|
|
|
|
clientuuid: getStorage("client_uuid")
|
|
|
|
|
},
|
|
|
|
|
function (resp) {
|
|
|
|
|
if (resp.status == "OK") {
|
|
|
|
|
if (resp.machines.length > 0) {
|
|
|
|
|
for (var i = 0; i < resp.machines.length; i++) {
|
|
|
|
|
var id = resp.machines[i].id;
|
|
|
|
|
var type = resp.machines[i].type.label;
|
|
|
|
|
var icon = resp.machines[i].icon;
|
|
|
|
|
$("#client-machine-suggestion-list ul").append('<li><a class="item-link item-content" href="/track/' + id + '">'
|
|
|
|
|
+ '<div class="item-inner"><div class="item-title">'
|
|
|
|
|
+ '<i class="' + icon + '"></i> ' + type + " #" + id
|
|
|
|
|
+ '</div></div></a></li>');
|
|
|
|
|
}
|
|
|
|
|
$("#client-machine-suggestion-list").removeClass("display-none");
|
|
|
|
|
}
|
|
|
|
|
$("#client-machine-suggestion-list-preloader").addClass("display-none");
|
|
|
|
|
}
|
|
|
|
|
}, "GET");
|
|
|
|
|
} else {
|
|
|
|
|
$("#client-link-account-message").removeClass("display-none");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function trackOpenAsync(routeTo, routeFrom, resolve, reject) {
|
|
|
|
|
app.dialog.preloader("Loading...");
|
|
|
|
|
|
|
|
|
|