feat(webui): responsive tweaks for mobile; seed channels from config when DB empty; expose KnownChannels on server
This commit is contained in:
parent
bb60430df2
commit
f78dc43374
2 changed files with 10 additions and 0 deletions
|
|
@ -40,6 +40,8 @@ type Server struct {
|
|||
Commit string
|
||||
BuiltAt string
|
||||
StartedAt time.Time
|
||||
// Optional seed list from config for /api/channels when DB is empty
|
||||
KnownChannels []string
|
||||
}
|
||||
|
||||
func (s *Server) Start(ctx context.Context) error {
|
||||
|
|
@ -217,6 +219,10 @@ func (s *Server) handleUI(w http.ResponseWriter, r *http.Request) {
|
|||
body { padding: 1rem; }
|
||||
pre { max-height: 50vh; overflow: auto; }
|
||||
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
|
||||
@media (max-width: 768px) {
|
||||
.grid { grid-template-columns: 1fr !important; }
|
||||
pre { max-height: 40vh; }
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
const st={token: localStorage.getItem('token')||''};
|
||||
|
|
@ -328,6 +334,9 @@ func (s *Server) handleChannels(w http.ResponseWriter, r *http.Request) {
|
|||
_, _ = w.Write([]byte("store error"))
|
||||
return
|
||||
}
|
||||
if len(chs) == 0 && len(s.KnownChannels) > 0 {
|
||||
chs = append(chs, s.KnownChannels...)
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_ = json.NewEncoder(w).Encode(chs)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue