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
6e31783a
Commit
6e31783a
authored
Jun 29, 2017
by
Jeremy Bokobza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added shutdown command for the full node to the UI's unload event
parent
e201ad10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
app.component.ts
Breeze.UI/src/app/app.component.ts
+20
-1
api.service.ts
Breeze.UI/src/app/shared/services/api.service.ts
+6
-0
No files found.
Breeze.UI/src/app/app.component.ts
View file @
6e31783a
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
HostListener
}
from
'@angular/core'
;
import
{
Router
}
from
'@angular/router'
;
import
{
ApiService
}
from
'./shared/services/api.service'
;
...
...
@@ -26,4 +26,23 @@ export class AppComponent implements OnInit {
this
.
loading
=
false
;
this
.
router
.
navigate
([
'/login'
]);
}
@
HostListener
(
'window:unload'
)
unloadHandler
()
{
this
.
apiService
.
shutdownNode
().
subscribe
(
response
=>
{},
error
=>
{
if
(
error
.
status
===
0
)
{
alert
(
"Error closing application. please close the dotnet process manually."
);
}
else
if
(
error
.
status
>=
400
)
{
if
(
!
error
.
json
().
errors
[
0
])
{
console
.
log
(
error
);
}
else
{
alert
(
error
.
json
().
errors
[
0
].
message
);
}
}
}
);
}
}
Breeze.UI/src/app/shared/services/api.service.ts
View file @
6e31783a
...
...
@@ -132,4 +132,10 @@ export class ApiService {
.
post
(
this
.
webApiUrl
+
'/wallet/send-transaction/'
,
JSON
.
stringify
(
data
),
{
headers
:
this
.
headers
})
.
map
((
response
:
Response
)
=>
response
);
}
shutdownNode
():
Observable
<
any
>
{
return
this
.
http
.
post
(
this
.
webApiUrl
+
'/node/shutdown'
,
''
)
.
map
((
response
:
Response
)
=>
response
);
}
}
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