From 5433630a5c674820eab444ac6fd8d219a6b8a9a3 Mon Sep 17 00:00:00 2001 From: Taka Date: Thu, 25 Nov 2021 01:45:47 +1100 Subject: [PATCH] Tightened up when we show the spinner when preparing the data files. --- asl_rulebook2/webapp/static/css/prepare.css | 1 + asl_rulebook2/webapp/static/prepare.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/asl_rulebook2/webapp/static/css/prepare.css b/asl_rulebook2/webapp/static/css/prepare.css index 9009528..feb9567 100644 --- a/asl_rulebook2/webapp/static/css/prepare.css +++ b/asl_rulebook2/webapp/static/css/prepare.css @@ -33,6 +33,7 @@ code { display: block ; margin: 5px 0 5px 20px ; } padding: 10px ; background: #f0f0f0 ; font-size: 80% ; font-style: italic ; text-align: center ; + transition: opacity 5s ; } #download-panel { diff --git a/asl_rulebook2/webapp/static/prepare.js b/asl_rulebook2/webapp/static/prepare.js index 3f2938d..a9d9fd3 100644 --- a/asl_rulebook2/webapp/static/prepare.js +++ b/asl_rulebook2/webapp/static/prepare.js @@ -185,13 +185,15 @@ gPrepareApp.component( "progress-panel", { data() { return { socketIOClient: null, statusBlocks: [], - isDone: false, + isDone: false, isError: false } ; }, + // FUDGE! Opening the PDF is synchronous, which makes the webserver unresponsive while it's happening, + // so we delay showing the "features" link to the user until we get past that point. template: `
-
+
While you're waiting, you can
check out the features here. @@ -211,8 +213,10 @@ gPrepareApp.component( "progress-panel", { // initialize the socketio client this.socketIOClient = io.connect() ; //eslint-disable-line no-undef this.socketIOClient.on( "disconnect", () => { - if ( ! this.isDone ) + if ( ! this.isDone ) { this.$emit( "fatal", "The server has gone away. Please restart it, then reload this page." ) ; + this.isError = true ; + } } ) ; this.socketIOClient.on( "status", (msg) => { this.addStatusBlock( msg ) ; } ) ; this.socketIOClient.on( "progress", (msg) => { this.addProgressMsg( "info", msg ) ; } ) ;