|
|
@ -32,6 +32,20 @@ var resetLoader = function () {
|
|
|
|
$('#lbl-execution').addClass("hidden");
|
|
|
|
$('#lbl-execution').addClass("hidden");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function changeLabel(type) {
|
|
|
|
|
|
|
|
$(".modal #operation-error-msg").addClass("hidden");
|
|
|
|
|
|
|
|
if (type == "no") {
|
|
|
|
|
|
|
|
$(".modal #operation-warn-msg span").text("File will be saved in default location if not specified.");
|
|
|
|
|
|
|
|
$(".modal #operation-warn-msg").removeClass("hidden");
|
|
|
|
|
|
|
|
document.getElementById('fileURL').placeholder = "FTP URL of the file";
|
|
|
|
|
|
|
|
document.getElementById('fileLocation').placeholder = "Location to save file in device";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$(".modal #operation-warn-msg").addClass("hidden");
|
|
|
|
|
|
|
|
document.getElementById('fileURL').placeholder = "FTP URL of the folder to upload file";
|
|
|
|
|
|
|
|
document.getElementById('fileLocation').placeholder = "File location in the device";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function submitForm(formId) {
|
|
|
|
function submitForm(formId) {
|
|
|
|
$("#btnSend").addClass("hidden");
|
|
|
|
$("#btnSend").addClass("hidden");
|
|
|
|
$("#lbl-execution").removeClass("hidden");
|
|
|
|
$("#lbl-execution").removeClass("hidden");
|
|
|
@ -57,6 +71,8 @@ function submitForm(formId) {
|
|
|
|
payload[input.attr("id")] = input.val();
|
|
|
|
payload[input.attr("id")] = input.val();
|
|
|
|
} else if (input.attr("type") == "checkbox") {
|
|
|
|
} else if (input.attr("type") == "checkbox") {
|
|
|
|
payload[input.attr("id")] = input.is(":checked");
|
|
|
|
payload[input.attr("id")] = input.is(":checked");
|
|
|
|
|
|
|
|
} else if (input.attr("type") == "radio") {
|
|
|
|
|
|
|
|
payload[input.attr("id")] = input.is(":checked");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -180,12 +196,15 @@ function validatePayload(operationCode, payload) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "FILE_TRANSFER":
|
|
|
|
case "FILE_TRANSFER":
|
|
|
|
if (!payload.fileURL) {
|
|
|
|
if (payload.upload && !payload.fileURL) {
|
|
|
|
returnVal = "Please enter the URL of the file in server";
|
|
|
|
returnVal = "Please enter the FTP URL of the file";
|
|
|
|
}else if(!payload.ftpPassword){
|
|
|
|
} else if (!payload.upload && !payload.fileURL) {
|
|
|
|
|
|
|
|
returnVal = "Please enter the FTP URL of the folder to upload file";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!payload.ftpPassword) {
|
|
|
|
returnVal = "Please enter FTP password";
|
|
|
|
returnVal = "Please enter FTP password";
|
|
|
|
}else if(!payload.savingDirectory){
|
|
|
|
} else if (!payload.upload && !payload.fileLocation) {
|
|
|
|
returnVal = "Please enter the location in device where you wan to save the file";
|
|
|
|
returnVal = "Please specify the file location in device";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -254,8 +273,9 @@ var generatePayload = function (operationCode, operationData, deviceList) {
|
|
|
|
"operation": {
|
|
|
|
"operation": {
|
|
|
|
"fileURL": operationData["fileURL"],
|
|
|
|
"fileURL": operationData["fileURL"],
|
|
|
|
"ftpPassword": operationData["ftpPassword"],
|
|
|
|
"ftpPassword": operationData["ftpPassword"],
|
|
|
|
"savingDirectory": operationData["savingDirectory"]
|
|
|
|
"fileLocation": operationData["fileLocation"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
"upload": operationData["upload"]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case androidOperationConstants["ENCRYPT_STORAGE_OPERATION_CODE"]:
|
|
|
|
case androidOperationConstants["ENCRYPT_STORAGE_OPERATION_CODE"]:
|
|
|
|