Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
wenyuanwall
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
3rdeye
wenyuanwall
Commits
1accc1a8
Commit
1accc1a8
authored
Dec 26, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support multiple accounts things
parent
7ca94f4e
Pipeline
#42160
failed with stages
in 2 minutes and 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
16 deletions
+80
-16
src/app/app.component.html
src/app/app.component.html
+16
-10
src/app/app.component.ts
src/app/app.component.ts
+64
-6
No files found.
src/app/app.component.html
View file @
1accc1a8
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
</table>
</table>
</div>
</div>
</div>
</div>
<div
class=
"row grid"
*ngIf=
"whitelistResult?.length"
>
<div
class=
"row grid"
*ngIf=
"whitelist
Display
Result?.length"
>
<br>
<br>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
...
@@ -92,17 +92,23 @@
...
@@ -92,17 +92,23 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
*ngFor=
"let item of whitelistResult"
>
<tr
*ngFor=
"let row of whitelistDisplayResult"
>
<td>
{{item.name || ''}}
</td>
<td>
{{row.item.name || ''}}
</td>
<td>
{{item.account || ''}}
</td>
<td>
<td>
<
a
*ngIf=
"item.twitter"
[href]=
"getTwitterLink(item.twitter)"
target=
"_blank
"
>
<
div
*ngFor=
"let account of row.accounts
"
>
{{
truncateMiddle(item.twitter, 15)
}}
{{
account
}}
</
a
>
</
div
>
</td>
</td>
<td>
{{item.fee || ''}}
</td>
<td>
<td>
{{item.type || ''}}
</td>
<div
*ngFor=
"let twitter of row.twitters"
>
<td>
{{item.forbidden || ''}}
</td>
<a
[href]=
"getTwitterLink(twitter)"
target=
"_blank"
>
{{ truncateMiddle(twitter, 15) }}
</a>
</div>
</td>
<td>
{{row.item.fee || ''}}
</td>
<td>
{{row.item.type || ''}}
</td>
<td>
{{row.item.forbidden || ''}}
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
src/app/app.component.ts
View file @
1accc1a8
import
{
AfterViewInit
,
Component
}
from
'
@angular/core
'
;
import
{
AfterViewInit
,
Component
}
from
'
@angular/core
'
;
import
{
ToastService
}
from
'
./toast.service
'
;
import
{
ToastService
}
from
'
./toast.service
'
;
import
{
ApiService
}
from
'
./api/services/api.service
'
;
import
{
lastValueFrom
}
from
'
rxjs
'
;
import
{
lastValueFrom
}
from
'
rxjs
'
;
import
*
as
moment
from
'
moment
'
;
import
*
as
moment
from
'
moment
'
;
import
{
import
{
Ad
,
Ad
,
BlacklistAccountResultDto
,
BlacklistAccountResultDto
,
WhitelistAccountResultDto
,
WhitelistAccountResultDto
,
WhitelistAccountRefResultDto
,
}
from
'
./api/models
'
;
}
from
'
./api/models
'
;
import
{
AdService
,
BlacklistAccountService
,
WhitelistAccountService
,
}
from
'
./api/services
'
;
@
Component
({
@
Component
({
selector
:
'
app-root
'
,
selector
:
'
app-root
'
,
...
@@ -21,7 +26,17 @@ export class AppComponent implements AfterViewInit {
...
@@ -21,7 +26,17 @@ export class AppComponent implements AfterViewInit {
ad
:
Ad
|
null
=
null
;
ad
:
Ad
|
null
=
null
;
blacklistResult
?:
BlacklistAccountResultDto
[];
blacklistResult
?:
BlacklistAccountResultDto
[];
whitelistResult
?:
WhitelistAccountResultDto
[];
whitelistResult
?:
WhitelistAccountResultDto
[];
constructor
(
public
toast
:
ToastService
,
private
api
:
ApiService
)
{}
whitelistDisplayResult
?:
Array
<
{
item
:
WhitelistAccountResultDto
|
WhitelistAccountRefResultDto
;
accounts
:
string
[];
twitters
:
string
[];
}
>
;
constructor
(
public
toast
:
ToastService
,
private
adService
:
AdService
,
private
blacklistAccountService
:
BlacklistAccountService
,
private
whitelistAccountService
:
WhitelistAccountService
)
{}
ngAfterViewInit
()
{
ngAfterViewInit
()
{
this
.
initAd
();
this
.
initAd
();
...
@@ -35,7 +50,9 @@ export class AppComponent implements AfterViewInit {
...
@@ -35,7 +50,9 @@ export class AppComponent implements AfterViewInit {
try
{
try
{
const
adId
=
new
URLSearchParams
(
window
.
location
.
search
).
get
(
'
ad
'
);
const
adId
=
new
URLSearchParams
(
window
.
location
.
search
).
get
(
'
ad
'
);
const
{
data
:
ad
}
=
await
lastValueFrom
(
const
{
data
:
ad
}
=
await
lastValueFrom
(
this
.
api
.
adControllerGetAd
(
adId
?
{
id
:
parseInt
(
adId
)
}
:
undefined
)
this
.
adService
.
adControllerGetAd
(
adId
?
{
id
:
parseInt
(
adId
)
}
:
undefined
)
);
);
if
(
ad
)
{
if
(
ad
)
{
this
.
ad
=
ad
;
this
.
ad
=
ad
;
...
@@ -55,7 +72,7 @@ export class AppComponent implements AfterViewInit {
...
@@ -55,7 +72,7 @@ export class AppComponent implements AfterViewInit {
async
onAdClick
()
{
async
onAdClick
()
{
const
clickResult
=
await
lastValueFrom
(
const
clickResult
=
await
lastValueFrom
(
this
.
a
pi
.
adControllerClickAd
({
id
:
this
.
ad
!
.
id
!
})
this
.
a
dService
.
adControllerClickAd
({
id
:
this
.
ad
!
.
id
!
})
);
);
if
(
clickResult
?.
data
)
{
if
(
clickResult
?.
data
)
{
this
.
openInNewTab
(
clickResult
.
data
);
this
.
openInNewTab
(
clickResult
.
data
);
...
@@ -70,14 +87,16 @@ export class AppComponent implements AfterViewInit {
...
@@ -70,14 +87,16 @@ export class AppComponent implements AfterViewInit {
async
searchWhitelist
(
account
?:
string
)
{
async
searchWhitelist
(
account
?:
string
)
{
this
.
whitelistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
this
.
whitelistDisplayResult
=
undefined
;
const
{
data
}
=
await
lastValueFrom
(
const
{
data
}
=
await
lastValueFrom
(
this
.
api
.
whitelistAccountControllerFindAll
({
this
.
whitelistAccountService
.
whitelistAccountControllerFindAll
({
recordsPerPage
:
5
,
recordsPerPage
:
5
,
account
:
account
||
undefined
,
account
:
account
||
undefined
,
random
:
account
?
0
:
1
,
random
:
account
?
0
:
1
,
})
})
);
);
this
.
whitelistResult
=
data
;
this
.
whitelistResult
=
data
;
this
.
whitelistDisplayResult
=
this
.
buildWhitelistDisplayResult
(
data
);
}
}
async
checkSearch
(
allowEmpty
=
false
)
{
async
checkSearch
(
allowEmpty
=
false
)
{
...
@@ -102,13 +121,14 @@ export class AppComponent implements AfterViewInit {
...
@@ -102,13 +121,14 @@ export class AppComponent implements AfterViewInit {
async
onBlacklistSearch
()
{
async
onBlacklistSearch
()
{
this
.
blacklistResult
=
undefined
;
this
.
blacklistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
this
.
whitelistDisplayResult
=
undefined
;
const
search
=
this
.
search
.
trim
();
const
search
=
this
.
search
.
trim
();
if
(
!
(
await
this
.
checkSearch
()))
{
if
(
!
(
await
this
.
checkSearch
()))
{
return
;
return
;
}
}
try
{
try
{
const
{
data
}
=
await
lastValueFrom
(
const
{
data
}
=
await
lastValueFrom
(
this
.
api
.
blacklistAccountControllerFindAll
({
this
.
blacklistAccountService
.
blacklistAccountControllerFindAll
({
recordsPerPage
:
100
,
recordsPerPage
:
100
,
account
:
search
,
account
:
search
,
})
})
...
@@ -126,6 +146,7 @@ export class AppComponent implements AfterViewInit {
...
@@ -126,6 +146,7 @@ export class AppComponent implements AfterViewInit {
async
onWhitelistSearch
()
{
async
onWhitelistSearch
()
{
this
.
blacklistResult
=
undefined
;
this
.
blacklistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
this
.
whitelistDisplayResult
=
undefined
;
const
search
=
this
.
search
.
trim
();
const
search
=
this
.
search
.
trim
();
if
(
!
(
await
this
.
checkSearch
()))
{
if
(
!
(
await
this
.
checkSearch
()))
{
return
;
return
;
...
@@ -141,6 +162,7 @@ export class AppComponent implements AfterViewInit {
...
@@ -141,6 +162,7 @@ export class AppComponent implements AfterViewInit {
async
onRandomSearch
()
{
async
onRandomSearch
()
{
this
.
blacklistResult
=
undefined
;
this
.
blacklistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
this
.
whitelistDisplayResult
=
undefined
;
try
{
try
{
await
this
.
searchWhitelist
();
await
this
.
searchWhitelist
();
...
@@ -157,4 +179,40 @@ export class AppComponent implements AfterViewInit {
...
@@ -157,4 +179,40 @@ export class AppComponent implements AfterViewInit {
const
keep
=
Math
.
floor
((
maxLength
-
3
)
/
2
);
// -3 for '...'
const
keep
=
Math
.
floor
((
maxLength
-
3
)
/
2
);
// -3 for '...'
return
text
.
slice
(
0
,
keep
)
+
'
...
'
+
text
.
slice
(
-
keep
);
return
text
.
slice
(
0
,
keep
)
+
'
...
'
+
text
.
slice
(
-
keep
);
}
}
private
buildWhitelistDisplayResult
(
data
?:
WhitelistAccountResultDto
[]):
|
Array
<
{
item
:
WhitelistAccountResultDto
|
WhitelistAccountRefResultDto
;
accounts
:
string
[];
twitters
:
string
[];
}
>
|
undefined
{
if
(
!
data
)
{
return
undefined
;
}
return
data
.
map
((
entry
)
=>
{
const
item
=
entry
.
ref
??
entry
;
const
accounts
=
this
.
uniqueNonEmptyStrings
([
item
.
account
,
...(
item
.
refs
?.
map
((
refEntry
)
=>
refEntry
.
account
)
||
[]),
]);
const
twitters
=
this
.
uniqueNonEmptyStrings
([
item
.
twitter
,
...(
item
.
refs
?.
map
((
refEntry
)
=>
refEntry
.
twitter
)
||
[]),
]).
filter
((
s
)
=>
s
&&
!
s
.
includes
(
'
无
'
));
return
{
item
,
accounts
,
twitters
};
});
}
private
uniqueNonEmptyStrings
(
values
:
Array
<
string
|
undefined
>
):
string
[]
{
const
seen
=
new
Set
<
string
>
();
for
(
const
value
of
values
)
{
const
normalized
=
value
?.
trim
();
if
(
!
normalized
)
{
continue
;
}
seen
.
add
(
normalized
);
}
return
Array
.
from
(
seen
);
}
}
}
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