From d9dbd39e6660ec29d0310d84bebc995012512431 Mon Sep 17 00:00:00 2001 From: Dev-JamesR Date: Wed, 16 Oct 2019 22:36:08 -0700 Subject: [PATCH] Added ethoFS User Switch Feature --- assets/templates/uploads.html | 1150 +++++++++++++++++---------------- renderer/uploads.js | 14 +- 2 files changed, 599 insertions(+), 565 deletions(-) diff --git a/assets/templates/uploads.html b/assets/templates/uploads.html index a7ca6d8..755d947 100644 --- a/assets/templates/uploads.html +++ b/assets/templates/uploads.html @@ -1,6 +1,7 @@ - + @@ -12,7 +13,8 @@ --> - + @@ -128,582 +130,608 @@
- -
-

-
+ + + + +

+
- + + - -
-
-
-
-

ETHOFS HOSTING CONTRACTS

-
-
-
- - - - - - - - - - - - -
NameethoFS Contract HashStart BlockEnd BlockStatusOptions
-
-
+ +
+
+
+
+

ETHOFS HOSTING CONTRACTS

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
\ No newline at end of file diff --git a/renderer/uploads.js b/renderer/uploads.js index 0106abf..1aa7dcc 100644 --- a/renderer/uploads.js +++ b/renderer/uploads.js @@ -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) { - EthoUploads.beforeLoginState(); + 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(); });