MainLayout.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <q-layout view="lHh lpR fFf">
  3. <!-- <q-layout view="hHh Lpr lFr">-->
  4. <q-header elevated>
  5. <q-toolbar>
  6. <q-btn
  7. flat
  8. dense
  9. round
  10. icon="menu"
  11. aria-label="Menu"
  12. @click="toggleLeftDrawer"
  13. />
  14. <q-tabs align="right">
  15. <q-route-tab to="/spectrum" label="Spectrum" name="spectrum" />
  16. <q-route-tab to="/nearfield" label="Near-field" name="nearfield" />
  17. <!-- <q-route-tab to="/farfield" label="Far-field" name="farfield"/>-->
  18. </q-tabs>
  19. </q-toolbar>
  20. </q-header>
  21. <q-drawer v-model="leftDrawerOpen" bordered>
  22. <q-list>
  23. <q-item clickable @click="toggleLeftDrawer">
  24. <q-item-section></q-item-section>
  25. <q-item-section avatar side> <q-icon name="close" /> </q-item-section>
  26. </q-item>
  27. <q-item clickable to="/materials" @click="toggleLeftDrawer">
  28. <q-item-section avatar>
  29. <q-icon name="o_tune" />
  30. </q-item-section>
  31. <q-item-section>
  32. <q-item-label> Materials </q-item-label>
  33. </q-item-section>
  34. </q-item>
  35. <q-item clickable to="/info" @click="toggleLeftDrawer">
  36. <q-item-section avatar>
  37. <q-icon name="o_info" />
  38. </q-item-section>
  39. <q-item-section>
  40. <q-item-label> Info </q-item-label>
  41. </q-item-section>
  42. </q-item>
  43. <q-separator inset spaced />
  44. <q-item>
  45. <q-item-section>
  46. <q-item-label> External links</q-item-label>
  47. </q-item-section>
  48. </q-item>
  49. <q-item
  50. clickable
  51. tag="a"
  52. target="_blank"
  53. href="https://github.com/ovidiopr/scattnlay"
  54. >
  55. <q-item-section avatar> <q-icon name="code" /> </q-item-section>
  56. <q-item-section>
  57. <q-item-label>Project at GitHub</q-item-label>
  58. <q-item-label caption> Open-source software </q-item-label>
  59. </q-item-section>
  60. </q-item>
  61. <q-item
  62. clickable
  63. tag="a"
  64. target="_blank"
  65. href="https://github.com/ovidiopr/scattnlay/issues/new?title=[webapp]"
  66. >
  67. <q-item-section avatar> <q-icon name="support" /> </q-item-section>
  68. <q-item-section>
  69. <q-item-label>Support</q-item-label>
  70. <q-item-label caption>
  71. Requires a GitHub account</q-item-label
  72. ></q-item-section
  73. >
  74. </q-item>
  75. <q-separator inset spaced />
  76. <q-item class="q-mt-auto text-body2">
  77. Last simulation took ...<br />
  78. - spectrum
  79. {{
  80. $store.state.simulationSetup.nmies.spectrum.nmieTotalRunTime.toFixed(
  81. 2
  82. )
  83. }}
  84. s.<br />
  85. - near-field
  86. {{
  87. $store.state.simulationSetup.nmies.nearField.nmieTotalRunTime.toFixed(
  88. 2
  89. )
  90. }}
  91. s.
  92. </q-item>
  93. </q-list>
  94. </q-drawer>
  95. <q-page-container>
  96. <!-- <router-view />-->
  97. <router-view v-slot="{ Component }">
  98. <!-- <transition name="fade">-->
  99. <keep-alive>
  100. <component :is="Component" />
  101. </keep-alive>
  102. <!-- </transition>-->
  103. </router-view>
  104. </q-page-container>
  105. </q-layout>
  106. </template>
  107. <script lang="ts">
  108. import { defineComponent, ref } from 'vue';
  109. export default defineComponent({
  110. name: 'MainLayout',
  111. components: {},
  112. // components: {
  113. // EssentialLink
  114. // },
  115. setup() {
  116. const leftDrawerOpen = ref(false);
  117. return {
  118. leftDrawerOpen,
  119. toggleLeftDrawer() {
  120. leftDrawerOpen.value = !leftDrawerOpen.value;
  121. },
  122. };
  123. },
  124. });
  125. </script>