Skip to content
Permalink
Browse files

Merge branch 'dev' into enhance/logging

  • Loading branch information
pciavald committed Jan 28, 2018
2 parents 07f8e3c + cb4624d commit 30202b89df22d25bde01e03e2439899439c7df73
Showing with 13,446 additions and 1,515 deletions.
  1. +10 −10 README.md
  2. +4 −0 main.js
  3. +14 −9 modules/daemon/daemon.js
  4. +3 −3 modules/daemon/daemonManager.js
  5. +9 −3 modules/ipc/ipc.js
  6. +1 −6 modules/options.js
  7. +2 −1 modules/rpc/cookie.js
  8. +7 −1 modules/rpc/rpc.js
  9. +72 −47 package.json
  10. +0 −1 src/app/app.component.ts
  11. +0 −1 src/app/app.module.ts
  12. +78 −32 src/app/core-ui/main/main-view.component.html
  13. +16 −9 src/app/core-ui/main/main-view.component.scss
  14. +64 −8 src/app/core-ui/main/main-view.component.ts
  15. +13 −4 src/app/core-ui/main/main-view.module.ts
  16. +19 −0 src/app/core-ui/main/release-notification/release-notification.component.html
  17. +41 −0 src/app/core-ui/main/release-notification/release-notification.component.scss
  18. +30 −0 src/app/core-ui/main/release-notification/release-notification.component.spec.ts
  19. +39 −0 src/app/core-ui/main/release-notification/release-notification.component.ts
  20. +7 −0 src/app/core-ui/main/release-notification/release-notification.model.ts
  21. +3 −0 src/app/core-ui/main/status/modal/help-modal/command.model.ts
  22. +51 −0 src/app/core-ui/main/status/modal/help-modal/console-modal.component.html
  23. +60 −0 src/app/core-ui/main/status/modal/help-modal/console-modal.component.scss
  24. +41 −0 src/app/core-ui/main/status/modal/help-modal/console-modal.component.spec.ts
  25. +137 −0 src/app/core-ui/main/status/modal/help-modal/console-modal.component.ts
  26. +14 −6 src/app/core-ui/main/status/status.component.html
  27. +9 −0 src/app/core-ui/main/status/status.component.scss
  28. +23 −9 src/app/core-ui/main/status/status.component.ts
  29. +1 −0 src/app/core-ui/material/material.module.ts
  30. +29 −16 src/app/core-ui/paginator/paginator.component.html
  31. +11 −6 src/app/core-ui/paginator/paginator.component.ts
  32. +1 −1 src/app/core/core.module.ts
  33. +1 −0 src/app/core/ipc/ipc.service.ts
  34. +1 −2 src/app/core/rpc/blockstatus/blockstatus.service.ts
  35. +57 −48 src/app/core/rpc/rpc-state/rpc-state.class.ts
  36. +13 −4 src/app/core/rpc/rpc.service.ts
  37. +10 −14 src/app/modals/coldstake/coldstake.component.ts
  38. +34 −6 src/app/modals/createwallet/createwallet.component.html
  39. +4 −0 src/app/modals/createwallet/createwallet.component.spec.ts
  40. +86 −28 src/app/modals/createwallet/createwallet.component.ts
  41. +3 −3 src/app/modals/createwallet/passphrase/passphrase.component.html
  42. +20 −8 src/app/modals/createwallet/passphrase/passphrase.component.ts
  43. +10 −8 src/app/modals/encryptwallet/encryptwallet.component.html
  44. +6 −10 src/app/modals/encryptwallet/encryptwallet.component.ts
  45. +1 −1 src/app/modals/modals.component.html
  46. +13 −6 src/app/modals/modals.component.ts
  47. +5 −2 src/app/modals/modals.module.ts
  48. +13 −7 src/app/modals/modals.service.ts
  49. +1 −1 src/app/modals/shared/alert/alert.component.ts
  50. +15 −0 src/app/modals/shared/daemon-connection/daemon-connection.component.html
  51. 0 ...ordion-heading.component.scss → modals/shared/daemon-connection/daemon-connection.component.scss}
  52. +39 −0 src/app/modals/shared/daemon-connection/daemon-connection.component.spec.ts
  53. +16 −0 src/app/modals/shared/daemon-connection/daemon-connection.component.ts
  54. +2 −2 src/app/modals/shared/password/password.component.html
  55. +3 −0 src/app/modals/shared/password/password.component.scss
  56. +25 −15 src/app/modals/shared/password/password.component.ts
  57. +1 −1 src/app/modals/shared/percentage-bar/percentage-bar.component.html
  58. +1 −1 src/app/modals/shared/percentage-bar/percentage-bar.component.ts
  59. +8 −5 src/app/modals/syncing/syncing.component.ts
  60. +1 −0 src/app/modals/unlockwallet/unlockwallet.component.html
  61. +7 −5 src/app/modals/unlockwallet/unlockwallet.component.ts
  62. +0 −3 src/app/wallet/overview/overview.component.ts
  63. +74 −19 src/app/wallet/overview/widgets/coldstake/coldstake.component.html
  64. +52 −9 src/app/wallet/overview/widgets/coldstake/coldstake.component.scss
  65. +97 −37 src/app/wallet/overview/widgets/coldstake/coldstake.component.ts
  66. +33 −0 src/app/wallet/overview/widgets/coldstake/revert-coldstaking/revert-coldstaking.component.html
  67. +3 −0 src/app/wallet/overview/widgets/coldstake/revert-coldstaking/revert-coldstaking.component.scss
  68. +44 −0 src/app/wallet/overview/widgets/coldstake/revert-coldstaking/revert-coldstaking.component.spec.ts
  69. +151 −0 src/app/wallet/overview/widgets/coldstake/revert-coldstaking/revert-coldstaking.component.ts
  70. +28 −0 src/app/wallet/overview/widgets/coldstake/zap-coldstaking/zap-coldstaking.component.html
  71. +3 −0 src/app/wallet/overview/widgets/coldstake/zap-coldstaking/zap-coldstaking.component.scss
  72. +37 −0 src/app/wallet/overview/widgets/coldstake/zap-coldstaking/zap-coldstaking.component.spec.ts
  73. +138 −0 src/app/wallet/overview/widgets/coldstake/zap-coldstaking/zap-coldstaking.component.ts
  74. +16 −5 src/app/wallet/overview/widgets/stakinginfo/stakinginfo.component.ts
  75. +7 −1 src/app/wallet/settings/settings.component.html
  76. +5 −1 src/app/wallet/settings/settings.component.ts
  77. +1 −1 src/app/wallet/settings/settings.service.ts
  78. +0 −4 src/app/wallet/shared/accordion/accordion-group/accordion-group.component.html
  79. +0 −10 src/app/wallet/shared/accordion/accordion-group/accordion-group.component.scss
  80. +0 −25 src/app/wallet/shared/accordion/accordion-group/accordion-group.component.spec.ts
  81. +0 −22 src/app/wallet/shared/accordion/accordion-group/accordion-group.component.ts
  82. +0 −1 src/app/wallet/shared/accordion/accordion-heading/accordion-heading.component.html
  83. +0 −25 src/app/wallet/shared/accordion/accordion-heading/accordion-heading.component.spec.ts
  84. +0 −15 src/app/wallet/shared/accordion/accordion-heading/accordion-heading.component.ts
  85. +0 −22 src/app/wallet/shared/accordion/accordion.module.ts
  86. +0 −1 src/app/wallet/shared/accordion/accordion/accordion.component.html
  87. 0 src/app/wallet/shared/accordion/accordion/accordion.component.scss
  88. +0 −25 src/app/wallet/shared/accordion/accordion/accordion.component.spec.ts
  89. +0 −18 src/app/wallet/shared/accordion/accordion/accordion.component.ts
  90. +16 −5 src/app/wallet/shared/delete-confirmation-modal/delete-confirmation-modal.component.html
  91. +0 −3 src/app/wallet/shared/delete-confirmation-modal/delete-confirmation-modal.component.scss
  92. +0 −3 src/app/wallet/shared/grid/grid.component.html
  93. +0 −69 src/app/wallet/shared/grid/grid.component.scss
  94. +0 −25 src/app/wallet/shared/grid/grid.component.spec.ts
  95. +0 −18 src/app/wallet/shared/grid/grid.component.ts
  96. +6 −20 src/app/wallet/shared/shared.module.ts
  97. +0 −3 src/app/wallet/shared/table/table.component.html
  98. +0 −71 src/app/wallet/shared/table/table.component.scss
  99. +0 −25 src/app/wallet/shared/table/table.component.spec.ts
  100. +0 −18 src/app/wallet/shared/table/table.component.ts
  101. +25 −2 src/app/wallet/shared/util/utils.ts
  102. +11 −7 src/app/wallet/wallet.module.ts
  103. +3 −1 src/app/wallet/wallet.routing.ts
  104. +21 −6 src/app/wallet/wallet/address-book/address-book.component.html
  105. +5 −1 src/app/wallet/wallet/address-book/address-book.component.scss
  106. +16 −6 src/app/wallet/wallet/address-book/address-book.component.ts
  107. +7 −3 src/app/wallet/wallet/address-book/modal/new-address-modal/new-address-modal.component.html
  108. +2 −3 src/app/wallet/wallet/address-book/modal/new-address-modal/new-address-modal.component.ts
  109. +12 −3 src/app/wallet/wallet/addresslookup/addresslookup.component.html
  110. +10 −1 src/app/wallet/wallet/addresslookup/addresslookup.component.scss
  111. +16 −8 src/app/wallet/wallet/addresslookup/addresslookup.component.ts
  112. +74 −18 src/app/wallet/wallet/history/history.component.html
  113. +48 −103 src/app/wallet/wallet/history/history.component.scss
  114. +4 −2 src/app/wallet/wallet/history/history.component.spec.ts
  115. +75 −15 src/app/wallet/wallet/history/history.component.ts
  116. +10 −3 src/app/wallet/wallet/receive/modals/add-address-label/add-address-label.component.html
  117. +17 −11 src/app/wallet/wallet/receive/receive.component.html
  118. +5 −2 src/app/wallet/wallet/receive/receive.component.scss
  119. +42 −37 src/app/wallet/wallet/receive/receive.component.ts
  120. +2 −2 src/app/wallet/wallet/send/send-confirmation-modal/send-confirmation-modal.component.ts
  121. +10 −7 src/app/wallet/wallet/send/send.component.html
  122. +8 −0 src/app/wallet/wallet/send/send.component.scss
  123. +21 −14 src/app/wallet/wallet/send/send.component.ts
  124. +2 −1 src/app/wallet/wallet/send/send.service.ts
  125. +4 −1 src/app/wallet/wallet/shared/address-table/address-table.component.html
  126. +1 −1 src/app/wallet/wallet/shared/address-table/address-table.component.scss
  127. +39 −21 src/app/wallet/wallet/shared/address-table/address-table.component.ts
  128. +2 −2 src/app/wallet/wallet/shared/address.service.ts
  129. +3 −3 src/app/wallet/wallet/shared/qr-code-modal/qr-code-modal.component.html
  130. +9 −8 src/app/wallet/wallet/shared/qr-code-modal/qr-code-modal.component.ts
  131. +11 −9 src/app/wallet/wallet/shared/signature-address-modal/signature-address-modal.component.html
  132. +7 −11 src/app/wallet/wallet/shared/signature-address-modal/signature-address-modal.component.scss
  133. +4 −3 src/app/wallet/wallet/shared/signature-address-modal/signature-address-modal.component.ts
  134. +126 −128 src/app/wallet/wallet/shared/transaction-table/transaction-table.component.html
  135. +2 −6 src/app/wallet/wallet/shared/transaction-table/transaction-table.component.scss
  136. +30 −18 src/app/wallet/wallet/shared/transaction-table/transaction-table.component.ts
  137. +3 −18 src/app/wallet/wallet/shared/transaction.model.ts
  138. +126 −38 src/app/wallet/wallet/shared/transaction.service.ts
  139. +4 −2 src/assets/_config.scss
  140. BIN src/assets/fonts/part.eot
  141. +89 −65 src/assets/fonts/part.svg
  142. BIN src/assets/fonts/part.ttf
  143. BIN src/assets/fonts/part.woff
  144. BIN src/assets/fonts/part.woff2
  145. +1 −0 src/assets/icons/SVG/circle-info.svg
  146. +1 −0 src/assets/icons/SVG/circle-user.svg
  147. +1 −0 src/assets/icons/SVG/console-window.svg
  148. +1 −0 src/assets/icons/SVG/flash.svg
  149. +1 −0 src/assets/icons/SVG/info.svg
  150. +56 −0 src/assets/icons/SVG/lock/lock-off.svg
  151. +56 −0 src/assets/icons/SVG/lock/lock-stake.svg
  152. +56 −0 src/assets/icons/SVG/lock/lock.svg
  153. +55 −0 src/assets/icons/SVG/network/peers-0.svg
  154. +102 −0 src/assets/icons/SVG/network/peers-1.svg
  155. +102 −0 src/assets/icons/SVG/network/peers-2.svg
  156. +102 −0 src/assets/icons/SVG/network/peers-3.svg
  157. +102 −0 src/assets/icons/SVG/network/peers-4.svg
  158. +102 −0 src/assets/icons/SVG/network/peers-5.svg
  159. +102 −0 src/assets/icons/SVG/network/peers-6.svg
  160. +1 −0 src/assets/icons/SVG/preferences.svg
  161. +1 −0 src/assets/icons/SVG/rocket.svg
  162. +1 −0 src/assets/icons/SVG/tool.svg
  163. +41 −5 src/assets/theme.scss
  164. +1 −1 src/index.html
  165. +97 −65 src/styles.scss
  166. +9,642 −0 yarn.lock
