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
0e5c65d9
Commit
0e5c65d9
authored
Oct 27, 2016
by
wudizhanche1000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除平台信息的运行
parent
c4c69a89
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
33 deletions
+47
-33
app/app-detail.component.ts
app/app-detail.component.ts
+9
-8
app/app.ts
app/app.ts
+1
-1
app/apps.service.ts
app/apps.service.ts
+36
-23
apps.json
apps.json
+1
-1
No files found.
app/app-detail.component.ts
View file @
0e5c65d9
...
...
@@ -2,6 +2,7 @@ import {Component, OnInit} from "@angular/core";
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
InstallConfig
}
from
"
./install-config
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
import
{
App
}
from
"
./app
"
;
declare
var
process
;
declare
var
$
;
...
...
@@ -42,7 +43,7 @@ export class AppDetailComponent implements OnInit {
};
get
isInstalled
()
{
let
currentApp
=
this
.
appsService
.
currentApp
;
let
currentApp
=
this
.
appsService
.
currentApp
;
return
!!
(
currentApp
.
local
&&
currentApp
.
local
.
path
);
}
...
...
@@ -120,20 +121,20 @@ export class AppDetailComponent implements OnInit {
return
dir
[
0
];
}
startApp
(
app
)
{
let
execute
=
this
.
path
.
join
(
app
.
local
.
path
,
app
.
actions
[
process
.
platform
][
"
main
"
]
.
execute
);
let
args
=
app
.
actions
[
process
.
platform
][
"
main
"
]
.
args
;
let
env
=
app
.
actions
[
process
.
platform
][
"
main
"
]
.
env
;
startApp
(
app
:
App
)
{
let
execute
=
this
.
path
.
join
(
app
.
local
.
path
,
app
.
actions
.
get
(
"
main
"
)
.
execute
);
let
args
=
app
.
actions
.
get
(
"
main
"
)
.
args
;
let
env
=
app
.
actions
.
get
(
"
main
"
)
.
env
;
let
opt
=
{
cwd
:
app
.
local
.
path
,
env
:
env
};
let
open
=
''
;
let
open
Id
=
app
.
actions
[
process
.
platform
][
"
main
"
]
.
open
;
if
(
open
Id
)
{
let
open
App
=
app
.
actions
.
get
(
"
main
"
)
.
open
;
if
(
open
App
)
{
if
(
this
.
isInstalled
)
{
open
=
this
.
path
.
join
(
this
.
appsService
.
searchApp
(
openId
).
local
.
path
,
this
.
appsService
.
searchApp
(
openId
).
actions
[
process
.
platform
][
"
main
"
]
.
execute
);
open
=
this
.
path
.
join
(
openApp
.
local
.
path
,
openApp
.
actions
.
get
(
"
main
"
)
.
execute
);
args
.
push
(
execute
);
}
else
{
console
.
error
(
'
open app not found
'
);
...
...
app/app.ts
View file @
0e5c65d9
...
...
@@ -29,7 +29,7 @@ export class App {
homepage
:
string
;
category
:
string
;
parent
:
App
;
actions
:
{[
action
:
string
]:
{
execute
:
string
,
args
:
string
[],
env
:
{},
open
:
App
}}
;
actions
:
Map
<
string
,{
execute
:
string
,
args
:
string
[],
env
:
{},
open
:
App
}
>
;
references
:
Map
<
string
,
App
>
;
dependencies
:
Map
<
string
,
App
>
;
locales
:
string
[];
...
...
app/apps.service.ts
View file @
0e5c65d9
...
...
@@ -107,25 +107,26 @@ export class AppsService {
//[{"id": "th01", "wait":["wine", "dx"], resolve: resolve, tarObj: tarObj}]
let
waitObj
;
let
waitRef
=
[
"
runtime
"
,
"
emulator
"
,
"
dependency
"
];
if
(
!
this
.
isEmptyObject
(
refs
))
{
refs
[
process
.
platform
].
map
((
ref
)
=>
{
if
(
waitRef
.
includes
(
ref
.
type
))
{
if
(
!
this
.
checkInstall
(
ref
.
id
))
{
if
(
!
waitObj
)
{
waitObj
=
{
id
:
this
.
downloadsInfo
[
index
].
id
,
wait
:
[
ref
.
id
],
resolve
:
resolve
,
tarObj
:
tarObj
}
}
else
{
waitObj
.
wait
.
push
(
ref
.
id
);
}
}
}
});
}
// TODO 重写依赖的安装
// let waitRef = ["runtime", "emulator", "dependency"];
// if (!this.isEmptyObject(refs)) {
// refs[process.platform].map((ref)=> {
// if (waitRef.includes(ref.type)) {
// if (!this.checkInstall(ref.id)) {
// if (!waitObj) {
// waitObj = {
// id: this.downloadsInfo[index].id,
// wait: [ref.id],
// resolve: resolve,
// tarObj: tarObj
// }
// } else {
// waitObj.wait.push(ref.id);
// }
// }
// }
// });
// }
console
.
log
(
"
wait obj:
"
,
waitObj
);
if
(
waitObj
)
{
...
...
@@ -138,9 +139,9 @@ export class AppsService {
console
.
log
(
tarObj
);
this
.
tarPush
(
tarObj
);
});
promise
.
catch
((
err
)
=>
{
console
.
log
(
"
err
"
,
err
);
})
//
promise.catch((err)=> {
// err.printt
//
})
}
}
else
{
console
.
log
(
"
cannot found download info!
"
);
...
...
@@ -249,7 +250,18 @@ export class AppsService {
}
// 设置App关系
for
(
let
id
of
Array
.
from
(
apps
.
keys
()))
{
let
temp
=
apps
.
get
(
id
)[
"
actions
"
]
let
map
=
new
Map
<
string
,
any
>
();
for
(
let
action
of
Object
.
keys
(
temp
))
{
let
openId
=
temp
[
action
][
"
open
"
];
if
(
openId
)
{
temp
[
action
][
"
open
"
]
=
apps
.
get
(
openId
);
}
map
.
set
(
action
,
temp
[
action
]);
}
apps
.
get
(
id
).
actions
=
map
;
[
'
dependencies
'
,
'
references
'
,
'
parent
'
].
forEach
((
key
)
=>
{
let
app
=
apps
.
get
(
id
);
...
...
@@ -265,6 +277,7 @@ export class AppsService {
}
});
}
console
.
log
(
apps
);
return
apps
;
};
...
...
@@ -327,7 +340,7 @@ export class AppsService {
})
!==
-
1
)
{
console
.
log
(
"
this app is downloading
"
)
}
else
{
let
url
=
this
.
currentApp
.
download
[
process
.
platform
]
;
let
url
=
this
.
currentApp
.
download
;
this
.
aria2
.
addUri
([
url
],
{
'
dir
'
:
this
.
download_dir
},
(
error
,
gid
)
=>
{
console
.
log
(
error
,
gid
);
if
(
error
)
{
...
...
apps.json
View file @
0e5c65d9
...
...
@@ -33,7 +33,7 @@
"actions"
:
{
"win32"
:
{
"main"
:
{
"execute"
:
"
th07
.exe"
,
"execute"
:
"
東方紅魔郷
.exe"
,
"args"
:
[],
"env"
:
{
"LC_ALL"
:
"ja_JP"
...
...
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