diff --git a/package.json b/package.json index b3a5d84..2bf87e5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "srjp-td2", "private": true, - "version": "0.0.0", + "version": "0.1.0", "type": "module", "scripts": { "dev": "vite", @@ -9,6 +9,7 @@ "preview": "vite preview" }, "dependencies": { + "@heroicons/vue": "^2.2.0", "axios": "^1.7.9", "pinia": "^2.3.1", "vue": "^3.5.13" diff --git a/public/icons/printer.svg b/public/icons/printer.svg new file mode 100644 index 0000000..8d529c6 --- /dev/null +++ b/public/icons/printer.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/App.vue b/src/App.vue index d6d3bab..0f0bbea 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,25 +3,41 @@
- +
+ + + + + +
- + {{ selectedTrain.timetable!.category }} {{ selectedTrain.trainNo }} Relacja {{ selectedTrain.timetable?.route.replace('|', ' - ') }} + +
@@ -213,8 +229,8 @@
Nr
linii
-
@@ -227,6 +243,9 @@ import { useGlobalStore } from './stores/global.store'; import sceneryCorrections from './data/corrections.json'; import type { ActiveTrain } from './types/common.types'; +import { version } from '../package.json'; +import { PrinterIcon, ArrowPathIcon } from '@heroicons/vue/16/solid'; + interface StopRow { pointName: string; pointKm: string; @@ -259,6 +278,7 @@ interface StopRow { } export default defineComponent({ + components: { PrinterIcon, ArrowPathIcon }, data: () => ({ selectedTrainId: '', globalStore: useGlobalStore(), @@ -266,6 +286,7 @@ export default defineComponent({ generatedMs: 0, generatedDate: null as Date | null, + version, }), mounted() { @@ -280,6 +301,14 @@ export default defineComponent({ if (this.selectTrain != null) this.generatedDate = new Date(); }, + + openPrintingWindow() { + window.print(); + }, + + refreshData() { + this.selectTrain(); + }, }, computed: { diff --git a/yarn.lock b/yarn.lock index ebbaddc..ca4e66d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -157,6 +157,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz#34aa0b52d0fbb1a654b596acfa595f0c7b77a77b" integrity sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg== +"@heroicons/vue@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@heroicons/vue/-/vue-2.2.0.tgz#d81f14eed448eec9859849ed63facd3f29bca2b3" + integrity sha512-G3dbSxoeEKqbi/DFalhRxJU4mTXJn7GwZ7ae8NuEQzd1bqdd0jAbdaBZlHPcvPD2xI1iGzNVB4k20Un2AguYPw== + "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550"