                         (filter #(.contains % grep))
                         (string/join "\n"))
                    log-string)])
-          (let [pager-data (if (is-txt-file fname) (pager-links fname start length file-length) nil)]
+          (let [pager-data (if (is-txt-file fname) (pager-links fname start length file-length "daemonlog") nil)]
             (html (concat (search-file-form fname "yes")
                           (log-file-selection-form reordered-files-str "daemonlog") ; list all daemon logs
                           pager-data

      (-> (resp/response "Page not found")
          (resp/status 404)))))

(defn download-log-file [fname req resp user ^String root-dir]
  (let [file (.getCanonicalFile (File. root-dir fname))]
    (if (.exists file)
      (if (or (blank? (*STORM-CONF* UI-FILTER))
              (authorized-log-user? user fname *STORM-CONF*))
        (-> (resp/response file)
            (resp/content-type "application/octet-stream"))
        (unauthorized-user-html user))

    (drop-down "file" log-files)
    [:input {:type "submit" :value "Switch file"}]]])

(defn pager-links [fname start length file-size type]
  (let [prev-start (max 0 (- start length))
        next-start (if (> file-size 0)
                     (min (max 0 (- file-size length)) (+ start length))
                     (+ start length))]
    [[:div
      (concat
          [(to-btn-link (url (str "/" type)
                          {:file fname
                           :start (max 0 (- start length))
                           :length length})
                          "Prev" :enabled (< prev-start start))]
          [(to-btn-link (url (str "/" type)
                           {:file fname
                            :start 0
                            :length length}) "First")]
          [(to-btn-link (url (str "/" type)
                           {:file fname
                            :length length})
                        "Last")]
          [(to-btn-link (url (str "/" type)
                          {:file fname
                           :start (min (max 0 (- file-size length))
                                       (+ start length))
