Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Moecube Store
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
MyCard
Moecube Store
Commits
e555ea2e
Commit
e555ea2e
authored
Jan 23, 2017
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态下载地址
parent
29bba1f3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
26 deletions
+69
-26
Dockerfile
Dockerfile
+13
-0
app/store.component.html
app/store.component.html
+8
-9
app/store.component.ts
app/store.component.ts
+32
-4
package.json
package.json
+14
-12
systemjs.config.js
systemjs.config.js
+2
-1
No files found.
Dockerfile
0 → 100644
View file @
e555ea2e
FROM
node
RUN
mkdir
-p
/usr/src/app
WORKDIR
/usr/src/app
COPY
package.json /usr/src/app/
RUN
npm
install
COPY
. /usr/src/app
RUN
npm run build:aot
VOLUME
/usr/src/app/aot
CMD
[ "echo", "mycard-store" ]
app/store.component.html
View file @
e555ea2e
...
...
@@ -6,7 +6,6 @@
<a
class=
"navbar-brand"
href=
"#"
>
<img
src=
"https://mycard.moe/logo_60.png"
width=
"40"
height=
"40"
class=
"d-inline-block align-center"
alt=
""
>
MyCard
</a>
<!--<a class="navbar-brand" href="#"></a>-->
<div
class=
"collapse navbar-collapse"
id=
"navbarsExampleDefault"
>
<ul
class=
"navbar-nav mr-auto"
>
...
...
@@ -28,12 +27,13 @@
<div
class=
"col-md-5"
id=
"title"
>
<h1
class=
"display-3"
>
萌卡
<sup
class=
"titileBeta"
>
BETA
</sup></h1>
<p>
MyCard 同人游戏平台
</p>
<p>
<a
class=
"btn btn-primary btn-lg"
href=
"https://wudizhanche.mycard.moe/download?platform=win32
"
role=
"button"
>
立即安装
</a>
<p
*ngIf=
"latest"
>
<a
class=
"btn btn-primary btn-lg"
[href]=
"latest.win32.url
"
role=
"button"
>
立即安装
</a>
</p>
<p>
萌卡平台支持
<a
href=
"https://wudizhanche.mycard.moe/download?platform=win32"
>
Windows
</a>
与
<a
href=
"https://wudizhanche.mycard.moe/download?platform=darwin"
>
Mac
</a>
操作系统。
</p>
<p
*ngIf=
"latest"
>
萌卡平台支持
<a
[href]=
"latest.win32.url"
>
Windows
</a>
与
<a
[href]=
"latest.darwin.url"
>
Mac
</a>
操作系统。
</p>
<p
*ngIf=
"!latest"
>
Loading...
</p>
</div>
<div
class=
"col"
>
<img
id=
"pic"
src=
"MyCardProduct.png"
>
...
...
@@ -114,9 +114,9 @@
<div
id=
"requirements-wrapper"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
id=
"setup"
class=
"col"
>
<div
id=
"setup"
class=
"col"
*ngIf=
"latest"
>
<p>
欢迎加入萌卡这个大家庭
</p>
<a
class=
"btn btn-primary btn-lg"
href=
"https://wudizhanche.mycard.moe/download?platform=win32
"
role=
"button"
>
立即安装
</a>
<a
class=
"btn btn-primary btn-lg"
[href]=
"latest.win32.url
"
role=
"button"
>
立即安装
</a>
</div>
<div
id=
"requirements"
class=
"col"
>
<p>
...
...
@@ -139,4 +139,3 @@
</footer>
</div>
</div>
app/store.component.ts
View file @
e555ea2e
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Http
,
URLSearchParams
}
from
'
@angular/http
'
;
import
'
rxjs/Rx
'
;
import
*
as
yaml
from
'
js-yaml
'
;
@
Component
({
moduleId
:
module
.
id
,
...
...
@@ -9,22 +10,49 @@ import 'rxjs/Rx';
styleUrls
:
[
'
store.component.css
'
],
})
export
class
StoreComponent
implements
OnInit
{
s
ignups
:
number
;
online
:
number
;
s
tats
:
{
signups
:
number
;
online
:
number
;}
;
latest
:
{
win32
:
{
version
:
string
,
url
:
string
},
darwin
:
{
version
:
string
,
url
:
string
}}
;
constructor
(
private
http
:
Http
)
{
}
async
ngOnInit
()
{
this
.
latest
=
{
win32
:
await
this
.
get_latest_win32
(),
darwin
:
await
this
.
get_latest_darwin
()
};
this
.
stats
=
{
signups
:
await
this
.
get_stats_signups
(),
online
:
await
this
.
get_stats_online
()
};
}
async
get_latest_win32
()
{
let
data
=
await
this
.
http
.
get
(
'
https://wudizhanche.mycard.moe/downloads/latest.yml
'
).
map
(
response
=>
yaml
.
safeLoad
(
response
.
text
())).
toPromise
();
data
.
url
=
'
https://r.my-card.in/downloads/
'
+
data
.
path
;
return
data
;
}
async
get_latest_darwin
()
{
let
data
=
await
this
.
http
.
get
(
'
https://wudizhanche.mycard.moe/downloads/latest-mac.json
'
).
map
(
response
=>
response
.
json
()).
toPromise
();
data
.
url
=
data
.
url
.
replace
(
'
-mac.zip
'
,
'
.dmg
'
).
replace
(
'
https://wudizhanche.mycard.moe/downloads/
'
,
'
https://r.my-card.in/downloads/
'
);
return
data
;
}
async
get_stats_signups
()
{
let
params
=
new
URLSearchParams
();
params
.
set
(
'
api_key
'
,
'
dc7298a754828b3d26b709f035a0eeceb43e73cbd8c4fa8dec18951f8a95d2bc
'
);
params
.
set
(
'
api_username
'
,
'
zh99998
'
);
let
data
=
await
this
.
http
.
get
(
'
https://ygobbs.com/admin/dashboard.json
'
,
{
search
:
params
})
.
map
(
response
=>
response
.
json
()).
toPromise
();
this
.
signups
=
data
.
global_reports
.
find
((
item
:
any
)
=>
item
.
type
===
'
signups
'
).
total
;
return
data
.
global_reports
.
find
((
item
:
any
)
=>
item
.
type
===
'
signups
'
).
total
;
}
async
get_stats_online
()
{
let
document
=
await
this
.
http
.
get
(
'
https://chat.mycard.moe/stats/online
'
)
.
map
(
response
=>
new
DOMParser
().
parseFromString
(
response
.
text
(),
'
text/xml
'
)).
toPromise
();
this
.
online
=
parseInt
(
document
.
querySelector
(
'
#content > table > tbody > tr:nth-child(2) > td:nth-child(2)
'
).
textContent
);
return
parseInt
(
document
.
querySelector
(
'
#content > table > tbody > tr:nth-child(2) > td:nth-child(2)
'
).
textContent
);
}
}
package.json
View file @
e555ea2e
...
...
@@ -28,28 +28,30 @@
"
@angular/platform-browser
"
:
"
latest
"
,
"
@angular/platform-browser-dynamic
"
:
"
latest
"
,
"
@angular/router
"
:
"
latest
"
,
"
@types/bootstrap
"
:
"
latest
"
,
"
@types/jquery
"
:
"
latest
"
,
"
@types/node
"
:
"
^7.0.1
"
,
"
@types/tether
"
:
"
latest
"
,
"
angular-in-memory-web-api
"
:
"
latest
"
,
"
bootstrap
"
:
"
next
"
,
"
core-js
"
:
"
latest
"
,
"
jquery
"
:
"
latest
"
,
"
js-yaml
"
:
"
latest
"
,
"
rxjs
"
:
"
latest
"
,
"
systemjs
"
:
"
latest
"
,
"
tether
"
:
"
latest
"
,
"
zone.js
"
:
"
^0.7.4
"
"
zone.js
"
:
"
latest
"
},
"devDependencies"
:
{
"
@angular/compiler-cli
"
:
"
^2.4.4
"
,
"
@angular/platform-server
"
:
"
^2.4.4
"
,
"
@angular/compiler-cli
"
:
"
latest
"
,
"
@angular/platform-server
"
:
"
latest
"
,
"
@types/bootstrap
"
:
"
latest
"
,
"
@types/jquery
"
:
"
latest
"
,
"
@types/js-yaml
"
:
"
latest
"
,
"
@types/node
"
:
"
latest
"
,
"
@types/tether
"
:
"
latest
"
,
"
lite-server
"
:
"
latest
"
,
"
rollup
"
:
"
^0.41.4
"
,
"
rollup-plugin-commonjs
"
:
"
^7.0.0
"
,
"
rollup-plugin-node-resolve
"
:
"
^2.0.0
"
,
"
rollup-plugin-uglify
"
:
"
^1.0.1
"
,
"
tslint
"
:
"
^3.15.1
"
,
"
rollup
"
:
"
latest
"
,
"
rollup-plugin-commonjs
"
:
"
latest
"
,
"
rollup-plugin-node-resolve
"
:
"
latest
"
,
"
rollup-plugin-uglify
"
:
"
latest
"
,
"
tslint
"
:
"
latest
"
,
"
typescript
"
:
"
latest
"
},
"repository"
:
{}
...
...
systemjs.config.js
View file @
e555ea2e
...
...
@@ -29,7 +29,8 @@
'
jquery
'
:
'
npm:jquery/dist/jquery.min.js
'
,
'
tether
'
:
'
npm:tether/dist/js/tether.min.js
'
,
'
bootstrap
'
:
'
npm:bootstrap/dist/js/bootstrap.min.js
'
'
bootstrap
'
:
'
npm:bootstrap/dist/js/bootstrap.min.js
'
,
'
js-yaml
'
:
'
npm:js-yaml/dist/js-yaml.min.js
'
},
// packages tells the System loader how to load when no filename and/or no extension
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