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
f4030dc4
Commit
f4030dc4
authored
Apr 01, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add balance dashboard in menu
parent
34fdd115
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
1 deletion
+84
-1
db.json
Breeze.UI/db.json
+27
-1
app.component.ts
Breeze.UI/src/app/app.component.ts
+2
-0
api.service.ts
Breeze.UI/src/app/shared/api/api.service.ts
+14
-0
dashboard.component.css
Breeze.UI/src/app/wallet/menu/dashboard.component.css
+0
-0
dashboard.component.html
Breeze.UI/src/app/wallet/menu/dashboard.component.html
+2
-0
dashboard.component.ts
Breeze.UI/src/app/wallet/menu/dashboard.component.ts
+36
-0
menu.component.html
Breeze.UI/src/app/wallet/menu/menu.component.html
+1
-0
wallet.module.ts
Breeze.UI/src/app/wallet/wallet.module.ts
+2
-0
No files found.
Breeze.UI/db.json
View file @
f4030dc4
...
...
@@ -10,5 +10,31 @@
"trackedScriptPubKeyCount"
:
"100"
,
"walletState"
:
"syncingBlocks"
,
"historyChangeBump"
:
"231321"
}
},
"balance"
:
{
"success"
:
"true"
,
"synced"
:
"true"
,
"confirmed"
:
"0.144"
,
"unconfirmed"
:
"-6.23"
},
"history"
:
{
"success"
:
"true"
,
"history"
:
[
{
"txid"
:
"9a9949476b629b4075b31d8faad64dad352586a18df8f2810c5a7bb900478c60"
,
"amount"
:
"0.1"
,
"confirmed"
:
"true"
,
"timestamp"
:
"2016.12.19. 23:15:05"
},
{
"txid"
:
"9a9949476b629b4075b31d8faad64dad352586a18df8f2810c5a7bb900478c60"
,
"amount"
:
"-0.1"
,
"confirmed"
:
"false"
,
"timestamp"
:
"2016.12.20. 1:15:36"
}
]
}
}
\ No newline at end of file
Breeze.UI/src/app/app.component.ts
View file @
f4030dc4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Router
}
from
'@angular/router'
;
import
{
remote
}
from
'electron'
;
import
{
ApiService
}
from
'./shared/api/api.service'
;
@
Component
({
...
...
Breeze.UI/src/app/shared/api/api.service.ts
View file @
f4030dc4
...
...
@@ -28,6 +28,20 @@ export class ApiService {
.
catch
(
this
.
handleError
);
}
getWalletBalance
():
Observable
<
any
>
{
return
this
.
http
.
get
(
this
.
webApiUrl
+
'/wallet/balance'
)
.
map
((
response
:
Response
)
=>
response
.
json
())
.
catch
(
this
.
handleError
);
}
getWalletHistory
():
Observable
<
any
>
{
return
this
.
http
.
get
(
this
.
webApiUrl
+
'/wallet/history'
)
.
map
((
response
:
Response
)
=>
response
.
json
())
.
catch
(
this
.
handleError
);
}
createWallet
(
data
:
SafeCreation
):
Observable
<
any
>
{
console
.
log
(
JSON
.
stringify
(
data
));
return
this
.
http
...
...
Breeze.UI/src/app/wallet/menu/dashboard.component.css
0 → 100644
View file @
f4030dc4
Breeze.UI/src/app/wallet/menu/dashboard.component.html
0 → 100644
View file @
f4030dc4
<p>
Balance: {{confirmedBalance}}
</p>
<p>
Unconfirmed: {{unconfirmedBalance}}
<p>
\ No newline at end of file
Breeze.UI/src/app/wallet/menu/dashboard.component.ts
0 → 100644
View file @
f4030dc4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ApiService
}
from
'../../shared/api/api.service'
;
@
Component
({
selector
:
'dashboard-component'
,
templateUrl
:
'./dashboard.component.html'
,
styleUrls
:
[
'./dashboard.component.css'
],
})
export
class
DashboardComponent
{
constructor
(
private
apiService
:
ApiService
)
{}
private
balanceResponse
:
any
;
private
confirmedBalance
:
number
;
private
unconfirmedBalance
:
number
;
private
errorMessage
:
string
;
ngOnInit
()
{
this
.
getWalletBalance
();
}
private
getWalletBalance
()
{
this
.
apiService
.
getWalletBalance
()
.
subscribe
(
response
=>
this
.
balanceResponse
=
response
,
error
=>
this
.
errorMessage
=
<
any
>
error
,
()
=>
this
.
setBalance
()
);
}
private
setBalance
()
{
this
.
confirmedBalance
=
this
.
balanceResponse
.
confirmed
;
this
.
unconfirmedBalance
=
this
.
balanceResponse
.
unconfirmed
;
}
}
Breeze.UI/src/app/wallet/menu/menu.component.html
View file @
f4030dc4
<nav
class=
"navbar navbar-fixed-top"
>
<div
class=
"container"
>
<a
class=
"navbar-brand"
>
Breeze
</a>
<dashboard-component></dashboard-component>
<ul
class=
"nav navbar-nav"
routerLinkActive=
"active"
>
<li
class=
"nav-item"
><a
class=
"nav-link"
routerLink=
"send"
>
Send
</a></li>
<li
class=
"nav-item"
><a
class=
"nav-link"
routerLink=
"receive"
>
Receive
</a></li>
...
...
Breeze.UI/src/app/wallet/wallet.module.ts
View file @
f4030dc4
...
...
@@ -5,6 +5,7 @@ import { RouterModule } from '@angular/router';
import
{
WalletComponent
}
from
'./wallet.component'
;
import
{
MenuComponent
}
from
'./menu/menu.component'
;
import
{
DashboardComponent
}
from
'./menu/dashboard.component'
;
import
{
SendComponent
}
from
'./send/send.component'
;
import
{
ReceiveComponent
}
from
'./receive/receive.component'
;
import
{
HistoryComponent
}
from
'./history/history.component'
;
...
...
@@ -23,6 +24,7 @@ import { WalletRoutingModule } from './wallet-routing.module';
declarations
:
[
WalletComponent
,
MenuComponent
,
DashboardComponent
,
ReceiveComponent
,
SendComponent
,
HistoryComponent
,
...
...
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