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
6a532662
Commit
6a532662
authored
Oct 25, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Plain Diff
login
parents
47770a6b
de8359d8
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
63 additions
and
133 deletions
+63
-133
app/app-detail.component.html
app/app-detail.component.html
+16
-44
app/app-detail.component.ts
app/app-detail.component.ts
+17
-22
app/apps.component.html
app/apps.component.html
+8
-8
app/apps.component.ts
app/apps.component.ts
+6
-21
app/apps.service.ts
app/apps.service.ts
+9
-18
app/candy.component.ts
app/candy.component.ts
+1
-2
app/lobby.component.html
app/lobby.component.html
+1
-1
app/lobby.component.ts
app/lobby.component.ts
+1
-2
app/mycard.component.ts
app/mycard.component.ts
+1
-3
app/mycard.module.ts
app/mycard.module.ts
+1
-2
app/routing.service.ts
app/routing.service.ts
+0
-7
app/ygopro.component.ts
app/ygopro.component.ts
+2
-3
No files found.
app/app-detail.component.html
View file @
6a532662
<h1>
{{'app.' + currentApp.id + '.name' | translate}}
</h1>
<h1>
{{'app.' +
appsService.
currentApp.id + '.name' | translate}}
</h1>
<h2>
{{appsService._aa}}
</h2>
<div
*ngIf=
"!isInstalled"
>
<div
*ngIf=
"!appsService.getDownloadInfo(routingService.app)"
>
<button
type=
"button"
(click)=
"updateInstallConfig()"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#install-modal"
>
安装
</button>
<div
*ngIf=
"!appsService.getDownloadInfo(appsService.currentApp)"
>
<button
type=
"button"
(click)=
"updateInstallConfig()"
class=
"btn btn-primary"
data-toggle=
"modal"
data-target=
"#install-modal"
>
安装
</button>
<button
type=
"button"
class=
"btn btn-secondary"
>
导入
</button>
<!--<button type="button" class="btn btn-secondary">正版代购</button>-->
</div>
<div
*ngIf=
"appsService.getDownloadInfo(
routingService.a
pp)"
>
<div
*ngIf=
"appsService.getDownloadInfo(
routingService.a
pp).status === 'install'"
>
正在安装...
</div>
<div
*ngIf=
"appsService.getDownloadInfo(
routingService.a
pp).status === 'wait'"
>
等待安装...
</div>
<progress
*ngIf=
"appsService.getDownloadInfo(
routingService.a
pp).status === 'active'"
<div
*ngIf=
"appsService.getDownloadInfo(
appsService.currentA
pp)"
>
<div
*ngIf=
"appsService.getDownloadInfo(
appsService.currentA
pp).status === 'install'"
>
正在安装...
</div>
<div
*ngIf=
"appsService.getDownloadInfo(
appsService.currentA
pp).status === 'wait'"
>
等待安装...
</div>
<progress
*ngIf=
"appsService.getDownloadInfo(
appsService.currentA
pp).status === 'active'"
class=
"progress progress-striped progress-animated"
value=
"{{appsService.getDownloadInfo(
routingService.a
pp).progress}}"
max=
"100"
>
value=
"{{appsService.getDownloadInfo(
appsService.currentA
pp).progress}}"
max=
"100"
>
</progress>
</div>
</div>
<div
*ngIf=
"isInstalled && (
routingService.a
pp != 'ygopro')"
>
<button
(click)=
"startApp(
routingService.a
pp)"
type=
"button"
class=
"btn btn-primary"
>
运行
</button>
<div
*ngIf=
"isInstalled && (
appsService.currentA
pp != 'ygopro')"
>
<button
(click)=
"startApp(
appsService.currentA
pp)"
type=
"button"
class=
"btn btn-primary"
>
运行
</button>
<button
type=
"button"
data-toggle=
"modal"
data-target=
"#settings-modal"
class=
"btn btn-secondary"
>
设置
</button>
<!--<button (click)="appsService.browse(
routingService.a
pp)" type="button" class="btn btn-secondary">游览本地文件</button>-->
<!--<button (click)="appsService.browse(
appsService.currentA
pp)" type="button" class="btn btn-secondary">游览本地文件</button>-->
<button
type=
"button"
class=
"btn btn-secondary"
>
联机
</button>
</div>
<ygopro
*ngIf=
"isInstalled && (
routingService.a
pp == 'ygopro')"
></ygopro>
<ygopro
*ngIf=
"isInstalled && (
appsService.currentA
pp == 'ygopro')"
></ygopro>
<br>
<h2
*ngIf=
"news"
>
新闻
</h2>
<!--<div *ngIf="news">
<div class="list-group">
<a *ngFor="let item of news" href="{{item.url}}" class="list-group-item">{{item.title}}</a>
</div>
</div>-->
<!--<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li *ngFor="let item of news; let index = index;" data-target="#carousel-example-generic" [data-slide-to]="index" [class.active]="index == 0"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div *ngFor="let item of news; let index = index;" class="carousel-item" [class.active]="index == 0">
<img [src]="item.image" [alt]="item.title">
<div class="carousel-caption">
<h3>{{item.title}}</h3>
<p>{{item.text}}</p>
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="icon-prev" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="icon-next" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>-->
<div
id=
"news"
*ngFor=
"let item of news"
>
<h3>
{{item.title}}
</h3>
<p>
{{item.text}}
</p>
...
...
@@ -116,7 +88,7 @@
<div
*ngIf=
"isInstalled"
>
<h2>
本地文件
</h2>
<button
(click)=
"appsService.browse(
routingService.a
pp)"
type=
"button"
class=
"btn btn-secondary"
>
浏览本地文件
</button>
<button
(click)=
"appsService.browse(
appsService.currentA
pp)"
type=
"button"
class=
"btn btn-secondary"
>
浏览本地文件
</button>
<button
(click)=
"uninstall()"
type=
"button"
class=
"btn btn-secondary"
>
{{'uninstall'|translate}}
</button>
</div>
...
...
@@ -189,7 +161,7 @@
<h4>
{{'install_path'|translate}}
</h4>
<div
class=
"form-group"
>
<select
class=
"form-control"
>
<option
*ngFor=
"let library of settings.getLibraries()"
[selected]=
"library['default']"
>
<option
*ngFor=
"let library of settings
Service
.getLibraries()"
[selected]=
"library['default']"
>
{{ library['path']}}
</option>
</select>
...
...
app/app-detail.component.ts
View file @
6a532662
import
{
Component
,
OnInit
}
from
"
@angular/core
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
import
{
App
}
from
"
./app
"
;
import
{
InstallConfig
}
from
"
./install-config
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
...
...
@@ -13,7 +11,7 @@ declare var $;
templateUrl
:
'
app/app-detail.component.html
'
,
styleUrls
:
[
'
app/app-detail.component.css
'
],
})
export
class
AppDetailComponent
implements
OnInit
{
export
class
AppDetailComponent
implements
OnInit
{
platform
=
process
.
platform
;
fs
=
window
[
'
System
'
].
_nodeRequire
(
'
fs
'
);
...
...
@@ -23,37 +21,34 @@ export class AppDetailComponent implements OnInit{
installConfig
:
InstallConfig
;
ngOnInit
(){
this
.
updateInstallConfig
();
}
updateInstallConfig
()
{
this
.
installConfig
=
this
.
appsService
.
getInstallConfig
(
this
.
currentApp
);
constructor
(
private
appsService
:
AppsService
,
private
settingsService
:
SettingsService
)
{
}
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
,
private
settings
:
SettingsService
)
{
ngOnInit
()
{
this
.
updateInstallConfig
();
}
get
currentApp
():
App
{
return
this
.
appsService
.
searchApp
(
this
.
routingService
.
a
pp
);
updateInstallConfig
()
{
this
.
installConfig
=
this
.
appsService
.
getInstallConfig
(
this
.
appsService
.
currentA
pp
);
}
get
name
()
{
if
(
this
.
currentApp
)
{
return
this
.
currentApp
.
name
[
this
.
currentApp
.
locales
[
0
]];
let
currentApp
=
this
.
appsService
.
currentApp
;
if
(
currentApp
)
{
return
currentApp
.
name
[
this
.
settingsService
.
getLocale
()];
}
return
"
Loading
"
;
};
get
isInstalled
()
{
return
this
.
checkInstall
(
this
.
routingService
.
a
pp
);
return
this
.
checkInstall
(
this
.
appsService
.
currentA
pp
);
}
get
news
()
{
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
.
news
.
length
>
0
)
{
return
this
.
currentApp
.
news
;
}
let
currentApp
=
this
.
appsService
.
currentApp
;
if
(
currentApp
)
{
return
currentApp
.
news
;
}
}
...
...
@@ -68,9 +63,10 @@ export class AppDetailComponent implements OnInit{
get
mods
()
{
let
contains
=
[
"
optional
"
,
"
language
"
,
"
emulator
"
];
if
(
this
.
currentApp
)
{
if
(
this
.
currentApp
.
references
[
process
.
platform
]
&&
this
.
currentApp
.
references
[
process
.
platform
].
length
>
0
)
{
let
refs
=
this
.
currentApp
.
references
[
process
.
platform
];
let
currentApp
=
this
.
appsService
.
currentApp
;
if
(
currentApp
)
{
if
(
currentApp
.
references
[
process
.
platform
]
&&
currentApp
.
references
[
process
.
platform
].
length
>
0
)
{
let
refs
=
currentApp
.
references
[
process
.
platform
];
refs
=
refs
.
filter
((
ref
)
=>
{
return
contains
.
includes
(
ref
.
type
);
});
...
...
@@ -123,7 +119,6 @@ export class AppDetailComponent implements OnInit{
uninstall
(
id
:
string
)
{
if
(
confirm
(
"
确认删除?
"
))
{
this
.
uninstalling
=
true
;
id
=
this
.
currentApp
.
id
;
this
.
appsService
.
uninstall
(
id
).
then
(()
=>
{
this
.
uninstalling
=
false
;
}
...
...
app/apps.component.html
View file @
6a532662
<span
*ngIf=
"grouped_apps.installed"
>
已安装
</span>
<ul
*ngIf=
"grouped_apps.installed"
class=
"nav nav-sidebar"
>
<li
*ngFor=
"let app of grouped_apps.installed"
[class.active]=
"app
.id==routingService.a
pp"
>
<a
(click)=
"
selectApp(app.id
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
<li
*ngFor=
"let app of grouped_apps.installed"
[class.active]=
"app
===appsService.currentA
pp"
>
<a
(click)=
"
chooseApp(app
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
</li>
</ul>
<span
*ngIf=
"grouped_apps.yugioh"
>
游戏王
</span>
<ul
*ngIf=
"grouped_apps.yugioh"
class=
"nav nav-sidebar"
>
<li
*ngFor=
"let app of grouped_apps.yugioh"
[class.active]=
"app
.id==routingService.a
pp"
>
<a
(click)=
"
selectApp(app.id
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
<li
*ngFor=
"let app of grouped_apps.yugioh"
[class.active]=
"app
===appsService.currentA
pp"
>
<a
(click)=
"
chooseApp(app
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
</li>
</ul>
<span
*ngIf=
"grouped_apps.touhou"
>
东方 Project
</span>
<ul
*ngIf=
"grouped_apps.touhou"
class=
"nav nav-sidebar"
>
<li
*ngFor=
"let app of grouped_apps.touhou"
[class.active]=
"app
.id==routingService.a
pp"
>
<a
(click)=
"
selectApp(app.id
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
<li
*ngFor=
"let app of grouped_apps.touhou"
[class.active]=
"app
===appsService.currentA
pp"
>
<a
(click)=
"
chooseApp(app
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
</li>
</ul>
<span
*ngIf=
"grouped_apps.touhou_pc98"
>
东方旧作
</span>
<ul
*ngIf=
"grouped_apps.touhou_pc98"
class=
"nav nav-sidebar"
>
<li
*ngFor=
"let app of grouped_apps.touhou_pc98"
[class.active]=
"app
.id==routingService.a
pp"
>
<a
(click)=
"
selectApp(app.id
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
<li
*ngFor=
"let app of grouped_apps.touhou_pc98"
[class.active]=
"app
===appsService.currentA
pp"
>
<a
(click)=
"
chooseApp(app
)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
</li>
</ul>
\ No newline at end of file
app/apps.component.ts
View file @
6a532662
import
{
Component
,
OnInit
}
from
"
@angular/core
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
import
{
App
}
from
"
./app
"
;
@
Component
({
selector
:
'
apps
'
,
...
...
@@ -9,31 +9,16 @@ import {RoutingService} from "./routing.service";
})
export
class
AppsComponent
implements
OnInit
{
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
constructor
(
private
appsService
:
AppsService
)
{
}
ngOnInit
()
{
}
// _apps;
// get apps() {
//
// let data = this.appsService.data;
// let apps;
//
// if (data) {
// apps = this.appsService.data.filter((app)=> {
// return contains.includes(app.category);
// });
// }
//
// return apps || [];
// }
//
// selectApp(id) {
// this.routingService.app = id;
// this.appsService.createInstallConfig(id);
// }
chooseApp
(
app
:
App
)
{
this
.
appsService
.
currentApp
=
app
;
}
get
grouped_apps
()
{
let
contains
=
[
"
game
"
,
"
music
"
,
"
book
"
];
...
...
app/apps.service.ts
View file @
6a532662
...
...
@@ -19,7 +19,15 @@ const execFile = window['System']._nodeRequire('child_process').execFile;
export
class
AppsService
{
currentApp
:
App
;
private
_currentApp
:
App
;
get
currentApp
():
App
{
return
this
.
_currentApp
;
}
set
currentApp
(
app
:
App
)
{
this
.
_currentApp
=
app
;
}
constructor
(
private
http
:
Http
,
private
translate
:
TranslateService
,
private
settings
:
SettingsService
)
{
let
loop
=
setInterval
(()
=>
{
...
...
@@ -197,23 +205,6 @@ export class AppsService {
.
subscribe
((
apps
)
=>
{
console
.
log
(
apps
);
this
.
data
=
apps
;
// for (let app of data) {
// }
// this.data = data;
// for (let app of data) {
// //console.log(app)
// for (let attribute of ['name', 'description']) {
// if (!app[attribute]) {
// continue
// } //这句应当是不需要的, 如果转换成了 App 类型, 应当保证一定有这些属性
// for (let locale of Object.keys(app[attribute])) {
// let result = {};
// result[`app.${app['id']}.${attribute}`] = app[attribute][locale];
// this.translate.setTranslation(locale, result, true);
// }
// }
// }
//console.log(this.data);
if
(
typeof
(
callback
)
===
'
function
'
)
{
callback
();
}
...
...
app/candy.component.ts
View file @
6a532662
import
{
Component
}
from
'
@angular/core
'
;
import
{
RoutingService
}
from
"
./routing.service
"
;
@
Component
({
selector
:
'
#candy
'
,
templateUrl
:
'
app/candy.component.html
'
,
styleUrls
:
[
'
app/candy.component.css
'
],
})
export
class
CandyComponent
{
constructor
(
private
routingService
:
RoutingService
){
constructor
(){
}
}
app/lobby.component.html
View file @
6a532662
<!-- Begin page content -->
<div
id=
"main"
>
<apps
*ngIf=
"appsService.allApps"
></apps>
<app-detail
*ngIf=
"
routingService.a
pp"
></app-detail>
<app-detail
*ngIf=
"
appsService._currentA
pp"
></app-detail>
<roster></roster>
</div>
<webview
id=
"candy"
...
...
app/lobby.component.ts
View file @
6a532662
...
...
@@ -2,7 +2,6 @@
* Created by zh99998 on 16/9/2.
*/
import
{
Component
}
from
"
@angular/core
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
@
Component
({
selector
:
'
lobby
'
,
...
...
@@ -10,6 +9,6 @@ import {AppsService} from "./apps.service";
styleUrls
:
[
'
app/lobby.component.css
'
],
})
export
class
LobbyComponent
{
constructor
(
private
routingService
:
RoutingService
,
private
appsService
:
AppsService
)
{
constructor
(
private
appsService
:
AppsService
)
{
}
}
app/mycard.component.ts
View file @
6a532662
import
{
Component
,
Renderer
}
from
"
@angular/core
"
;
import
{
TranslateService
}
from
"
ng2-translate
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
import
{
LoginService
}
from
"
./login.service
"
;
const
electron
=
System
.
_nodeRequire
(
'
electron
'
);
declare
var
process
;
...
...
@@ -19,8 +18,7 @@ export class MyCardComponent {
platform
=
process
.
platform
;
constructor
(
private
routingService
:
RoutingService
,
private
renderer
:
Renderer
,
private
translate
:
TranslateService
,
private
loginService
:
LoginService
)
{
constructor
(
private
renderer
:
Renderer
,
private
translate
:
TranslateService
,
private
loginService
:
LoginService
)
{
renderer
.
listenGlobal
(
'
window
'
,
'
message
'
,
(
event
)
=>
{
console
.
log
(
event
);
// Do something with 'event'
...
...
app/mycard.module.ts
View file @
6a532662
...
...
@@ -12,7 +12,6 @@ import {RosterComponent} from "./roster.component";
import
{
CandyComponent
}
from
"
./candy.component
"
;
import
{
CommunityComponent
}
from
"
./community.component
"
;
import
{
YGOProComponent
}
from
"
./ygopro.component
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
TranslateModule
}
from
"
ng2-translate
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
...
...
@@ -22,7 +21,7 @@ import {LoginService} from "./login.service";
imports
:
[
BrowserModule
,
FormsModule
,
ReactiveFormsModule
,
HttpModule
,
TranslateModule
.
forRoot
()],
declarations
:
[
MyCardComponent
,
LoginComponent
,
StoreComponent
,
LobbyComponent
,
CommunityComponent
,
AppsComponent
,
AppDetailComponent
,
RosterComponent
,
CandyComponent
,
YGOProComponent
],
bootstrap
:
[
MyCardComponent
],
providers
:
[
RoutingService
,
AppsService
,
SettingsService
,
LoginService
],
providers
:
[
AppsService
,
SettingsService
,
LoginService
],
schemas
:
[
NO_ERRORS_SCHEMA
]
})
export
class
MyCard
{
...
...
app/routing.service.ts
deleted
100644 → 0
View file @
47770a6b
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
()
export
class
RoutingService
{
component
=
'
lobby
'
;
app
;
}
\ No newline at end of file
app/ygopro.component.ts
View file @
6a532662
/**
* Created by zh99998 on 16/9/2.
*/
import
{
Component
,
OnInit
,
ChangeDetectorRef
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
ChangeDetectorRef
}
from
"
@angular/core
"
;
import
{
AppsService
}
from
"
./apps.service
"
;
import
{
RoutingService
}
from
"
./routing.service
"
;
declare
var
process
;
...
...
@@ -56,7 +55,7 @@ export class YGOProComponent implements OnInit {
connections
=
[];
constructor
(
private
appsService
:
AppsService
,
private
r
outingService
:
RoutingService
,
private
r
ef
:
ChangeDetectorRef
)
{
constructor
(
private
appsService
:
AppsService
,
private
ref
:
ChangeDetectorRef
)
{
this
.
refresh
();
}
...
...
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