feat: show timestamp in results page

This commit is contained in:
Aravinth Manivannan 2023-02-01 15:27:26 +05:30
parent 21ff6741a0
commit 94eb76c188
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
3 changed files with 13 additions and 7 deletions

View file

@ -66,7 +66,7 @@ mime = "0.3.16"
#sailfish = "0.3.2" #sailfish = "0.3.2"
tracing = { version = "0.1.37", features = ["log"] } tracing = { version = "0.1.37", features = ["log"] }
tera = "1.17.1" tera = { version="1.17.1", features=["builtins"]}
#tokio = "1.11.0" #tokio = "1.11.0"

View file

@ -163,6 +163,7 @@ pub mod runners {
#[derive(Debug)] #[derive(Debug)]
struct InternalSurveyResp { struct InternalSurveyResp {
id: i32, id: i32,
submitted_at: OffsetDateTime,
user_id: Uuid, user_id: Uuid,
threads: Option<i32>, threads: Option<i32>,
device_user_provided: String, device_user_provided: String,
@ -198,6 +199,7 @@ pub mod runners {
device_software_recognised, device_software_recognised,
threads, threads,
user_id, user_id,
submitted_at,
device_user_provided device_user_provided
FROM FROM
survey_responses survey_responses
@ -256,6 +258,7 @@ pub mod runners {
user, user,
device_user_provided: r.device_user_provided, device_user_provided: r.device_user_provided,
device_software_recognised: r.device_software_recognised, device_software_recognised: r.device_software_recognised,
submitted_at: r.submitted_at.unix_timestamp(),
id: r.id as usize, id: r.id as usize,
threads: r.threads.map(|t| t as usize), threads: r.threads.map(|t| t as usize),
}) })
@ -314,6 +317,7 @@ pub struct SurveyResponse {
pub device_software_recognised: String, pub device_software_recognised: String,
pub id: usize, pub id: usize,
pub threads: Option<usize>, pub threads: Option<usize>,
pub submitted_at: i64,
pub benches: Vec<Bench>, pub benches: Vec<Bench>,
} }

View file

@ -11,6 +11,7 @@
<thead> <thead>
<tr> <tr>
<th>Submission ID</th> <th>Submission ID</th>
<th>Time (UTC)</th>
<th>User ID</th> <th>User ID</th>
<th>Device make (user provided)</th> <th>Device make (user provided)</th>
<th>Device make (detected)</th> <th>Device make (detected)</th>
@ -21,12 +22,13 @@
<tbody> <tbody>
{% for sub in payload.submissions %} {% for sub in payload.submissions %}
<tr> <tr>
<th>{{ sub.id }}</th> <td>{{ sub.id }}</td>
<th>{{ sub.user.id }}</th> <td>{{ sub.submitted_at | date(format="%Y-%m-%d %H:%M", timezone="GMT") }}</td>
<th>{{ sub.device_user_provided }}</th> <td>{{ sub.user.id }}</td>
<th>{{ sub.device_software_recognised }}</th> <td>{{ sub.device_user_provided }}</td>
<th>{{ sub.threads }}</th> <td>{{ sub.device_software_recognised }}</td>
<th> <td>{{ sub.threads }}</td>
<td>
<table> <table>
<thead> <thead>
<th>Difficulty</th> <th>Difficulty</th>