Detail Modal FIx / Contract Extension Fix
This commit is contained in:
@@ -668,7 +668,7 @@
|
|||||||
<div class="modal-footer" style="background-color: #840032; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color:#000">
|
<div class="modal-footer" style="background-color: #840032; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color:#000">
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<button class="btn btn-primary" id="contract-extension-button" type="button">Extend Hosting Contract</button>
|
<button class="btn btn-primary" id="contract-extension-button" type="button">Extend Hosting Contract</button>
|
||||||
<button type="button" class="btn btn-primary" data-dismiss="modal" id="reset-table-button">Close</button>
|
<button type="button" class="btn btn-primary" id="reset-table-button">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,15 +15,12 @@ const request = require('request');
|
|||||||
var $ethomessage;
|
var $ethomessage;
|
||||||
var $nodeId;
|
var $nodeId;
|
||||||
var $uploadMessage;
|
var $uploadMessage;
|
||||||
var $analyzeMessage;
|
|
||||||
var $nodeAddresses;
|
|
||||||
var $logs;
|
var $logs;
|
||||||
// Files
|
// Files
|
||||||
var $fetchButton;
|
var $fetchButton;
|
||||||
var $dragContainer;
|
var $dragContainer;
|
||||||
var $progressBar;
|
var $progressBar;
|
||||||
var $fileHistory;
|
var $fileHistory;
|
||||||
var $emptyRow;
|
|
||||||
// Misc
|
// Misc
|
||||||
var $allDisabledButtons;
|
var $allDisabledButtons;
|
||||||
var $allDisabledInputs;
|
var $allDisabledInputs;
|
||||||
@@ -227,6 +224,7 @@ class Uploads {
|
|||||||
if (result) {
|
if (result) {
|
||||||
$('#minedBlockTrackerModal').iziModal();
|
$('#minedBlockTrackerModal').iziModal();
|
||||||
$('#minedBlockTrackerModal').iziModal('open');
|
$('#minedBlockTrackerModal').iziModal('open');
|
||||||
|
$miningMessage = document.querySelector('.mining-message')
|
||||||
EthoUploads.waitForReceipt(result, function (receipt) {
|
EthoUploads.waitForReceipt(result, function (receipt) {
|
||||||
console.log("Transaction Has Been Mined: " + receipt);
|
console.log("Transaction Has Been Mined: " + receipt);
|
||||||
$('#minedBlockTrackerModal').iziModal('close');
|
$('#minedBlockTrackerModal').iziModal('close');
|
||||||
@@ -247,6 +245,7 @@ class Uploads {
|
|||||||
document.getElementById("wait").innerHTML = 'Waiting For Add User Confirmation.';
|
document.getElementById("wait").innerHTML = 'Waiting For Add User Confirmation.';
|
||||||
$('#minedBlockTrackerModal').iziModal();
|
$('#minedBlockTrackerModal').iziModal();
|
||||||
$('#minedBlockTrackerModal').iziModal('open');
|
$('#minedBlockTrackerModal').iziModal('open');
|
||||||
|
$miningMessage = document.querySelector('.mining-message')
|
||||||
EthoUploads.waitForReceipt(result, function (receipt) {
|
EthoUploads.waitForReceipt(result, function (receipt) {
|
||||||
console.log("Transaction Has Been Mined: " + receipt);
|
console.log("Transaction Has Been Mined: " + receipt);
|
||||||
$('#minedBlockTrackerModal').iziModal('close');
|
$('#minedBlockTrackerModal').iziModal('close');
|
||||||
@@ -291,7 +290,7 @@ class Uploads {
|
|||||||
//CHECK FOR TX - BLOCK TO BE MINED
|
//CHECK FOR TX - BLOCK TO BE MINED
|
||||||
waitForReceipt(hash, cb) {
|
waitForReceipt(hash, cb) {
|
||||||
web3.eth.getTransactionReceipt(hash, function (err, receipt) {
|
web3.eth.getTransactionReceipt(hash, function (err, receipt) {
|
||||||
document.getElementById("mining-status-message").textContent = "In Progress";
|
//document.getElementById("mining-status-message").textContent = "In Progress";
|
||||||
$miningMessage.innerText = "Waiting For Transaction Confirmation";
|
$miningMessage.innerText = "Waiting For Transaction Confirmation";
|
||||||
web3.eth.getBlock('latest', function (e, res) {
|
web3.eth.getBlock('latest', function (e, res) {
|
||||||
if (!e) {
|
if (!e) {
|
||||||
@@ -304,7 +303,7 @@ class Uploads {
|
|||||||
}
|
}
|
||||||
if (receipt !== null) {
|
if (receipt !== null) {
|
||||||
$miningMessage.innerText = "Transaction Confirmed";
|
$miningMessage.innerText = "Transaction Confirmed";
|
||||||
document.getElementById("mining-status-message").textContent = "Complete";
|
//document.getElementById("mining-status-message").textContent = "Complete";
|
||||||
if (cb) {
|
if (cb) {
|
||||||
cb(receipt);
|
cb(receipt);
|
||||||
}
|
}
|
||||||
@@ -335,6 +334,7 @@ class Uploads {
|
|||||||
if (result) {
|
if (result) {
|
||||||
$('#minedBlockTrackerModal').iziModal();
|
$('#minedBlockTrackerModal').iziModal();
|
||||||
$('#minedBlockTrackerModal').iziModal('open');
|
$('#minedBlockTrackerModal').iziModal('open');
|
||||||
|
$miningMessage = document.querySelector('.mining-message')
|
||||||
EthoUploads.waitForReceipt(result, function (receipt) {
|
EthoUploads.waitForReceipt(result, function (receipt) {
|
||||||
console.log("Transaction Has Been Mined: " + receipt);
|
console.log("Transaction Has Been Mined: " + receipt);
|
||||||
$('#minedBlockTrackerModal').iziModal('close');
|
$('#minedBlockTrackerModal').iziModal('close');
|
||||||
@@ -520,6 +520,7 @@ class Uploads {
|
|||||||
$('#uploadTrackerModal').iziModal();
|
$('#uploadTrackerModal').iziModal();
|
||||||
$('#uploadTrackerModal').iziModal('open');
|
$('#uploadTrackerModal').iziModal('open');
|
||||||
document.getElementById("upload-hash").innerHTML = HostingContractName;
|
document.getElementById("upload-hash").innerHTML = HostingContractName;
|
||||||
|
$uploadMessage = document.querySelector('.upload-message')
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -677,10 +678,11 @@ class Uploads {
|
|||||||
contractExtensionChange(selectObj) {
|
contractExtensionChange(selectObj) {
|
||||||
var index = selectObj.selectedIndex;
|
var index = selectObj.selectedIndex;
|
||||||
var extensionDuration = selectObj.options[index].value;
|
var extensionDuration = selectObj.options[index].value;
|
||||||
|
console.log("Extenstion Duration: " + extensionDuration);
|
||||||
GlobalExtensionDuration = extensionDuration;
|
GlobalExtensionDuration = extensionDuration;
|
||||||
document.getElementById("contract-extension-button").style.visibility = "visible";
|
document.getElementById("contract-extension-button").style.visibility = "visible";
|
||||||
var extensionCost = ((GlobalHostingContractDetailArray['storage'] / 1048576) * GlobalHostingCost) * (extensionDuration / 46522);
|
var extensionCost = ((GlobalHostingContractDetailArray['storage'] / 1048576) * GlobalHostingCost) * (extensionDuration / 46522);
|
||||||
document.getElementById("contract-extension-cost").innerHTML = round(extensionCost, 2);
|
document.getElementById("contract-extension-cost").innerHTML = EthoUploads.round(extensionCost, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//CONTRACT EXTENSION CONFIRM
|
//CONTRACT EXTENSION CONFIRM
|
||||||
@@ -711,7 +713,7 @@ class Uploads {
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
if (result) {
|
if (result) {
|
||||||
$("#contractDetailModal").iziModal("close");
|
$("#contractDetailModal").iziModal("close");
|
||||||
$("#contractDetailModal").iziModal();
|
$("#minedBlockTrackerModal").iziModal();
|
||||||
$("#minedBlockTrackerModal").iziModal("open");
|
$("#minedBlockTrackerModal").iziModal("open");
|
||||||
EthoUploads.waitForReceipt(result, function (receipt) {
|
EthoUploads.waitForReceipt(result, function (receipt) {
|
||||||
console.log("Transaction Has Been Mined: " + receipt);
|
console.log("Transaction Has Been Mined: " + receipt);
|
||||||
@@ -850,10 +852,12 @@ class Uploads {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resetProgress() {
|
resetProgress() {
|
||||||
|
$progressBar = document.querySelector('#progress-bar')
|
||||||
$progressBar.style.transform = 'translateX(-100%)'
|
$progressBar.style.transform = 'translateX(-100%)'
|
||||||
}
|
}
|
||||||
|
|
||||||
appendFile(name, hash, size, data) {
|
appendFile(name, hash, size, data) {
|
||||||
|
$fileHistory = document.querySelector('#file-history tbody')
|
||||||
const file = new window.Blob([data], {
|
const file = new window.Blob([data], {
|
||||||
type: 'application/octet-binary'
|
type: 'application/octet-binary'
|
||||||
})
|
})
|
||||||
@@ -891,9 +895,11 @@ class Uploads {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onDragEnter(event) {
|
onDragEnter(event) {
|
||||||
|
$dragContainer = document.querySelector('#drag-container')
|
||||||
$dragContainer.classList.add('dragging')
|
$dragContainer.classList.add('dragging')
|
||||||
}
|
}
|
||||||
onDragLeave() {
|
onDragLeave() {
|
||||||
|
$dragContainer = document.querySelector('#drag-container')
|
||||||
$dragContainer.classList.remove('dragging')
|
$dragContainer.classList.remove('dragging')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -961,7 +967,7 @@ class Uploads {
|
|||||||
if (response.status == 200) {
|
if (response.status == 200) {
|
||||||
hashConfirmationCount++;
|
hashConfirmationCount++;
|
||||||
var confirmationPercentage = Math.ceil((hashConfirmationCount / hashVerificationArray.length) * 100);
|
var confirmationPercentage = Math.ceil((hashConfirmationCount / hashVerificationArray.length) * 100);
|
||||||
updateUploadProgress(confirmationPercentage);
|
EthoUploads.updateUploadProgress(confirmationPercentage);
|
||||||
console.log("Data Upload Confirmation Received: " + hashConfirmationCount + "/" + hashVerificationArray.length);
|
console.log("Data Upload Confirmation Received: " + hashConfirmationCount + "/" + hashVerificationArray.length);
|
||||||
$uploadMessage.innerText = "Upload Confirmation Received: " + hashConfirmationCount + "/" + hashVerificationArray.length;
|
$uploadMessage.innerText = "Upload Confirmation Received: " + hashConfirmationCount + "/" + hashVerificationArray.length;
|
||||||
if (confirmationPercentage >= 99) {
|
if (confirmationPercentage >= 99) {
|
||||||
@@ -969,8 +975,8 @@ class Uploads {
|
|||||||
document.getElementById("upload-status-message").textContent = "Complete";
|
document.getElementById("upload-status-message").textContent = "Complete";
|
||||||
if (!uploadCompleteFlag) {
|
if (!uploadCompleteFlag) {
|
||||||
uploadCompleteFlag = true;
|
uploadCompleteFlag = true;
|
||||||
updateContractTable();
|
EthoUploads.updateContractTable();
|
||||||
finishUploadModal();
|
EthoUploads.finishUploadModal();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1052,6 +1058,7 @@ class Uploads {
|
|||||||
console.log("Result: " + result);
|
console.log("Result: " + result);
|
||||||
$("#minedBlockTrackerModal").iziModal();
|
$("#minedBlockTrackerModal").iziModal();
|
||||||
$('#minedBlockTrackerModal').iziModal('open');
|
$('#minedBlockTrackerModal').iziModal('open');
|
||||||
|
$miningMessage = document.querySelector('.mining-message')
|
||||||
$('#preparingUploadModal').iziModal('close');
|
$('#preparingUploadModal').iziModal('close');
|
||||||
EthoUploads.waitForReceipt(result, function (receipt) {
|
EthoUploads.waitForReceipt(result, function (receipt) {
|
||||||
console.log("Transaction Has Been Mined: " + receipt);
|
console.log("Transaction Has Been Mined: " + receipt);
|
||||||
@@ -1075,6 +1082,7 @@ class Uploads {
|
|||||||
if (result) {
|
if (result) {
|
||||||
$('#minedBlockTrackerModal').iziModal();
|
$('#minedBlockTrackerModal').iziModal();
|
||||||
$('#minedBlockTrackerModal').iziModal('open');
|
$('#minedBlockTrackerModal').iziModal('open');
|
||||||
|
$miningMessage = document.querySelector('.mining-message')
|
||||||
$('#preparingUploadModal').iziModal('close');
|
$('#preparingUploadModal').iziModal('close');
|
||||||
EthoUploads.waitForReceipt(result, function (receipt) {
|
EthoUploads.waitForReceipt(result, function (receipt) {
|
||||||
console.log("Transaction Has Been Mined: " + receipt);
|
console.log("Transaction Has Been Mined: " + receipt);
|
||||||
@@ -1177,7 +1185,7 @@ class Uploads {
|
|||||||
EthoUploads.appendFile(updatedPath, filename, stats.size, null);
|
EthoUploads.appendFile(updatedPath, filename, stats.size, null);
|
||||||
console.log("Path: " + filepath + " Size: " + stats.size + " Total Size: " + GlobalUploadSize);
|
console.log("Path: " + filepath + " Size: " + stats.size + " Total Size: " + GlobalUploadSize);
|
||||||
document.getElementById("upload-size").textContent = totalUploadSizeMB;
|
document.getElementById("upload-size").textContent = totalUploadSizeMB;
|
||||||
EthoUploads.contractDurationChange(document.getElementById('contract-duration').value);
|
EthoUploads.contractDurationChange(document.getElementById('contract-duration'));
|
||||||
streamCompareCount--;
|
streamCompareCount--;
|
||||||
EthoUploads.updateAnalyzeProgress(((totalUploadItems - streamCompareCount) / totalUploadItems));
|
EthoUploads.updateAnalyzeProgress(((totalUploadItems - streamCompareCount) / totalUploadItems));
|
||||||
if (streamCompareCount == 0) {
|
if (streamCompareCount == 0) {
|
||||||
@@ -1243,11 +1251,11 @@ class Uploads {
|
|||||||
GlobalUploadSize += Number(file.size);
|
GlobalUploadSize += Number(file.size);
|
||||||
fileSize += Number(file.size);
|
fileSize += Number(file.size);
|
||||||
var totalUploadSizeMB = GlobalUploadSize / 1000000;
|
var totalUploadSizeMB = GlobalUploadSize / 1000000;
|
||||||
appendFile(entry.fullPath, entry.name, file.size, null);
|
EthoUploads.appendFile(entry.fullPath, entry.name, file.size, null);
|
||||||
document.getElementById("upload-size").textContent = totalUploadSizeMB;
|
document.getElementById("upload-size").textContent = totalUploadSizeMB;
|
||||||
contractDurationChange(document.getElementById('contract-duration').value);
|
EthoUploads.contractDurationChange(document.getElementById('contract-duration'));
|
||||||
streamCompareCount--;
|
streamCompareCount--;
|
||||||
updateAnalyzeProgress(((totalItemCount - streamCompareCount) / totalItemCount));
|
EthoUploads.updateAnalyzeProgress(((totalItemCount - streamCompareCount) / totalItemCount));
|
||||||
if (streamCompareCount == 0) {
|
if (streamCompareCount == 0) {
|
||||||
document.getElementById("upload-hash").textContent = "READY FOR UPLOAD";
|
document.getElementById("upload-hash").textContent = "READY FOR UPLOAD";
|
||||||
document.getElementById("upload-confirm-button").style.visibility = "visible";
|
document.getElementById("upload-confirm-button").style.visibility = "visible";
|
||||||
@@ -1367,11 +1375,11 @@ class Uploads {
|
|||||||
|
|
||||||
startApplication() {
|
startApplication() {
|
||||||
// Setup event listeners
|
// Setup event listeners
|
||||||
document.getElementById("drag-container").addEventListener('dragenter', EthoUploads.onDragEnter)
|
//document.getElementById("drag-container").addEventListener('dragenter', EthoUploads.onDragEnter)
|
||||||
document.getElementById("drag-container").addEventListener('dragover', EthoUploads.onDragEnter)
|
//document.getElementById("drag-container").addEventListener('dragover', EthoUploads.onDragEnter)
|
||||||
document.getElementById("drag-container").addEventListener('drop', EthoUploads.onDrop)
|
//document.getElementById("drag-container").addEventListener('drop', EthoUploads.onDrop)
|
||||||
document.getElementById("drag-container").addEventListener('dragleave', EthoUploads.onDragLeave)
|
//document.getElementById("drag-container").addEventListener('dragleave', EthoUploads.onDragLeave)
|
||||||
document.getElementById("fileUploadButton").addEventListener("change", EthoUploads.onFileUpload)
|
//document.getElementById("fileUploadButton").addEventListener("change", EthoUploads.onFileUpload)
|
||||||
//start()
|
//start()
|
||||||
window.startNode()
|
window.startNode()
|
||||||
EthoUploads.extendedStartApplication()
|
EthoUploads.extendedStartApplication()
|
||||||
@@ -1399,27 +1407,37 @@ EthoUploads = new Uploads();
|
|||||||
|
|
||||||
$(document).on("render_uploads", function () {
|
$(document).on("render_uploads", function () {
|
||||||
|
|
||||||
// Node
|
// Misc
|
||||||
$ethomessage = document.querySelector('.etho-message')
|
$ethomessage = document.querySelector('.etho-message')
|
||||||
$nodeId = document.querySelector('.node-id')
|
$nodeId = document.querySelector('.node-id')
|
||||||
$uploadMessage = document.querySelector('.upload-message')
|
|
||||||
$analyzeMessage = document.querySelector('.analyze-message')
|
|
||||||
$nodeAddresses = document.querySelector('.node-addresses')
|
|
||||||
$logs = document.querySelector('#logs')
|
$logs = document.querySelector('#logs')
|
||||||
// Files
|
|
||||||
$fetchButton = document.querySelector('#fetch-btn')
|
$fetchButton = document.querySelector('#fetch-btn')
|
||||||
$dragContainer = document.querySelector('#drag-container')
|
|
||||||
$progressBar = document.querySelector('#progress-bar')
|
|
||||||
$fileHistory = document.querySelector('#file-history tbody')
|
|
||||||
$emptyRow = document.querySelector('.empty-row')
|
|
||||||
// Misc
|
|
||||||
$allDisabledButtons = document.querySelectorAll('button:disabled')
|
$allDisabledButtons = document.querySelectorAll('button:disabled')
|
||||||
$allDisabledInputs = document.querySelectorAll('input:disabled')
|
$allDisabledInputs = document.querySelectorAll('input:disabled')
|
||||||
$allDisabledElements = document.querySelectorAll('.disabled')
|
$allDisabledElements = document.querySelectorAll('.disabled')
|
||||||
$miningMessage = document.querySelector('.mining-message')
|
|
||||||
|
|
||||||
EthoUploads.beforeLoginState();
|
EthoUploads.beforeLoginState();
|
||||||
|
|
||||||
|
$(document).on("dragenter", "#drag-container", function (event) {
|
||||||
|
EthoUploads.onDragEnter(event);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("dragover", "#drag-container", function (event) {
|
||||||
|
EthoUploads.onDragEnter(event);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("drop", "#drag-container", function (event) {
|
||||||
|
EthoUploads.onDrop(event);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("dragleave", "#drag-container", function (event) {
|
||||||
|
EthoUploads.onDragLeave(event);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("change", "#fileUploadButton", function (event) {
|
||||||
|
EthoUploads.onFileUpload(event);
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on("click", "#main-login-button", function (event) {
|
$(document).on("click", "#main-login-button", function (event) {
|
||||||
EthoUploads.checkLogin();
|
EthoUploads.checkLogin();
|
||||||
});
|
});
|
||||||
@@ -1484,15 +1502,16 @@ $(document).on("render_uploads", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", "#reset-table-button", function (event) {
|
$(document).on("click", "#reset-table-button", function (event) {
|
||||||
|
$("#contractDetailModal").iziModal("close");
|
||||||
EthoUploads.resetContractDetailTableRows();
|
EthoUploads.resetContractDetailTableRows();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("change", "#contract-duration", function (event) {
|
$(document).on("change", "#contract-duration", function (event) {
|
||||||
EthoUploads.contractDurationChange(document.getElementById('contract-duration').value);
|
EthoUploads.contractDurationChange(document.getElementById('contract-duration'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("change", "#extend-contract", function (event) {
|
$(document).on("change", "#extend-contract", function (event) {
|
||||||
EthoUploads.contractDurationChange(document.getElementById('extend-contract').value);
|
EthoUploads.contractExtensionChange(document.getElementById('extend-contract'));
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://api.coinmarketcap.com/v2/ticker/3452/').then(response => {
|
fetch('https://api.coinmarketcap.com/v2/ticker/3452/').then(response => {
|
||||||
|
|||||||
Reference in New Issue
Block a user