multiple ux fixes
This commit is contained in:
parent
a50f4cc638
commit
dcd903904e
6 changed files with 53 additions and 54 deletions
|
|
@ -243,3 +243,5 @@ button.secondary:hover { background-color: #FFDF00 !important;}
|
||||||
.m30v {margin: 30px 0;}
|
.m30v {margin: 30px 0;}
|
||||||
.m30a {margin: 30px auto;}
|
.m30a {margin: 30px auto;}
|
||||||
.br100 {border-radius: 100%;}
|
.br100 {border-radius: 100%;}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
39
index.html
39
index.html
|
|
@ -18,8 +18,8 @@
|
||||||
</figure>
|
</figure>
|
||||||
<div class="text-right" ng-show="$root.wallet">
|
<div class="text-right" ng-show="$root.wallet">
|
||||||
<h5 ng-show="$root.wallet.id">Wallet ID: {{$root.wallet.id}}</h5>
|
<h5 ng-show="$root.wallet.id">Wallet ID: {{$root.wallet.id}}</h5>
|
||||||
<p ng-show="totalBalance">{{totalBalance}} BTC</p>
|
<p ng-show="totalBalance">{{totalBalance}} <i class="fi-bitcoin"></i></p>
|
||||||
<p ng-show="!totalBalance">0 BTC</p>
|
<p ng-show="!totalBalance">0 <i class="fi-bitcoin"></i></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -215,11 +215,11 @@
|
||||||
<h3>Address</h3>
|
<h3>Address</h3>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-6 columns">
|
<div class="large-6 columns">
|
||||||
<a class="panel db" ng-repeat="addr in addrs" ng-click="selectAddr(addr)">{{addr}} <span class="right">{{balanceByAddr[addr] || 0}} BTC</span></a>
|
<a class="panel db" ng-repeat="addr in addrs" ng-click="selectAddr(addr)">{{addr}} <span class="right">{{balanceByAddr[addr] || 0}} <i class="fi-bitcoin"></i></span></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 columns line-dashed-v text-center">
|
<div class="large-3 columns line-dashed-v text-center">
|
||||||
<qrcode size="160" data="{{selectedAddr}}"></qrcode>
|
<qrcode size="160" data="{{selectedAddr}}"></qrcode>
|
||||||
<p class="m10t" ng-repeat="addr in addrs" ng-if="selectedAddr==addr"> <strong> {{balanceByAddr[addr]}} BTC </strong> </p>
|
<p class="m10t" ng-repeat="addr in addrs" ng-if="selectedAddr==addr"> <strong> {{balanceByAddr[addr]}} <i class="fi-bitcoin"></i> </strong> </p>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-3 columns text-center">
|
<div class="large-3 columns text-center">
|
||||||
<p> Create a New <strong> Address </strong> </p>
|
<p> Create a New <strong> Address </strong> </p>
|
||||||
|
|
@ -241,7 +241,7 @@
|
||||||
<div class="txheader">
|
<div class="txheader">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-8 columns">
|
<div class="large-8 columns">
|
||||||
ntxid: {{tx.ntxid}}
|
Proposal ID: {{tx.ntxid}}
|
||||||
</div>
|
</div>
|
||||||
<div class="large-4 columns text-right">
|
<div class="large-4 columns text-right">
|
||||||
created at {{tx.createdTs | date:'medium'}}
|
created at {{tx.createdTs | date:'medium'}}
|
||||||
|
|
@ -251,20 +251,23 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<table>
|
<table style="width:100%">
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Creator</th>
|
|
||||||
<th class="text-center"><i class="fi-arrow-right"></i></th>
|
|
||||||
<th>To address</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="o in tx.outs">
|
<tr ng-repeat="o in tx.outs">
|
||||||
<td>{{tx.creator}}</td>
|
<td class="text-right size-24">{{o.value}} <i class="fi-bitcoin"></i></td>
|
||||||
<td class="text-center">{{o.value}} BTC</td>
|
<td class="text-center size-48"> <i class="fi-arrow-right size-40">
|
||||||
<td>{{o.address}}</td>
|
<td class="text-left size-24">{{o.address}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr ng-repeat="(peer, actions) in tx.peerActions">
|
||||||
|
<td colspan="3" >
|
||||||
|
<span ng-if="peer == $root.wallet.network.peerId"> You</span>
|
||||||
|
<span ng-if="peer != $root.wallet.network.peerId"> {{peer}}</span>
|
||||||
|
:
|
||||||
|
<span ng-repeat="(action, ts) in actions">
|
||||||
|
<a title="{{ts | date:'medium'}}"> {{action}}</a>
|
||||||
|
</span>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -272,7 +275,7 @@
|
||||||
|
|
||||||
<div class="txbottom">
|
<div class="txbottom">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-6 columns">
|
<div class="large-6 columns" ng-show="!tx.sentTs">
|
||||||
<div ng-show="tx.signedByUs">
|
<div ng-show="tx.signedByUs">
|
||||||
<i class="fi-check size-40"></i> Signed by you already
|
<i class="fi-check size-40"></i> Signed by you already
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -294,7 +297,9 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span ng-show="!tx.missingSignatures && tx.sentTs">
|
<span ng-show="!tx.missingSignatures && tx.sentTs">
|
||||||
|
<i class="fi-arrow-right size-40"></i>
|
||||||
Sent at {{tx.sentTs | date:'medium'}}
|
Sent at {{tx.sentTs | date:'medium'}}
|
||||||
|
TXID: tx.sentTxid
|
||||||
</span>
|
</span>
|
||||||
<span ng-show="tx.missingSignatures==1">
|
<span ng-show="tx.missingSignatures==1">
|
||||||
One signature missing
|
One signature missing
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,7 @@ console.log('[transactions.js.10:_updateTxs:]'); //TODO
|
||||||
var txs = [];
|
var txs = [];
|
||||||
|
|
||||||
inT.forEach(function(i){
|
inT.forEach(function(i){
|
||||||
var b = i.txp.builder;
|
var tx = i.builder.build();
|
||||||
var tx = b.build();
|
|
||||||
var one = {
|
|
||||||
feeSat: b.feeSat,
|
|
||||||
};
|
|
||||||
var outs = [];
|
var outs = [];
|
||||||
|
|
||||||
tx.outs.forEach(function(o) {
|
tx.outs.forEach(function(o) {
|
||||||
|
|
@ -30,19 +26,13 @@ console.log('[transactions.js.10:_updateTxs:]'); //TODO
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
one.outs = outs;
|
// extra fields
|
||||||
|
i.outs = outs;
|
||||||
// TOD: check missingSignatures === in al inputs?
|
i.fee = i.feeSat/bitcore.util.COIN;
|
||||||
one.missingSignatures = tx.countInputMissingSignatures(0);
|
i.missingSignatures = tx.countInputMissingSignatures(0);
|
||||||
one.signedByUs = i.signedByUs;
|
txs.push(i);
|
||||||
one.ntxid = i.ntxid;
|
|
||||||
one.creator = i.txp.creator;
|
|
||||||
one.createdTs = i.txp.createdTs;
|
|
||||||
one.sentTs = i.txp.sentTs;
|
|
||||||
txs.push(one);
|
|
||||||
});
|
});
|
||||||
$scope.txs = txs;
|
$scope.txs = txs;
|
||||||
console.log('[transactions.js.55] SET HANDL+'); //TODO
|
|
||||||
w.removeListener('txProposalsUpdated',_updateTxs)
|
w.removeListener('txProposalsUpdated',_updateTxs)
|
||||||
w.once('txProposalsUpdated',_updateTxs);
|
w.once('txProposalsUpdated',_updateTxs);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ function TxProposal(opts) {
|
||||||
this.signedBy = opts.signedBy || {};
|
this.signedBy = opts.signedBy || {};
|
||||||
this.builder = opts.builder;
|
this.builder = opts.builder;
|
||||||
this.sentTs = opts.sentTs || null;
|
this.sentTs = opts.sentTs || null;
|
||||||
|
this.sentTxid = opts.sentTxid || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
TxProposal.prototype.toObj = function() {
|
TxProposal.prototype.toObj = function() {
|
||||||
|
|
@ -30,7 +31,8 @@ TxProposal.prototype.toObj = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
TxProposal.prototype.setSent = function() {
|
TxProposal.prototype.setSent = function(sentTxid) {
|
||||||
|
this.sentTxid = txid;
|
||||||
this.sentTs = Date.now();;
|
this.sentTs = Date.now();;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -143,8 +145,9 @@ console.log('[TxProposals.js.127:v0:]',v0, v1); //TODO
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!v0.sentTs && v1.sentTs) {
|
if (!v0.sentTxid && v1.sentTxid) {
|
||||||
v0.sentTs = v1.sentTs;
|
v0.sentTs = v1.sentTs;
|
||||||
|
v0.sentTxid = v1.sentTxid;
|
||||||
hasChanged++;
|
hasChanged++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,12 +77,7 @@ Wallet.prototype._handleTxProposals = function(senderId, data, isInbound) {
|
||||||
var recipients;
|
var recipients;
|
||||||
var inTxp = copay.TxProposals.fromObj(data.txProposals);
|
var inTxp = copay.TxProposals.fromObj(data.txProposals);
|
||||||
var mergeInfo = this.txProposals.merge(inTxp, true);
|
var mergeInfo = this.txProposals.merge(inTxp, true);
|
||||||
console.log('[Wallet.js.79:inTxp:]',inTxp); //TODO
|
|
||||||
|
|
||||||
var addSeen = this.addSeenToTxProposals();
|
var addSeen = this.addSeenToTxProposals();
|
||||||
|
|
||||||
console.log('[Wallet.js.81]', addSeen, mergeInfo); //TODO
|
|
||||||
// if ((mergeInfo.merged && !data.isBroadcast) || addSeen) {
|
|
||||||
if (mergeInfo.hasChanged || addSeen) {
|
if (mergeInfo.hasChanged || addSeen) {
|
||||||
this.log('### BROADCASTING txProposals. ' );
|
this.log('### BROADCASTING txProposals. ' );
|
||||||
recipients = null;
|
recipients = null;
|
||||||
|
|
@ -168,7 +163,6 @@ Wallet.prototype.getMyPeerId = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
Wallet.prototype.netStart = function() {
|
Wallet.prototype.netStart = function() {
|
||||||
console.log('[Wallet.js.159:netStart:]'); //TODO
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var net = this.network;
|
var net = this.network;
|
||||||
net.removeAllListeners();
|
net.removeAllListeners();
|
||||||
|
|
@ -188,7 +182,6 @@ console.log('[Wallet.js.159:netStart:]'); //TODO
|
||||||
peerId: myPeerId
|
peerId: myPeerId
|
||||||
};
|
};
|
||||||
net.start(function() {
|
net.start(function() {
|
||||||
console.log('[Wallet.js.177] NET START: emit CREATED'); //TODO
|
|
||||||
self.emit('created');
|
self.emit('created');
|
||||||
for (var i=0; i<self.publicKeyRing.registeredCopayers(); i++) {
|
for (var i=0; i<self.publicKeyRing.registeredCopayers(); i++) {
|
||||||
var otherPeerId = self.getPeerId(i);
|
var otherPeerId = self.getPeerId(i);
|
||||||
|
|
@ -296,9 +289,24 @@ Wallet.prototype.getTxProposals = function() {
|
||||||
var ret = [];
|
var ret = [];
|
||||||
for(var k in this.txProposals.txps) {
|
for(var k in this.txProposals.txps) {
|
||||||
var txp = this.txProposals.txps[k];
|
var txp = this.txProposals.txps[k];
|
||||||
var i = {txp:txp};
|
var i = JSON.parse(JSON.stringify(txp));
|
||||||
|
i.builder = txp.builder;
|
||||||
i.ntxid = k;
|
i.ntxid = k;
|
||||||
i.signedByUs = txp.signedBy[this.getMyPeerId()]?true:false;
|
i.signedByUs = txp.signedBy[this.getMyPeerId()]?true:false;
|
||||||
|
|
||||||
|
i.peerActions = {};
|
||||||
|
for(var p in txp.seenBy){
|
||||||
|
i.peerActions[p]={seen: txp.seenBy[p]};
|
||||||
|
}
|
||||||
|
for(var p in txp.signedBy){
|
||||||
|
i.peerActions[p]= i.peerActions[p] || {};
|
||||||
|
i.peerActions[p].sign = txp.signedBy[p];
|
||||||
|
}
|
||||||
|
var c = txp.creator;
|
||||||
|
i.peerActions[c] = i.peerActions[c] || {};
|
||||||
|
i.peerActions[c].create = txp.createdTs;
|
||||||
|
|
||||||
|
|
||||||
ret.push(i);
|
ret.push(i);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -363,10 +371,8 @@ Wallet.prototype.addSeenToTxProposals = function() {
|
||||||
|
|
||||||
for(var k in this.txProposals.txps) {
|
for(var k in this.txProposals.txps) {
|
||||||
var txp = this.txProposals.txps[k];
|
var txp = this.txProposals.txps[k];
|
||||||
console.log('[Wallet.js.364:txp:] ADD SEEN',txp); //TODO
|
|
||||||
if (!txp.seenBy[myId]) {
|
if (!txp.seenBy[myId]) {
|
||||||
|
|
||||||
console.log('[Wallet.js.367] ADDING'); //TODO
|
|
||||||
txp.seenBy[myId] = Date.now();
|
txp.seenBy[myId] = Date.now();
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
@ -446,12 +452,9 @@ Wallet.prototype.createTx = function(toAddress, amountSatStr, opts, cb) {
|
||||||
}
|
}
|
||||||
self.getUnspent(function(unspentList) {
|
self.getUnspent(function(unspentList) {
|
||||||
// TODO check enough funds, etc.
|
// TODO check enough funds, etc.
|
||||||
console.log('[Wallet.js.452]', self); //TODO
|
|
||||||
self.createTxSync(toAddress, amountSatStr, unspentList, opts);
|
self.createTxSync(toAddress, amountSatStr, unspentList, opts);
|
||||||
self.sendPublicKeyRing(); // Change Address
|
self.sendPublicKeyRing(); // Change Address
|
||||||
self.sendTxProposals();
|
self.sendTxProposals();
|
||||||
|
|
||||||
console.log('[Wallet.js.452]', self); //TODO
|
|
||||||
self.store();
|
self.store();
|
||||||
return cb();
|
return cb();
|
||||||
});
|
});
|
||||||
|
|
@ -488,8 +491,6 @@ Wallet.prototype.createTxSync = function(toAddress, amountSatStr, utxos, opts) {
|
||||||
|
|
||||||
if (priv) me[myId] = now;
|
if (priv) me[myId] = now;
|
||||||
|
|
||||||
console.log('[Wallet.js.485:me:]',myId, me); //TODO
|
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
signedBy: (priv && b.signaturesAdded ? me : {}),
|
signedBy: (priv && b.signaturesAdded ? me : {}),
|
||||||
seenBy: (priv ? me : {}),
|
seenBy: (priv ? me : {}),
|
||||||
|
|
@ -498,8 +499,6 @@ console.log('[Wallet.js.485:me:]',myId, me); //TODO
|
||||||
builder: b,
|
builder: b,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('[Wallet.js.499:data:]',data); //TODO
|
|
||||||
|
|
||||||
this.txProposals.add(data);
|
this.txProposals.add(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ WalletFactory.prototype.getWalletIds = function() {
|
||||||
|
|
||||||
WalletFactory.prototype.remove = function(walletId) {
|
WalletFactory.prototype.remove = function(walletId) {
|
||||||
// TODO remove wallet contents
|
// TODO remove wallet contents
|
||||||
console.log('TODO: remove wallet contents');
|
this.log('TODO: remove wallet contents');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue