|
|
@ -24,6 +24,9 @@ function operationSelect(selection) {
|
|
|
|
$(modalPopupContent).addClass("operation-data");
|
|
|
|
$(modalPopupContent).addClass("operation-data");
|
|
|
|
$(modalPopupContent).html($(" .operation[data-operation-code=" + selection + "]").html());
|
|
|
|
$(modalPopupContent).html($(" .operation[data-operation-code=" + selection + "]").html());
|
|
|
|
$(modalPopupContent).data("operation-code", selection);
|
|
|
|
$(modalPopupContent).data("operation-code", selection);
|
|
|
|
|
|
|
|
if (selection === "FILE_TRANSFER") {
|
|
|
|
|
|
|
|
fillUserName();
|
|
|
|
|
|
|
|
}
|
|
|
|
showPopup();
|
|
|
|
showPopup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -32,6 +35,24 @@ var resetLoader = function () {
|
|
|
|
$('#lbl-execution').addClass("hidden");
|
|
|
|
$('#lbl-execution').addClass("hidden");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function fillUserName() {
|
|
|
|
|
|
|
|
var inputBox = document.getElementById('fileURL');
|
|
|
|
|
|
|
|
var regexp = ':\/\/[^\/]*@';
|
|
|
|
|
|
|
|
var pattern = new RegExp(regexp);
|
|
|
|
|
|
|
|
jQuery(inputBox).on('input', function () {
|
|
|
|
|
|
|
|
var fileUrl = inputBox.value;
|
|
|
|
|
|
|
|
var res = pattern.test(fileUrl);
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
|
|
|
|
var name = fileUrl.match(regexp).toString();
|
|
|
|
|
|
|
|
document.getElementById('userName').value = name.substring(3, name.length - 1);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
document.getElementById('userName').value = "";
|
|
|
|
|
|
|
|
document.getElementById('userName').placeholder = "User Name"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This changes the text box label when the operation is toggled between FILE UPLOAD and FILE DOWNLOAD
|
|
|
|
* This changes the text box label when the operation is toggled between FILE UPLOAD and FILE DOWNLOAD
|
|
|
|
* and shows an info label for FILE UPLOAD regarding saving location.
|
|
|
|
* and shows an info label for FILE UPLOAD regarding saving location.
|
|
|
@ -42,13 +63,14 @@ function changeLabel(type) {
|
|
|
|
if (type == "no") {
|
|
|
|
if (type == "no") {
|
|
|
|
$(".modal #operation-warn-msg span").text("File will be saved in default location if not specified.");
|
|
|
|
$(".modal #operation-warn-msg span").text("File will be saved in default location if not specified.");
|
|
|
|
$(".modal #operation-warn-msg").removeClass("hidden");
|
|
|
|
$(".modal #operation-warn-msg").removeClass("hidden");
|
|
|
|
document.getElementById('fileURL').placeholder = "HTTP/FTP URL of the file";
|
|
|
|
document.getElementById('fileURL').placeholder = "File URL";
|
|
|
|
document.getElementById('fileLocation').placeholder = "Location to save file in device";
|
|
|
|
document.getElementById('fileLocation').placeholder = "Location to save file in device";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(".modal #operation-warn-msg").addClass("hidden");
|
|
|
|
$(".modal #operation-warn-msg").addClass("hidden");
|
|
|
|
document.getElementById('fileURL').placeholder = "FTP URL of the folder to upload file";
|
|
|
|
document.getElementById('fileURL').placeholder = "URL for file upload";
|
|
|
|
document.getElementById('fileLocation').placeholder = "File location in the device";
|
|
|
|
document.getElementById('fileLocation').placeholder = "File location in the device";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fillUserName();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function submitForm(formId) {
|
|
|
|
function submitForm(formId) {
|
|
|
@ -275,6 +297,7 @@ var generatePayload = function (operationCode, operationData, deviceList) {
|
|
|
|
payload = {
|
|
|
|
payload = {
|
|
|
|
"operation": {
|
|
|
|
"operation": {
|
|
|
|
"fileURL": operationData["fileURL"],
|
|
|
|
"fileURL": operationData["fileURL"],
|
|
|
|
|
|
|
|
"userName": operationData["userName"],
|
|
|
|
"ftpPassword": operationData["ftpPassword"],
|
|
|
|
"ftpPassword": operationData["ftpPassword"],
|
|
|
|
"fileLocation": operationData["fileLocation"]
|
|
|
|
"fileLocation": operationData["fileLocation"]
|
|
|
|
},
|
|
|
|
},
|
|
|
|