2018-08-09 11:28:37 +02:00
|
|
|
(ns sliva.pages.hub
|
2018-08-10 16:35:52 +02:00
|
|
|
(:require [sliva.data :refer [appstate]]
|
|
|
|
[sliva.pages.navigation :refer [navigation]]))
|
2018-08-09 11:28:37 +02:00
|
|
|
|
|
|
|
(defn hub []
|
|
|
|
[:div
|
|
|
|
[:h1 "Connected clients"]
|
|
|
|
[:table
|
|
|
|
[:thead
|
|
|
|
[:tr
|
|
|
|
[:th "Client ID"]
|
2018-08-10 16:35:52 +02:00
|
|
|
[:th "status"]]]
|
2018-08-09 11:28:37 +02:00
|
|
|
[:tbody
|
2018-08-10 16:35:52 +02:00
|
|
|
(let [clients (:clients @appstate)]
|
|
|
|
(if (empty? clients)
|
|
|
|
[:tr [:td "No"] [:td "clients"]]
|
|
|
|
(->> clients
|
|
|
|
(map-indexed (fn [idx cid]
|
|
|
|
[:tr {:key idx}
|
|
|
|
[:td cid]
|
|
|
|
[:td "connected"]])))))]]
|
|
|
|
(navigation)])
|