Added ethoFS User Switch Feature

This commit is contained in:
Dev-JamesR
2019-10-16 22:36:08 -07:00
parent 6eb6cf2674
commit d9dbd39e66
2 changed files with 599 additions and 565 deletions

View File

@@ -1,6 +1,7 @@
<head>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet"
type="text/css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
<!-- Bootstrap Core Css -->
<!--<link href="assets/dashboard/plugins/bootstrap/css/bootstrap.css" rel="stylesheet">-->
@@ -12,7 +13,8 @@
<link href="assets/dashboard/plugins/morrisjs/morris.css" rel="stylesheet" />-->
<!-- Custom Css -->
<link href="assets/dashboard/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
<!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
<link href="assets/dashboard/css/themes/all-themes.css" rel="stylesheet" />
<script src="https://medium-widget.pixelpoint.io/widget.js"></script>
@@ -128,15 +130,22 @@
</div>
<center>
<button type="button" class="btn bg-indigo waves-effect" id="main-upload-button">
<button type="button" class="btn bg-indigo waves-effect" id="main-upload-button"
style="margin: 10px; display:inline-block;">
<i class="material-icons">cloud_upload</i>
<span>Upload to ethoFS</span>
</button>
<button type="button" class="btn bg-indigo waves-effect" id="main-login-button">
<button type="button" class="btn bg-indigo waves-effect" id="main-login-button"
style="margin: 10px; display:inline-block;">
<i class="material-icons">fingerprint</i>
<span>Login To ethoFS</span>
<span id="ethofs-login-button-text">Login To ethoFS</span>
</button>
</center>
</div>
<h1></h1>
<br>
</div>
@@ -195,7 +204,8 @@
</tr>
<tr style="border-color:#000;">
<td data-th="Private Key">
<input type="text" id="privatekey" name="privatekey" placeholder="Enter Private Key" style="color:White;">
<input type="text" id="privatekey" name="privatekey" placeholder="Enter Private Key"
style="color:White;">
</td>
</tr>
</table>
@@ -235,7 +245,8 @@
</div>
</div>
<div class="modal-footer" style="background-color: #840032;">
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal" id="ethofs-registration-button">REGISTER</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal"
id="ethofs-registration-button">REGISTER</button>
</div>
</div>
</div>
@@ -306,7 +317,8 @@
box to upload.
</p>
</center>
<input type="file" id="fileUploadButton" webkitdirectory="true" mozdirectory="true" msdirectory="true" odirectory="true" directory="true" multiple="true">
<input type="file" id="fileUploadButton" webkitdirectory="true" mozdirectory="true" msdirectory="true"
odirectory="true" directory="true" multiple="true">
</div>
<div id="progress-container">
<div id="progress-bar"></div>
@@ -347,7 +359,8 @@
</tr>
<tr style="border-color:#000;">
<td data-th="Contract Name">
<input type="text" id="newcontractname" name="newcontractname" placeholder="Enter Contract Name" style="color:white;">
<input type="text" id="newcontractname" name="newcontractname" placeholder="Enter Contract Name"
style="color:white;">
</td>
</tr>
<tr>
@@ -404,7 +417,8 @@
<div class="modal-content" style="background-color: #840032;">
<div class="modal-header">
<h4 class="modal-title" id="defaultModalLabel" style="color:white;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color:#ffffff;" id="tracker-close-button">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color:#ffffff;"
id="tracker-close-button">
<span aria-hidden="true">&times;</span>
</button>
<br>
@@ -423,24 +437,29 @@
<h3 style="padding-left:10px;">Message Log:</h3>
<span class="upload-message" style="color: #3CB371; font-size: 24px; padding: 10px"></span>
</div>
<div class="summary" style="text-align: center !important; padding: 10px; width:100%; background: #000000;">
<div class="summary"
style="text-align: center !important; padding: 10px; width:100%; background: #000000;">
<div id="myBar">0%</div>
</div>
</div>
</main>
</div>
<div class="modal-footer" style="background-color: #840032; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color:#000">
<button type="button" class="btn btn-primary" id="upload-check-button" onclick="event.stopPropagation();">Close</button>
<div class="modal-footer"
style="background-color: #840032; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color:#000">
<button type="button" class="btn btn-primary" id="upload-check-button"
onclick="event.stopPropagation();">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="analyzeDataModal" tabindex="-1" role="dialog" aria-labelledby="staticModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal fade" id="analyzeDataModal" tabindex="-1" role="dialog" aria-labelledby="staticModalLabel"
aria-hidden="true" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content" style="background-color: #840032;">
<div class="modal-header">
<h4 class="modal-title" id="defaultModalLabel" style="color:white;">
<button type="button" class="close" data-dismiss="modal" id="analyze-close-button" aria-label="Close" style="color:#ffffff;">
<button type="button" class="close" data-dismiss="modal" id="analyze-close-button" aria-label="Close"
style="color:#ffffff;">
<span aria-hidden="true">&times;</span>
</button>
<br>
@@ -460,14 +479,17 @@
<h4 style="padding-left:10px;">Message Log:</h4>
<pre class="analyze-message" style="color: #3CB371; font-size: 24px;"></pre>
</div>
<div class="summary" style="text-align: center !important; padding: 10px; width:100%; background: #000000;">
<div class="summary"
style="text-align: center !important; padding: 10px; width:100%; background: #000000;">
<div id="myAnalyzeBar">0%</div>
</div>
</div>
<div class="modal-footer" style="background-color: #840032; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color:#000">
<button type="button" class="btn btn-primary" id="upload-check-button" onclick="event.stopPropagation();">Close</button>
<div class="modal-footer"
style="background-color: #840032; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color:#000">
<button type="button" class="btn btn-primary" id="upload-check-button"
onclick="event.stopPropagation();">Close</button>
</div>
</main>
</div>
@@ -477,7 +499,8 @@
<!-- end analyze data modal -->
<!-- begin mined block checking modal -->
<div class="modal fade" id="minedBlockTrackerModal" tabindex="-1" role="dialog" aria-labelledby="staticModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal fade" id="minedBlockTrackerModal" tabindex="-1" role="dialog" aria-labelledby="staticModalLabel"
aria-hidden="true" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content" style="background-color: #840032;">
<div class="modal-header">
@@ -495,7 +518,8 @@
<main>
<div class="box node" style="width:100%; background: #000000; background-color: #000;">
<h3 style="padding: 20px;">Ether-1 Transaction Status:
<span id="mining-status-message" style="color: #3CB371; font-size: 24px; text-align: center !important;">In
<span id="mining-status-message"
style="color: #3CB371; font-size: 24px; text-align: center !important;">In
Progress</span>
</h3>
<div>
@@ -504,7 +528,8 @@
<span class="mining-message" id="mining-message" style="color: #3CB371; font-size: 24px;"></span>
</center>
</div>
<div class="summary" style="text-align: center !important; padding: 20px; width:100%; background: #000000;">
<div class="summary"
style="text-align: center !important; padding: 20px; width:100%; background: #000000;">
<h3 style="font-size: 24px;">Current Ether-1 Block Height:
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<span id="block-height" style="color: #3CB371; font-size: 24px;">0</span>
@@ -519,7 +544,8 @@
<!-- end mined block checking modal -->
<!-- begin preparing upload modal -->
<div class="modal fade" id="preparingUploadModal" tabindex="-1" role="dialog" aria-labelledby="staticModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal fade" id="preparingUploadModal" tabindex="-1" role="dialog" aria-labelledby="staticModalLabel"
aria-hidden="true" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content" style="background-color: #840032;">
<div class="modal-header">
@@ -665,30 +691,32 @@
</div>
</main>
</div>
<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">
<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" id="reset-table-button">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END MODAL -->
</section>
</div>
<!-- END MODAL -->
</section>
<script>
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="assets/dashboard/js/admin.js"></script>
<script src="assets/dashboard/js/bundle.js"></script>
<script src="assets/dashboard/js/demo.js"></script>
<script src="assets/dashboard/js/medium.js"></script>
<script>
</script>
<script src="assets/dashboard/js/admin.js"></script>
<script src="assets/dashboard/js/bundle.js"></script>
<script src="assets/dashboard/js/demo.js"></script>
<script src="assets/dashboard/js/medium.js"></script>
<script>
MediumWidget.Init({
renderTo: '#medium-widget',
params: {
@@ -700,10 +728,10 @@
"ratio": "landscape"
}
})
</script>
<script>
</script>
<script>
if (window.module)
module = window.module;
</script>
</script>
</div>

