Browse Source

add route for materials page

Konstantin Ladutenko 3 years ago
parent
commit
0ae6064588

+ 24 - 0
guiapp/deploy.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+# build, copy build files, and copy (manually) content of index.html to https://physics.itmo.ru/ru/node/2611/edit
+
+quasar build
+cp dist/spa/nmiejs.wasm dist/spa/js/nmiejs.wasm
+
+#cd ~/github/kostyfisik.github.io
+#git reset --hard c66101abdd5db0a4ff5ef69c3328cdfdbadaa398
+#cp -r ../scattnlay/guiapp/dist/spa/* ./
+#git add *
+#git add  */*
+#git commit -am 'update'
+#git push -f
+
+cd dist/spa/css
+for file in `ls *.css`; do sed -i 's/[.]block{display:block\!important}//g' $file; done
+cd ..
+#sed -i 's=[<]base href[=]//themes//custom//physics//mie-next// [>]==g' index.html
+cd ../..
+
+rsync -aue ssh --progress  dist/spa/ physics@physics.ifmo.ru:/var/www/html/physicsifmoru/web/themes/custom/physics/mie-next
+echo
+cat dist/spa/index.html
+echo

+ 54 - 0
guiapp/src/components/MaterialsSelector.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="row items-baseline">
+    <div class="col-xs-12 col-sm-auto text-weight-bold text-center q-px-md q-py-sm">
+      <div :style="flexRowTitleStyle">
+        Host media
+      </div>
+    </div>
+    <div class="col-xs-grow col-sm">
+      <div class="row justify-xs-center justify-sm-start items-center">
+
+        <div class="col-auto" ><input-with-units
+            v-model:input-result="hostIndex"
+            v-model:is-showing-help="isShowingHelpForInputWithUnits"
+            :initial-expression="hostIndex.toString()"
+            title="Re(n)"
+            units=""
+        /></div>
+
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+import {
+  defineComponent,
+  computed,
+  } from 'vue'
+import { useStore } from 'src/store'
+import InputWithUnits from 'components/InputWithUnits.vue'
+import { flexRowTitleStyle } from 'components/config'
+
+export default defineComponent({
+
+  name: 'GetHostIndex',
+  components: {InputWithUnits,},
+
+  setup() {
+    const $store = useStore()
+
+    const isShowingHelpForInputWithUnits = computed({
+      get: () => $store.state.guiRuntime.isShowingHelpForInputWithUnits,
+      set: val => $store.commit('guiRuntime/setIsShowingHelpForInputWithUnits', val)
+    })
+
+    const hostIndex = computed({
+      get: () => $store.state.simulationSetup.gui.hostIndex,
+      set: val => $store.commit('simulationSetup/setHostIndex', val)
+    })
+
+    return { hostIndex, isShowingHelpForInputWithUnits, flexRowTitleStyle}
+  },
+})
+</script>

+ 18 - 0
guiapp/src/layouts/MainLayout.vue

@@ -28,6 +28,23 @@
           <q-item-section></q-item-section>
           <q-item-section></q-item-section>
           <q-item-section avatar side> <q-icon name="close" /> </q-item-section>
           <q-item-section avatar side> <q-icon name="close" /> </q-item-section>
         </q-item>
         </q-item>
+
+        <q-item
+            clickable
+            to="/materials"
+            @click="toggleLeftDrawer"
+        >
+          <q-item-section
+              avatar
+          >
+            <q-icon name="o_tune" />
+          </q-item-section>
+          <q-item-section>
+            <q-item-label>            Materials
+            </q-item-label>
+          </q-item-section>
+        </q-item>
+
         <q-item
         <q-item
             clickable
             clickable
             to="/info"
             to="/info"
@@ -43,6 +60,7 @@
             </q-item-label>
             </q-item-label>
           </q-item-section>
           </q-item-section>
         </q-item>
         </q-item>
+
         <q-separator inset spaced/>
         <q-separator inset spaced/>
         <q-item> <q-item-section> <q-item-label> External links</q-item-label> </q-item-section> </q-item>
         <q-item> <q-item-section> <q-item-label> External links</q-item-label> </q-item-section> </q-item>
         <q-item clickable tag="a" target="_blank" href="https://github.com/ovidiopr/scattnlay" >
         <q-item clickable tag="a" target="_blank" href="https://github.com/ovidiopr/scattnlay" >

+ 23 - 0
guiapp/src/pages/Materials.vue

@@ -0,0 +1,23 @@
+<template>
+  <q-page class="column q-px-md">
+    <div class="q-ma-md"/>
+    <MaterialsSelector/>
+  </q-page>
+</template>
+
+<script lang='ts'>
+import {
+  defineComponent,
+} from 'vue'
+
+import MaterialsSelector from 'components/MaterialsSelector.vue'
+// import { useStore } from 'src/store'
+
+
+export default defineComponent({
+  name: 'PageIndex',
+  components: {
+    MaterialsSelector
+  },
+})
+</script>