Set a print limit of 400 characters in the event header

This commit is contained in:
Daniel Compton 2018-01-26 14:43:09 +13:00
parent 40f33585f0
commit 05c9f84225
3 changed files with 13 additions and 6 deletions

View File

@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file. This change
### Changed
* Updated bundled re-frame version to 0.10.3, and bundled reagent version to 0.7.0. This shouldn't impact your project's dependencies as they are source bundled via [mranderson](https://github.com/benedekfazekas/mranderson).
* Add hyperlinks to docs
### Fixed
* Set a print limit of 400 characters in the event header, to prevent very large events from DOSing the host application.
* XML encode # character in SVGs, fixing [#130](https://github.com/Day8/re-frame-trace/issues/130).
* Fix the reset tracing button in the traces panel.
* Fix a bug when there is only one traced event, re-frame-trace would allow you to go back an epoch, throwing an exception.
## [0.1.15] - 2018-01-24

View File

@ -99,7 +99,7 @@
:overflow-x "hidden"
:overflow-y "auto"
:background-color "white"}
:children [[:span.event-header (prn-str current-event)]]]
:children [[:span.event-header (subs (prn-str current-event) 0 400)]]]
[:span.arrow (if newer-epochs-available?
{:on-click #(rf/dispatch [:epochs/next-epoch])}
{:class "arrow__disabled"})

View File

@ -73,11 +73,10 @@
[:td.trace--details-tags {:col-span 2
:on-click #(.log js/console tags)}
[:div.trace--details-tags-text
(let [tag-str (with-out-str (pprint/pprint tags))
string-size-limit 400]
(if (< string-size-limit (count tag-str))
(str (subs tag-str 0 string-size-limit) " ...")
tag-str))]]
(let [tag-str (prn-str tags)]
(str (subs tag-str 0 400)
(when (< 400 (count tag-str))
" ...")))]]
[:td.trace--meta.trace--details-icon
{:on-click #(.log js/console tags)}]]))))))))