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
3bdfcb80
Commit
3bdfcb80
authored
Oct 20, 2016
by
wudizhanche1000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加卸载
parent
6c86bc5d
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
174 additions
and
96 deletions
+174
-96
app/app-detail.component.html
app/app-detail.component.html
+72
-11
app/app-detail.component.ts
app/app-detail.component.ts
+7
-5
app/apps.service.ts
app/apps.service.ts
+87
-78
i18n/zh-CN.json
i18n/zh-CN.json
+6
-1
index.js
index.js
+1
-1
systemjs.config.js
systemjs.config.js
+1
-0
No files found.
app/app-detail.component.html
View file @
3bdfcb80
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</div>
</div>
<div
*ngIf=
"isInstalled"
>
<div
*ngIf=
"isInstalled"
>
<button
(click)=
"startApp(routingService.app)"
type=
"button"
class=
"btn btn-primary"
>
运行
</button>
<button
(click)=
"startApp(routingService.app)"
type=
"button"
class=
"btn btn-primary"
>
运行
</button>
<button
type=
"button"
class=
"btn btn-secondary"
>
设置
</button>
<button
type=
"button"
class=
"btn btn-secondary"
data-toggle=
"modal"
data-target=
"#settings-modal"
>
设置
</button>
<button
(click)=
"openDir(routingService.app)"
type=
"button"
class=
"btn btn-secondary"
>
游览本地文件
</button>
<button
(click)=
"openDir(routingService.app)"
type=
"button"
class=
"btn btn-secondary"
>
游览本地文件
</button>
<button
type=
"button"
class=
"btn btn-secondary"
>
联机
</button>
<button
type=
"button"
class=
"btn btn-secondary"
>
联机
</button>
</div>
</div>
...
@@ -65,12 +65,22 @@
...
@@ -65,12 +65,22 @@
<td>
{{'app.' + mod.id + '.name' | translate}}
</td>
<td>
{{'app.' + mod.id + '.name' | translate}}
</td>
<td>
{{mod.type}}
</td>
<td>
{{mod.type}}
</td>
<td
*ngIf=
"checkInstall(mod.id)"
>
<td
*ngIf=
"checkInstall(mod.id)"
>
<button
type=
"button"
class=
"btn btn-danger btn-sm"
>
卸载
</button></td>
<button
type=
"button"
class=
"btn btn-danger btn-sm"
>
卸载
</button>
</td>
<td
*ngIf=
"!checkInstall(mod.id)"
>
<td
*ngIf=
"!checkInstall(mod.id)"
>
<button
*ngIf=
"!appsService.getDownloadInfo(mod.id)"
(click)=
"install(mod.id)"
type=
"button"
class=
"btn btn-primary btn-sm"
>
安装
</button>
<button
*ngIf=
"!appsService.getDownloadInfo(mod.id)"
(click)=
"install(mod.id)"
type=
"button"
<progress
*ngIf=
"appsService.getDownloadInfo(mod.id) && appsService.getDownloadInfo(mod.id).status === 'active'"
class=
"progress progress-striped progress-animated"
value=
"{{appsService.getDownloadInfo(mod.id).progress}}"
max=
"100"
></progress>
class=
"btn btn-primary btn-sm"
>
安装
<div
*ngIf=
"appsService.getDownloadInfo(mod.id) && appsService.getDownloadInfo(mod.id).status === 'wait'"
>
等待安装...
</div>
</button>
<div
*ngIf=
"appsService.getDownloadInfo(mod.id) && appsService.getDownloadInfo(mod.id).status === 'install'"
>
正在安装...
</div>
<progress
*ngIf=
"appsService.getDownloadInfo(mod.id) && appsService.getDownloadInfo(mod.id).status === 'active'"
class=
"progress progress-striped progress-animated"
value=
"{{appsService.getDownloadInfo(mod.id).progress}}"
max=
"100"
></progress>
<div
*ngIf=
"appsService.getDownloadInfo(mod.id) && appsService.getDownloadInfo(mod.id).status === 'wait'"
>
等待安装...
</div>
<div
*ngIf=
"appsService.getDownloadInfo(mod.id) && appsService.getDownloadInfo(mod.id).status === 'install'"
>
正在安装...
</div>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
...
@@ -84,13 +94,60 @@
...
@@ -84,13 +94,60 @@
{{appsService.tarQueue | json}}
{{appsService.tarQueue | json}}
{{appsService.waitInstallQueue | json}}
{{appsService.waitInstallQueue | json}}
</pre>
</pre>
<button
(click)=
"appsService.doTar()"
>
DOTAR
</button>
<button
(click)=
"appsService.doTar()"
>
DOTAR
</button>
<div
class=
"modal fade"
id=
"settings-modal"
tabindex=
"-1"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
<h4
class=
"modal-title"
>
{{'settings'|translate}}
</h4>
<ul
class=
"nav nav-tabs"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link active"
data-toggle=
"tab"
href=
"#general"
>
{{'general'|translate}}
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
data-toggle=
"tab"
href=
"#updates"
>
{{'updates'|translate}}
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
data-toggle=
"tab"
href=
"#local-files"
>
{{'local files'|translate}}
</a>
</li>
</ul>
</div>
<div
class=
"modal-body"
>
<div
class=
"tab-content"
>
<div
id=
"general"
role=
"tabpanel"
class=
"tab-pane fade active"
>
</div>
<div
id=
"updates"
role=
"tabpanel"
class=
"tab-pane fade"
>
</div>
<div
id=
"local-files"
role=
"tabpanel"
class=
"tab-pane fade"
>
<button
type=
"button"
(click)=
"uninstall()"
>
{{'uninstall'|translate}}
</button>
</div>
</div>
</div>
<div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<!-- Modal -->
<div
class=
"modal fade"
id=
"install-modal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
<div
class=
"modal fade"
id=
"install-modal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-dialog"
role=
"document"
>
<form
class=
"modal-content"
(ngSubmit)=
"installSubmit(theForm)"
#theForm
="
ngForm
"
>
<form
id=
"install-form"
class=
"modal-content"
(ngSubmit)=
"installSubmit(theForm)"
#theForm
="
ngForm
"
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
<span
aria-hidden=
"true"
>
×
</span>
...
@@ -103,7 +160,8 @@
...
@@ -103,7 +160,8 @@
<h4>
安装位置
</h4>
<h4>
安装位置
</h4>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"input-group"
>
<div
class=
"input-group"
>
<input
type=
"text"
[(ngModel)]=
"appsService.installConfig.installDir"
name=
"installDir"
class=
"form-control"
placeholder=
"安装位置"
>
<input
type=
"text"
[(ngModel)]=
"appsService.installConfig.installDir"
name=
"installDir"
class=
"form-control"
placeholder=
"安装位置"
>
<span
class=
"input-group-btn"
>
<span
class=
"input-group-btn"
>
<button
(click)=
"selectDir()"
class=
"btn btn-secondary"
type=
"button"
>
浏览
</button>
<button
(click)=
"selectDir()"
class=
"btn btn-secondary"
type=
"button"
>
浏览
</button>
</span>
</span>
...
@@ -112,7 +170,8 @@
...
@@ -112,7 +170,8 @@
<h4>
快捷方式
</h4>
<h4>
快捷方式
</h4>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
[(ngModel)]=
"appsService.installConfig.shortcut.application"
name=
"application"
>
<input
type=
"checkbox"
[(ngModel)]=
"appsService.installConfig.shortcut.application"
name=
"application"
>
创建应用程序快捷方式
创建应用程序快捷方式
</label>
</label>
</div>
</div>
...
@@ -133,10 +192,12 @@
...
@@ -133,10 +192,12 @@
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"submit"
[disabled]=
"!theForm.form.valid"
class=
"btn btn-primary"
>
安装
</button>
<button
id=
"submit"
type=
"submit"
[disabled]=
"!theForm.form.valid"
class=
"btn btn-primary"
>
安装
</button>
</div>
</div>
<!--
<!--
-->
-->
</form>
</form>
</div>
</div>
</div>
</div>
app/app-detail.component.ts
View file @
3bdfcb80
...
@@ -5,7 +5,6 @@ import {App} from "./app";
...
@@ -5,7 +5,6 @@ import {App} from "./app";
declare
var
process
;
declare
var
process
;
declare
var
$
;
declare
var
$
;
@
Component
({
@
Component
({
selector
:
'
app-detail
'
,
selector
:
'
app-detail
'
,
templateUrl
:
'
app/app-detail.component.html
'
,
templateUrl
:
'
app/app-detail.component.html
'
,
...
@@ -105,13 +104,18 @@ export class AppDetailComponent {
...
@@ -105,13 +104,18 @@ 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
);
$
(
'
#install-modal
'
).
modal
(
'
hide
'
);
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!
"
);
}
}
}
uninstall
(
id
:
string
)
{
id
=
this
.
currentApp
.
id
;
this
.
appsService
.
uninstall
(
id
);
}
}
...
@@ -123,8 +127,6 @@ export class AppDetailComponent {
...
@@ -123,8 +127,6 @@ export class AppDetailComponent {
this
.
install
(
mod
);
this
.
install
(
mod
);
}
}
}
}
$
(
"
#install-modal
"
).
modal
(
"
hide
"
);
}
}
selectDir
()
{
selectDir
()
{
...
...
app/apps.service.ts
View file @
3bdfcb80
This diff is collapsed.
Click to expand it.
i18n/zh-CN.json
View file @
3bdfcb80
{
{
"library"
:
"游戏"
,
"library"
:
"游戏"
,
"community"
:
"社区"
"community"
:
"社区"
,
"settings"
:
"设置"
,
"uninstall"
:
"卸载"
,
"general"
:
"常规"
,
"updates"
:
"更新"
,
"local files"
:
"本地文件"
}
}
index.js
View file @
3bdfcb80
...
@@ -94,7 +94,7 @@ function createAria2c() {
...
@@ -94,7 +94,7 @@ function createAria2c() {
let
aria2c
=
child_process
.
spawn
(
aria2c_path
,
[
'
--enable-rpc
'
,
'
--rpc-allow-origin-all
'
,
"
--continue
"
,
"
--split=10
"
,
"
--min-split-size=1M
"
,
"
--max-connection-per-server=10
"
]);
let
aria2c
=
child_process
.
spawn
(
aria2c_path
,
[
'
--enable-rpc
'
,
'
--rpc-allow-origin-all
'
,
"
--continue
"
,
"
--split=10
"
,
"
--min-split-size=1M
"
,
"
--max-connection-per-server=10
"
]);
aria2c
.
on
(
'
data
'
,
(
data
)
=>
{
aria2c
.
on
(
'
data
'
,
(
data
)
=>
{
console
.
log
(
data
);
console
.
log
(
data
);
})
})
;
return
aria2c
;
return
aria2c
;
}
}
...
...
systemjs.config.js
View file @
3bdfcb80
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
'
angular2-in-memory-web-api
'
:
'
node_modules/angular2-in-memory-web-api
'
,
'
angular2-in-memory-web-api
'
:
'
node_modules/angular2-in-memory-web-api
'
,
'
rxjs
'
:
'
node_modules/rxjs
'
,
'
rxjs
'
:
'
node_modules/rxjs
'
,
'
ng2-translate
'
:
'
node_modules/ng2-translate/bundles/ng2-translate.js
'
,
'
ng2-translate
'
:
'
node_modules/ng2-translate/bundles/ng2-translate.js
'
,
"
os
"
:
''
};
};
// packages tells the System loader how to load when no filename and/or no extension
// packages tells the System loader how to load when no filename and/or no extension
var
packages
=
{
var
packages
=
{
...
...
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