Wizard redesign

This commit is contained in:
dsc
2019-01-14 01:02:44 +01:00
parent 333f4aaf83
commit f329a71029
79 changed files with 4670 additions and 3098 deletions

View File

@@ -87,3 +87,23 @@ function ago(epoch) {
}
}
}
function netTypeToString(){
// 0: mainnet, 1: testnet, 2: stagenet
var nettype = appWindow.persistentSettings.nettype;
return nettype == 1 ? qsTr("Testnet") : nettype == 2 ? qsTr("Stagenet") : qsTr("Mainnet");
}
function randomChoice(arr){
return arr[Math.floor(Math.random() * arr.length)];
}
function filterNodes(nodes, port) {
if(typeof data === 'number')
port = port.toString();
return nodes.filter(function(_){return _.indexOf(port) !== -1});
}
function epoch(){
return Math.floor((new Date).getTime()/1000);
}