Merge pull request #24 from Spythere/development

Site migration to a new domain (old branch)
This commit is contained in:
Spythere
2026-03-08 01:39:12 +01:00
committed by GitHub
7 changed files with 105 additions and 3 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ name: Deploy to Firebase Hosting on merge
'on': 'on':
push: push:
branches: branches:
- main - main-old
jobs: jobs:
build_and_deploy: build_and_deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+25 -2
View File
@@ -8,6 +8,10 @@
<UpdatePrompt /> <UpdatePrompt />
</transition> </transition>
<transition name="slide-anim">
<MigrationInfo v-if="store.isMigrationInfoOpen" />
</transition>
<div class="app-body"> <div class="app-body">
<Navbar /> <Navbar />
@@ -28,11 +32,12 @@ import axios from 'axios';
import StorageManager from './managers/storageManager'; import StorageManager from './managers/storageManager';
import Navbar from './components/App/Navbar.vue'; import Navbar from './components/App/Navbar.vue';
import UpdatePrompt from './components/Global/UpdatePrompt.vue'; import UpdatePrompt from './components/Global/UpdatePrompt.vue';
import MigrationInfo from './components/Global/MigrationInfo.vue';
const STORAGE_VERSION_KEY = 'app_version'; const STORAGE_VERSION_KEY = 'app_version';
export default defineComponent({ export default defineComponent({
components: { UpdateCard, UpdatePrompt, Navbar }, components: { UpdateCard, UpdatePrompt, Navbar, MigrationInfo },
mixins: [orderStorageMixin], mixins: [orderStorageMixin],
@@ -49,6 +54,7 @@ export default defineComponent({
this.loadLang(); this.loadLang();
this.setupDarkMode(); this.setupDarkMode();
this.loadSettings(); this.loadSettings();
this.handleMigrationInfo();
this.checkAppVersion(); this.checkAppVersion();
this.handleQueries(); this.handleQueries();
}, },
@@ -65,7 +71,10 @@ export default defineComponent({
} }
this.store.orderDarkMode = this.getOrderSetting('dark-mode') === 'true'; 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() { handleQueries() {
@@ -124,6 +133,20 @@ export default defineComponent({
if (!naviLanguage.startsWith('pl')) { if (!naviLanguage.startsWith('pl')) {
this.changeLang('en'); 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);
} }
} }
}); });
+67
View File
@@ -0,0 +1,67 @@
<template>
<div class="migrate-info">
<div class="info-content">
<i18n-t keypath="migrate-info.line-1" for="migrate-info" tag="div">
<a href="https://generator-td2.spythere.eu/" target="_blank">{{
t('migrate-info.link')
}}</a>
</i18n-t>
<button class="g-button action accept-btn" @click="onAcceptButtonClick">
{{ t('migrate-info.accept-btn') }}
</button>
</div>
</div>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useStore } from '../../store/store';
const store = useStore();
const { t } = useI18n();
function onAcceptButtonClick() {
store.isMigrationInfoOpen = false;
localStorage.setItem('showMigrationInfo', 'false');
}
</script>
<style lang="scss" scoped>
@use '../../styles/colors';
.migrate-info {
position: fixed;
z-index: 100;
bottom: 0;
left: 0;
padding: 0.25em;
text-align: center;
width: 100%;
background-color: colors.$warnCol;
color: black;
font-weight: bold;
}
.info-content {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 0.5em;
}
a {
color: black;
text-decoration: underline;
&:hover {
color: black;
}
}
.accept-btn {
color: white;
}
</style>
+5
View File
@@ -69,5 +69,10 @@
"title": "Active timetables and trains on the scenery", "title": "Active timetables and trains on the scenery",
"subtitle": "Click on the user below to fill the current order with their information", "subtitle": "Click on the user below to fill the current order with their information",
"no-trains": "No trains to display" "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!"
} }
} }
+5
View File
@@ -69,5 +69,10 @@
"title": "Aktywne RJ i gracze na scenerii", "title": "Aktywne RJ i gracze na scenerii",
"subtitle": "Kliknij na gracza, aby wypełnić obecny rozkaz jego danymi", "subtitle": "Kliknij na gracza, aby wypełnić obecny rozkaz jego danymi",
"no-trains": "Brak pociągów do wyświetlenia" "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!"
} }
} }
+1
View File
@@ -19,6 +19,7 @@ export const useStore = defineStore('store', {
releaseURL: '' releaseURL: ''
}, },
isMigrationInfoOpen: false,
updateCardOpen: false, updateCardOpen: false,
helperModalOpen: false, helperModalOpen: false,
orderDarkMode: false, orderDarkMode: false,
+1
View File
@@ -57,6 +57,7 @@ button.g-button {
&.action { &.action {
background-color: colors.$bgColDarker; background-color: colors.$bgColDarker;
padding: 0.5em; padding: 0.5em;
color: white;
&:focus-visible { &:focus-visible {
outline: 2px solid colors.$accentCol; outline: 2px solid colors.$accentCol;