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
1277a247
Commit
1277a247
authored
Sep 11, 2021
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maybe works
parent
3c91aebc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
src/app/ygopro/ygopro.component.html
src/app/ygopro/ygopro.component.html
+17
-8
src/app/ygopro/ygopro.component.ts
src/app/ygopro/ygopro.component.ts
+4
-2
No files found.
src/app/ygopro/ygopro.component.html
View file @
1277a247
...
@@ -27,15 +27,24 @@
...
@@ -27,15 +27,24 @@
<div
class=
"col-sm-8 input-group input-group-sm"
>
<div
class=
"col-sm-8 input-group input-group-sm"
>
<label
i18n
class=
"input-group-text"
id=
"basic-addon1"
>
卡组
</label>
<label
i18n
class=
"input-group-text"
id=
"basic-addon1"
>
卡组
</label>
<select
class=
"form-select form-select-sm"
id=
"exampleSelect1"
name=
"deck"
[(ngModel)]=
"current_deck"
>
<select
class=
"form-select form-select-sm"
id=
"exampleSelect1"
name=
"deck"
[(ngModel)]=
"current_deck"
>
<option
*ngFor=
"let deck of group[1]"
[value]=
"group[0] + '/' + deck"
>
{{deck}}
</option>
<option
*ngFor=
"let deck of decks_grouped['.']"
[value]=
"deck"
>
{{deck}}
</option>
<ng-container
*ngFor=
"let group of deckGroup()"
>
<ng-container
*ngFor=
"let group of decks_grouped | keyvalue"
>
<ng-container
*ngIf=
"group[0] == '.'; else #x"
>
<optgroup
*ngIf=
"group.key !== '.'"
[label]=
'group.key'
>
<option
*ngFor=
"let deck of group.value"
[value]=
"group.key + '/' + deck"
>
{{deck}}
</option>
</ng-container>
</optgroup>
<ng-template
#elseBlock
>
Content to render when condition is false.
</ng-template>
<optgroup
[label]=
"group[0]"
></optgroup>
<option
*ngFor=
"let deck of group[1]"
[value]=
"group[0] + '/' + deck"
>
{{deck}}
</option>
</ng-container>
</ng-container>
<!-- <option *ngFor="let deck of group[1]" [value]="group[0] + '/' + deck">{{deck}}</option>-->
<!-- -->
<!-- <ng-container *ngFor="let group of deck_grouped | keyvalue">-->
<!-- <ng-container *ngIf="group[0] == '.'; else #x">-->
<!-- </ng-container>-->
<!-- <ng-template #elseBlock>Content to render when condition is false.</ng-template>-->
<!-- <optgroup [label]="group[0]"></optgroup>-->
<!-- <option *ngFor="let deck of group[1]" [value]="group[0] + '/' + deck">{{deck}}</option>-->
<!-- </ng-container>-->
</select>
</select>
<span
class=
"input-group-btn"
>
<span
class=
"input-group-btn"
>
<button
id=
"edit_deck_button"
i18n
[disabled]=
"!appsService.allReady(app)"
class=
"btn btn-secondary btn-sm"
(click)=
"edit_deck(current_deck)"
>
编辑
</button>
<button
id=
"edit_deck_button"
i18n
[disabled]=
"!appsService.allReady(app)"
class=
"btn btn-secondary btn-sm"
(click)=
"edit_deck(current_deck)"
>
编辑
</button>
...
...
src/app/ygopro/ygopro.component.ts
View file @
1277a247
...
@@ -137,7 +137,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
...
@@ -137,7 +137,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
@
Output
()
@
Output
()
points
:
EventEmitter
<
any
>
=
new
EventEmitter
();
points
:
EventEmitter
<
any
>
=
new
EventEmitter
();
decks
:
string
[]
=
[];
decks
:
string
[]
=
[];
decks_grouped
:
Record
<
string
,
string
[]
>
;
decks_grouped
:
Record
<
string
,
string
[]
>
=
{}
;
replays
:
string
[]
=
[];
replays
:
string
[]
=
[];
current_deck
:
string
;
current_deck
:
string
;
system_conf
?:
string
;
system_conf
?:
string
;
...
@@ -492,6 +492,8 @@ export class YGOProComponent implements OnInit, OnDestroy {
...
@@ -492,6 +492,8 @@ export class YGOProComponent implements OnInit, OnDestroy {
}
else
if
(
init
)
{
}
else
if
(
init
)
{
this
.
current_deck
=
this
.
decks
[
0
];
this
.
current_deck
=
this
.
decks
[
0
];
}
}
console
.
log
(
this
.
current_deck
)
}
}
this
.
replays
=
await
this
.
get_replays
();
this
.
replays
=
await
this
.
get_replays
();
...
@@ -513,7 +515,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
...
@@ -513,7 +515,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
async
get_decks
():
Promise
<
string
[]
>
{
async
get_decks
():
Promise
<
string
[]
>
{
try
{
try
{
return
fg
.
sync
(
'
**/*.ydk
'
,
{
cwd
:
this
.
app
.
ygoproDeckPath
}
);
return
(
await
fg
(
'
**/*.ydk
'
,
{
cwd
:
this
.
app
.
ygoproDeckPath
})).
map
(
d
=>
d
.
slice
(
0
,
-
4
)
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`Load deck fail:
${
error
.
toString
()}
`
);
console
.
error
(
`Load deck fail:
${
error
.
toString
()}
`
);
return
[];
return
[];
...
...
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