Skip to content

Commit ffe57ac

Browse files
netuserclaude
andcommitted
Release 2.1.17: node grouping and card/table view toggle in node monitor
- Add group_name field to Node model (auto-migrated) - Node management page: group field in create/edit dialog, group column in table - Node monitor page: group nodes by groupName, card/table view toggle - i18n: node.groupName, monitor.cardView, monitor.tableView, monitor.ungrouped Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f9a1680 commit ffe57ac

File tree

11 files changed

+284
-150
lines changed

11 files changed

+284
-150
lines changed

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Push Images Based on Version
22

33
# 在这里定义统一版本号
44
env:
5-
VERSION: "2.1.16"
5+
VERSION: "2.1.17"
66

77
on:
88
push:

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ services:
2525
retries: 10
2626

2727
node-binary-init:
28-
image: 0xnetuser/node-binary:2.1.16
28+
image: 0xnetuser/node-binary:2.1.17
2929
container_name: node-binary-init
3030
volumes:
3131
- node_binary:/data/node
3232
restart: "no"
3333

3434
backend:
35-
image: 0xnetuser/go-backend:2.1.16
35+
image: 0xnetuser/go-backend:2.1.17
3636
container_name: go-backend
3737
restart: unless-stopped
3838
environment:
@@ -65,7 +65,7 @@ services:
6565
start_period: 10s
6666

6767
frontend:
68-
image: 0xnetuser/nextjs-frontend:2.1.16
68+
image: 0xnetuser/nextjs-frontend:2.1.17
6969
container_name: nextjs-frontend
7070
restart: unless-stopped
7171
ports:

go-backend/dto/node.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
package dto
22

33
type NodeDto struct {
4-
Name string `json:"name" binding:"required"`
5-
Ip string `json:"ip"`
6-
EntryIps string `json:"entryIps"`
7-
ServerIp string `json:"serverIp" binding:"required"`
8-
PortSta int `json:"portSta"`
9-
PortEnd int `json:"portEnd"`
4+
Name string `json:"name" binding:"required"`
5+
Ip string `json:"ip"`
6+
EntryIps string `json:"entryIps"`
7+
ServerIp string `json:"serverIp" binding:"required"`
8+
PortSta int `json:"portSta"`
9+
PortEnd int `json:"portEnd"`
10+
GroupName string `json:"groupName"`
1011
}
1112

1213
type NodeUpdateDto struct {
13-
ID int64 `json:"id" binding:"required"`
14-
Name string `json:"name"`
15-
Ip string `json:"ip"`
16-
EntryIps string `json:"entryIps"`
17-
ServerIp string `json:"serverIp"`
18-
PortSta *int `json:"portSta"`
19-
PortEnd *int `json:"portEnd"`
14+
ID int64 `json:"id" binding:"required"`
15+
Name string `json:"name"`
16+
Ip string `json:"ip"`
17+
EntryIps string `json:"entryIps"`
18+
ServerIp string `json:"serverIp"`
19+
PortSta *int `json:"portSta"`
20+
PortEnd *int `json:"portEnd"`
21+
GroupName *string `json:"groupName"`
2022
}

go-backend/model/node.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type Node struct {
2020
UpdatedTime int64 `gorm:"column:updated_time" json:"updatedTime"`
2121
Status int `gorm:"column:status" json:"status"`
2222
Inx int `gorm:"column:inx" json:"inx"`
23+
GroupName string `gorm:"column:group_name" json:"groupName"`
2324
DisguiseName string `gorm:"column:disguise_name" json:"disguiseName"`
2425
XrayDisguiseName string `gorm:"column:xray_disguise_name" json:"vDisguiseName"`
2526
}

go-backend/service/monitor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func GetNodeHealthList() dto.R {
2929
"serverIp": n.ServerIp,
3030
"online": online,
3131
"version": n.Version,
32+
"groupName": n.GroupName,
3233
}
3334

3435
if online {

go-backend/service/node.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func CreateNode(d dto.NodeDto) dto.R {
8686
PortEnd: d.PortEnd,
8787
Secret: pkg.GenerateSecureSecret(),
8888
Status: 0,
89+
GroupName: d.GroupName,
8990
CreatedTime: time.Now().UnixMilli(),
9091
UpdatedTime: time.Now().UnixMilli(),
9192
DisguiseName: disguise,
@@ -132,6 +133,7 @@ func GetAllNodes() dto.R {
132133
"updatedTime": n.UpdatedTime,
133134
"status": status,
134135
"inx": n.Inx,
136+
"groupName": n.GroupName,
135137
"disguiseName": n.DisguiseName,
136138
"xrayDisguiseName": n.XrayDisguiseName,
137139
}
@@ -194,6 +196,9 @@ func UpdateNode(d dto.NodeUpdateDto) dto.R {
194196
if d.PortEnd != nil {
195197
updates["port_end"] = *d.PortEnd
196198
}
199+
if d.GroupName != nil {
200+
updates["group_name"] = *d.GroupName
201+
}
197202

198203
if err := DB.Model(&node).Updates(updates).Error; err != nil {
199204
return dto.Err("更新节点失败")

0 commit comments

Comments
 (0)