Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
xiaoye
mycard
Commits
4fada0a9
Commit
4fada0a9
authored
Oct 18, 2016
by
wudizhanche1000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改程序列表
parent
19c6546c
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2176 additions
and
324 deletions
+2176
-324
app/app-detail.component.ts
app/app-detail.component.ts
+22
-21
app/apps.component.ts
app/apps.component.ts
+0
-1
apps.json
apps.json
+2154
-302
No files found.
app/app-detail.component.ts
View file @
4fada0a9
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
}
from
'
@angular/core
'
;
import
{
AppsService
}
from
'
./apps.service
'
import
{
AppsService
}
from
'
./apps.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
App
}
from
"
./app
"
;
import
{
App
}
from
"
./app
"
;
declare
var
process
;
declare
var
process
;
...
@@ -19,8 +19,9 @@ export class AppDetailComponent {
...
@@ -19,8 +19,9 @@ export class AppDetailComponent {
spawn
=
window
[
'
System
'
].
_nodeRequire
(
'
child_process
'
).
spawn
;
spawn
=
window
[
'
System
'
].
_nodeRequire
(
'
child_process
'
).
spawn
;
path
=
window
[
'
System
'
].
_nodeRequire
(
'
path
'
);
path
=
window
[
'
System
'
].
_nodeRequire
(
'
path
'
);
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
}
}
_currentApp
;
_currentApp
;
get
currentApp
():
App
{
get
currentApp
():
App
{
return
this
.
appsService
.
searchApp
(
this
.
routingService
.
app
);
return
this
.
appsService
.
searchApp
(
this
.
routingService
.
app
);
...
@@ -28,7 +29,7 @@ export class AppDetailComponent {
...
@@ -28,7 +29,7 @@ export class AppDetailComponent {
_name
;
_name
;
get
name
()
{
get
name
()
{
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
)
{
return
this
.
currentApp
.
name
[
this
.
currentApp
.
locales
[
0
]];
return
this
.
currentApp
.
name
[
this
.
currentApp
.
locales
[
0
]];
}
}
return
"
Loading
"
;
return
"
Loading
"
;
...
@@ -42,8 +43,8 @@ export class AppDetailComponent {
...
@@ -42,8 +43,8 @@ export class AppDetailComponent {
_news
;
_news
;
get
news
()
{
get
news
()
{
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
.
news
.
length
>
0
)
{
if
(
this
.
currentApp
.
news
.
length
>
0
)
{
return
this
.
currentApp
.
news
;
return
this
.
currentApp
.
news
;
}
}
}
}
...
@@ -63,15 +64,15 @@ export class AppDetailComponent {
...
@@ -63,15 +64,15 @@ export class AppDetailComponent {
get
mods
()
{
get
mods
()
{
let
contains
=
[
"
optional
"
,
"
language
"
,
"
emulator
"
];
let
contains
=
[
"
optional
"
,
"
language
"
,
"
emulator
"
];
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
.
references
[
process
.
platform
]
&&
this
.
currentApp
.
references
[
process
.
platform
].
length
>
0
)
{
if
(
this
.
currentApp
.
references
[
process
.
platform
]
&&
this
.
currentApp
.
references
[
process
.
platform
].
length
>
0
)
{
let
refs
=
this
.
currentApp
.
references
[
process
.
platform
];
let
refs
=
this
.
currentApp
.
references
[
process
.
platform
];
refs
=
refs
.
filter
((
ref
)
=>
{
refs
=
refs
.
filter
((
ref
)
=>
{
return
contains
.
includes
(
ref
.
type
);
return
contains
.
includes
(
ref
.
type
);
});
});
refs
=
refs
.
map
((
ref
)
=>
{
refs
=
refs
.
map
((
ref
)
=>
{
let
tmp
=
Object
.
create
(
ref
);
let
tmp
=
Object
.
create
(
ref
);
switch
(
tmp
.
type
)
{
switch
(
tmp
.
type
)
{
case
"
optional
"
:
case
"
optional
"
:
tmp
.
type
=
"
选项
"
;
tmp
.
type
=
"
选项
"
;
break
;
break
;
...
@@ -92,10 +93,10 @@ export class AppDetailComponent {
...
@@ -92,10 +93,10 @@ export class AppDetailComponent {
}
}
checkInstall
(
id
):
boolean
{
checkInstall
(
id
):
boolean
{
if
(
this
.
appsService
.
searchApp
(
id
))
{
if
(
this
.
appsService
.
searchApp
(
id
))
{
if
(
this
.
appsService
.
searchApp
(
id
).
local
.
path
)
{
let
local
=
this
.
appsService
.
searchApp
(
id
).
local
;
if
(
local
&&
local
.
path
)
{
return
true
;
return
true
;
}
}
}
}
...
@@ -105,7 +106,7 @@ export class AppDetailComponent {
...
@@ -105,7 +106,7 @@ export class AppDetailComponent {
install
(
id
)
{
install
(
id
)
{
let
uri
=
this
.
appsService
.
searchApp
(
id
).
download
[
process
.
platform
];
let
uri
=
this
.
appsService
.
searchApp
(
id
).
download
[
process
.
platform
];
console
.
log
(
process
.
platform
);
console
.
log
(
process
.
platform
);
if
(
uri
)
{
if
(
uri
)
{
this
.
appsService
.
download
(
id
,
uri
);
this
.
appsService
.
download
(
id
,
uri
);
}
else
{
}
else
{
console
.
log
(
"
lost download uri!
"
);
console
.
log
(
"
lost download uri!
"
);
...
@@ -117,8 +118,8 @@ export class AppDetailComponent {
...
@@ -117,8 +118,8 @@ export class AppDetailComponent {
installSubmit
(
theForm
)
{
installSubmit
(
theForm
)
{
console
.
log
(
theForm
);
console
.
log
(
theForm
);
this
.
install
(
this
.
routingService
.
app
);
this
.
install
(
this
.
routingService
.
app
);
for
(
let
mod
in
this
.
appsService
.
installConfig
.
mods
)
{
for
(
let
mod
in
this
.
appsService
.
installConfig
.
mods
)
{
if
(
this
.
appsService
.
installConfig
.
mods
[
mod
])
{
if
(
this
.
appsService
.
installConfig
.
mods
[
mod
])
{
this
.
install
(
mod
);
this
.
install
(
mod
);
}
}
}
}
...
@@ -132,6 +133,7 @@ export class AppDetailComponent {
...
@@ -132,6 +133,7 @@ export class AppDetailComponent {
this
.
appsService
.
installConfig
.
installDir
=
dir
[
0
];
this
.
appsService
.
installConfig
.
installDir
=
dir
[
0
];
return
dir
[
0
];
return
dir
[
0
];
}
}
openDir
(
id
)
{
openDir
(
id
)
{
this
.
electron
.
remote
.
shell
.
showItemInFolder
(
this
.
appsService
.
searchApp
(
id
).
local
.
path
);
this
.
electron
.
remote
.
shell
.
showItemInFolder
(
this
.
appsService
.
searchApp
(
id
).
local
.
path
);
}
}
...
@@ -147,9 +149,9 @@ export class AppDetailComponent {
...
@@ -147,9 +149,9 @@ export class AppDetailComponent {
let
open
=
''
;
let
open
=
''
;
let
openId
=
this
.
appsService
.
searchApp
(
id
).
actions
[
process
.
platform
][
"
main
"
].
open
;
let
openId
=
this
.
appsService
.
searchApp
(
id
).
actions
[
process
.
platform
][
"
main
"
].
open
;
if
(
openId
)
{
if
(
openId
)
{
this
.
appsService
.
searchApp
(
openId
).
actions
[
process
.
platform
][
"
main
"
].
execute
;
this
.
appsService
.
searchApp
(
openId
).
actions
[
process
.
platform
][
"
main
"
].
execute
;
if
(
this
.
checkInstall
(
openId
))
{
if
(
this
.
checkInstall
(
openId
))
{
open
=
this
.
path
.
join
(
this
.
appsService
.
searchApp
(
openId
).
local
.
path
,
this
.
appsService
.
searchApp
(
openId
).
actions
[
process
.
platform
][
"
main
"
].
execute
);
open
=
this
.
path
.
join
(
this
.
appsService
.
searchApp
(
openId
).
local
.
path
,
this
.
appsService
.
searchApp
(
openId
).
actions
[
process
.
platform
][
"
main
"
].
execute
);
args
.
push
(
execute
);
args
.
push
(
execute
);
}
else
{
}
else
{
...
@@ -180,5 +182,4 @@ export class AppDetailComponent {
...
@@ -180,5 +182,4 @@ export class AppDetailComponent {
}
}
}
}
app/apps.component.ts
View file @
4fada0a9
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
}
from
'
@angular/core
'
;
import
{
AppsService
}
from
'
./apps.service
'
import
{
AppsService
}
from
'
./apps.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
App
}
from
"
./app
"
;
@
Component
({
@
Component
({
selector
:
'
apps
'
,
selector
:
'
apps
'
,
...
...
apps.json
View file @
4fada0a9
This diff is collapsed.
Click to expand it.
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