Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
ce03cf34
Commit
ce03cf34
authored
Jun 28, 2017
by
Pieterjan Vanhoof
Committed by
GitHub
Jun 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #119 from stratisproject/ui
Spawn API when in production mode
parents
896fcfa5
14dca061
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
104 additions
and
128 deletions
+104
-128
.gitignore
.gitignore
+1
-0
README.md
Breeze.UI/README.md
+2
-0
main.ts
Breeze.UI/main.ts
+11
-6
package.json
Breeze.UI/package.json
+3
-3
app.component.ts
Breeze.UI/src/app/app.component.ts
+1
-21
login.component.ts
Breeze.UI/src/app/login/login.component.ts
+6
-3
create.component.ts
Breeze.UI/src/app/setup/create/create.component.ts
+2
-2
coin-abbreviation.pipe.spec.ts
...ze.UI/src/app/shared/pipes/coin-abbreviation.pipe.spec.ts
+0
-8
coin-abbreviation.pipe.ts
Breeze.UI/src/app/shared/pipes/coin-abbreviation.pipe.ts
+0
-14
coin-notation.pipe.ts
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
+20
-14
global.service.ts
Breeze.UI/src/app/shared/services/global.service.ts
+22
-22
shared.module.ts
Breeze.UI/src/app/shared/shared.module.ts
+2
-3
dashboard.component.html
Breeze.UI/src/app/wallet/dashboard/dashboard.component.html
+9
-9
dashboard.component.ts
Breeze.UI/src/app/wallet/dashboard/dashboard.component.ts
+16
-14
history.component.html
Breeze.UI/src/app/wallet/history/history.component.html
+1
-1
history.component.ts
Breeze.UI/src/app/wallet/history/history.component.ts
+2
-1
receive.component.ts
Breeze.UI/src/app/wallet/receive/receive.component.ts
+2
-5
send.component.ts
Breeze.UI/src/app/wallet/send/send.component.ts
+4
-2
No files found.
.gitignore
View file @
ce03cf34
...
...
@@ -241,6 +241,7 @@ ModelManifest.xml
# UI ignores
# compiled output
**/app-builds
**/assets/daemon
**/dist
**/tmp
**/build
...
...
Breeze.UI/README.md
View file @
ce03cf34
...
...
@@ -33,6 +33,8 @@ npm install -g @angular/cli
## To build for development
-
**in a terminal window**
-> npm start
This will compile the Angular code and spawn the Electron process in parallel.
After compilation has completed the Electron UI will refresh.
If you want to seperate the build process from the Electron process you can use:
-
**in a terminal window**
-> npm start:webpack
...
...
Breeze.UI/main.ts
View file @
ce03cf34
...
...
@@ -51,7 +51,12 @@ function createWindow() {
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app
.
on
(
'ready'
,
function
()
{
//startApi();
if
(
serve
)
{
console
.
log
(
"Breeze UI was started in development mode. This requires the user to be running the Breeze Daemon himself."
)
}
else
{
startApi
();
}
createTray
();
createWindow
();
})
...
...
@@ -74,16 +79,16 @@ app.on('activate', function () {
});
function
startApi
()
{
let
apiProcess
;
var
spawn
=
require
(
'child_process'
).
spawn
;
var
apiProcess
;
const
spawn
=
require
(
'child_process'
).
spawn
;
//Start Breeze Daemon
apipath
=
path
.
join
(
__dirname
,
'
'
);
let
apipath
=
path
.
join
(
__dirname
,
'..//..//daemon//Breeze.Daemon
'
);
if
(
os
.
platform
()
===
'win32'
)
{
var
apipath
=
path
.
join
(
__dirname
,
'
'
);
apipath
=
path
.
join
(
__dirname
,
'.
\\
assets
\\
daemon
\\
Breeze.Daemon.exe
'
);
}
apiProcess
=
spawn
(
apipath
,
{
apiProcess
=
spawn
(
apipath
+
' light -testnet'
,
{
detached
:
true
});
...
...
Breeze.UI/package.json
View file @
ce03cf34
...
...
@@ -30,9 +30,9 @@
"electron:test"
:
"electron ./dist"
,
"electron:dev"
:
"npm run build && electron ./dist"
,
"electron:prod"
:
"npm run build:prod && electron ./dist"
,
"package:linux"
:
"npm run build:prod && node package.js --
asar --
platform=linux --arch=x64"
,
"package:windows"
:
"npm run build:prod && node package.js --
asar --
platform=win32 --arch=ia32"
,
"package:mac"
:
"npm run build:prod && node package.js --
asar --
platform=darwin --arch=x64"
,
"package:linux"
:
"npm run build:prod && node package.js --platform=linux --arch=x64"
,
"package:windows"
:
"npm run build:prod && node package.js --platform=win32 --arch=ia32"
,
"package:mac"
:
"npm run build:prod && node package.js --platform=darwin --arch=x64"
,
"test"
:
"karma start ./karma.conf.js"
,
"pree2e"
:
"webdriver-manager update --standalone false --gecko false --quiet && npm run build"
,
"e2e"
:
"protractor ./protractor.conf.js"
...
...
Breeze.UI/src/app/app.component.ts
View file @
ce03cf34
...
...
@@ -16,25 +16,5 @@ export class AppComponent implements OnInit {
ngOnInit
()
{
this
.
router
.
navigate
([
'/login'
]);
//this.checkWalletStatus();
}
// private checkWalletStatus(){
// this.apiService.getWalletStatus()
// .subscribe(
// response => {
// if (response.status >= 200 && response.status < 400) {
// this.responseMessage = response;
// this.router.navigate(['/login']);
// }
// },
// error => {
// this.errorMessage = <any>error;
// if (error.status === 400 || error.status === 404) {
// this.router.navigate(['/setup']);
// console.log(this.errorMessage);
// }
// }
// );
// }
}
Breeze.UI/src/app/login/login.component.ts
View file @
ce03cf34
...
...
@@ -11,6 +11,7 @@ import { WalletLoad } from '../shared/classes/wallet-load';
templateUrl
:
'./login.component.html'
,
styleUrls
:
[
'./login.component.css'
]
})
export
class
LoginComponent
implements
OnInit
{
constructor
(
private
globalService
:
GlobalService
,
private
apiService
:
ApiService
,
private
router
:
Router
,
private
fb
:
FormBuilder
)
{
this
.
buildDecryptForm
();
...
...
@@ -109,7 +110,8 @@ export class LoginComponent implements OnInit {
console
.
log
(
errorMessage
);
}
}
);
)
;
}
private
loadWallet
(
walletLoad
:
WalletLoad
)
{
...
...
@@ -131,6 +133,7 @@ export class LoginComponent implements OnInit {
console
.
log
(
errorMessage
);
}
}
);
)
;
}
}
Breeze.UI/src/app/setup/create/create.component.ts
View file @
ce03cf34
...
...
@@ -21,7 +21,6 @@ export class CreateComponent {
private
createWalletForm
:
FormGroup
;
private
newWallet
:
WalletCreation
;
private
mnemonic
:
string
;
private
buildCreateForm
():
void
{
...
...
@@ -104,6 +103,7 @@ export class CreateComponent {
console
.
log
(
errorMessage
);
}
}
);
)
;
}
}
Breeze.UI/src/app/shared/pipes/coin-abbreviation.pipe.spec.ts
deleted
100644 → 0
View file @
896fcfa5
import
{
CoinAbbreviationPipe
}
from
'./coin-abbreviation.pipe'
;
describe
(
'CoinAbbreviationPipe'
,
()
=>
{
it
(
'create an instance'
,
()
=>
{
const
pipe
=
new
CoinAbbreviationPipe
();
expect
(
pipe
).
toBeTruthy
();
});
});
Breeze.UI/src/app/shared/pipes/coin-abbreviation.pipe.ts
deleted
100644 → 0
View file @
896fcfa5
import
{
Pipe
,
PipeTransform
}
from
'@angular/core'
;
@
Pipe
({
name
:
'coinAbbreviation'
})
export
class
CoinAbbreviationPipe
implements
PipeTransform
{
transform
(
value
:
any
):
any
{
if
(
!
value
)
return
value
;
let
abbreviationAdded
=
value
+
" BTC"
return
abbreviationAdded
;
}
}
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
View file @
ce03cf34
...
...
@@ -7,22 +7,28 @@ export class CoinNotationPipe implements PipeTransform {
private
coinUnit
=
"BTC"
;
private
coinNotation
:
number
;
private
decimalLimit
=
8
;
transform
(
value
:
any
):
any
{
if
(
!
value
)
return
value
;
this
.
coinNotation
=
value
;
switch
(
this
.
coinUnit
)
{
let
temp
;
if
(
typeof
value
===
'number'
)
{
switch
(
this
.
getCoinUnit
())
{
case
"BTC"
:
this
.
coinNotation
=
Number
(
value
.
toFixed
(
8
))
;
return
this
.
coinNotation
=
this
.
coinNotation
/
100000000
;
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TBTC"
;
case
"mBTC"
:
this
.
coinNotation
=
Number
(
value
.
toFixed
(
8
))
;
return
this
.
coinNotation
=
this
.
coinNotation
/
100000
;
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TmBTC"
;
case
"uBTC"
:
this
.
coinNotation
=
Number
(
value
.
toFixed
(
8
))
;
return
this
.
coinNotation
=
this
.
coinNotation
/
100
;
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuBTC"
;
}
}
}
getCoinUnit
()
{
return
this
.
coinUnit
;
}
}
Breeze.UI/src/app/shared/services/global.service.ts
View file @
ce03cf34
Breeze.UI/src/app/shared/shared.module.ts
View file @
ce03cf34
import
{
NgModule
,
ModuleWithProviders
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
CoinNotationPipe
}
from
'./pipes/coin-notation.pipe'
;
import
{
CoinAbbreviationPipe
}
from
'./pipes/coin-abbreviation.pipe'
;
@
NgModule
({
imports
:
[
CommonModule
],
declarations
:
[
CoinNotationPipe
,
CoinAbbreviationPipe
],
exports
:
[
CoinNotationPipe
,
CoinAbbreviationPipe
]
declarations
:
[
CoinNotationPipe
],
exports
:
[
CoinNotationPipe
]
})
export
class
SharedModule
{
...
...
Breeze.UI/src/app/wallet/dashboard/dashboard.component.html
View file @
ce03cf34
...
...
@@ -2,8 +2,8 @@
<div
class=
"d-flex flex-row align-items-center nopadding"
id=
"dashboard"
>
<div
class=
"d-flex flex-column"
>
<div
class=
"p"
>
Active Balance
</div>
<div
class=
"p"
>
Balance: {{confirmedBalance | coinNotation
| coinAbbreviation
}}
</div>
<div
class=
"p"
>
Unconfirmed Balance: {{unconfirmedBalance | coinNotation
| coinAbbreviation
}}
</div>
<div
class=
"p"
>
Balance: {{confirmedBalance | coinNotation }}
</div>
<div
class=
"p"
>
Unconfirmed Balance: {{unconfirmedBalance | coinNotation }}
</div>
</div>
<div
class=
"d-flex flex-column"
>
<!--<div>Current Value</div>
...
...
@@ -31,7 +31,7 @@
<!--<td *ngIf="{{ transaction.amount }} < 0">SENT</td>
<td *ngIf="{{ transaction.amount }} > 0">RECEIVED</td>-->
<td
*
ngIf=
"i<5"
>
{{ transaction.type }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.amount | coinNotation | coinAbbrevi
ation }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.amount | coinNot
ation }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.id }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.confirmedInBlock }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.timestamp * 1000 | date:'medium' }}
</td>
...
...
Breeze.UI/src/app/wallet/dashboard/dashboard.component.ts
View file @
ce03cf34
...
...
@@ -62,7 +62,8 @@ export class DashboardComponent {
console
.
log
(
errorMessage
);
}
}
);
)
;
};
private
getHistory
()
{
...
...
@@ -82,6 +83,7 @@ export class DashboardComponent {
console
.
log
(
errorMessage
);
}
}
);
)
;
};
}
Breeze.UI/src/app/wallet/history/history.component.html
View file @
ce03cf34
...
...
@@ -13,7 +13,7 @@
<!--<td *ngIf="{{ transaction.amount }} < 0; else received">SENT</td>
<td #received>RECEIVED</td>-->
<td>
{{ transaction.type }}
</td>
<td>
{{ transaction.amount | coinNotation
| coinAbbreviation
}}
</td>
<td>
{{ transaction.amount | coinNotation }}
</td>
<td>
{{ transaction.id }}
</td>
<td>
{{ transaction.confirmedInBlock }}
</td>
<td>
{{ transaction.timestamp * 1000 | date:'medium' }}
</td>
...
...
Breeze.UI/src/app/wallet/history/history.component.ts
View file @
ce03cf34
...
...
@@ -46,6 +46,7 @@ export class HistoryComponent {
console
.
log
(
this
.
errorMessage
);
}
}
);
)
;
}
}
Breeze.UI/src/app/wallet/receive/receive.component.ts
View file @
ce03cf34
...
...
@@ -23,10 +23,6 @@ export class ReceiveComponent {
this
.
getUnusedReceiveAddresses
();
}
private
copyAddress
()
{
}
private
getUnusedReceiveAddresses
()
{
let
walletInfo
=
new
WalletInfo
(
this
.
globalService
.
getWalletName
(),
this
.
globalService
.
getCoinType
())
this
.
apiService
.
getUnusedReceiveAddress
(
walletInfo
)
...
...
@@ -42,6 +38,7 @@ export class ReceiveComponent {
console
.
log
(
this
.
errorMessage
);
}
}
);
)
;
}
}
Breeze.UI/src/app/wallet/send/send.component.ts
View file @
ce03cf34
...
...
@@ -103,7 +103,8 @@ export class SendComponent {
}
},
()
=>
this
.
sendTransaction
(
this
.
responseMessage
.
hex
)
);
)
;
};
private
getFeeType
(){
...
...
@@ -136,6 +137,7 @@ export class SendComponent {
console
.
log
(
this
.
errorMessage
);
}
}
);
)
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment