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
xiaoye
mycard
Commits
0d7ce086
Commit
0d7ce086
authored
Sep 09, 2021
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
197ab652
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
356 additions
and
768 deletions
+356
-768
package-lock.json
package-lock.json
+321
-731
package.json
package.json
+12
-12
src/app/apps.service.ts
src/app/apps.service.ts
+9
-9
src/app/ygopro/ygopro.component.ts
src/app/ygopro/ygopro.component.ts
+10
-15
webpack.config.js
webpack.config.js
+4
-1
No files found.
package-lock.json
View file @
0d7ce086
This diff is collapsed.
Click to expand it.
package.json
View file @
0d7ce086
...
...
@@ -15,17 +15,17 @@
"author"
:
"zh99998 <zh99998@gmail.com>"
,
"devDependencies"
:
{
"
@angular-builders/custom-webpack
"
:
"
^12.1.1
"
,
"
@angular/animations
"
:
"
~12.
1.0
"
,
"
@angular/cli
"
:
"
~12.
1.0
"
,
"
@angular/common
"
:
"
~12.
1.0
"
,
"
@angular/compiler
"
:
"
~12.
1.0
"
,
"
@angular/compiler-cli
"
:
"
~12.
1.0
"
,
"
@angular/core
"
:
"
~12.
1.0
"
,
"
@angular/forms
"
:
"
~12.
1.0
"
,
"
@angular/localize
"
:
"
~12.
1
.5
"
,
"
@angular/platform-browser
"
:
"
~12.
1.0
"
,
"
@angular/platform-browser-dynamic
"
:
"
~12.
1.0
"
,
"
@angular/router
"
:
"
~12.
1.0
"
,
"
@angular/animations
"
:
"
~12.
2.5
"
,
"
@angular/cli
"
:
"
~12.
2.5
"
,
"
@angular/common
"
:
"
~12.
2.5
"
,
"
@angular/compiler
"
:
"
~12.
2.5
"
,
"
@angular/compiler-cli
"
:
"
~12.
2.5
"
,
"
@angular/core
"
:
"
~12.
2.5
"
,
"
@angular/forms
"
:
"
~12.
2.5
"
,
"
@angular/localize
"
:
"
~12.
2
.5
"
,
"
@angular/platform-browser
"
:
"
~12.
2.5
"
,
"
@angular/platform-browser-dynamic
"
:
"
~12.
2.5
"
,
"
@angular/router
"
:
"
~12.
2.5
"
,
"
@types/bootstrap
"
:
"
^5.1.4
"
,
"
@types/mousetrap
"
:
"
^1.6.8
"
,
"
@types/node
"
:
"
^16.4.13
"
,
...
...
@@ -34,7 +34,7 @@
"
electron
"
:
"
^13.3.0
"
,
"
electron-builder
"
:
"
^22.11.7
"
,
"
mousetrap
"
:
"
^1.6.5
"
,
"
rxjs
"
:
"
^
6.6.7
"
,
"
rxjs
"
:
"
^
7.3.0
"
,
"
tslib
"
:
"
^2.3.0
"
,
"
typescript
"
:
"
~4.3.5
"
,
"
zone.js
"
:
"
~0.11.4
"
...
...
src/app/apps.service.ts
View file @
0d7ce086
...
...
@@ -20,8 +20,8 @@ import { AppsJson } from './shared/apps-json-type';
import
os
from
'
os
'
;
import
Timer
=
NodeJS
.
Timer
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
map
,
timeout
}
from
'
rxjs/operator
s
'
;
import
{
Observable
,
Observer
}
from
'
rxjs
'
;
import
{
lastValueFrom
,
map
,
Observable
,
Observer
,
timeout
}
from
'
rxj
s
'
;
const
Logger
=
{
info
:
(...
message
:
any
[])
=>
{
...
...
@@ -103,12 +103,12 @@ export class AppsService {
let
appsURL
=
'
https://sapi.moecube.com:444/release/update/apps.json
'
;
let
keysURL
=
'
https://sapi.moecube.com:444/keys
'
;
try
{
let
data
=
await
this
.
http
.
get
<
AppsJson
.
App
[]
>
(
appsURL
).
pipe
(
timeout
(
5000
)).
toPromise
(
);
let
keys_data
=
await
this
.
http
.
get
<
any
[]
>
(
keysURL
,
{
let
data
=
await
lastValueFrom
(
this
.
http
.
get
<
AppsJson
.
App
[]
>
(
appsURL
).
pipe
(
timeout
(
5000
))
);
let
keys_data
=
await
lastValueFrom
(
this
.
http
.
get
<
any
[]
>
(
keysURL
,
{
params
:
{
user_id
:
this
.
loginService
.
user
.
email
}
})
.
toPromise
(
);
}));
for
(
let
item
of
keys_data
)
{
let
app
=
data
.
find
((
app
:
any
)
=>
app
.
id
===
item
.
app_id
);
if
(
app
)
{
...
...
@@ -658,7 +658,7 @@ export class AppsService {
locale
=
'
en-US
'
;
}
let
updateUrl
=
App
.
updateUrl
(
app
,
process
.
platform
,
locale
,
os
.
arch
());
let
metalink
=
await
this
.
http
.
post
(
updateUrl
,
changedFiles
,
{
responseType
:
'
text
'
}).
toPromise
(
);
let
metalink
=
await
lastValueFrom
(
this
.
http
.
post
(
updateUrl
,
changedFiles
,
{
responseType
:
'
text
'
})
);
let
downloadDir
=
path
.
join
(
path
.
dirname
(
app
.
local
!
.
path
),
'
downloading
'
);
let
downloadId
=
await
this
.
downloadService
.
addMetalink
(
metalink
,
downloadDir
);
await
this
.
downloadService
.
progress
(
downloadId
,
(
status
:
DownloadStatus
)
=>
{
...
...
@@ -717,7 +717,7 @@ export class AppsService {
}
let
metalinkUrl
=
App
.
downloadUrl
(
_app
,
process
.
platform
,
locale
,
os
.
arch
());
_app
.
status
.
status
=
'
downloading
'
;
let
metalink
=
await
this
.
http
.
get
(
metalinkUrl
,{
responseType
:
'
text
'
}).
toPromise
(
);
let
metalink
=
await
lastValueFrom
(
this
.
http
.
get
(
metalinkUrl
,{
responseType
:
'
text
'
})
);
let
downloadId
=
await
this
.
downloadService
.
addMetalink
(
metalink
,
dir
);
try
{
await
this
.
downloadService
.
progress
(
downloadId
,
(
status
:
DownloadStatus
)
=>
{
...
...
@@ -1124,7 +1124,7 @@ export class AppsService {
}
let
checksumUrl
=
App
.
checksumUrl
(
app
,
process
.
platform
,
locale
,
os
.
arch
());
return
this
.
http
.
get
(
checksumUrl
,{
responseType
:
'
text
'
}).
pipe
(
map
((
response
)
=>
{
return
lastValueFrom
(
this
.
http
.
get
(
checksumUrl
,{
responseType
:
'
text
'
}).
pipe
(
map
((
response
)
=>
{
let
map
=
new
Map
<
string
,
string
>
();
for
(
let
line
of
response
.
split
(
'
\n
'
))
{
if
(
line
!==
''
)
{
...
...
@@ -1135,7 +1135,7 @@ export class AppsService {
}
}
return
map
;
}))
.
toPromise
(
);
})));
}
...
...
src/app/ygopro/ygopro.component.ts
View file @
0d7ce086
...
...
@@ -16,7 +16,7 @@ import fg from 'fast-glob';
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
WillNavigateEvent
=
Electron
.
WillNavigateEvent
;
import
Timer
=
NodeJS
.
Timer
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
lastValueFrom
,
Subscription
}
from
'
rxjs
'
;
interface
SystemConf
{
use_d3d
:
string
;
...
...
@@ -462,12 +462,11 @@ export class YGOProComponent implements OnInit, OnDestroy {
// https://mycard.moe/ygopro/api/user?username=ozxdno
try
{
let
points
=
await
this
.
http
.
get
<
any
>
(
'
https://mycard.moe/ygopro/api/user
'
,
{
let
points
=
await
lastValueFrom
(
this
.
http
.
get
<
any
>
(
'
https://mycard.moe/ygopro/api/user
'
,
{
params
:
{
username
:
this
.
loginService
.
user
.
username
}
})
.
toPromise
();
}));
this
.
points
.
emit
(
points
);
}
catch
(
error
)
{
console
.
log
(
error
);
...
...
@@ -611,15 +610,14 @@ export class YGOProComponent implements OnInit, OnDestroy {
win
.
restore
();
});
try
{
this
.
http
.
get
<
any
>
(
'
https://mycard.moe/ygopro/api/history
'
,
{
lastValueFrom
(
this
.
http
.
get
<
any
>
(
'
https://mycard.moe/ygopro/api/history
'
,
{
params
:
{
page
:
1
,
username
:
this
.
loginService
.
user
.
username
,
type
:
0
,
page_num
:
1
}
})
.
toPromise
()
}))
.
then
((
d
)
=>
{
start_time
=
d
.
data
[
0
].
start_time
;
});
...
...
@@ -627,8 +625,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
console
.
log
(
error
);
}
try
{
this
.
http
.
get
<
any
>
(
'
https://sapi.moecube.com:444/ygopro/arena/user
'
,
{
params
:
{
username
:
this
.
loginService
.
user
.
username
}
})
.
toPromise
()
lastValueFrom
(
this
.
http
.
get
<
any
>
(
'
https://sapi.moecube.com:444/ygopro/arena/user
'
,
{
params
:
{
username
:
this
.
loginService
.
user
.
username
}
}))
.
then
((
d2
)
=>
{
exp_rank_ex
=
d2
.
exp_rank
;
arena_rank_ex
=
d2
.
arena_rank
;
...
...
@@ -638,7 +635,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
}
});
try
{
await
this
.
http
.
get
<
any
>
(
'
https://mycard.moe/ygopro/api/history
'
,
{
await
lastValueFrom
(
this
.
http
.
get
<
any
>
(
'
https://mycard.moe/ygopro/api/history
'
,
{
params
:
{
page
:
1
,
username
:
this
.
loginService
.
user
.
username
,
...
...
@@ -646,19 +643,17 @@ export class YGOProComponent implements OnInit, OnDestroy {
type
:
0
,
page_num
:
1
}
})
.
toPromise
()
}))
.
then
((
d
)
=>
{
data
=
d
.
data
[
0
];
data
.
myname
=
this
.
loginService
.
user
.
username
;
});
await
this
.
http
.
get
<
any
>
(
'
https://sapi.moecube.com:444/ygopro/arena/user
'
,
{
await
lastValueFrom
(
this
.
http
.
get
<
any
>
(
'
https://sapi.moecube.com:444/ygopro/arena/user
'
,
{
params
:
{
username
:
this
.
loginService
.
user
.
username
}
})
.
toPromise
()
}))
.
then
((
data2
)
=>
{
data
.
athletic_win
=
data2
.
athletic_win
;
data
.
athletic_lose
=
data2
.
athletic_lose
;
...
...
webpack.config.js
View file @
0d7ce086
...
...
@@ -2,7 +2,10 @@ const CopyPlugin = require('copy-webpack-plugin');
module
.
exports
=
{
target
:
'
electron-renderer
'
,
externals
:
Object
.
fromEntries
([
'
bufferutil
'
,
'
utf-8-validate
'
].
map
((
pkg
)
=>
[
pkg
,
`commonjs2
${
pkg
}
`
])),
externals
:
{
bufferutil
:
'
commonjs2 bufferutil
'
,
'
utf-8-validate
'
:
'
commonjs2 utf-8-validate
'
,
},
plugins
:
[
new
CopyPlugin
({
patterns
:
[{
from
:
'
node_modules/candy/res
'
,
to
:
'
candy/res
'
}],
...
...
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