diff options
| author | dsc <xmrdsc@protonmail.com> | 2019-01-14 01:02:44 +0100 |
|---|---|---|
| committer | dsc <xmrdsc@protonmail.com> | 2019-02-22 03:05:27 +0100 |
| commit | f329a710295deed3c15f2acff9a519c0a70e98e1 (patch) | |
| tree | 95d2b1f6b8c31826a561d74d33368c1e9ef85d42 /js/Utils.js | |
| parent | 333f4aaf83bd64de02b07a56d86bbf90363e403b (diff) | |
| download | monzero-gui-f329a710295deed3c15f2acff9a519c0a70e98e1.tar.gz monzero-gui-f329a710295deed3c15f2acff9a519c0a70e98e1.tar.xz monzero-gui-f329a710295deed3c15f2acff9a519c0a70e98e1.zip | |
Wizard redesign
Diffstat (limited to 'js/Utils.js')
| -rw-r--r-- | js/Utils.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/Utils.js b/js/Utils.js index 8bf7660c..4f522a35 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -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); +} |
