| Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 1 | <template> | 
| Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 2 | <div class="app-container"> | 
| kennyneedsmilky | 14172d7 | 2021-11-10 15:26:07 -0600 | [diff] [blame] | 3 | <app-header | 
|  | 4 | ref="focusTarget" | 
|  | 5 | class="app-header" | 
|  | 6 | :router-key="routerKey" | 
|  | 7 | @refresh="refresh" | 
|  | 8 | /> | 
| Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 9 | <app-navigation class="app-navigation" /> | 
|  | 10 | <page-container class="app-content"> | 
|  | 11 | <router-view ref="routerView" :key="routerKey" /> | 
| Dixsie Wolmers | 970ea7d | 2020-11-16 16:46:01 -0600 | [diff] [blame] | 12 | <!-- Scroll to top button --> | 
|  | 13 | <button-back-to-top /> | 
| Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 14 | </page-container> | 
| Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 15 | </div> | 
|  | 16 | </template> | 
|  | 17 |  | 
|  | 18 | <script> | 
| Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 19 | import AppHeader from '@/components/AppHeader'; | 
|  | 20 | import AppNavigation from '@/components/AppNavigation'; | 
| SurenNeware | 6185909 | 2020-10-01 09:37:32 +0530 | [diff] [blame] | 21 | import PageContainer from '@/components/Global/PageContainer'; | 
| Dixsie Wolmers | 970ea7d | 2020-11-16 16:46:01 -0600 | [diff] [blame] | 22 | import ButtonBackToTop from '@/components/Global/ButtonBackToTop'; | 
| Dixsie Wolmers | dc6b3cd | 2021-05-20 19:01:42 -0500 | [diff] [blame] | 23 | import JumpLinkMixin from '@/components/Mixins/JumpLinkMixin'; | 
| Dixsie Wolmers | 970ea7d | 2020-11-16 16:46:01 -0600 | [diff] [blame] | 24 |  | 
| Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 25 | export default { | 
| Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 26 | name: 'App', | 
| Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 27 | components: { | 
|  | 28 | AppHeader, | 
| Yoshie Muranaka | 8d12910 | 2019-12-19 09:51:55 -0800 | [diff] [blame] | 29 | AppNavigation, | 
| Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 30 | PageContainer, | 
| Dixsie Wolmers | 970ea7d | 2020-11-16 16:46:01 -0600 | [diff] [blame] | 31 | ButtonBackToTop, | 
| Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 32 | }, | 
| Dixsie Wolmers | dc6b3cd | 2021-05-20 19:01:42 -0500 | [diff] [blame] | 33 | mixins: [JumpLinkMixin], | 
| Yoshie Muranaka | eb154bb | 2020-02-07 12:18:45 -0800 | [diff] [blame] | 34 | data() { | 
|  | 35 | return { | 
| Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 36 | routerKey: 0, | 
| Yoshie Muranaka | eb154bb | 2020-02-07 12:18:45 -0800 | [diff] [blame] | 37 | }; | 
|  | 38 | }, | 
| Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 39 | watch: { | 
| Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 40 | $route: function () { | 
| Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 41 | this.$nextTick(function () { | 
| Derick Montague | 8026797 | 2021-02-16 09:47:03 -0600 | [diff] [blame] | 42 | this.setFocus(this.$refs.focusTarget.$el); | 
| Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 43 | }); | 
| Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 44 | }, | 
| Yoshie Muranaka | eb154bb | 2020-02-07 12:18:45 -0800 | [diff] [blame] | 45 | }, | 
| Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 46 | mounted() { | 
|  | 47 | this.$root.$on('refresh-application', () => this.refresh()); | 
| BlueSnake00 | 248d5bc | 2024-02-01 16:55:54 +0300 | [diff] [blame] | 48 | setInterval(() => { | 
|  | 49 | if (!localStorage.getItem('storedUsername')) { | 
|  | 50 | this.$eventBus.$consoleWindow.close(); | 
|  | 51 | this.refresh(); | 
|  | 52 | } | 
|  | 53 | }, 10000); | 
| Yoshie Muranaka | 6f71284 | 2021-02-04 11:23:03 -0800 | [diff] [blame] | 54 | }, | 
| Yoshie Muranaka | eb154bb | 2020-02-07 12:18:45 -0800 | [diff] [blame] | 55 | methods: { | 
|  | 56 | refresh() { | 
|  | 57 | // Changing the component :key value will trigger | 
|  | 58 | // a component re-rendering and 'refresh' the view | 
|  | 59 | this.routerKey += 1; | 
| Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 60 | }, | 
|  | 61 | }, | 
| Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 62 | }; | 
|  | 63 | </script> | 
|  | 64 |  | 
|  | 65 | <style lang="scss" scoped> | 
| Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 66 | .app-container { | 
|  | 67 | display: grid; | 
|  | 68 | grid-template-columns: 100%; | 
|  | 69 | grid-template-rows: auto; | 
|  | 70 | grid-template-areas: | 
|  | 71 | 'header' | 
|  | 72 | 'content'; | 
|  | 73 |  | 
|  | 74 | @include media-breakpoint-up($responsive-layout-bp) { | 
|  | 75 | grid-template-columns: $navigation-width 1fr; | 
|  | 76 | grid-template-areas: | 
|  | 77 | 'header header' | 
|  | 78 | 'navigation content'; | 
|  | 79 | } | 
|  | 80 | } | 
|  | 81 |  | 
|  | 82 | .app-header { | 
|  | 83 | grid-area: header; | 
|  | 84 | position: sticky; | 
|  | 85 | top: 0; | 
|  | 86 | z-index: $zindex-fixed + 1; | 
|  | 87 | } | 
|  | 88 |  | 
|  | 89 | .app-navigation { | 
|  | 90 | grid-area: navigation; | 
|  | 91 | } | 
|  | 92 |  | 
|  | 93 | .app-content { | 
|  | 94 | grid-area: content; | 
|  | 95 | background-color: $white; | 
| Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 96 | } | 
|  | 97 | </style> |