From e1bae3771ede3696a271ec15bb1958a22c2710f2 Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Wed, 4 Mar 2015 12:59:17 -0300 Subject: [PATCH] updated network app to latest build --- ...aa7d6.js => 0399904a52b6faf064b55942c70f0bf0add60b77.js} | 6 +++--- cmd/mist/assets/qml/views/network-health/index.html | 2 +- cmd/mist/assets/qml/views/network.qml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) rename cmd/mist/assets/qml/views/network-health/{42bbc78978031f82dbd6b6adb1358c26618aa7d6.js => 0399904a52b6faf064b55942c70f0bf0add60b77.js} (99%) diff --git a/cmd/mist/assets/qml/views/network-health/42bbc78978031f82dbd6b6adb1358c26618aa7d6.js b/cmd/mist/assets/qml/views/network-health/0399904a52b6faf064b55942c70f0bf0add60b77.js similarity index 99% rename from cmd/mist/assets/qml/views/network-health/42bbc78978031f82dbd6b6adb1358c26618aa7d6.js rename to cmd/mist/assets/qml/views/network-health/0399904a52b6faf064b55942c70f0bf0add60b77.js index 9086e822a8..d6733cbff5 100644 --- a/cmd/mist/assets/qml/views/network-health/42bbc78978031f82dbd6b6adb1358c26618aa7d6.js +++ b/cmd/mist/assets/qml/views/network-health/0399904a52b6faf064b55942c70f0bf0add60b77.js @@ -157,9 +157,9 @@ if(H._super.render.call(this)){for(a&&t.drawCircle(n,n,e.floor(n-a/2),r.get("bor !function(){"undefined"==typeof web3&&(web3=require("web3"),web3.setProvider(new web3.providers.HttpSyncProvider("http://localhost:8545")))}(); -!function(){Template.views_home.created=function(){var e=Blocks.findOne({},{sort:{number:-1}}),t=GeoPattern.generate(e?e.hash:"---");$(".latest-block-info").css("background-image",t.toDataUrl());try{if(void 0!=web3.eth.number)for(currentBlock=web3.eth.number,Blocks.remove({number:{$lt:currentBlock-50}}),i=currentBlock;i>currentBlock-10;i--)Blocks.upsert("block_"+i,{_id:"block_"+i,number:i,gasUsed:web3.eth.block(i).gasUsed,size:web3.eth.block(i).size,time:web3.eth.block(i).time,hash:web3.eth.block(i).hash,miner:web3.eth.block(i).coinbase,uncles:web3.eth.block(i).uncles.Length})}catch(n){console.log("no web3 object")}},Template.views_home.destroyed=function(){},Template.views_home.helpers({blocks:function(){var e=Blocks.find({},{limit:50,sort:{number:-1}}),t=Template.instance();return Tracker.afterFlush(function(){t.view.isRendered&&t.$(".wrapper").css("width",562*e.count()+500+"px")}),e.fetch()},currentBlockPattern:function(){var e=GeoPattern.generate(this.hash);return e?e.toDataUrl():"white"},peerCount:function(){try{return web3.eth.peerCount}catch(e){return"---"}},gasPrice:function(){try{return EthTools.fromWei(web3.eth.gasPrice,"finney")}catch(e){return"---"}},miningSlider:function(){return Miner.mining||0},hashrate:function(){return Miner.hashrate},timeSpent:function(){var e=MiningData.findOne().totalTimeSpent;return e?180>e?Math.round(10*e)/10+" Seconds ":10800>e?Math.round(10*e/60)/10+" Minutes ":86400>e?Math.round(10*e/3600)/10+" Hours ":Math.round(10*e/86400)/10+" Days ":"---"},totalRewards:function(){var e=MiningData.findOne().totalRewards;if(e&&e>0){var t=.59,n=t*Number(e);return 1>n?Math.floor(1e5*n)/100+" Finney ":n>1e3?Math.floor(n/10)/100+" KEther ":Math.floor(100*n)/100+" Ether "}return"---"},averageRewardPerHour:function(){var e=MiningData.findOne().totalRewards,t=MiningData.findOne().totalTimeSpent;if(e&&t>0){var n=.59,r=10*n*60*60*e/t;return.001>r?Math.floor(1e5*r)/100+" Finney/h ":r>1e3?Math.floor(r/10)/100+" KEther/h ":Math.floor(100*r)/100+" Ether/h ";return reward}return"---"}}),Template.views_home.events({"change input.slider-vertical, input input.slider-vertical":function(e){Miner.mining=Number(e.currentTarget.value)}})}(); +!function(){Template.views_home.created=function(){var e=Blocks.findOne({},{sort:{number:-1}}),t=GeoPattern.generate(e?e.hash:"---");$(".latest-block-info").css("background-image",t.toDataUrl());try{if(void 0!=web3.eth.number)for(currentBlock=web3.eth.number,Blocks.remove({number:{$lt:currentBlock-50}}),i=currentBlock;i>currentBlock-10;i--)Blocks.upsert("block_"+i,{_id:"block_"+i,number:i,gasUsed:web3.eth.block(i).gasUsed,size:web3.eth.block(i).size,time:web3.eth.block(i).time,hash:web3.eth.block(i).hash,miner:web3.eth.block(i).coinbase,uncles:web3.eth.block(i).uncles.Length})}catch(n){console.log("no web3 object")}},Template.views_home.destroyed=function(){},Template.views_home.helpers({blocks:function(){var e=Blocks.find({},{limit:50,sort:{number:-1}}),t=Template.instance();return Tracker.afterFlush(function(){t.view.isRendered&&t.$(".wrapper").css("width",562*e.count()+500+"px")}),e.fetch()},currentBlockPattern:function(){var e=GeoPattern.generate(this.hash);return e?e.toDataUrl():"white"},peerCount:function(){try{return web3.eth.peerCount}catch(e){return"---"}},gasPrice:function(){try{return EthTools.fromWei(web3.eth.gasPrice,"finney")}catch(e){return"---"}},miningSlider:function(){return Miner.mining||0},hashrate:function(){return Miner.hashrate},timeSpent:function(){var e=MiningData.findOne().totalTimeSpent;return e?180>e?Math.round(10*e)/10+" Seconds ":10800>e?Math.round(10*e/60)/10+" Minutes ":86400>e?Math.round(10*e/3600)/10+" Hours ":Math.round(10*e/86400)/10+" Days ":"---"},totalRewards:function(){var e=MiningData.findOne().totalRewards;return e&&e>0?1>e?Math.floor(1e5*e)/100+" Finney ":e>1e3?Math.floor(e)+" Ether ":Math.floor(100*e)/100+" Ether ":"---"},averageRewardPerHour:function(){var e=MiningData.findOne().totalRewards,t=MiningData.findOne().totalTimeSpent;if(e&&t>0){var n=3600*e/t;return.001>n?Math.floor(1e5*n)/100+" Finney/h ":n>1e3?Math.floor(n)+" Ether/h ":Math.floor(100*n)/100+" Ether/h ";return reward}return"---"}}),Template.views_home.events({"change input.slider-vertical, input input.slider-vertical":function(e){Miner.mining=Number(e.currentTarget.value)}})}(); -!function(){Blocks=new Mongo.Collection("blocks",{connection:null}),new PersistentMinimongo(Blocks),MiningData=new Mongo.Collection("miningdata",{connection:null}),new PersistentMinimongo(MiningData),MiningData.findOne()||MiningData.insert({totalTimeSpent:0,totalRewards:0})}(); +!function(){Blocks=new Mongo.Collection("blocks",{connection:null}),new PersistentMinimongo(Blocks),MiningData=new Mongo.Collection("miningdata",{connection:null}),new PersistentMinimongo(MiningData),MiningData.findOne()||MiningData.insert({totalTimeSpent:0,lastCoinbaseBalance:0,totalRewards:0})}(); !function(){"localhost:3000"!==location.host&&"127.0.0.1:3000"!==location.host&&Meteor.disconnect(),Meteor.startup(function(){if(Cookie.get("TAPi18next"))TAPi18n.setLanguage(Cookie.get("TAPi18next"));else{var e=navigator.language||navigator.userLanguage,n=TAPi18n.getLanguages();TAPi18n.setLanguage(_.isObject(n)&&n[e]?e:_.isObject(n)&&n[e.substr(0,2)]?e.substr(0,2):"en")}Tracker.autorun(function(){_.isString(TAPi18n.getLanguage())&&(moment.locale(TAPi18n.getLanguage().substr(0,2)),numeral.language(TAPi18n.getLanguage().substr(0,2)))})})}(); @@ -167,7 +167,7 @@ if(H._super.render.call(this)){for(a&&t.drawCircle(n,n,e.floor(n-a/2),r.get("bor !function(){Router.configure({layoutTemplate:"layout_main",yieldRegions:{layout_header:{to:"header"}},autoRun:!1,autoRender:!1}),Router.route("/",{template:"views_home",name:"home"}),Router.route("/profile",{template:"views_home",name:"userProfile"})}(); -!function(){var e=web3.eth.watch("chain");e.changed(function(e){if(console.log("Block arrived",e),e.number=web3.eth.number,Blocks.upsert("block_"+e.number,{_id:"block_"+e.number,number:e.number,gasUsed:web3.eth.block(e.number).gasUsed,size:web3.eth.block(e.number).size,time:web3.eth.block(e.number).time,hash:web3.eth.block(e.number).hash,miner:web3.eth.block(e.number).coinbase,uncles:web3.eth.block(e.number).uncles.Length}),web3.eth.coinbase==web3.eth.block(e.number).coinbase){var b=MiningData.findOne();MiningData.update(b._id,{$inc:{totalRewards:1}})}})}(); +!function(){var e=web3.eth.watch("chain");e.changed(function(e){if(e.number=web3.eth.number,Blocks.upsert("block_"+e.number,{_id:"block_"+e.number,number:e.number,gasUsed:web3.eth.block(e.number).gasUsed,size:web3.eth.block(e.number).size,time:web3.eth.block(e.number).time,hash:web3.eth.block(e.number).hash,miner:web3.eth.block(e.number).coinbase,uncles:web3.eth.block(e.number).uncles.Length}),web3.eth.coinbase==web3.eth.block(e.number).coinbase){var a=MiningData.findOne();lastBalance=a.lastCoinbaseBalance||0,WeiToFin=1e15,currentBalance=Number(web3.toDecimal(web3.eth.balanceAt(web3.eth.coinbase)))/WeiToFin,blockReward=currentBalance-lastBalance,console.log("New Block! last balance: "+a.lastCoinbaseBalance+" Reward: "+blockReward),MiningData.update(a._id,{$inc:{totalRewards:blockReward}}),MiningData.update(a._id,{$set:{lastCoinbaseBalance:currentBalance}})}else{WeiToFin=1e15,currentBalance=Number(web3.toDecimal(web3.eth.balanceAt(web3.eth.coinbase)))/WeiToFin;var a=MiningData.findOne();MiningData.update(a._id,{lastCoinbaseBalance:currentBalance}),console.log("New Block! last balance: "+a.lastCoinbaseBalance)}})}(); !function(){var n=Package.underscore._,e="project",o="project";"project"!=e&&(o=TAPi18n.packages[e].namespace),TAPi18n._enable({helper_name:"_",supported_languages:null,i18n_files_route:"/tap-i18n",cdn_path:null}),TAPi18n.languages_names.en=["English","English"],translations={},translations[o]={app:{loading:"Loading...",offline:"Can't connect are you offline?",logginIn:"Logging in..."},error:{insufficientRights:"You don't have enough rights for this action."},buttons:{ok:"OK",cancel:"Cancel",save:"Save",edit:"edit",send:"Send",create:"Create",tryToReconnect:"Try to reconnect"},commonWords:{you:"You",send:"Send",or:"or","with":"with",and:"and",on:"on",off:"off",per:"per"}},TAPi18n._loadLangFileObject("en",translations)}(); diff --git a/cmd/mist/assets/qml/views/network-health/index.html b/cmd/mist/assets/qml/views/network-health/index.html index a8a12a4093..608d5c883c 100755 --- a/cmd/mist/assets/qml/views/network-health/index.html +++ b/cmd/mist/assets/qml/views/network-health/index.html @@ -24,7 +24,7 @@ - + \ No newline at end of file diff --git a/cmd/mist/assets/qml/views/network.qml b/cmd/mist/assets/qml/views/network.qml index 82e11303dd..332854745f 100644 --- a/cmd/mist/assets/qml/views/network.qml +++ b/cmd/mist/assets/qml/views/network.qml @@ -119,6 +119,7 @@ Rectangle { anchors.fill: parent url: "network-health/index.html" + //url: "http://localhost:3000/" experimental.settings.javascriptCanAccessClipboard: true