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
ee74a9a4
Commit
ee74a9a4
authored
Oct 28, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Plain Diff
import
parents
019a2286
927e633a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
10 deletions
+119
-10
app/app-detail.component.ts
app/app-detail.component.ts
+9
-6
app/download.service.ts
app/download.service.ts
+25
-0
aria2.js
aria2.js
+37
-0
aria2.js.map
aria2.js.map
+1
-0
aria2.ts
aria2.ts
+40
-0
systemjs.config.js
systemjs.config.js
+3
-1
typings.json
typings.json
+4
-3
No files found.
app/app-detail.component.ts
View file @
ee74a9a4
...
@@ -3,14 +3,15 @@ import {AppsService} from "./apps.service";
...
@@ -3,14 +3,15 @@ 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
"
;
import
{
App
}
from
"
./app
"
;
import
{
DownloadService
}
from
"
./download.service
"
;
declare
var
System
;
declare
var
System
;
declare
var
process
;
declare
var
$
;
declare
var
$
;
const
readline
=
System
.
_nodeRequire
(
'
readline
'
);
import
*
as
readline
from
'
readline
'
;
const
os
=
System
.
_nodeRequire
(
'
os
'
);
import
*
as
os
from
'
os
'
;
const
{
clipboard
,
remote
}
=
System
.
_nodeRequire
(
'
electron
'
);
import
{
clipboard
,
remote
}
from
'
electron
'
;
const
sudo
=
new
(
System
.
_nodeRequire
(
'
electron-sudo
'
).
default
)({
name
:
'
MyCard
'
});
const
sudo
=
new
(
System
.
_nodeRequire
(
'
electron-sudo
'
).
default
)({
name
:
'
MyCard
'
});
sudo
.
fork
=
function
(
modulePath
,
args
,
options
)
{
sudo
.
fork
=
function
(
modulePath
,
args
,
options
)
{
...
@@ -32,6 +33,7 @@ sudo.fork = function (modulePath, args, options) {
...
@@ -32,6 +33,7 @@ sudo.fork = function (modulePath, args, options) {
selector
:
'
app-detail
'
,
selector
:
'
app-detail
'
,
templateUrl
:
'
app/app-detail.component.html
'
,
templateUrl
:
'
app/app-detail.component.html
'
,
styleUrls
:
[
'
app/app-detail.component.css
'
],
styleUrls
:
[
'
app/app-detail.component.css
'
],
providers
:
[
DownloadService
]
})
})
export
class
AppDetailComponent
implements
OnInit
{
export
class
AppDetailComponent
implements
OnInit
{
platform
=
process
.
platform
;
platform
=
process
.
platform
;
...
@@ -43,7 +45,8 @@ export class AppDetailComponent implements OnInit {
...
@@ -43,7 +45,8 @@ export class AppDetailComponent implements OnInit {
installConfig
:
InstallConfig
;
installConfig
:
InstallConfig
;
constructor
(
private
appsService
:
AppsService
,
private
settingsService
:
SettingsService
)
{
constructor
(
private
appsService
:
AppsService
,
private
settingsService
:
SettingsService
,
private
downloadService
:
DownloadService
)
{
}
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -184,7 +187,7 @@ export class AppDetailComponent implements OnInit {
...
@@ -184,7 +187,7 @@ export class AppDetailComponent implements OnInit {
}
}
copy
(
text
){
copy
(
text
)
{
clipboard
.
writeText
(
text
);
clipboard
.
writeText
(
text
);
}
}
...
...
app/download.service.ts
0 → 100644
View file @
ee74a9a4
/**
* Created by weijian on 2016/10/26.
*/
import
{
Injectable
}
from
"
@angular/core
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
import
{
ipcRenderer
}
from
"
electron
"
;
@
Injectable
()
export
class
DownloadService
{
constructor
(
private
settingsService
:
SettingsService
)
{
ipcRenderer
.
send
(
"
download-message
"
,
"
123
"
);
}
sendEvent
(
event
,
args
)
{
ipcRenderer
.
send
(
''
)
}
listenEvent
()
{
console
.
log
(
ipcRenderer
);
}
}
aria2.js
0 → 100644
View file @
ee74a9a4
"
use strict
"
;
/**
* Created by weijian on 2016/10/27.
*/
var
Rx
=
require
(
"
rxjs/Rx
"
);
var
ipcMain
=
require
(
'
electron
'
).
ipcMain
;
var
child_process_1
=
require
(
"
child_process
"
);
// import * as Aria2 from "aria2";
var
Aria2
=
require
(
"
aria2
"
);
var
a
=
(
createProcess
(
"
D:/Github/mycard/bin/aria2c.exe
"
,
[
'
--enable-rpc
'
,
'
--rpc-allow-origin-all
'
,
"
--continue
"
,
"
--split=10
"
,
"
--min-split-size=1M
"
,
"
--max-connection-per-server=10
"
]));
a
.
on
(
'
error
'
,
function
(
error
)
{
console
.
log
(
error
);
});
// console.log(Aria2,2);
function
createProcess
(
aria2c_path
,
args
)
{
if
(
args
===
void
0
)
{
args
=
[];
}
return
child_process_1
.
spawn
(
aria2c_path
,
args
);
}
var
options
=
{
'
host
'
:
'
localhost
'
,
'
port
'
:
6800
,
'
secure
'
:
false
};
var
aria2
=
new
Aria2
(
options
);
aria2
.
onDownloadComplete
=
function
(
response
)
{
console
.
log
(
response
);
};
var
open
=
aria2
.
open
();
function
addUri
(
uri
,
path
)
{
return
open
.
then
(
function
()
{
return
aria2
.
addUri
(
uri
,
{
'
dir
'
:
path
});
});
}
function
pause
(
gid
)
{
return
aria2
.
pause
(
gid
);
}
function
reportStatus
()
{
aria2
.
tellActive
();
}
//ipcMain.on()
//# sourceMappingURL=aria2.js.map
\ No newline at end of file
aria2.js.map
0 → 100644
View file @
ee74a9a4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AACD,eAAe,GAAW;IACtB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC;AAED;IACI,KAAK,CAAC,UAAU,EAAE,CAAA;AACtB,CAAC;AAED,cAAc"}
\ No newline at end of file
aria2.ts
0 → 100644
View file @
ee74a9a4
/**
* Created by weijian on 2016/10/27.
*/
const
Rx
=
require
(
"
rxjs/Rx
"
);
const
{
ipcMain
}
=
require
(
'
electron
'
);
import
{
ChildProcess
,
spawn
}
from
"
child_process
"
;
// import * as Aria2 from "aria2";
const
Aria2
=
require
(
"
aria2
"
);
let
a
=
(
createProcess
(
"
D:/Github/mycard/bin/aria2c.exe
"
,
[
'
--enable-rpc
'
,
'
--rpc-allow-origin-all
'
,
"
--continue
"
,
"
--split=10
"
,
"
--min-split-size=1M
"
,
"
--max-connection-per-server=10
"
]))
a
.
on
(
'
error
'
,
(
error
)
=>
{
console
.
log
(
error
);
});
// console.log(Aria2,2);
function
createProcess
(
aria2c_path
:
string
,
args
:
string
[]
=
[]):
ChildProcess
{
return
spawn
(
aria2c_path
,
args
);
}
let
options
=
{
'
host
'
:
'
localhost
'
,
'
port
'
:
6800
,
'
secure
'
:
false
}
let
aria2
=
new
Aria2
(
options
);
aria2
.
onDownloadComplete
=
(
response
)
=>
{
console
.
log
(
response
);
};
let
open
=
aria2
.
open
();
function
addUri
(
uri
:
string
[],
path
:
string
)
{
return
open
.
then
(()
=>
{
return
aria2
.
addUri
(
uri
,
{
'
dir
'
:
path
});
});
}
function
pause
(
gid
:
string
):
Promise
<
string
>
{
return
aria2
.
pause
(
gid
)
}
function
reportStatus
()
{
aria2
.
tellActive
()
}
//ipcMain.on()
systemjs.config.js
View file @
ee74a9a4
...
@@ -10,7 +10,9 @@
...
@@ -10,7 +10,9 @@
'
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/index.js
'
,
'
ng2-translate
'
:
'
node_modules/ng2-translate/bundles/index.js
'
,
"
os
"
:
''
"
electron
"
:
"
@node/electron
"
,
"
readline
"
:
"
@node/readline
"
,
"
os
"
:
"
@node/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
=
{
...
...
typings.json
View file @
ee74a9a4
{
{
"globalDependencies"
:
{
"globalDependencies"
:
{
"core-js"
:
"registry:dt/core-js#0.0.0+20160602141332"
,
"core-js"
:
"registry:dt/core-js"
,
"jasmine"
:
"registry:dt/jasmine#2.2.0+20160621224255"
,
"electron/github-electron"
:
"registry:dt/electron/github-electron"
,
"node"
:
"registry:dt/node#6.0.0+20160807145350"
"jasmine"
:
"registry:dt/jasmine"
,
"node"
:
"registry:dt/node"
}
}
}
}
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