View File

@@ -40,6 +40,7 @@ let messageFlag = 0;
let messageString = "";
let healthMessage = "";
let averageAvailableStorageTotal = 0;
var switchFlag = null;
/*SET CONTRACTS UP HERE*/
var GlobalChannelString = "ethoFSPinningChannel_alpha11";
@@ -111,13 +112,17 @@ class Uploads {
statsRow.style.display = "block";
var uploadButton = document.getElementById("main-upload-button");
uploadButton.style.display = "block";
var loginButton = document.getElementById("main-login-button");
loginButton.style.display = "none";
document.getElementById("ethofs-login-button-text").innerHTML = "Switch User";
switchFlag = "SWITCH";
//var loginButton = document.getElementById("main-login-button");
//loginButton.style.display = "none";
}
checkLogin() {
if (GlobalPrivateKey == null || GlobalPrivateKey == "SWITCH") {
if (GlobalPrivateKey == null) {
EthoUploads.beforeLoginState();
}
web3 = new Web3()
web3.setProvider(new Web3.providers.WebsocketProvider("ws://localhost:8546"));
$('#ethofsLoginModal').iziModal();
@@ -1421,6 +1426,7 @@ $(document).on("render_uploads", function () {
});
$(document).on("click", "#main-login-button", function (event) {
GlobalPrivateKey = switchFlag;
EthoUploads.checkLogin();
});