Commit 0aa65759 authored by zeroleak's avatar zeroleak
Browse files

cleanup

parent b7a998f0
......@@ -12,27 +12,20 @@ import { Dropdown, DropdownButton } from 'react-bootstrap';
/* eslint-disable react/prefer-stateless-function */
class UtxoPoolSelector extends React.PureComponent {
computePools(utxo) {
if (utxo.account === WHIRLPOOL_ACCOUNTS.DEPOSIT) {
return mixService.getPoolsForTx0(utxo)
}
return mixService.getPoolsForMix(utxo)
}
computePoolLabel(poolId) {
return poolId ? poolId : 'none'
}
render () {
const utxo = this.props.utxo
const pools = this.computePools(utxo);
const pools = mixService.getPoolsForUtxo(utxo);
if (pools.length == 0) {
// no pool
return <span className='text-muted'>-</span>
}
const activeLabel = this.computePoolLabel(utxo.poolId)
if (pools.length < 2 && (!this.props.noPool || !utxo.poolId)) {
// single choice available
if (!utxo.poolId) {
// no pool
return <span className='text-muted'>-</span>
}
return <span>{activeLabel}</span>
}
return (
......
......@@ -127,7 +127,7 @@ const UtxosTable = ({ controls, account, utxos }) => {
<tbody>
{sortedUtxos.map((utxo, i) => {
const lastActivity = mixService.computeLastActivity(utxo);
const utxoReadOnly = utils.isUtxoReadOnly(utxo);
const utxoReadOnly = utils.isUtxoReadOnly(utxo) || mixService.getPoolsForUtxo(utxo).length == 0;
const allowNoPool = utxo.account === WHIRLPOOL_ACCOUNTS.DEPOSIT;
return (
......
......@@ -38,7 +38,7 @@ class ConnectingPage extends Component<Props> {
renderConnecting(cliUrlError) {
return (
<form className="form-signin text-center" onSubmit={(e) => {this.onSubmit();e.preventDefault()}}>
<h1 className="h3 mb-3 font-weight-normal">{cliService.getStatusIcon((icon,status)=><span>{icon} {status}</span>)}</h1>
<h1 className="h3 mb-3 font-weight-normal">{cliService.getStatusIcon((icon,status)=><span>{status}</span>)}</h1>
<div><FontAwesomeIcon icon={Icons.faCloud} size='3x' color='#343a40'/></div><br/>
<div>whirlpool-cli @ <strong>{cliService.isCliLocal() ? 'standalone GUI' : cliService.getCliUrl()}</strong></div>
<br/>
......
......@@ -49,7 +49,7 @@ export default class StatusPage extends Component<Props> {
}
onResync() {
if (confirm('This will resync mix counters. Are you sure?')) {
if (confirm('This will resync postmix counters. Are you sure?')) {
walletService.resync()
}
}
......@@ -133,7 +133,7 @@ export default class StatusPage extends Component<Props> {
<Card.Body>
<div className='float-right text-right'>
<button type='button' className='btn btn-primary btn-sm' onClick={this.onRestartCli}>Restart CLI</button>{' '}
{walletService.isReady() && <button type='button' className='btn btn-secondary btn-sm' onClick={this.onResync}>Resync mix counters</button>}
{walletService.isReady() && <button type='button' className='btn btn-secondary btn-sm' onClick={this.onResync}>Resync postmix counters</button>}
</div>
<div className='row'>
<div className='col-sm-2'>
......
......@@ -412,7 +412,7 @@ class CliService {
}
if (cliService.getCliUrlError()) {
// error
const status = 'CLI error'
const status = 'CLI is disconnected'
return format(<FontAwesomeIcon icon={Icons.faWifi} color='red' title={status} />, status)
}
// connected & initialization required
......
......@@ -107,6 +107,13 @@ class MixService {
return poolsService.getPoolsForMix(utxo.value, liquidity)
}
getPoolsForUtxo(utxo) {
if (utxo.account === WHIRLPOOL_ACCOUNTS.DEPOSIT) {
return this.getPoolsForTx0(utxo)
}
return this.getPoolsForMix(utxo)
}
isStartMixPossible(utxo) {
return (utxo.account === WHIRLPOOL_ACCOUNTS.PREMIX || utxo.account === WHIRLPOOL_ACCOUNTS.POSTMIX)
&& (utxo.status === 'MIX_FAILED' || utxo.status === 'READY')
......
import ifNot from 'if-not-running';
import moment from 'moment';
import backendService from './backendService';
const REFRESH_RATE = 30000;
......
#!/usr/bin/env ruby
unless File.exists?("icons/1024x1024.png")
STDERR.puts "Please create icons/1024x1024.png before running this script."
exit 1
end
system "rm -f icon.ico icon.icns icon.png"
[16, 24, 32, 48, 64, 96, 128, 256, 512].each do |size|
system "rm -f icons/#{size}x#{size}.png"
system "convert -resize #{size}x#{size}! icons/1024x1024.png icons/#{size}x#{size}.png"
end
system "cp icons/256x256.png icon.png"
system <<-SYSTEM
mkdir MyIcon.iconset
sips -z 16 16 icons/1024x1024.png --out MyIcon.iconset/icon_16x16.png
sips -z 32 32 icons/1024x1024.png --out MyIcon.iconset/icon_16x16@2x.png
sips -z 32 32 icons/1024x1024.png --out MyIcon.iconset/icon_32x32.png
sips -z 64 64 icons/1024x1024.png --out MyIcon.iconset/icon_32x32@2x.png
sips -z 128 128 icons/1024x1024.png --out MyIcon.iconset/icon_128x128.png
sips -z 256 256 icons/1024x1024.png --out MyIcon.iconset/icon_128x128@2x.png
sips -z 256 256 icons/1024x1024.png --out MyIcon.iconset/icon_256x256.png
sips -z 512 512 icons/1024x1024.png --out MyIcon.iconset/icon_256x256@2x.png
sips -z 512 512 icons/1024x1024.png --out MyIcon.iconset/icon_512x512.png
cp icons/1024x1024.png MyIcon.iconset/icon_512x512@2x.png
iconutil -c icns -o icon.icns MyIcon.iconset
convert icons/16x16.png icons/32x32.png icons/48x48.png icons/64x64.png icons/128x128.png icons/256x256.png icon.ico
rm -R MyIcon.iconset
SYSTEM
system "cp icon.icns ../app/app.icns"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment