From 24c5eb63eb60e3ca1aab2b2830d8bd8b0267b9af Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 3 Nov 2018 18:08:21 +0100 Subject: [PATCH] [enh] color tags on apps page --- templates/apps.html | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/templates/apps.html b/templates/apps.html index d31e1c1..03dfbc0 100644 --- a/templates/apps.html +++ b/templates/apps.html @@ -16,8 +16,8 @@ Day - {{app.name}} {{app.app_list}} {{app.state}} - #{{app.job_id}} {{app.job_state}} + {{app.name}} {{app.app_list}} {{app.state}} + #{{app.job_id}} {{app.job_state}} {{timestampToDate(app.created_time)}} {{timestampToDate(app.started_time)}} {{timestampToDate(app.end_time)}} @@ -44,6 +44,25 @@ if (timestamp === null) return ""; return new Date(timestamp * 1000).toLocaleString() + }, + appStateTagClass: function (appState) { + // this is one the only used one + if (appState == "working") + return {"is-success": true} + // other states notworking inprogress validated + if (appState == "") + return {"is-danger": true} + return {"is-danger": true} + }, + jobStateTagClass: function (jobState) { + if (jobState == "done") + return {"is-success": true} + if (jobState == "failure") + return {"is-danger": true} + if (jobState == "canceled") + return {"is-warning": true} + if (jobState == "running") + return {"is-info": true} } } })