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
60b7db29
authored
Sep 01, 2025
by
Seefs
Committed by
GitHub
Sep 01, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1713 from seefs001/feature/channel_remark
feat: add channel remark #1710
parents
5bb73239
06785c01
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
model/channel.go
+1
-0
web/src/components/table/channels/ChannelsColumnDefs.jsx
+35
-0
web/src/components/table/channels/modals/EditChannelModal.jsx
+8
-0
No files found.
model/channel.go
View file @
60b7db29
...
...
@@ -47,6 +47,7 @@ type Channel struct {
Setting
*
string
`json:"setting" gorm:"type:text"`
// 渠道额外设置
ParamOverride
*
string
`json:"param_override" gorm:"type:text"`
HeaderOverride
*
string
`json:"header_override" gorm:"type:text"`
Remark
string
`json:"remark,omitempty" gorm:"type:varchar(255)" validate:"max=255"`
// add after v0.8.5
ChannelInfo
ChannelInfo
`json:"channel_info" gorm:"type:json"`
...
...
web/src/components/table/channels/ChannelsColumnDefs.jsx
View file @
60b7db29
...
...
@@ -35,6 +35,8 @@ import {
renderQuota
,
getChannelIcon
,
renderQuotaWithAmount
,
showSuccess
,
showError
,
}
from
'../../../helpers'
;
import
{
CHANNEL_OPTIONS
}
from
'../../../constants'
;
import
{
IconTreeTriangleDown
,
IconMore
}
from
'@douyinfe/semi-icons'
;
...
...
@@ -216,6 +218,39 @@ export const getChannelsColumns = ({
key
:
COLUMN_KEYS
.
NAME
,
title
:
t
(
'名称'
),
dataIndex
:
'name'
,
render
:
(
text
,
record
,
index
)
=>
{
if
(
record
.
remark
&&
record
.
remark
.
trim
()
!==
''
)
{
return
(
<
Tooltip
content=
{
<
div
className=
'flex flex-col gap-2 max-w-xs'
>
<
div
className=
'text-sm'
>
{
record
.
remark
}
</
div
>
<
Button
size=
'small'
type=
'primary'
theme=
'outline'
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
navigator
.
clipboard
.
writeText
(
record
.
remark
).
then
(()
=>
{
showSuccess
(
t
(
'复制成功'
));
}).
catch
(()
=>
{
showError
(
t
(
'复制失败'
));
});
}
}
>
{
t
(
'复制'
)
}
</
Button
>
</
div
>
}
trigger=
'hover'
position=
'topLeft'
>
<
span
>
{
text
}
</
span
>
</
Tooltip
>
);
}
return
text
;
},
},
{
key
:
COLUMN_KEYS
.
GROUP
,
...
...
web/src/components/table/channels/modals/EditChannelModal.jsx
View file @
60b7db29
...
...
@@ -1993,6 +1993,14 @@ const EditChannelModal = (props) => {
showClear
onChange=
{
(
value
)
=>
handleInputChange
(
'tag'
,
value
)
}
/>
<
Form
.
TextArea
field=
'remark'
label=
{
t
(
'备注'
)
}
placeholder=
{
t
(
'请输入备注(仅管理员可见)'
)
}
maxLength=
{
255
}
showClear
onChange=
{
(
value
)
=>
handleInputChange
(
'remark'
,
value
)
}
/>
<
Row
gutter=
{
12
}
>
<
Col
span=
{
12
}
>
...
...
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