|
17 | 17 | [:link {:rel "icon" :href "/public/img/icon.png" :type "image/png"}] |
18 | 18 | [:title title]] |
19 | 19 | (into |
20 | | - [:body {:style "display:flex; flex-direction:column; height:100%;"} |
21 | | - content |
22 | | - [:footer {:style "text-align:right; padding-botton: 20px"} |
23 | | - [:p (format "Build: %s (%s)" (@config :build :version) |
24 | | - (@config :build :git-sha))]]] |
| 20 | + [:body {:style "display:flex; justify-content:center;"} |
| 21 | + [:div {:style "display:flex; flex-direction:column; justify-content: space-between; width: 1000px; max-width: 100%;"} |
| 22 | + content |
| 23 | + [:footer {:style "text-align:right; padding-botton: 20px"} |
| 24 | + [:p (format "Build: %s (%s)" (@config :build :version) |
| 25 | + (@config :build :git-sha))]]]] |
25 | 26 | rst)]))) |
26 | 27 |
|
| 28 | +(defn header [upload?] |
| 29 | + [:div {:style {:display "flex" |
| 30 | + :justify-content "space-between" |
| 31 | + :width "100%" |
| 32 | + ;; :max-width "100%" |
| 33 | + :align-items "center" |
| 34 | + :margin-bottom "40px"}} |
| 35 | + ;; Logo container |
| 36 | + [:a {:href "/" |
| 37 | + :style "text-decoration:none; color:inherit;"} |
| 38 | + [:div {:style {:display "flex" |
| 39 | + :align-items "center" |
| 40 | + :gap "10px"}} |
| 41 | + [:img {:src "/public/img/icon.png" |
| 42 | + :alt "Flamebin logo" |
| 43 | + :style {:width "32px" |
| 44 | + :height "32px"}}] |
| 45 | + [:span {:style {:font-size "24px" |
| 46 | + :font-weight "500"}} |
| 47 | + "Flamebin"]]] |
| 48 | + |
| 49 | + ;; Upload button |
| 50 | + [:a {:href "/profiles/upload" |
| 51 | + :style {:visibility (if upload? |
| 52 | + "visible" "hidden")}} |
| 53 | + [:button {:href "/profiles/upload" |
| 54 | + :style {:background-color "#2F4F4F" |
| 55 | + :color "white" |
| 56 | + :padding "8px 16px" |
| 57 | + :border "none" |
| 58 | + :border-radius "6px" |
| 59 | + :cursor "pointer" |
| 60 | + :font-size "15px"}} |
| 61 | + "UPLOAD"]]]) |
| 62 | + |
27 | 63 | (defn upload-page [] |
28 | 64 | (base |
29 | 65 | "Upload profile - Flamebin" |
30 | | - [:div {:style "flex:1;"} |
31 | | - [:div {:style "display:flex; justify-content:center"} |
32 | | - [:div |
33 | | - [:h1 "Upload collapsed stacks file (.txt)"] |
34 | | - (form/form-to {:enctype "multipart/form-data" |
35 | | - :id "uploadForm"} |
36 | | - [:post "this-is-ignored-the-url-is-set-in-javascript"] |
37 | | - (form/file-upload {:id "fileInput"} "file") |
38 | | - (form/submit-button "Upload")) |
39 | | - [:div#status] |
40 | | - [:a {:href "/"} "↰ Home"]]]] |
| 66 | + [:div {:style {:font-family "system-ui, -apple-system, sans-serif" |
| 67 | + :padding "20px"}} |
| 68 | + (header false) |
| 69 | + [:div {:style "flex:1;"} |
| 70 | + [:div {:style "display:flex; justify-content:center"} |
| 71 | + [:div |
| 72 | + [:h1 "Upload collapsed stacks file (.txt)"] |
| 73 | + (form/form-to {:enctype "multipart/form-data" |
| 74 | + :id "uploadForm"} |
| 75 | + [:post "this-is-ignored-the-url-is-set-in-javascript"] |
| 76 | + (form/file-upload {:id "fileInput"} "file") |
| 77 | + (form/submit-button "Upload")) |
| 78 | + [:div#status]]]]] |
41 | 79 | [:script (h/raw (render-template |
42 | 80 | (slurp (io/resource "site/upload.js")) |
43 | 81 | {:upload-url "/api/v1/upload-profile?type=cpu&format=collapsed"}))])) |
|
52 | 90 | (defn index-page [] |
53 | 91 | (base |
54 | 92 | "Flamebin" |
55 | | - [:div {:style "flex:1;"} |
56 | | - [:center [:h1 "Flamebin"]] |
57 | | - [:center [:h5 "Pastebin for your flamegraphs"]] |
| 93 | + [:div {:style {:font-family "system-ui, -apple-system, sans-serif" |
| 94 | + ;; :max-width "1200px" |
| 95 | + ;; :margin "0 auto" |
| 96 | + :padding "20px"}} |
| 97 | + (header true) |
| 98 | + |
| 99 | + ;; Main heading |
| 100 | + [:h1 {:style {:font-size "48px" |
| 101 | + :font-weight "300" |
| 102 | + :text-align "center" |
| 103 | + :margin "100px 0" |
| 104 | + :color "#000000"}} |
| 105 | + "Pastebin for your flamegraphs 🔥📈"] |
| 106 | + |
| 107 | + [:div |
| 108 | + [:h2 {:style {:font-size "24px" |
| 109 | + :font-weight "600" |
| 110 | + :margin-bottom "30px"}} |
| 111 | + "EXAMPLES"] |
| 112 | + |
| 113 | + ;; Grid of uploads - hardcode for now |
| 114 | + [:div {:style {:display "grid" |
| 115 | + :grid-template-columns "repeat(3, 1fr)" |
| 116 | + :gap "20px" |
| 117 | + :margin-bottom "30px"}} |
| 118 | + (for [{:keys [i date url desc]} |
| 119 | + [{:i 1 |
| 120 | + :date "01.11.2024" |
| 121 | + :desc "Aleph client and server" |
| 122 | + :url "/Rmxt9P"} |
| 123 | + {:i 2 |
| 124 | + :date "09.11.2024" |
| 125 | + :desc "Recursive functions" |
| 126 | + :url "/3anDLN"} |
| 127 | + {:i 3 |
| 128 | + :date "21.11.2024" |
| 129 | + :desc "Clojure start-up" |
| 130 | + :url "/8mVw7b"}]] |
| 131 | + [:a {:href url |
| 132 | + :style "text-decoration:none; color:inherit;"} |
| 133 | + [:div |
| 134 | + [:div {:key i |
| 135 | + :style {:border "1px solid #eee" |
| 136 | + :border-radius "8px" |
| 137 | + :overflow "hidden"}} |
| 138 | + [:div {:style {:padding "15px"}} |
| 139 | + [:div {:style {:font-size "18px" |
| 140 | + :font-weight "500"}} |
| 141 | + date] |
| 142 | + [:div {:style {:color "#666" |
| 143 | + :margin-top "5px"}} |
| 144 | + desc]] |
| 145 | + [:img {:src (format "/public/img/thumbnail%d.png" i) |
| 146 | + :style {:width "300px" |
| 147 | + :height "auto"}}]]]])]] |
| 148 | + |
| 149 | + [:h2 {:style {:font-size "24px" |
| 150 | + :font-weight "600" |
| 151 | + :margin-bottom "30px"}} |
| 152 | + "PUBLIC UPLOADS"] |
| 153 | + |
58 | 154 | [:div {:style "display:flex; justify-content:center"} |
59 | 155 | [:ul {:id "flamegraph-list"} |
60 | 156 | (for [p (core/list-public-profiles)] |
61 | | - [:li (format-ts (:upload_ts p)) " - " [:a {:href (format "/%s" (:id p))} (:id p)] ])]] |
62 | | - [:center [:p [:a {:href "/profiles/upload"} "Upload another"]]]])) |
| 157 | + [:li (format-ts (:upload_ts p)) " - " [:a {:href (format "/%s" (:id p))} (:id p)] ])]]])) |
0 commit comments