Skip to content

Commit

Permalink
Add "slow loading" banner if SITE_SLOW environment variable is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
cstephen authored and BobTorgerson committed Jan 27, 2025
1 parent 9057d39 commit 7f6cdcc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@
</div>
<div v-else class="px-5-touch">
<client-only>
<div v-if="slow">
<div class="container mt-5">
<b-message
title="Northern Climate Reports is experiencing slow load times"
type="is-warning"
aria-close-label="Close message"
>
<p>
We&rsquo;re sorry! Northern Climate Reports is experiencing slower
load times than usual. We&rsquo;re working to improve performance
as soon as possible, but we don&rsquo;t have an estimated time for
completion. Please check back soon, or reach out to us at
<a href="mailto:[email protected]"
>[email protected]</a
>
with questions.
</p>
</b-message>
</div>
</div>
<div v-show="!this.reportIsVisible">
<div class="container mt-5">
<div class="columns" id="controls">
Expand Down Expand Up @@ -77,6 +97,7 @@ export default {
data() {
return {
offline: process.env.offline,
slow: process.env.slow,
}
},
computed: {
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export default {
apiUrl: process.env.SNAP_API_URL || 'https://earthmaps.io',
localStorageExpiration: 4,
offline: process.env.SITE_OFFLINE?.toLowerCase() == 'true',
slow: process.env.SITE_SLOW?.toLowerCase() == 'true',
},

// Router customizations
Expand Down

0 comments on commit 7f6cdcc

Please sign in to comment.