Feat: make dashboard and machine profile page

This commit is contained in:
Cesar 2020-11-17 12:13:10 +00:00 committed by Josh Harvey
parent 1df90c3196
commit c21cdb13e1
29 changed files with 717 additions and 135 deletions

View file

@ -147,21 +147,6 @@ function plugins (settings, deviceId) {
]
}
<<<<<<< HEAD
=======
function getLcmOrBigx2 (n1, n2) {
let big = Math.max(n1, n2)
let small = Math.min(n1, n2)
let i = big * 2
while (i % small !== 0) {
i += lar
}
return i
}
>>>>>>> 1706b2c... Feat: save highVolumeTxs on DB and plugins code refactor
function buildAvailableCassettes (excludeTxId) {
const cashOutConfig = configManager.getCashOut(deviceId, settings.config)
@ -169,7 +154,6 @@ function plugins (settings, deviceId) {
const denominations = [cashOutConfig.top, cashOutConfig.bottom]
<<<<<<< HEAD
const virtualCassettes = [Math.max(cashOutConfig.top, cashOutConfig.bottom) * 2]
return Promise.all([dbm.cassetteCounts(deviceId), cashOutHelper.redeemableTxs(deviceId, excludeTxId)])
@ -179,11 +163,6 @@ function plugins (settings, deviceId) {
const counts = argv.cassettes
? argv.cassettes.split(',')
: rec.counts
=======
const virtualCassettes = [
getLcmOrBigx2(cashOutConfig.top, cashOutConfig.bottom)
]
>>>>>>> 1706b2c... Feat: save highVolumeTxs on DB and plugins code refactor
return Promise.all([
dbm.cassetteCounts(deviceId),
@ -288,7 +267,6 @@ function plugins (settings, deviceId) {
currentConfigVersionPromise
].concat(tickerPromises, balancePromises, testnetPromises, currentAvailablePromoCodes)
<<<<<<< HEAD
return Promise.all(promises)
.then(arr => {
const cassettes = arr[0]
@ -310,26 +288,6 @@ function plugins (settings, deviceId) {
areThereAvailablePromoCodes
}
})
=======
return Promise.all(promises).then(arr => {
const cassettes = arr[0]
const configVersion = arr[2]
const cryptoCodesCount = cryptoCodes.length
const tickers = arr.slice(3, cryptoCodesCount + 3)
const balances = arr.slice(cryptoCodesCount + 3, 2 * cryptoCodesCount + 3)
const testNets = arr.slice(2 * cryptoCodesCount + 3)
const coinParams = _.zip(cryptoCodes, testNets)
const coinsWithoutRate = _.map(mapCoinSettings, coinParams)
return {
cassettes,
rates: buildRates(tickers),
balances: buildBalances(balances),
coins: _.zipWith(_.assign, coinsWithoutRate, tickers),
configVersion
}
})
>>>>>>> 1706b2c... Feat: save highVolumeTxs on DB and plugins code refactor
}
function sendCoins (tx) {
@ -648,15 +606,8 @@ function plugins (settings, deviceId) {
const notifications = configManager.getGlobalNotifications(settings.config)
let promises = []
<<<<<<< HEAD
if (notifications.email.active && rec.email) promises.push(email.sendMessage(settings, rec))
if (notifications.sms.active && rec.sms) promises.push(sms.sendMessage(settings, rec))
=======
if (notifications.email.active && rec.email)
promises.push(email.sendMessage(settings, rec))
if (notifications.sms.active && rec.sms)
promises.push(sms.sendMessage(settings, rec))
>>>>>>> 1706b2c... Feat: save highVolumeTxs on DB and plugins code refactor
return Promise.all(promises)
}
@ -757,25 +708,11 @@ function plugins (settings, deviceId) {
fiatCode
}
<<<<<<< HEAD
if (_.isFinite(lowAlertThreshold) && BN(fiatBalance.balance).lt(lowAlertThreshold)) {
=======
if (
_.isFinite(lowAlertThreshold) &&
BN(fiatBalance.balance).lt(lowAlertThreshold)
)
>>>>>>> 1706b2c... Feat: save highVolumeTxs on DB and plugins code refactor
return _.set('code')('LOW_CRYPTO_BALANCE')(req)
}
<<<<<<< HEAD
if (_.isFinite(highAlertThreshold) && BN(fiatBalance.balance).gt(highAlertThreshold)) {
=======
if (
_.isFinite(highAlertThreshold) &&
BN(fiatBalance.balance).gt(highAlertThreshold)
)
>>>>>>> 1706b2c... Feat: save highVolumeTxs on DB and plugins code refactor
return _.set('code')('HIGH_CRYPTO_BALANCE')(req)
}