@@ -1,8 +1,8 @@
# Particl Wallet - UI
# particl-desktop - UI

![UI Preview](preview.gif)

> *"Particl is an open source project that aims to restore the balance of privacy on the internet."*
> *"Particl is an open source project that aims to restore the balance of privacy on the internet."*
We provide a decentralized privacy platform with a suite of tools to enhance your online privacy:
* **An anonymous cryptocurrency** - send and receive the PART cryptocurrency without revealing the transaction history
@@ -11,14 +11,14 @@ We provide a decentralized privacy platform with a suite of tools to enhance you

This repository is the user interface that works in combination with our [`particl-core`](https://github.com/particl/particl-core).

[![Download the packaged wallet for Mac, Windows and Linux](download-button.png)](https://github.com/particl/partgui/releases)
[![Download the packaged wallet for Mac, Windows and Linux](download-button.png)](https://github.com/particl/particl-desktop/releases)

# Contribute

[![Build Status](https://travis-ci.org/particl/partgui.svg?branch=master)](https://travis-ci.org/particl/partgui)
[![Coverage Status](https://coveralls.io/repos/github/particl/partgui/badge.svg?branch=master)](https://coveralls.io/github/particl/partgui?branch=master)
[![Code Climate](https://codeclimate.com/github/particl/partgui/badges/gpa.svg)](https://codeclimate.com/github/particl/partgui)
[![Greenkeeper badge](https://badges.greenkeeper.io/particl/partgui.svg)](https://greenkeeper.io/)
[![Snyk](https://snyk.io/test/github/particl/particl-desktop/badge.svg)](https://snyk.io/test/github/particl/particl-desktop)
[![Build Status](https://travis-ci.org/particl/particl-desktop.svg?branch=master)](https://travis-ci.org/particl/particl-desktop)
[![Coverage Status](https://coveralls.io/repos/github/particl/particl-desktop/badge.svg?branch=master)](https://coveralls.io/github/particl/particl-desktop?branch=master)
[![Code Climate](https://codeclimate.com/github/particl/particl-desktop/badges/gpa.svg)](https://codeclimate.com/github/particl/particl-desktop)
[![Greenkeeper badge](https://badges.greenkeeper.io/particl/particl-desktop.svg)](https://greenkeeper.io/)

## Development

@@ -27,8 +27,8 @@ This repository is the user interface that works in combination with our [`parti
* Download + Install [git](https://git-scm.com/)

```bash
git clone https://github.com/particl/partgui
cd partgui
git clone https://github.com/particl/particl-desktop
cd particl-desktop
npm install
```

@@ -50,6 +50,9 @@ let openDevTools = false;
if (process.argv.includes('-opendevtools'))
openDevTools = true;

if (app.getVersion().includes('RC'))
process.argv.push(...['-testnet', '-printtoconsole']);

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
@@ -112,6 +115,7 @@ function initMainWindow() {
maxWidth: 1920,
height: 675,
resizable: false,
icon: path.join(__dirname, 'resources/icon.png'),
webPreferences: {
nodeIntegration: false,
sandbox: true,
@@ -9,7 +9,7 @@ const cookie = require('../rpc/cookie');
const daemonManager = require('../daemon/daemonManager');
const multiwallet = require('../multiwallet');

let daemon;
let daemon = undefined;
let exitCode = 0;
let restarting = false;
let chosenWallets = [];
@@ -54,12 +54,8 @@ exports.restart = function (cb) {
exports.start = function (wallets, callback) {
return (new Promise((resolve, reject) => {

let options = _options.get();
const daemonPath = options.customdaemon
? options.customdaemon
: daemonManager.getPath();
chosenWallets = wallets;

chosenWallets = wallets;
rpc.init();
exports.check().then(() => {
log.info('daemon already started');
@@ -70,6 +66,11 @@ exports.start = function (wallets, callback) {
if (!restarting && ['debug', 'silly'].includes(log.transports.console.level))
process.argv.push('-printtoconsole');

let options = _options.get();
const daemonPath = options.customdaemon
? options.customdaemon
: daemonManager.getPath();

wallets = wallets.map(wallet => `-wallet=${wallet}`);
log.info(`starting daemon ${daemonPath} ${process.argv} ${wallets}`);

@@ -101,7 +102,7 @@ exports.start = function (wallets, callback) {
exports.wait = function(wallets, callback) {
return new Promise((resolve, reject) => {

const maxRetries = 10; // Some slow computers...
const maxRetries = 100; // Some slow computers...
let retries = 0;
let errorString = '';

@@ -127,7 +128,6 @@ exports.wait = function(wallets, callback) {
}
log.error('Could not connect to daemon.')
reject();
electron.app.exit();
}
} /* daemonStartup */

@@ -170,7 +170,12 @@ exports.stop = function() {
resolve();
}
});
} else resolve();
} else
{
log.debug('Daemon not managed by gui.');
resolve();
electron.app.quit();
}

}).catch(() => {
if (daemon)
@@ -14,12 +14,12 @@ const rpc = require('../rpc/rpc');
let options;

// master
// const BINARY_URL = 'https://raw.githubusercontent.com/particl/partgui/master/modules/clientBinaries/clientBinaries.json';
// const BINARY_URL = 'https://raw.githubusercontent.com/particl/particl-desktop/master/modules/clientBinaries/clientBinaries.json';

// dev
// const BINARY_URL = 'https://raw.githubusercontent.com/particl/partgui/dev/modules/clientBinaries/clientBinaries.json';
// const BINARY_URL = 'https://raw.githubusercontent.com/particl/particl-desktop/dev/modules/clientBinaries/clientBinaries.json';

const BINARY_URL = 'https://raw.githubusercontent.com/particl/partgui/dev/modules/clientBinaries/clientBinaries.json';
const BINARY_URL = 'https://raw.githubusercontent.com/particl/particl-desktop/dev/modules/clientBinaries/clientBinaries.json';

//const ALLOWED_DOWNLOAD_URLS_REGEX = new RegExp('*', 'i');

@@ -60,15 +60,21 @@ exports.init = function() {
// Register new listener
rxIpc.registerListener('rpc-channel', (event, method, params) => {
return Observable.create(observer => {

if (['restart-daemon'].includes(method)) {
daemon.restart(() => observer.next(true));
} else {
rpc.call(method, params, (error, response) => {
error ? observer.error(error) : observer.next(response || undefined);
try {
error ? observer.error(error) : observer.next(response || undefined);
} catch (err) {
if (err.message == 'Object has been destroyed') {
// suppress error
} else {
log.error(err);
}
}
});
}

});
});
}
@@ -19,17 +19,12 @@ let _options = {};
exports.parse = function() {

let options = {};

if (path.basename(process.argv[0]).includes('electron')) {
if (process.argv[0].match(/[Ee]lectron/)) {
// striping 'electron .' from argv
process.argv = process.argv.splice(2);
} else {
// striping /path/to/particl from argv
process.argv = process.argv.splice(1);
// fixed for development mode only
if (process.platform === 'darwin') {
process.argv = process.argv.splice(1);
}
}

process.argv.forEach((arg, index) => {
@@ -97,7 +97,8 @@ function getAuth(options) {
}

let auth;
const COOKIE_FILE = findCookiePath()
var dataDir = options.datadir ? options.datadir : findCookiePath();
const COOKIE_FILE = dataDir
+ (options.testnet ? '/testnet' : '')
+ '/.cookie';

@@ -4,6 +4,8 @@ const http = require('http');
const cookie = require('./cookie');
const _options = require('../options');

const spyOnRpc = false;

let TIMEOUT = 15000;
let HOSTNAME;
let PORT;
@@ -35,6 +37,10 @@ exports.call = function(method, params, callback) {
method: method,
params: params
});

if(spyOnRpc) {
log.debug('rpc.call:', postData);
}

if (!rpcOptions) {
rpcOptions = {
@@ -100,7 +106,7 @@ exports.call = function(method, params, callback) {
case 'ECONNREFUSED':
callback({
status: 502,
message: 'Connection Refused',
message: 'Daemon not connected, retrying connection',
_error: error
});
break;

0 comments on commit 30202b8

Please sign in to comment.
You can’t perform that action at this time.