Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
792d24d2
authored
Nov 19, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 一键编辑标签下渠道重定向
parent
6463ad69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
controller/channel.go
+7
-6
web/src/components/ChannelsTable.js
+1
-1
web/src/pages/Channel/EditTagModal.js
+7
-4
No files found.
controller/channel.go
View file @
792d24d2
...
...
@@ -158,8 +158,8 @@ func SearchChannels(c *gin.Context) {
keyword
:=
c
.
Query
(
"keyword"
)
group
:=
c
.
Query
(
"group"
)
modelKeyword
:=
c
.
Query
(
"model"
)
//
idSort, _ := strconv.ParseBool(c.Query("id_sort"))
channels
,
err
:=
model
.
SearchChannels
(
keyword
,
group
,
modelKeyword
)
idSort
,
_
:=
strconv
.
ParseBool
(
c
.
Query
(
"id_sort"
))
channels
,
err
:=
model
.
SearchChannels
(
keyword
,
group
,
modelKeyword
,
idSort
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
...
...
@@ -294,10 +294,11 @@ func DeleteDisabledChannel(c *gin.Context) {
}
type
ChannelTag
struct
{
Tag
string
`json:"tag"`
NewTag
*
string
`json:"newTag"`
Priority
*
int64
`json:"priority"`
Weight
*
uint
`json:"weight"`
Tag
string
`json:"tag"`
NewTag
*
string
`json:"new_tag"`
Priority
*
int64
`json:"priority"`
Weight
*
uint
`json:"weight"`
MapMapping
*
string
`json:"map_mapping"`
}
func
DisableTagChannels
(
c
*
gin
.
Context
)
{
...
...
web/src/components/ChannelsTable.js
View file @
792d24d2
...
...
@@ -691,7 +691,7 @@ const ChannelsTable = () => {
}
setSearching
(
true
);
const
res
=
await
API
.
get
(
`/api/channel/search?keyword=
${
searchKeyword
}
&group=
${
searchGroup
}
&model=
${
searchModel
}
`
`/api/channel/search?keyword=
${
searchKeyword
}
&group=
${
searchGroup
}
&model=
${
searchModel
}
&id_sort=
${
idSort
}
`
);
const
{
success
,
message
,
data
}
=
res
.
data
;
if
(
success
)
{
...
...
web/src/pages/Channel/EditTagModal.js
View file @
792d24d2
...
...
@@ -8,7 +8,8 @@ const EditTagModal = (props) => {
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
originInputs
=
{
tag
:
''
,
newTag
:
null
,
new_tag
:
null
,
model_mapping
:
null
,
}
const
[
inputs
,
setInputs
]
=
useState
(
originInputs
);
...
...
@@ -18,11 +19,13 @@ const EditTagModal = (props) => {
let
data
=
{
tag
:
tag
,
}
let
shouldSave
=
true
;
if
(
inputs
.
newTag
===
tag
)
{
setLoading
(
false
);
return
;
}
if
(
inputs
.
model_mapping
!==
null
)
{
data
.
model_mapping
=
inputs
.
model
}
data
.
newTag
=
inputs
.
newTag
;
if
(
data
.
newTag
===
''
)
{
Modal
.
confirm
({
...
...
@@ -80,8 +83,8 @@ const EditTagModal = (props) => {
<
TextInput
label
=
"新标签(留空则解散标签,不会删除标签下的渠道)"
name
=
"newTag"
value
=
{
inputs
.
new
T
ag
}
onChange
=
{(
value
)
=>
setInputs
({
...
inputs
,
new
T
ag
:
value
})}
value
=
{
inputs
.
new
_t
ag
}
onChange
=
{(
value
)
=>
setInputs
({
...
inputs
,
new
_t
ag
:
value
})}
placeholder
=
"请输入新标签"
/>
<
/Spin
>
...
...
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