Commit 30e8c86b authored by Pieterjan Vanhoof's avatar Pieterjan Vanhoof Committed by GitHub

Merge pull request #286 from stratisproject/ui

Show fee in transaction details, shutdown daemons on OS X quit, fix password validation, fix stdout logging
parents 137a7130 cc1c1a9d
...@@ -105,7 +105,8 @@ app.on('activate', function () { ...@@ -105,7 +105,8 @@ app.on('activate', function () {
}); });
function closeBitcoinApi() { function closeBitcoinApi() {
if (process.platform !== 'darwin' && !serve) { // if (process.platform !== 'darwin' && !serve) {
if (!serve) {
var http1 = require('http'); var http1 = require('http');
const options1 = { const options1 = {
hostname: 'localhost', hostname: 'localhost',
...@@ -121,6 +122,7 @@ function closeBitcoinApi() { ...@@ -121,6 +122,7 @@ function closeBitcoinApi() {
}; };
function closeStratisApi() { function closeStratisApi() {
// if (process.platform !== 'darwin' && !serve) {
if (process.platform !== 'darwin' && !serve) { if (process.platform !== 'darwin' && !serve) {
var http2 = require('http'); var http2 = require('http');
const options2 = { const options2 = {
...@@ -148,15 +150,10 @@ function startBitcoinApi() { ...@@ -148,15 +150,10 @@ function startBitcoinApi() {
bitcoinProcess = spawnBitcoin(apiPath, ['-testnet'], { bitcoinProcess = spawnBitcoin(apiPath, ['-testnet'], {
detached: true detached: true
}, (error, stdout, stderr) => { });
if (error) {
writeLogError(`exec error: ${error}`); bitcoinProcess.stdout.on('data', (data) => {
return; writeLog(`Bitcoin: ${data}`);
}
if (serve) {
writeLog(`stdout: ${stdout}`);
writeLog(`stderr: ${stderr}`);
}
}); });
} }
...@@ -172,15 +169,10 @@ function startStratisApi() { ...@@ -172,15 +169,10 @@ function startStratisApi() {
stratisProcess = spawnStratis(apiPath, ['stratis', '-testnet'], { stratisProcess = spawnStratis(apiPath, ['stratis', '-testnet'], {
detached: true detached: true
}, (error, stdout, stderr) => { });
if (error) {
writeLogError(`exec error: ${error}`); stratisProcess.stdout.on('data', (data) => {
return; writeLog(`Stratis: ${data}`);
}
if (serve) {
writeLog(`stdout: ${stdout}`);
writeLog(`stderr: ${stderr}`);
}
}); });
} }
...@@ -226,10 +218,6 @@ function writeLog(msg) { ...@@ -226,10 +218,6 @@ function writeLog(msg) {
console.log(msg); console.log(msg);
}; };
function writeLogError(msg) {
console.error(msg);
};
function createMenu() { function createMenu() {
const Menu = electron.Menu; const Menu = electron.Menu;
......
...@@ -8,10 +8,15 @@ export class PasswordValidationDirective { ...@@ -8,10 +8,15 @@ export class PasswordValidationDirective {
constructor() { } constructor() { }
static MatchPassword(AC: AbstractControl) { static MatchPassword(AC: AbstractControl) {
AC.get('walletPassword').valueChanges.subscribe(() => {
AC.get('walletPasswordConfirmation').updateValueAndValidity();
});
let password = AC.get('walletPassword').value; let password = AC.get('walletPassword').value;
let confirmPassword = AC.get('walletPasswordConfirmation').value; let confirmPassword = AC.get('walletPasswordConfirmation').value;
if(password != confirmPassword) { if(password != confirmPassword) {
AC.get('walletPasswordConfirmation').setErrors( { walletPasswordConfirmation: true } ) AC.get('walletPasswordConfirmation').setErrors({ walletPasswordConfirmation: true });
} else { } else {
return null return null
} }
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<li *ngIf="transaction.transactionType == 'received'" class="list-inline-item col-8 blockText text-success">{{ transaction.transactionAmount | coinNotation }} {{ coinUnit }}</li> <li *ngIf="transaction.transactionType == 'received'" class="list-inline-item col-8 blockText text-success">{{ transaction.transactionAmount | coinNotation }} {{ coinUnit }}</li>
<li *ngIf="transaction.transactionType == 'sent'" class="list-inline-item col-8 blockText text-danger">-{{ transaction.transactionAmount + transaction.transactionFee | coinNotation }} {{ coinUnit }}</li> <li *ngIf="transaction.transactionType == 'sent'" class="list-inline-item col-8 blockText text-danger">-{{ transaction.transactionAmount + transaction.transactionFee | coinNotation }} {{ coinUnit }}</li>
</ul> </ul>
<!-- <ul class="list-inline row" *ngIf="transaction.transactionType == 'sent'"> <ul class="list-inline row" *ngIf="transaction.transactionType == 'sent'">
<li class="list-inline-item col blockLabel">Fee</li> <li class="list-inline-item col blockLabel">Fee</li>
<li *ngIf="transaction.transactionType == 'sent'" class="list-inline-item col-8 blockText text-danger">{{ transaction.transactionFee | coinNotation }} {{ coinUnit }}</li> <li *ngIf="transaction.transactionType == 'sent'" class="list-inline-item col-8 blockText text-danger">{{ transaction.transactionFee | coinNotation }} {{ coinUnit }}</li>
</ul> --> </ul>
<ul class="list-inline row"> <ul class="list-inline row">
<li class="list-inline-item col blockLabel">Date</li> <li class="list-inline-item col blockLabel">Date</li>
<li class="list-inline-item col-8 blockText">{{ transaction.transactionTimestamp * 1000 | date:'medium' }}</li> <li class="list-inline-item col-8 blockText">{{ transaction.transactionTimestamp * 1000 | date:'medium' }}</li>
......
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