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
940ff746
Commit
940ff746
authored
Jul 25, 2022
by
Syntax_J
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add filter username
parent
5844ace3
Pipeline
#14807
canceled with stages
in 2 minutes and 12 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
7 deletions
+47
-7
app/ygopro.component.css
app/ygopro.component.css
+4
-0
app/ygopro.component.html
app/ygopro.component.html
+6
-1
app/ygopro.component.ts
app/ygopro.component.ts
+32
-1
package-lock.json
package-lock.json
+5
-5
No files found.
app/ygopro.component.css
View file @
940ff746
...
...
@@ -294,3 +294,7 @@ form {
bottom
:
.75rem
;
width
:
500px
;
}
#title-filter-username
{
margin-left
:
6px
;
}
\ No newline at end of file
app/ygopro.component.html
View file @
940ff746
...
...
@@ -289,7 +289,12 @@
</div>
</div>
</th>
<th
i18n
class=
"title"
>
游戏标题
</th>
<th
class=
"title"
>
<div
class=
"d-flex"
>
<span
i18n
class=
"align-self-end"
>
游戏标题
</span>
<input
i18n-placeholder
type=
"text"
class=
"col-sm-6 form-control form-control-sm"
id=
"title-filter-username"
placeholder=
"支持玩家名称搜索房间"
[(ngModel)]=
"replay_rooms_filter.username"
(ngModelChange)=
"title_username_change_handler($event)"
/>
</div>
</th>
<th
i18n
class=
"users"
>
玩家
</th>
<th
i18n
class=
"extra"
>
额外选项
</th>
</tr>
...
...
app/ygopro.component.ts
View file @
940ff746
...
...
@@ -188,7 +188,8 @@ export class YGOProComponent implements OnInit, OnDestroy {
single
:
true
,
match
:
true
,
tag
:
true
,
windbot
:
false
windbot
:
false
,
username
:
''
};
matching
:
ISubscription
|
undefined
;
...
...
@@ -199,6 +200,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
join_password
:
string
;
host_password
=
(
this
.
loginService
.
user
.
external_id
^
0x54321
).
toString
();
title_username_change_handler
=
_
.
debounce
(
this
.
title_username_change
,
500
);
constructor
(
private
http
:
Http
,
private
appsService
:
AppsService
,
private
loginService
:
LoginService
,
public
settingsService
:
SettingsService
,
private
ref
:
ChangeDetectorRef
)
{
...
...
@@ -276,6 +278,35 @@ export class YGOProComponent implements OnInit, OnDestroy {
});
return
a_priority
-
b_priority
;
});
if
(
this
.
replay_rooms_filter
.
username
.
length
>
0
)
{
this
.
handle_filter_username
();
}
}
handle_filter_username
()
{
const
filter_username
=
this
.
replay_rooms_filter
.
username
.
toLowerCase
().
trim
();
if
(
filter_username
===
''
)
return
;
let
username_filter_rooms
=
[];
this
.
replay_rooms_show
.
forEach
(
room
=>
{
const
[
user_a
,
user_b
]
=
room
.
users
;
const
user_a_name
=
(
user_a
&&
user_a
.
username
.
toLowerCase
())
||
''
;
const
user_b_name
=
(
user_b
&&
user_b
.
username
.
toLowerCase
())
||
''
;
if
(
user_a_name
!==
''
||
user_b_name
!==
''
)
{
const
targetStr
=
`
${
user_a_name
}
/
${
user_b_name
}
`
;
if
(
targetStr
.
includes
(
filter_username
))
{
username_filter_rooms
.
push
(
room
);
}
}
});
this
.
replay_rooms_show
=
username_filter_rooms
;
}
title_username_change
(
input_value
:
string
)
{
if
(
input_value
.
length
)
{
this
.
handle_filter_username
();
}
else
{
this
.
refresh_replay_rooms
();
}
}
getYGOProData
(
app
:
App
)
{
...
...
package-lock.json
View file @
940ff746
{
"name"
:
"mycard"
,
"version"
:
"3.0.5
4
"
,
"version"
:
"3.0.5
8
"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
""
:
{
"version"
:
"3.0.5
4
"
,
"version"
:
"3.0.5
8
"
,
"hasInstallScript"
:
true
,
"license"
:
"
UNLICENSED
"
,
"license"
:
"
AGPL-3.0
"
,
"dependencies"
:
{
"@angular/animations"
:
"4.2.6"
,
"@angular/common"
:
"4.2.6"
,
...
...
@@ -34,7 +34,7 @@
"glob"
:
"7.1.2"
,
"ini"
:
"1.3.4"
,
"jquery"
:
"2.2.4"
,
"jquery-i18n"
:
"
github:
recurser/jquery-i18n"
,
"jquery-i18n"
:
"recurser/jquery-i18n"
,
"lodash"
:
"^4.17.21"
,
"marked"
:
"0.3.6"
,
"mustache"
:
"^4.2.0"
,
...
...
@@ -8904,7 +8904,7 @@
},
"jquery-i18n"
:
{
"version"
:
"git+ssh://git@github.com/recurser/jquery-i18n.git#513d1493729a1bb3c5c1937fb8604cf2aedb7884"
,
"from"
:
"jquery-i18n@
github:
recurser/jquery-i18n"
,
"from"
:
"jquery-i18n@recurser/jquery-i18n"
,
"requires"
:
{}
},
"js-tokens"
:
{
...
...
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