From 4fce109332560cf98c9e12115c5ec0091fc0ee85 Mon Sep 17 00:00:00 2001 From: Spythere Date: Sat, 7 Mar 2026 19:22:40 +0100 Subject: [PATCH] chore: added info bar about migration to a new domain --- .github/workflows/firebase-hosting-merge.yml | 2 +- src/App.vue | 27 +++++++- src/components/Global/MigrationInfo.vue | 67 ++++++++++++++++++++ src/locales/en.json | 5 ++ src/locales/pl.json | 5 ++ src/store/store.ts | 1 + src/styles/_global.scss | 1 + 7 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 src/components/Global/MigrationInfo.vue diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 4861b09..64f332c 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -5,7 +5,7 @@ name: Deploy to Firebase Hosting on merge 'on': push: branches: - - main + - main-old jobs: build_and_deploy: runs-on: ubuntu-latest diff --git a/src/App.vue b/src/App.vue index 99c0105..37005a1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,6 +8,10 @@ + + + +
@@ -28,11 +32,12 @@ import axios from 'axios'; import StorageManager from './managers/storageManager'; import Navbar from './components/App/Navbar.vue'; import UpdatePrompt from './components/Global/UpdatePrompt.vue'; +import MigrationInfo from './components/Global/MigrationInfo.vue'; const STORAGE_VERSION_KEY = 'app_version'; export default defineComponent({ - components: { UpdateCard, UpdatePrompt, Navbar }, + components: { UpdateCard, UpdatePrompt, Navbar, MigrationInfo }, mixins: [orderStorageMixin], @@ -49,6 +54,7 @@ export default defineComponent({ this.loadLang(); this.setupDarkMode(); this.loadSettings(); + this.handleMigrationInfo(); this.checkAppVersion(); this.handleQueries(); }, @@ -65,7 +71,10 @@ export default defineComponent({ } this.store.orderDarkMode = this.getOrderSetting('dark-mode') === 'true'; - document.documentElement.setAttribute('data-theme', this.store.orderDarkMode ? 'dark' : 'light'); + document.documentElement.setAttribute( + 'data-theme', + this.store.orderDarkMode ? 'dark' : 'light' + ); }, handleQueries() { @@ -124,6 +133,20 @@ export default defineComponent({ if (!naviLanguage.startsWith('pl')) { this.changeLang('en'); } + }, + + handleMigrationInfo() { + // Show only on old domain + if (location.hostname !== 'generator-td2.web.app' && location.hostname != 'localhost') return; + + const showInfo = localStorage.getItem('showMigrationInfo'); + + // Do not show if already acknowledged + if (showInfo === 'false') return; + + setTimeout(() => { + this.store.isMigrationInfoOpen = true; + }, 2000); } } }); diff --git a/src/components/Global/MigrationInfo.vue b/src/components/Global/MigrationInfo.vue new file mode 100644 index 0000000..5ba1257 --- /dev/null +++ b/src/components/Global/MigrationInfo.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/locales/en.json b/src/locales/en.json index 6732b56..726165e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -69,5 +69,10 @@ "title": "Active timetables and trains on the scenery", "subtitle": "Click on the user below to fill the current order with their information", "no-trains": "No trains to display" + }, + "migrate-info": { + "line-1": "GeneraTOR is being moved to a new domain - {0}! You can still use the current website, but it will no longer be updated and will be shut down in the nearest future!", + "link": "https://generator-td2.spythere.eu/", + "accept-btn": "ROGER THAT!" } } diff --git a/src/locales/pl.json b/src/locales/pl.json index 36a3bac..5d2f0fe 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -69,5 +69,10 @@ "title": "Aktywne RJ i gracze na scenerii", "subtitle": "Kliknij na gracza, aby wypełnić obecny rozkaz jego danymi", "no-trains": "Brak pociągów do wyświetlenia" + }, + "migrate-info": { + "line-1": "GeneraTOR zostaje przeniesiony na nową domenę - {0}! Możesz korzystać z obecnej strony, jednak nie będzie ona otrzymywać już aktualizacji i w przyszłości zostanie wyłączona!", + "link": "https://generator-td2.spythere.eu/", + "accept-btn": "PRZYJĄŁEM!" } } diff --git a/src/store/store.ts b/src/store/store.ts index 109ddb0..31d4851 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -19,6 +19,7 @@ export const useStore = defineStore('store', { releaseURL: '' }, + isMigrationInfoOpen: false, updateCardOpen: false, helperModalOpen: false, orderDarkMode: false, diff --git a/src/styles/_global.scss b/src/styles/_global.scss index dd7d720..1c1dc13 100644 --- a/src/styles/_global.scss +++ b/src/styles/_global.scss @@ -57,6 +57,7 @@ button.g-button { &.action { background-color: colors.$bgColDarker; padding: 0.5em; + color: white; &:focus-visible { outline: 2px solid colors.$accentCol;