From 173a1c33d48ba31d9be13cc4eaa0de6132a2d679 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 22 Jan 2019 03:24:18 +0100 Subject: [PATCH] [enh] better UX, tell when it's loading, there is no jobs or no apps --- templates/apps.html | 52 ++++++++++++++++++++++++++------------------ templates/index.html | 32 +++++++++++++-------------- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/templates/apps.html b/templates/apps.html index bbacfe1..5f4ff66 100644 --- a/templates/apps.html +++ b/templates/apps.html @@ -5,26 +5,34 @@

Apps

- - - - - - - - - - - - - - - - - - - -
AppLast jobCreated timeStarted timeEnd timeCommitDay
{{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)}}{{app.revision.slice(0, 7)}}{{app.random_job_day}}
+ +
Loading...
@@ -36,7 +44,8 @@ var app = new Vue({ el: '#apps', data: { - apps: [] + apps: [], + inited: false, }, methods: { timestampToDate: function (timestamp) { @@ -75,6 +84,7 @@ if (action == "init_apps") { app.apps = data; + Vue.set(app, 'inited', true); } else if (action == "new_app") { for (var i = 0; i < app.apps.length; ++i) { if (data.name < app.apps[i].name) { diff --git a/templates/index.html b/templates/index.html index 33d06f2..e1f101e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,7 +5,7 @@

Jobs display last done job of each app and next scheduled job

-
+ +
@@ -63,7 +63,7 @@ if (action == "init_jobs") { app.jobs = data; - app.inited = true; + Vue.set(app, 'inited', true); } else if (action == "update_job") { for (var i = 0; i < app.jobs.length; ++i) { if (app.jobs[i].id == data.id) {