From 8335365bbf732095ed15d3d2966ed7c4f2e10f49 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Mon, 1 May 2023 21:27:31 +0100 Subject: [PATCH] Adjustments --- js/pis.js | 4 ++++ pis.html | 4 ++-- settings.html | 26 +++++++++++++------------- sw.js | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/js/pis.js b/js/pis.js index f39db0a..f0c3ba5 100644 --- a/js/pis.js +++ b/js/pis.js @@ -7,7 +7,9 @@ async function findByOrigDest() { const formData = await fetchOrigDest() log(`findByOrigDest: Searching for PIS Code for ${JSON.stringify(formData)}`) const endpoint = `pis/origdest/${formData.origin}/${formData.destination}` + console.time('findByOrigDest-GET') const json = await getApi(endpoint, auth = true) + console.timeEnd('findByOrigDest-GET') if (json == false) { await displayNoData() } else if (json == 401) { @@ -30,6 +32,7 @@ async function insertData(json) { // Receives the JSON Respose ([{},{}]) containing one or more possible // PIS codes. Display the code and the stops with a method of scrolling between them. // Maybe as a table or a carousel? + console.time('insertData') const div = document.getElementById('result-box') let tableData = ` @@ -45,6 +48,7 @@ async function insertData(json) { tableData += '
' div.insertAdjacentHTML('beforeend', tableData) document.getElementById('result-count').textContent = results.toString() + console.timeEnd('insertData') } async function displayNoData() { diff --git a/pis.html b/pis.html index a42fddd..91217a9 100644 --- a/pis.html +++ b/pis.html @@ -57,7 +57,7 @@

- + @@ -67,7 +67,7 @@ and destination individually with a previous and next arrow. --> - +