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
4a8c47b7
Commit
4a8c47b7
authored
Jun 30, 2017
by
Pieterjan Vanhoof
Committed by
GitHub
Jun 30, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #129 from bokobza/master
added isChainsynced
parents
2bb8f4c4
ff0ea3fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
status-bar.component.html
...ze.UI/src/app/wallet/status-bar/status-bar.component.html
+1
-1
status-bar.component.ts
Breeze.UI/src/app/wallet/status-bar/status-bar.component.ts
+12
-10
No files found.
Breeze.UI/src/app/wallet/status-bar/status-bar.component.html
View file @
4a8c47b7
<div
class=
"status"
>
<ul
class=
"list-inline align-self-center row"
title=
"Total blocks: {{ chainTip }}
Last block received: {{ lastBlockSyncedHeight }}
Connections: {{ connectedNodes }}"
>
<li
class=
"list-inline-item pending"
><i
class=
"icon-syncr text-success"
></i></li>
<li
class=
"list-inline-item"
>
{{ percentSynced }}
%
</li>
<li
class=
"list-inline-item"
>
{{ percentSynced }}
</li>
<li
class=
"list-inline-item"
><i
class=
"icon-earth text-success"
></i></li>
<li
class=
"list-inline-item"
>
{{ connectedNodes }}
</li>
</ul>
...
...
Breeze.UI/src/app/wallet/status-bar/status-bar.component.ts
View file @
4a8c47b7
...
...
@@ -17,6 +17,7 @@ export class StatusBarComponent implements OnInit {
private
generalWalletInfoSubscription
:
Subscription
;
private
lastBlockSyncedHeight
:
number
;
private
chainTip
:
number
;
private
isChainSynced
:
boolean
;
private
connectedNodes
:
number
=
0
;
private
percentSyncedNumber
:
number
=
0
;
private
percentSynced
:
string
;
...
...
@@ -40,19 +41,20 @@ export class StatusBarComponent implements OnInit {
let
generalWalletInfoResponse
=
response
.
json
();
this
.
lastBlockSyncedHeight
=
generalWalletInfoResponse
.
lastBlockSyncedHeight
;
this
.
chainTip
=
generalWalletInfoResponse
.
chainTip
;
this
.
isChainSynced
=
generalWalletInfoResponse
.
isChainSynced
;
this
.
connectedNodes
=
generalWalletInfoResponse
.
connectedNodes
;
if
(
this
.
chainTip
===
0
)
{
this
.
chainTip
=
1
;
}
this
.
percentSyncedNumber
=
((
this
.
lastBlockSyncedHeight
/
this
.
chainTip
)
*
100
);
if
(
this
.
percentSyncedNumber
.
toFixed
(
0
)
===
"100"
&&
this
.
lastBlockSyncedHeight
!=
this
.
chainTip
)
{
this
.
percentSyncedNumber
=
99
;
}
if
(
!
this
.
isChainSynced
)
{
this
.
percentSynced
=
"syncing..."
;
}
else
{
this
.
percentSyncedNumber
=
((
this
.
lastBlockSyncedHeight
/
this
.
chainTip
)
*
100
);
if
(
this
.
percentSyncedNumber
.
toFixed
(
0
)
===
"100"
&&
this
.
lastBlockSyncedHeight
!=
this
.
chainTip
)
{
this
.
percentSyncedNumber
=
99
;
}
this
.
percentSynced
=
this
.
percentSyncedNumber
.
toFixed
(
0
);
this
.
percentSynced
=
this
.
percentSyncedNumber
.
toFixed
(
0
)
+
"%"
;
}
}
},
error
=>
{
...
...
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