Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mycard Mobile
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
Mycard Mobile
Commits
a7cede6c
Commit
a7cede6c
authored
Jun 20, 2018
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换账号警告
parent
d5ed1549
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
10 deletions
+44
-10
package.json
package.json
+1
-1
src/app/app.module.ts
src/app/app.module.ts
+4
-2
src/app/lobby/lobby.component.html
src/app/lobby/lobby.component.html
+1
-1
src/app/lobby/lobby.component.ts
src/app/lobby/lobby.component.ts
+20
-1
src/app/logout-dialog/logout-dialog.component.css
src/app/logout-dialog/logout-dialog.component.css
+0
-0
src/app/logout-dialog/logout-dialog.component.html
src/app/logout-dialog/logout-dialog.component.html
+8
-0
src/app/logout-dialog/logout-dialog.component.ts
src/app/logout-dialog/logout-dialog.component.ts
+8
-0
src/app/match-dialog/match-dialog.component.css
src/app/match-dialog/match-dialog.component.css
+0
-3
src/app/match-dialog/match-dialog.component.html
src/app/match-dialog/match-dialog.component.html
+1
-1
src/app/result-dialog/result-dialog.component.html
src/app/result-dialog/result-dialog.component.html
+1
-1
No files found.
package.json
View file @
a7cede6c
{
"name"
:
"mycard-mobile"
,
"version"
:
"1.0.3
1
"
,
"version"
:
"1.0.3
2
"
,
"license"
:
"UNLISENCED"
,
"scripts"
:
{
"ng"
:
"ng"
,
...
...
src/app/app.module.ts
View file @
a7cede6c
...
...
@@ -40,6 +40,7 @@ import { HttpClientModule } from '@angular/common/http';
import
*
as
Raven
from
'
raven-js
'
;
import
{
DecksComponent
}
from
'
./decks/decks.component
'
;
import
{
ConfirmDialogComponent
}
from
'
./confirm-dialog/confirm-dialog.component
'
;
import
{
LogoutDialogComponent
}
from
'
./logout-dialog/logout-dialog.component
'
;
export
class
RavenErrorHandler
implements
ErrorHandler
{
handleError
(
err
:
any
):
void
{
...
...
@@ -67,7 +68,8 @@ if (environment.production) {
ToolbarComponent
,
ResultDialogComponent
,
DecksComponent
,
ConfirmDialogComponent
ConfirmDialogComponent
,
LogoutDialogComponent
],
imports
:
[
BrowserModule
,
...
...
@@ -96,6 +98,6 @@ if (environment.production) {
],
providers
:
[
YGOProService
,
StorageService
,
...
sentry
],
bootstrap
:
[
AppComponent
],
entryComponents
:
[
MatchDialogComponent
,
ResultDialogComponent
,
ConfirmDialogComponent
]
entryComponents
:
[
MatchDialogComponent
,
ResultDialogComponent
,
ConfirmDialogComponent
,
LogoutDialogComponent
]
})
export
class
AppModule
{}
src/app/lobby/lobby.component.html
View file @
a7cede6c
...
...
@@ -24,7 +24,7 @@
<mat-icon>
add
</mat-icon>
</button>
<mat-menu
#menu
="
matMenu
"
>
<a
[href]=
"login.
logout()"
mat-menu-item
>
切换用户
</a>
<a
(click)=
"
logout()"
mat-menu-item
>
切换用户
</a>
<button
mat-menu-item
>
大厅版本 {{version}}
</button>
<button
mat-menu-item
*ngIf=
"build"
>
应用版本 {{build.version_name}}
</button>
</mat-menu>
...
...
src/app/lobby/lobby.component.ts
View file @
a7cede6c
...
...
@@ -8,6 +8,8 @@ import { YGOProService } from '../ygopro.service';
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
distinctUntilChanged
,
filter
,
map
,
switchMap
}
from
'
rxjs/internal/operators
'
;
import
{
MatDialog
}
from
'
@angular/material
'
;
import
{
LogoutDialogComponent
}
from
'
../logout-dialog/logout-dialog.component
'
;
@
Component
({
selector
:
'
app-lobby
'
,
...
...
@@ -34,7 +36,13 @@ export class LobbyComponent {
arena_url
:
string
;
constructor
(
public
login
:
LoginService
,
public
ygopro
:
YGOProService
,
private
http
:
HttpClient
,
public
storage
:
StorageService
)
{
constructor
(
public
login
:
LoginService
,
public
ygopro
:
YGOProService
,
private
http
:
HttpClient
,
public
storage
:
StorageService
,
private
dialog
:
MatDialog
)
{
const
arena_url
=
new
URL
(
'
https://mycard.moe/ygopro/arena
'
);
arena_url
.
searchParams
.
set
(
'
sso
'
,
login
.
token
);
this
.
arena_url
=
arena_url
.
toString
();
...
...
@@ -54,6 +62,17 @@ export class LobbyComponent {
url
.
searchParams
.
set
(
'
key
'
,
key
);
open
(
url
.
toString
());
}
async
logout
()
{
if
(
await
this
.
dialog
.
open
(
LogoutDialogComponent
)
.
afterClosed
()
.
toPromise
()
)
{
location
.
href
=
this
.
login
.
logout
();
}
}
}
interface
BuildConfig
{
...
...
src/app/logout-dialog/logout-dialog.component.css
0 → 100644
View file @
a7cede6c
src/app/logout-dialog/logout-dialog.component.html
0 → 100644
View file @
a7cede6c
<h2
mat-dialog-title
>
切换账号
</h2>
<mat-dialog-content>
您当前的卡组绑定着当前的帐号。切换帐号后,卡组列表将只会有您新帐号所绑定的卡组。
</mat-dialog-content>
<mat-dialog-actions
align=
"end"
>
<button
mat-button
mat-dialog-close
>
取消
</button>
<button
mat-button
[mat-dialog-close]=
"true"
>
切换账号
</button>
</mat-dialog-actions>
src/app/logout-dialog/logout-dialog.component.ts
0 → 100644
View file @
a7cede6c
import
{
Component
}
from
'
@angular/core
'
;
@
Component
({
selector
:
'
app-logout-dialog
'
,
templateUrl
:
'
./logout-dialog.component.html
'
,
styleUrls
:
[
'
./logout-dialog.component.css
'
]
})
export
class
LogoutDialogComponent
{}
src/app/match-dialog/match-dialog.component.css
View file @
a7cede6c
...
...
@@ -8,9 +8,6 @@ mat-dialog-content {
display
:
flex
;
overflow
:
hidden
;
}
mat-dialog-actions
{
justify-content
:
flex-end
}
ul
{
margin
:
0
;
}
src/app/match-dialog/match-dialog.component.html
View file @
a7cede6c
...
...
@@ -11,6 +11,6 @@
<dd>
{{actual_wait | async | date: 'mm:ss'}}
</dd>
</ul>
</mat-dialog-content>
<mat-dialog-actions>
<mat-dialog-actions
align=
"end"
>
<button
mat-button
mat-dialog-close
>
取消
</button>
</mat-dialog-actions>
src/app/result-dialog/result-dialog.component.html
View file @
a7cede6c
...
...
@@ -17,7 +17,7 @@
</mat-list-item>
</mat-list>
</mat-dialog-content>
<mat-dialog-actions>
<mat-dialog-actions
align=
"end"
>
<button
mat-button
mat-dialog-close
>
关闭
</button>
<button
mat-button
[mat-dialog-close]=
"true"
>
再来一局
</button>
</mat-dialog-actions>
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