mirror of
https://github.com/status-im/re-frame-10x.git
synced 2025-02-05 02:43:25 +00:00
Move trace count info and clear button to table header
This commit is contained in:
parent
c6eac7807a
commit
d04a114838
@ -15,6 +15,10 @@
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#--re-frame-trace-- .text-button {
|
||||
border-bottom: 1px dotted #888;
|
||||
font-weight: normal;
|
||||
}
|
||||
#--re-frame-trace-- .icon-button {
|
||||
vertical-align: middle;
|
||||
font-size: 10px;
|
||||
|
@ -14,8 +14,8 @@
|
||||
[goog.object :as gob]
|
||||
[re-frame.interop :as interop]
|
||||
|
||||
[devtools.formatters.core :as devtools]
|
||||
))
|
||||
[devtools.formatters.core :as devtools]))
|
||||
|
||||
|
||||
(defn comp-name [c]
|
||||
(let [n (or (component/component-path c)
|
||||
@ -179,9 +179,6 @@
|
||||
(filter #(< slower-than-ms-int (:duration %))))
|
||||
transducers (apply comp (remove nil? [ms-filter op-filter]))
|
||||
showing-traces (sequence transducers @traces)
|
||||
filter-msg (if (and (str/blank? @filter-input) (str/blank? @slower-than-ms))
|
||||
(str "Filter " (count @traces) " events: ")
|
||||
(str "Filtering " (count showing-traces) " of " (count @traces) " events:"))
|
||||
padding {:padding "0px 5px 0px 5px"}
|
||||
save-query (fn [_]
|
||||
(swap! filter-items conj {:id (random-uuid)
|
||||
@ -189,7 +186,6 @@
|
||||
:filter-type @filter-type}))]
|
||||
[:div
|
||||
{:style {:padding "10px"}}
|
||||
[:span filter-msg "(" [:button.text-button {:on-click #(do (trace/reset-tracing!) (reset! traces []))} " Clear"] ")"] [:br]
|
||||
[:span
|
||||
[:select {:value @filter-type :on-change (fn [e]
|
||||
(reset! filter-type (.. e -target -value))
|
||||
@ -216,8 +212,15 @@
|
||||
[:table
|
||||
{:cell-spacing "0" :width "100%"}
|
||||
[:thead>tr
|
||||
[:th "operation"]
|
||||
[:th "event"]
|
||||
[:th "operations"]
|
||||
[:th
|
||||
(when (pos? (count showing-traces))
|
||||
(str (count showing-traces) " of "))
|
||||
(when (pos? (count @traces))
|
||||
(str (count @traces)))
|
||||
" events "
|
||||
(when (pos? (count @traces))
|
||||
[:span "(" [:button.text-button {:on-click #(do (trace/reset-tracing!) (reset! traces []))} "clear"] ")"])]
|
||||
[:th "meta"]]
|
||||
[:tbody (render-traces padding slower-than-bold-int showing-traces)]]]))))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user