From be9735c955e1c260faa44459fc3f82589fc29293 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Thu, 14 Mar 2024 17:09:43 +0800 Subject: [PATCH] feat: display elapsed and creation time --- frontend/package.json | 1 + frontend/src/pages/jobs/index.vue | 21 ++++++++++++++++++++- frontend/yarn.lock | 12 ++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 574509d..6e13b14 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,6 +12,7 @@ "ansi_up": "^6.0.2", "axios": "^1.6.7", "core-js": "^3.34.0", + "javascript-time-ago": "^2.5.9", "pretty-bytes": "^6.1.1", "roboto-fontface": "*", "vue": "^3.3.0", diff --git a/frontend/src/pages/jobs/index.vue b/frontend/src/pages/jobs/index.vue index aaf4006..9b6383d 100644 --- a/frontend/src/pages/jobs/index.vue +++ b/frontend/src/pages/jobs/index.vue @@ -61,6 +61,19 @@ > Created +
+ mdi:mdi-clock-outline + + {{ new Date((item as Job).elapsed_secs * 1000).toISOString().substring(11, 19) }} +
+
+ mdi:mdi-calendar + {{ new TimeAgo('en-US').format(new Date((item as Job).creation_time)) }} + + {{ new Date((item as Job).creation_time) }} + +