Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "slow loading" banner if SITE_SLOW environment variable is set #701

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading