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
syntax_j
mycard
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";
...
@@ -2,6 +2,7 @@ import {Component, OnInit} from "@angular/core";
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
InstallConfig
}
from
"
./install-config
"
;
import
{
InstallConfig
}
from
"
./install-config
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
import
{
App
}
from
"
./app
"
;
declare
var
process
;
declare
var
process
;
declare
var
$
;
declare
var
$
;
...
@@ -42,7 +43,7 @@ export class AppDetailComponent implements OnInit {
...
@@ -42,7 +43,7 @@ export class AppDetailComponent implements OnInit {
};
};
get
isInstalled
()
{
get
isInstalled
()
{
let
currentApp
=
this
.
appsService
.
currentApp
;
let
currentApp
=
this
.
appsService
.
currentApp
;
return
!!
(
currentApp
.
local
&&
currentApp
.
local
.
path
);
return
!!
(
currentApp
.
local
&&
currentApp
.
local
.
path
);
}
}
...
@@ -120,20 +121,20 @@ export class AppDetailComponent implements OnInit {
...
@@ -120,20 +121,20 @@ export class AppDetailComponent implements OnInit {
return
dir
[
0
];
return
dir
[
0
];
}
}
startApp
(
app
)
{
startApp
(
app
:
App
)
{
let
execute
=
this
.
path
.
join
(
app
.
local
.
path
,
app
.
actions
[
process
.
platform
][
"
main
"
]
.
execute
);
let
execute
=
this
.
path
.
join
(
app
.
local
.
path
,
app
.
actions
.
get
(
"
main
"
)
.
execute
);
let
args
=
app
.
actions
[
process
.
platform
][
"
main
"
]
.
args
;
let
args
=
app
.
actions
.
get
(
"
main
"
)
.
args
;
let
env
=
app
.
actions
[
process
.
platform
][
"
main
"
]
.
env
;
let
env
=
app
.
actions
.
get
(
"
main
"
)
.
env
;
let
opt
=
{
let
opt
=
{
cwd
:
app
.
local
.
path
,
cwd
:
app
.
local
.
path
,
env
:
env
env
:
env
};
};
let
open
=
''
;
let
open
=
''
;
let
open
Id
=
app
.
actions
[
process
.
platform
][
"
main
"
]
.
open
;
let
open
App
=
app
.
actions
.
get
(
"
main
"
)
.
open
;
if
(
open
Id
)
{
if
(
open
App
)
{
if
(
this
.
isInstalled
)
{
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
);
args
.
push
(
execute
);
}
else
{
}
else
{
console
.
error
(
'
open app not found
'
);
console
.
error
(
'
open app not found
'
);
...
...
app/app.ts
View file @
0e5c65d9
...
@@ -29,7 +29,7 @@ export class App {
...
@@ -29,7 +29,7 @@ export class App {
homepage
:
string
;
homepage
:
string
;
category
:
string
;
category
:
string
;
parent
:
App
;
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
>
;
references
:
Map
<
string
,
App
>
;
dependencies
:
Map
<
string
,
App
>
;
dependencies
:
Map
<
string
,
App
>
;
locales
:
string
[];
locales
:
string
[];
...
...
app/apps.service.ts
View file @
0e5c65d9
...
@@ -107,25 +107,26 @@ export class AppsService {
...
@@ -107,25 +107,26 @@ export class AppsService {
//[{"id": "th01", "wait":["wine", "dx"], resolve: resolve, tarObj: tarObj}]
//[{"id": "th01", "wait":["wine", "dx"], resolve: resolve, tarObj: tarObj}]
let
waitObj
;
let
waitObj
;
let
waitRef
=
[
"
runtime
"
,
"
emulator
"
,
"
dependency
"
];
// TODO 重写依赖的安装
if
(
!
this
.
isEmptyObject
(
refs
))
{
// let waitRef = ["runtime", "emulator", "dependency"];
refs
[
process
.
platform
].
map
((
ref
)
=>
{
// if (!this.isEmptyObject(refs)) {
if
(
waitRef
.
includes
(
ref
.
type
))
{
// refs[process.platform].map((ref)=> {
if
(
!
this
.
checkInstall
(
ref
.
id
))
{
// if (waitRef.includes(ref.type)) {
if
(
!
waitObj
)
{
// if (!this.checkInstall(ref.id)) {
waitObj
=
{
// if (!waitObj) {
id
:
this
.
downloadsInfo
[
index
].
id
,
// waitObj = {
wait
:
[
ref
.
id
],
// id: this.downloadsInfo[index].id,
resolve
:
resolve
,
// wait: [ref.id],
tarObj
:
tarObj
// resolve: resolve,
}
// tarObj: tarObj
}
else
{
// }
waitObj
.
wait
.
push
(
ref
.
id
);
// } else {
}
// waitObj.wait.push(ref.id);
}
// }
}
// }
});
// }
}
// });
// }
console
.
log
(
"
wait obj:
"
,
waitObj
);
console
.
log
(
"
wait obj:
"
,
waitObj
);
if
(
waitObj
)
{
if
(
waitObj
)
{
...
@@ -138,9 +139,9 @@ export class AppsService {
...
@@ -138,9 +139,9 @@ export class AppsService {
console
.
log
(
tarObj
);
console
.
log
(
tarObj
);
this
.
tarPush
(
tarObj
);
this
.
tarPush
(
tarObj
);
});
});
promise
.
catch
((
err
)
=>
{
//
promise.catch((err)=> {
console
.
log
(
"
err
"
,
err
);
// err.printt
})
//
})
}
}
}
else
{
}
else
{
console
.
log
(
"
cannot found download info!
"
);
console
.
log
(
"
cannot found download info!
"
);
...
@@ -249,7 +250,18 @@ export class AppsService {
...
@@ -249,7 +250,18 @@ export class AppsService {
}
}
// 设置App关系
for
(
let
id
of
Array
.
from
(
apps
.
keys
()))
{
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
)
=>
{
[
'
dependencies
'
,
'
references
'
,
'
parent
'
].
forEach
((
key
)
=>
{
let
app
=
apps
.
get
(
id
);
let
app
=
apps
.
get
(
id
);
...
@@ -265,6 +277,7 @@ export class AppsService {
...
@@ -265,6 +277,7 @@ export class AppsService {
}
}
});
});
}
}
console
.
log
(
apps
);
return
apps
;
return
apps
;
};
};
...
@@ -327,7 +340,7 @@ export class AppsService {
...
@@ -327,7 +340,7 @@ export class AppsService {
})
!==
-
1
)
{
})
!==
-
1
)
{
console
.
log
(
"
this app is downloading
"
)
console
.
log
(
"
this app is downloading
"
)
}
else
{
}
else
{
let
url
=
this
.
currentApp
.
download
[
process
.
platform
]
;
let
url
=
this
.
currentApp
.
download
;
this
.
aria2
.
addUri
([
url
],
{
'
dir
'
:
this
.
download_dir
},
(
error
,
gid
)
=>
{
this
.
aria2
.
addUri
([
url
],
{
'
dir
'
:
this
.
download_dir
},
(
error
,
gid
)
=>
{
console
.
log
(
error
,
gid
);
console
.
log
(
error
,
gid
);
if
(
error
)
{
if
(
error
)
{
...
...
apps.json
View file @
0e5c65d9
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
"actions"
:
{
"actions"
:
{
"win32"
:
{
"win32"
:
{
"main"
:
{
"main"
:
{
"execute"
:
"
th07
.exe"
,
"execute"
:
"
東方紅魔郷
.exe"
,
"args"
:
[],
"args"
:
[],
"env"
:
{
"env"
:
{
"LC_ALL"
:
"ja_JP"
"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