You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.7 KiB
54 lines
1.7 KiB
import Ember from 'ember'; |
|
|
|
export default Ember.Controller.extend({ |
|
applicationController: Ember.inject.controller('application'), |
|
config: Ember.computed.reads('applicationController.config'), |
|
stats: Ember.computed.reads('applicationController.model.stats'), |
|
hashrate: Ember.computed.reads('applicationController.hashrate'), |
|
|
|
PersonalLuck: Ember.computed("stats", "model", { |
|
get() { |
|
var percent = this.get("model.stats.roundShares") / this.get("applicationController.difficulty"); |
|
if (!percent) { |
|
return 0; |
|
} |
|
return percent; |
|
}, |
|
}), |
|
|
|
roundPercent: Ember.computed('stats', 'model', { |
|
get() { |
|
var percent = this.get('model.roundShares') / this.get('stats.nShares'); |
|
if (!percent) { |
|
return 0; |
|
} |
|
|
|
if(percent>100){ |
|
return 100; |
|
} |
|
return percent; |
|
} |
|
}), |
|
|
|
earnPerDayToken: Ember.computed('model', { |
|
get() { |
|
return 24 * 60 * 60 / this.get('applicationController.blockTime') * this.get('config').BlockReward * |
|
this.getWithDefault('model.hashrate') / this.get('hashrate'); |
|
} |
|
}), |
|
|
|
earnPerDayUsd: Ember.computed('model', { |
|
get() { |
|
return 24 * 60 * 60 / this.get('applicationController.blockTime') * this.get('config').BlockReward * |
|
this.getWithDefault('model.hashrate') / this.get('hashrate') * this.get ('model.exchangedata.price_usd'); |
|
} |
|
}), |
|
|
|
earnTotalPaid: Ember.computed('model', { |
|
get() { |
|
return 1 * this.get ('model.exchangedata.price_usd') * this.get ('model.stats.paid'); |
|
} |
|
}) |
|
|
|
|
|
});
|
|
|