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
37911e4a
Commit
37911e4a
authored
Nov 08, 2018
by
Sergei Zubov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify daemon exit
parent
f7a1c0e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
23 deletions
+12
-23
main.ts
Breeze.UI/main.ts
+10
-23
package.json
Breeze.UI/package.json
+2
-0
No files found.
Breeze.UI/main.ts
View file @
37911e4a
const
electron
=
require
(
'electron'
);
import
"isomorphic-fetch"
;
// Module to control application life.
const
app
=
electron
.
app
;
...
...
@@ -86,16 +87,20 @@ app.on('ready', function () {
}
});
app
.
on
(
'before-quit'
,
function
()
{
closeDeStreamApi
();
});
// Quit when all windows are closed.
app
.
on
(
'window-all-closed'
,
function
()
{
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if
(
process
.
platform
!==
'darwin'
)
{
app
.
quit
();
fetch
(
'http://localhost:56864/api/node/shutdown'
,
{
method
:
'POST'
,
headers
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'application/json'
}
})
.
then
(
response
=>
app
.
quit
())
.
catch
(
error
=>
setTimeout
(()
=>
app
.
quit
(),
5000
));
}
});
...
...
@@ -107,23 +112,6 @@ app.on('activate', function () {
}
});
function
closeDeStreamApi
()
{
// if (process.platform !== 'darwin' && !serve) {
if
(
process
.
platform
!==
'darwin'
&&
!
serve
)
{
var
http2
=
require
(
'http'
);
const
options2
=
{
hostname
:
'localhost'
,
port
:
56864
,
path
:
'/api/node/shutdown'
,
method
:
'POST'
};
const
req
=
http2
.
request
(
options2
,
(
res
)
=>
{});
req
.
write
(
''
);
req
.
end
();
}
};
function
startDeStreamApi
()
{
var
destreamProcess
;
const
spawnDeStream
=
require
(
'child_process'
).
spawn
;
...
...
@@ -147,7 +135,6 @@ function startDeStreamApi() {
detached
:
false
});
}
destreamProcess
.
stdout
.
on
(
'data'
,
(
data
)
=>
{
writeLog
(
`DeStream:
${
data
}
`
);
});
...
...
Breeze.UI/package.json
View file @
37911e4a
...
...
@@ -58,6 +58,8 @@
"core-js"
:
"2.5.3"
,
"electron-context-menu"
:
"0.9.1"
,
"enhanced-resolve"
:
"3.4.1"
,
"es6-promise"
:
"^4.2.5"
,
"isomorphic-fetch"
:
"^2.2.1"
,
"ngx-bootstrap"
:
"2.0.0-beta.11"
,
"ngx-clipboard"
:
"9.0.0"
,
"rxjs"
:
"5.5.5"
,
...
...
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