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
54aa844c
Commit
54aa844c
authored
Nov 05, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3' of github.com:mycard/mycard into v3
parents
ffb80d0f
6a4f6518
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 @
54aa844c
...
@@ -136,9 +136,11 @@ export class AppDetailComponent implements OnInit {
...
@@ -136,9 +136,11 @@ export class AppDetailComponent implements OnInit {
(
error
)
=>
{
(
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
)
=>
{
await
Promise
.
all
(
downloadApps
.
map
((
app
)
=>
{
return
this
.
downloadService
.
getComplete
(
app
)
return
this
.
downloadService
.
getComplete
(
app
)
...
@@ -146,7 +148,11 @@ export class AppDetailComponent implements OnInit {
...
@@ -146,7 +148,11 @@ export class AppDetailComponent implements OnInit {
return
this
.
installService
.
add
(
completeApp
,
options
);
return
this
.
installService
.
add
(
completeApp
,
options
);
});
});
}));
}));
console
.
log
(
"
before
"
)
await
this
.
installService
.
getComplete
(
currentApp
);
console
.
log
(
"
install complete
"
);
currentApp
.
status
.
status
=
"
ready
"
;
currentApp
.
status
.
status
=
"
ready
"
;
this
.
ref
.
detectChanges
();
}
catch
(
e
)
{
}
catch
(
e
)
{
new
Notification
(
currentApp
.
name
,
{
body
:
"
下载失败
"
});
new
Notification
(
currentApp
.
name
,
{
body
:
"
下载失败
"
});
}
}
...
...
app/app-local.ts
View file @
54aa844c
import
{
App
}
from
"
./app
"
;
/**
/**
* Created by zh99998 on 16/9/6.
* Created by zh99998 on 16/9/6.
*/
*/
...
@@ -5,6 +6,7 @@ export class AppLocal {
...
@@ -5,6 +6,7 @@ export class AppLocal {
path
:
string
;
path
:
string
;
version
:
string
;
version
:
string
;
files
:
Map
<
string
,
string
>
;
files
:
Map
<
string
,
string
>
;
action
:
Map
<
string
,{
execute
:
string
,
args
:
string
[],
env
:
{},
open
:
App
}
>
;
update
(
local
)
{
update
(
local
)
{
this
.
path
=
local
.
path
;
this
.
path
=
local
.
path
;
...
...
app/apps.service.ts
View file @
54aa844c
This diff is collapsed.
Click to expand it.
app/install.service.ts
View file @
54aa844c
...
@@ -41,7 +41,12 @@ export class InstallService {
...
@@ -41,7 +41,12 @@ export class InstallService {
}
}
getComplete
(
app
:
App
):
Promise
<
App
>
{
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
)
{
extract
(
file
:
string
,
destPath
:
string
)
{
...
@@ -151,7 +156,6 @@ export class InstallService {
...
@@ -151,7 +156,6 @@ export class InstallService {
destPath
=
path
.
join
(
options
.
installLibrary
,
app
.
id
);
destPath
=
path
.
join
(
options
.
installLibrary
,
app
.
id
);
await
this
.
createDirectory
(
destPath
);
await
this
.
createDirectory
(
destPath
);
}
}
this
.
installQueue
.
delete
(
app
);
await
this
.
extract
(
packagePath
,
destPath
);
await
this
.
extract
(
packagePath
,
destPath
);
await
this
.
postInstall
(
app
,
destPath
);
await
this
.
postInstall
(
app
,
destPath
);
let
local
=
new
AppLocal
();
let
local
=
new
AppLocal
();
...
@@ -160,6 +164,9 @@ export class InstallService {
...
@@ -160,6 +164,9 @@ export class InstallService {
local
.
version
=
app
.
version
;
local
.
version
=
app
.
version
;
app
.
local
=
local
;
app
.
local
=
local
;
this
.
saveAppLocal
(
app
);
this
.
saveAppLocal
(
app
);
console
.
log
(
"
send
"
,
app
.
id
);
this
.
eventEmitter
.
emit
(
app
.
id
,
'
install complete
'
);
this
.
installQueue
.
delete
(
app
);
this
.
installingQueue
.
delete
(
app
);
this
.
installingQueue
.
delete
(
app
);
if
(
this
.
installQueue
.
size
>
0
)
{
if
(
this
.
installQueue
.
size
>
0
)
{
await
this
.
doInstall
()
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