feat: filter inbounds and clients by node (#4997)

Multi-node panels had no way to narrow the inbounds or clients lists to
a single node. Add a node filter to both pages:

- Inbounds: a toolbar select (All / Local / each node) that filters the
  list client-side; shown only when the panel has nodes or node-attached
  inbounds.
- Clients: a Nodes multi-select in the filter drawer. Node selections
  are mapped onto inbound IDs client-side and fed through the existing
  inbound CSV paging parameter, so the paging backend is untouched; an
  impossible id (-1) is sent when no inbound matches so the filter
  yields an honest empty result. InboundOption now carries nodeId to
  make the mapping possible.

The local panel is selectable via a 0 sentinel (inbounds without a
nodeId). New i18n keys in all 13 locales.
This commit is contained in:
MHSanaei
2026-06-12 09:33:35 +02:00
parent d04cb10971
commit 253063b785
24 changed files with 176 additions and 11 deletions
+6 -1
View File
@@ -295,6 +295,9 @@ type InboundOption struct {
Port int `json:"port" example:"443"`
TlsFlowCapable bool `json:"tlsFlowCapable" example:"true"`
SsMethod string `json:"ssMethod"`
// Hosting node; nil for this panel's own inbounds. Lets the clients
// page map a node filter onto inbound IDs (#4997).
NodeId *int `json:"nodeId,omitempty"`
}
func (s *InboundService) GetInboundOptions(userId int) ([]InboundOption, error) {
@@ -307,9 +310,10 @@ func (s *InboundService) GetInboundOptions(userId int) ([]InboundOption, error)
Port int `gorm:"column:port"`
StreamSettings string `gorm:"column:stream_settings"`
Settings string `gorm:"column:settings"`
NodeId *int `gorm:"column:node_id"`
}
err := db.Table("inbounds").
Select("id, remark, tag, protocol, port, stream_settings, settings").
Select("id, remark, tag, protocol, port, stream_settings, settings, node_id").
Where("user_id = ?", userId).
Order("id ASC").
Scan(&rows).Error
@@ -326,6 +330,7 @@ func (s *InboundService) GetInboundOptions(userId int) ([]InboundOption, error)
Port: r.Port,
TlsFlowCapable: inboundCanEnableTlsFlow(r.Protocol, r.StreamSettings, r.Settings),
SsMethod: inboundShadowsocksMethod(r.Protocol, r.Settings),
NodeId: r.NodeId,
})
}
return out, nil
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "ابحث بالبريد، التعليق، sub ID، UUID، كلمة المرور، auth…",
"filterTitle": "تصفية العملاء",
"clearAllFilters": "مسح الكل",
"filters": {
"nodes": "النودز",
"localPanel": "محلي (هذه اللوحة)"
},
"showingCount": "عرض {shown} من {total}",
"sortOldest": "الأقدم أولاً",
"sortNewest": "الأحدث أولاً",
+4
View File
@@ -674,6 +674,10 @@
"searchPlaceholder": "Search email, comment, sub ID, UUID, password, auth…",
"filterTitle": "Filter clients",
"clearAllFilters": "Clear all",
"filters": {
"nodes": "Nodes",
"localPanel": "Local (this panel)"
},
"showingCount": "Showing {shown} of {total}",
"sortOldest": "Oldest first",
"sortNewest": "Newest first",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "Buscar email, comentario, sub ID, UUID, contraseña, auth…",
"filterTitle": "Filtrar clientes",
"clearAllFilters": "Limpiar todo",
"filters": {
"nodes": "Nodos",
"localPanel": "Local (este panel)"
},
"showingCount": "Mostrando {shown} de {total}",
"sortOldest": "Más antiguos",
"sortNewest": "Más recientes",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "جستجوی ایمیل، توضیح، Sub ID، UUID، رمز، احراز...",
"filterTitle": "فیلتر کاربران",
"clearAllFilters": "پاک کردن همه",
"filters": {
"nodes": "نودها",
"localPanel": "محلی (همین پنل)"
},
"showingCount": "نمایش {shown} از {total}",
"sortOldest": "قدیمی‌ترین",
"sortNewest": "جدیدترین",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "Cari email, komentar, sub ID, UUID, kata sandi, auth…",
"filterTitle": "Filter klien",
"clearAllFilters": "Hapus semua",
"filters": {
"nodes": "Node",
"localPanel": "Lokal (panel ini)"
},
"showingCount": "Menampilkan {shown} dari {total}",
"sortOldest": "Terlama dulu",
"sortNewest": "Terbaru dulu",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "メール、コメント、sub ID、UUID、パスワード、auth を検索…",
"filterTitle": "クライアントをフィルタ",
"clearAllFilters": "すべてクリア",
"filters": {
"nodes": "ノード",
"localPanel": "ローカル(このパネル)"
},
"showingCount": "{total} 件中 {shown} 件を表示",
"sortOldest": "古い順",
"sortNewest": "新しい順",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "Buscar email, comentário, sub ID, UUID, senha, auth…",
"filterTitle": "Filtrar clientes",
"clearAllFilters": "Limpar tudo",
"filters": {
"nodes": "Nós",
"localPanel": "Local (este painel)"
},
"showingCount": "Mostrando {shown} de {total}",
"sortOldest": "Mais antigos primeiro",
"sortNewest": "Mais novos primeiro",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "Поиск email, комментария, sub ID, UUID, пароля, auth…",
"filterTitle": "Фильтр клиентов",
"clearAllFilters": "Очистить все",
"filters": {
"nodes": "Узлы",
"localPanel": "Локально (эта панель)"
},
"showingCount": "Показано {shown} из {total}",
"sortOldest": "Сначала старые",
"sortNewest": "Сначала новые",
+4
View File
@@ -674,6 +674,10 @@
"searchPlaceholder": "E-posta, yorum, sub ID, UUID, parola, auth ara…",
"filterTitle": "Kullanıcıları Filtrele",
"clearAllFilters": "Tümünü Temizle",
"filters": {
"nodes": "Düğümler",
"localPanel": "Yerel (bu panel)"
},
"showingCount": "{total} içinden {shown} gösteriliyor",
"sortOldest": "Önce En Eski",
"sortNewest": "Önce En Yeni",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "Пошук email, коментаря, sub ID, UUID, паролю, auth…",
"filterTitle": "Фільтр клієнтів",
"clearAllFilters": "Очистити все",
"filters": {
"nodes": "Вузли",
"localPanel": "Локально (ця панель)"
},
"showingCount": "Показано {shown} з {total}",
"sortOldest": "Спочатку старі",
"sortNewest": "Спочатку нові",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "Tìm email, ghi chú, sub ID, UUID, mật khẩu, auth…",
"filterTitle": "Lọc client",
"clearAllFilters": "Xóa tất cả",
"filters": {
"nodes": "Nút",
"localPanel": "Cục bộ (bảng này)"
},
"showingCount": "Hiển thị {shown} trên {total}",
"sortOldest": "Cũ nhất trước",
"sortNewest": "Mới nhất trước",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "搜索邮箱、备注、sub ID、UUID、密码、auth…",
"filterTitle": "筛选客户端",
"clearAllFilters": "清除全部",
"filters": {
"nodes": "节点",
"localPanel": "本机(此面板)"
},
"showingCount": "显示 {shown} / {total}",
"sortOldest": "最旧优先",
"sortNewest": "最新优先",
+4
View File
@@ -673,6 +673,10 @@
"searchPlaceholder": "搜尋電子郵件、備註、sub ID、UUID、密碼、auth…",
"filterTitle": "篩選客戶端",
"clearAllFilters": "清除全部",
"filters": {
"nodes": "節點",
"localPanel": "本機(此面板)"
},
"showingCount": "顯示 {shown} / {total}",
"sortOldest": "最舊優先",
"sortNewest": "最新優先",