Веб-морда: поиск, фильтры, сортировка и пагинация клиентов; раскладка настроек
- список клиентов: поиск по домену и названию, фильтр по статусу (чипы со счётчиками), сортировка по любой колонке, пагинация 10/25/50/100; состояние в URL — отфильтрованный вид можно сохранить ссылкой - размеры последних бэкапов одним запросом вместо запроса на клиента - шапка выровнена по колонке контента; настройки на всю ширину: ntfy и Telegram двумя карточками, на узком экране — друг под другом Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6942605c1
commit
83832fc734
8 files changed
+626
-179
No files matched your search
@@ -122,24 +122,6 @@ type clientRow struct {
|
||||
LastSize int64
|
||||
}
|
||||
|
||||
func (s *Server) webClients(w http.ResponseWriter, r *http.Request) {
|
||||
clients, err := s.st.ListClients()
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
var rows []clientRow
|
||||
for _, c := range clients {
|
||||
row := clientRow{Client: c}
|
||||
row.StatusClass, row.StatusText = clientStatus(c)
|
||||
if b, err := s.st.LatestComplete(c.ID); err == nil {
|
||||
row.LastSize = b.TotalSize
|
||||
}
|
||||
rows = append(rows, row)
|
||||
}
|
||||
s.render(w, r, "clients", map[string]any{"Clients": rows})
|
||||
}
|
||||
|
||||
func (s *Server) webClientNew(w http.ResponseWriter, r *http.Request) {
|
||||
s.render(w, r, "client_new", nil)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user