|
|
@ -164,39 +164,42 @@ function loadDevices() {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
groups = data.data;
|
|
|
|
groups = data.data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
viewModel.groups = groups;
|
|
|
|
if (groups.length == 1 && groups[0].id == 0) {
|
|
|
|
var content = template(viewModel);
|
|
|
|
$("#ast-container-parent").html($("#no-devices-div-content").html());
|
|
|
|
$("#ast-container-parent").html(content);
|
|
|
|
} else {
|
|
|
|
var deviceListing = $("#device-listing");
|
|
|
|
viewModel.groups = groups;
|
|
|
|
var deviceListingSrc = deviceListing.attr("src");
|
|
|
|
var content = template(viewModel);
|
|
|
|
var imageResource = deviceListing.data("image-resource");
|
|
|
|
$("#ast-container-parent").html(content);
|
|
|
|
$.template("device-listing", deviceListingSrc, function (template) {
|
|
|
|
var deviceListing = $("#device-listing");
|
|
|
|
for (var g in groups) {
|
|
|
|
var deviceListingSrc = deviceListing.attr("src");
|
|
|
|
if (groups[g].devices && groups[g].devices.length > 0) {
|
|
|
|
var imageResource = deviceListing.data("image-resource");
|
|
|
|
viewModel = {};
|
|
|
|
$.template("device-listing", deviceListingSrc, function (template) {
|
|
|
|
viewModel.devices = groups[g].devices;
|
|
|
|
for (var g in groups) {
|
|
|
|
viewModel.imageLocation = imageResource;
|
|
|
|
if (groups[g].devices && groups[g].devices.length > 0) {
|
|
|
|
content = template(viewModel);
|
|
|
|
viewModel = {};
|
|
|
|
} else {
|
|
|
|
viewModel.devices = groups[g].devices;
|
|
|
|
if (groupId && groupId != "0") {
|
|
|
|
viewModel.imageLocation = imageResource;
|
|
|
|
content = $("#no-grouped-devices-div-content").html();
|
|
|
|
content = template(viewModel);
|
|
|
|
} else if (groups[g].id == 0 && g == 0) {
|
|
|
|
|
|
|
|
content = $("#no-devices-div-content").html();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
content = $("#no-devices-in-group-div-content").html();
|
|
|
|
if (groupId && groupId != "0") {
|
|
|
|
|
|
|
|
content = $("#no-grouped-devices-div-content").html();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
content = $("#no-devices-in-group-div-content").html();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#ast-container-" + groups[g].id).html(content);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#ast-container-" + groups[g].id).html(content);
|
|
|
|
/*
|
|
|
|
}
|
|
|
|
* On device checkbox select add parent selected style class
|
|
|
|
/*
|
|
|
|
*/
|
|
|
|
* On device checkbox select add parent selected style class
|
|
|
|
$(deviceCheckbox).click(function () {
|
|
|
|
*/
|
|
|
|
addDeviceSelectedClass(this);
|
|
|
|
$(deviceCheckbox).click(function () {
|
|
|
|
});
|
|
|
|
addDeviceSelectedClass(this);
|
|
|
|
attachGroupEvents();
|
|
|
|
|
|
|
|
attachDeviceEvents();
|
|
|
|
|
|
|
|
formatDates();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
attachEvents();
|
|
|
|
}
|
|
|
|
formatDates();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
invokerUtil.get(serviceURL,
|
|
|
|
invokerUtil.get(serviceURL,
|
|
|
|
successCallback, function (message) {
|
|
|
|
successCallback, function (message) {
|
|
|
@ -260,7 +263,7 @@ function hidePopup() {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Following functions should be triggered after AJAX request is made.
|
|
|
|
* Following functions should be triggered after AJAX request is made.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function attachEvents() {
|
|
|
|
function attachDeviceEvents() {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Following click function would execute
|
|
|
|
* Following click function would execute
|
|
|
|
* when a user clicks on "Remove" link
|
|
|
|
* when a user clicks on "Remove" link
|
|
|
@ -535,7 +538,7 @@ function attachGroupAdding() {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Following functions should be triggered after AJAX request is made.
|
|
|
|
* Following functions should be triggered after AJAX request is made.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function attachEvents() {
|
|
|
|
function attachGroupEvents() {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Following click function would execute
|
|
|
|
* Following click function would execute
|
|
|
|