Skip to content

Commit

Permalink
better hints of which node you are on MyEtherWallet#420
Browse files Browse the repository at this point in the history
  • Loading branch information
tayvano committed Apr 28, 2017
1 parent ec1a021 commit f49bcad
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/includes/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@


</footer>

</main>
</body>
</html>
11 changes: 3 additions & 8 deletions app/includes/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<body>

<header aria-label="header" ng-controller='tabsCtrl' >
<header class="{{curNode.name}} {{curNode.service}}" aria-label="header" ng-controller='tabsCtrl' >
@@if (site === 'cx' ) {
<div class="small announcement annoucement-warning" target="_blank">
<div class="container" translate="CX_Warning_1">Make sure you have <strong>external backups</strong> of any wallets you store here. Many things could happen that would cause you to lose the data in this Chrome Extension, including uninstalling the extension. This extension is a way to easily access your wallets, <strong>not</strong> a way to back them up.</div>
Expand Down Expand Up @@ -77,7 +77,8 @@

&nbsp;&nbsp;

<span class="dropdown" ng-cloak>
<!-- Warning: The separators you see on the frontend are in styles/etherwallet-custom.less. If you add / change a node, you have to adjust these. Ping tayvano if you're not a CSS wizard -->
<span class="dropdown dropdown-node" ng-cloak>
<a tabindex="0" aria-haspopup="true" aria-label="change node. current node {{curNode.name}} node by {{curNode.service}}" class="dropdown-toggle" ng-click="dropdownNode = !dropdownNode"> {{curNode.name}} <small>({{curNode.service}})</small><i class="caret"></i></a>
<ul class="dropdown-menu" ng-show="dropdownNode">
<li ng-repeat="(key, value) in nodeList"><a ng-class="{true:'active'}[curNode == key]" ng-click="changeNode(key)">
Expand All @@ -93,12 +94,6 @@
</section>
</section>

<!-- TODO: turn this into notification -->
<div class="small announcement annoucement-warning" ng-show="!nodeIsConnected" ng-cloak>
<div class="container">Unable to connect to node. See the help page for troubleshooting suggestions.</div>
</div>
<!-- / TODO: turn this into notification -->

<nav role="navigation" aria-label="main navigation" class="container nav-container overflowing" >
<a aria-hidden="true" ng-show="showLeftArrow" class="nav-arrow-left" ng-click="scrollLeft(100);" ng-mouseover="scrollHoverIn(true,2);" ng-mouseleave="scrollHoverOut()">&#171;</a>
<div class="nav-scroll">
Expand Down
2 changes: 1 addition & 1 deletion app/includes/sendTx-modal.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<strong ng-show="tx.sendMode!=='ether'" class="mono"> {{tokenTx.to}} </strong>
</p>

<p> The <strong>{{ajaxReq.type}}</strong> node you are sending through is provided by <strong>{{ajaxReq.service}}</strong>.</p>
<p> You are interacting with the <strong>{{ajaxReq.type}} chain</strong>, provided by <strong>{{ajaxReq.service}}</strong>.</p>

<h4 translate="SENDModal_Content_3"> Are you sure you want to do this? </h4>
</div>
Expand Down
5 changes: 5 additions & 0 deletions app/includes/swap-stage-3.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@
</div>
</section>

<div class="alert alert-danger" ng-show="ajaxReq.type!=='ETH'">
<strong>Warning! You are not connected to an ETH node.</strong> <br />
Please use the node switcher in the upper-right corner to switch to an ETH node. We <strong>do not</strong> support swapping ETC or Testnet ETH.
</div>

<section class="clearfix" ng-show="wallet!=null" ng-controller='sendTxCtrl'>
@@if (site === 'mew' ) { @@include( './sendTx-content.tpl', { "site": "mew" } ) }
@@if (site === 'cx' ) { @@include( './sendTx-content.tpl', { "site": "cx" } ) }
Expand Down
2 changes: 0 additions & 2 deletions app/layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

@@include( '../includes/header.tpl', { "site": "mew" } )

<br />

<section class="container" style="min-height: 50%" ng-controller='viewCtrl'>

<div class="tab-content" >
Expand Down
9 changes: 7 additions & 2 deletions app/scripts/controllers/tabsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ var tabsCtrl = function($scope, globalService, $translate, $sce) {
$scope.notifier = uiFuncs.notifier;
$scope.notifier.sce = $sce;
$scope.notifier.scope = $scope;
$scope.ajaxReq = ajaxReq;
$scope.nodeType = $scope.ajaxReq.type
$scope.nodeService = $scope.ajaxReq.service
$scope.$watch('ajaxReq.type', function() { $scope.nodeType = $scope.ajaxReq.type })
$scope.$watch('ajaxReq.service', function() { $scope.nodeService = $scope.ajaxReq.service })
$scope.setArrowVisibility = function() {
setTimeout(function() {
if (document.querySelectorAll('.nav-inner')[0] && document.querySelectorAll('.nav-scroll')[0]) {
Expand Down Expand Up @@ -45,10 +50,10 @@ var tabsCtrl = function($scope, globalService, $translate, $sce) {
ajaxReq.getCurrentBlock(function(data) {
if (data.error) {
$scope.nodeIsConnected = false;
//$scope.notifier.danger(globalFuncs.errorMsgs[32]);
$scope.notifier.danger(globalFuncs.errorMsgs[32]);
} else {
$scope.nodeIsConnected = true;
//$scope.notifier.success(globalFuncs.successMsgs[5]);
$scope.notifier.info(globalFuncs.successMsgs[5] + 'to the <strong>'+$scope.nodeType+' node</strong>, provided by '+$scope.nodeService+'.')
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/globalFuncs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ globalFuncs.getDangerText = function(str) {
globalFuncs.errorMsgs = ["Please enter valid amount.", "Your password must be at least 9 characters. Please ensure it is a strong password. ", "Sorry! We don\'t recognize this type of wallet file. ", "This is not a valid wallet file. ", "This unit doesn\'t exists, please use the one of the following units ", "Invalid address. ", "Invalid password. ", "Invalid amount. ", "Invalid gas limit. ", "Invalid data value. ", "Invalid gas amount. ", // 10
"Invalid nonce. ", "Invalid signed transaction. ", "A wallet with this nickname already exists. ", "Wallet not found. ", "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", // 15
"A wallet with this address already exists in storage. Please check your wallets page. ", "You need to have at least 0.01 ETH in your account to cover the cost of gas. Please add some ETH and try again. ", "All gas would be used on this transaction. This means you have already voted on this proposal or the debate period has ended.", "Invalid symbol", "Not a valid ERC-20 token", "Could not estimate gas. There are not enough funds in the account, or the receiving contract address would throw an error. Feel free to manually set the gas and proceed. The error message upon sending may be more informative.",
"Please enter valid node name", "Enter valid url, if you are on https your url must be https", "Please enter valid port", "Please enter valid chain ID", "Please enter valid ABI", "Minimum amount: 0.01. Max amount: ", "You need your Keystore File & Password (or Private Key) to access this wallet in the future.", "Please enter valid user and password", "Invalid name", "Invalid secret phrase", "Could not change the node or connect to the node you selected. Please refresh the page and try again."];
"Please enter valid node name", "Enter valid url, if you are on https your url must be https", "Please enter valid port", "Please enter valid chain ID", "Please enter valid ABI", "Minimum amount: 0.01. Max amount: ", "You need your Keystore File & Password (or Private Key) to access this wallet in the future.", "Please enter valid user and password", "Invalid name", "Invalid secret phrase", "Could not connect to the node. Please refresh the page, or see the help page for more troubleshooting suggestions."];
// These are translated in the translation files
globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "Your wallet was successfully added: ", "File Selected: ", "You are successfully connected to the node "];
globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "Your wallet was successfully added: ", "File Selected: ", "You are successfully connected to the node ", "Message Signature Verified"];
// These are translated in the translation files
globalFuncs.gethErrors = {
"Invalid sender": "GETH_InvalidSender",
Expand Down
26 changes: 13 additions & 13 deletions app/scripts/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ nodes.nodeList = {
'service': 'Etherscan.io',
'lib': require('./nodeHelpers/etherscan')
},
'etc_epool': {
'name': 'ETC',
'blockExplorerTX': 'https://gastracker.io/tx/[[txHash]]',
'blockExplorerAddr': 'https://gastracker.io/addr/[[address]]',
'type': nodes.nodeTypes.ETC,
'eip155': true,
'chainId': 61,
'tokenList': require('./tokens/etcTokens.json'),
'abiList': require('./abiDefinitions/etcAbi.json'),
'estimateGas': false,
'service': 'Epool.io',
'lib': new nodes.customNode('https://mewapi.epool.io', '')
},
'rop_mew': {
'name': 'Ropsten',
'type': nodes.nodeTypes.Ropsten,
Expand Down Expand Up @@ -87,19 +100,6 @@ nodes.nodeList = {
'estimateGas': false,
'service': 'Etherscan.io',
'lib': require('./nodeHelpers/etherscanRin')
},
'etc_epool': {
'name': 'ETC',
'blockExplorerTX': 'https://gastracker.io/tx/[[txHash]]',
'blockExplorerAddr': 'https://gastracker.io/addr/[[address]]',
'type': nodes.nodeTypes.ETC,
'eip155': true,
'chainId': 61,
'tokenList': require('./tokens/etcTokens.json'),
'abiList': require('./abiDefinitions/etcAbi.json'),
'estimateGas': false,
'service': 'Epool.io',
'lib': new nodes.customNode('https://mewapi.epool.io', '')
}
};
nodes.ethPrice = require('./nodeHelpers/ethPrice');
Expand Down

0 comments on commit f49bcad

Please sign in to comment.