0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

Improve error report list template

This commit is contained in:
Andrey Antukh 2022-10-14 14:19:12 +02:00
parent 82d72fd388
commit 9c33dc529d
3 changed files with 22 additions and 7 deletions

View file

@ -11,7 +11,8 @@ penpot - error list
<main class="horizontal-list"> <main class="horizontal-list">
<ul> <ul>
{% for item in items %} {% for item in items %}
<li><a href="/dbg/error/{{item.id}}">{{item.created-at}}</a></li> <li><a class="date" href="/dbg/error/{{item.id}}">{{item.created-at}}</a>
<span class="title">{{item.hint|abbreviate:150}}</span></li>
{% endfor %} {% endfor %}
</ul> </ul>
</main> </main>

View file

@ -137,8 +137,6 @@ nav > div:not(:last-child) {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
flex-direction: column; flex-direction: column;
flex-wrap: wrap;
height: calc(100vh - 75px);
justify-content: flex-start; justify-content: flex-start;
} }
@ -151,19 +149,31 @@ nav > div:not(:last-child) {
margin: 0px 20px; margin: 0px 20px;
cursor: pointer; cursor: pointer;
display: flex; display: flex;
justify-content: center;
border-radius: 3px; border-radius: 3px;
} }
.horizontal-list li:hover { .horizontal-list li:hover {
background-color: #e9e9e9; background-color: #e9e9e9;
} }
.horizontal-list li > *:not(:last-child) {
margin-right: 10px;
}
.horizontal-list li > a { .horizontal-list li > a {
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;
} }
.horizontal-list li > .date {
font-weight: 200;
color: #686868;
min-width: 210px;
}
form .row { form .row {
padding: 5px 0; padding: 5px 0;
} }

View file

@ -244,15 +244,19 @@
(yrs/response 404 "not found"))))) (yrs/response 404 "not found")))))
(def sql:error-reports (def sql:error-reports
"select id, created_at from server_error_report order by created_at desc limit 100") "SELECT id, created_at,
content->>'~:hint' AS hint
FROM server_error_report
ORDER BY created_at DESC
LIMIT 100")
(defn error-list-handler (defn error-list-handler
[{:keys [pool]} request] [{:keys [pool]} request]
(when-not (authorized? pool request) (when-not (authorized? pool request)
(ex/raise :type :authentication (ex/raise :type :authentication
:code :only-admins-allowed)) :code :only-admins-allowed))
(let [items (db/exec! pool [sql:error-reports]) (let [items (->> (db/exec! pool [sql:error-reports])
items (map #(update % :created-at dt/format-instant :rfc1123) items)] (map #(update % :created-at dt/format-instant :rfc1123)))]
(yrs/response :status 200 (yrs/response :status 200
:body (-> (io/resource "app/templates/error-list.tmpl") :body (-> (io/resource "app/templates/error-list.tmpl")
(tmpl/render {:items items})) (tmpl/render {:items items}))