From 0f00f313cce4d801e0a59af1efdea9015b698b66 Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Sun, 30 Jul 2023 23:54:45 +0200 Subject: [PATCH] preparation --- www/app/helpers/format-ethinr.js | 16 ++++ www/app/helpers/format-ethusd.js | 16 ++++ www/config/environment.js | 131 ++++++++++++++++--------------- 3 files changed, 98 insertions(+), 65 deletions(-) create mode 100644 www/app/helpers/format-ethinr.js create mode 100644 www/app/helpers/format-ethusd.js diff --git a/www/app/helpers/format-ethinr.js b/www/app/helpers/format-ethinr.js new file mode 100644 index 0000000..98dfd3e --- /dev/null +++ b/www/app/helpers/format-ethinr.js @@ -0,0 +1,16 @@ +import Ember from 'ember'; + +export function formatEthInr(params) { + let value = params[0]; + let ethinr = params[1]; + let valueeth = value * 0.000000001; + let inr = valueeth * ethinr; + + if (isNaN(inr)) { + return ''; + } + + return "?" + inr.toFixed(2); +} + +export default Ember.Helper.helper(formatEthInr); \ No newline at end of file diff --git a/www/app/helpers/format-ethusd.js b/www/app/helpers/format-ethusd.js new file mode 100644 index 0000000..61a53cb --- /dev/null +++ b/www/app/helpers/format-ethusd.js @@ -0,0 +1,16 @@ +import Ember from 'ember'; + +export function formatEthUsd(params) { + let value = params[0]; + let ethinr = params[1]; + let valueeth = value * 0.000000001; + let inr = valueeth * ethinr; + + if (isNaN(inr)) { + return ''; + } + + return "$" + inr.toFixed(2); +} + +export default Ember.Helper.helper(formatEthUsd); \ No newline at end of file diff --git a/www/config/environment.js b/www/config/environment.js index 20c13b6..ceb3dab 100644 --- a/www/config/environment.js +++ b/www/config/environment.js @@ -1,70 +1,71 @@ /* jshint node: true */ -module.exports = function(environment) { - var ENV = { - modulePrefix: 'open-etc-pool', - environment: environment, - rootURL: '/', - locationType: 'hash', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. 'with-controller': true - } - }, - - APP: { - // API host and port - ApiUrl: '//192.168.178.27/', - - // HTTP mining endpoint - HttpHost: 'http://192.168.178.27', - HttpPort: 8888, - - // Stratum mining endpoint - StratumHost: 'example.net', - StratumPort: 8008, - - // The ETC network - Unit: 'ETC', - - // Fee and payout details - PoolFee: '1%', - PayoutThreshold: '0.5 ETC', - BlockReward: 2.56, - - // For network hashrate (change for your favourite fork) - BlockTime: 13.2 +module.exports = function (environment) { + var ENV = { + modulePrefix: 'open-etc-pool', + environment: environment, + rootURL: '/', + locationType: 'hash', + EmberENV: { + FEATURES: { + // Here you can enable experimental features on an ember canary build + // e.g. 'with-controller': true } - }; - - if (environment === 'development') { - /* Override ApiUrl just for development, while you are customizing - frontend markup and css theme on your workstation. - */ - ENV.APP.ApiUrl = 'http://localhost:8080/' - // ENV.APP.LOG_RESOLVER = true; - // ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - // ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.locationType = 'none'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - } - - if (environment === 'production') { - + }, + + APP: { + // API host and port + ApiUrl: '//192.168.178.27/', + + // HTTP mining endpoint + HttpHost: 'http://192.168.178.27', + HttpPort: 8888, + + // Stratum mining endpoint + StratumHost: 'example.net', + StratumPort: 8008, + + // The ETC network + Unit: 'ETC', + Currency: 'USD', + + // Fee and payout details + PoolFee: '1%', + PayoutThreshold: '0.5 ETC', + BlockReward: 2.56, + + // For network hashrate (change for your favourite fork) + BlockTime: 13.2 } - - return ENV; }; - + + if (environment === 'development') { + /* Override ApiUrl just for development, while you are customizing + frontend markup and css theme on your workstation. + */ + ENV.APP.ApiUrl = 'http://localhost:8080/' + // ENV.APP.LOG_RESOLVER = true; + // ENV.APP.LOG_ACTIVE_GENERATION = true; + // ENV.APP.LOG_TRANSITIONS = true; + // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; + // ENV.APP.LOG_VIEW_LOOKUPS = true; + } + + if (environment === 'test') { + // Testem prefers this... + ENV.locationType = 'none'; + + // keep test console output quieter + ENV.APP.LOG_ACTIVE_GENERATION = false; + ENV.APP.LOG_VIEW_LOOKUPS = false; + + ENV.APP.rootElement = '#ember-testing'; + } + + if (environment === 'production') { + + } + + return ENV; +}; +