Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
moecube
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JoyJ
moecube
Commits
6a4f6518
Commit
6a4f6518
authored
Nov 04, 2016
by
wudizhanche1000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安装完成更新界面
parent
32be85f0
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
291 deletions
+20
-291
app/app-detail.component.ts
app/app-detail.component.ts
+9
-3
app/app-local.ts
app/app-local.ts
+2
-0
app/apps.service.ts
app/apps.service.ts
+0
-286
app/install.service.ts
app/install.service.ts
+9
-2
No files found.
app/app-detail.component.ts
View file @
6a4f6518
...
...
@@ -136,9 +136,11 @@ export class AppDetailComponent implements OnInit {
(
error
)
=>
{
},
()
=>
{
currentApp
.
status
.
status
=
"
waiting
"
;
this
.
ref
.
detectChanges
();
// 避免安装过快
if
(
currentApp
.
status
.
status
===
"
downloading
"
)
{
currentApp
.
status
.
status
=
"
waiting
"
;
this
.
ref
.
detectChanges
();
}
});
await
Promise
.
all
(
downloadApps
.
map
((
app
)
=>
{
return
this
.
downloadService
.
getComplete
(
app
)
...
...
@@ -146,7 +148,11 @@ export class AppDetailComponent implements OnInit {
return
this
.
installService
.
add
(
completeApp
,
options
);
});
}));
console
.
log
(
"
before
"
)
await
this
.
installService
.
getComplete
(
currentApp
);
console
.
log
(
"
install complete
"
);
currentApp
.
status
.
status
=
"
ready
"
;
this
.
ref
.
detectChanges
();
}
catch
(
e
)
{
new
Notification
(
currentApp
.
name
,
{
body
:
"
下载失败
"
});
}
...
...
app/app-local.ts
View file @
6a4f6518
import
{
App
}
from
"
./app
"
;
/**
* Created by zh99998 on 16/9/6.
*/
...
...
@@ -5,6 +6,7 @@ export class AppLocal {
path
:
string
;
version
:
string
;
files
:
Map
<
string
,
string
>
;
action
:
Map
<
string
,{
execute
:
string
,
args
:
string
[],
env
:
{},
open
:
App
}
>
;
update
(
local
)
{
this
.
path
=
local
.
path
;
...
...
app/apps.service.ts
View file @
6a4f6518
This diff is collapsed.
Click to expand it.
app/install.service.ts
View file @
6a4f6518
...
...
@@ -41,7 +41,12 @@ export class InstallService {
}
getComplete
(
app
:
App
):
Promise
<
App
>
{
return
null
;
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
eventEmitter
.
once
(
app
.
id
,
(
complete
)
=>
{
console
.
log
(
"
receive
"
,
app
.
id
);
resolve
();
});
});
}
extract
(
file
:
string
,
destPath
:
string
)
{
...
...
@@ -151,7 +156,6 @@ export class InstallService {
destPath
=
path
.
join
(
options
.
installLibrary
,
app
.
id
);
await
this
.
createDirectory
(
destPath
);
}
this
.
installQueue
.
delete
(
app
);
await
this
.
extract
(
packagePath
,
destPath
);
await
this
.
postInstall
(
app
,
destPath
);
let
local
=
new
AppLocal
();
...
...
@@ -160,6 +164,9 @@ export class InstallService {
local
.
version
=
app
.
version
;
app
.
local
=
local
;
this
.
saveAppLocal
(
app
);
console
.
log
(
"
send
"
,
app
.
id
);
this
.
eventEmitter
.
emit
(
app
.
id
,
'
install complete
'
);
this
.
installQueue
.
delete
(
app
);
this
.
installingQueue
.
delete
(
app
);
if
(
this
.
installQueue
.
size
>
0
)
{
await
this
.
doInstall
()
...
...
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