Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template lang="pug">
  2. w-app
  3. w-drawer(v-model="openDrawer")
  4. w-flex.my12(:gap="3" align-center wrap)
  5. w-button.ma1(@click="$waveui.notify('Information.')" bg-color="info") Notify info
  6. w-button.ma1(@click="$waveui.notify('Success!', 'success')" bg-color="success") Notify success
  7. w-button.ma1(@click="$waveui.notify('Warning!', 'warning')" bg-color="warning") Notify warning
  8. w-button.ma1(@click="$waveui.notify('Error :(', 'error', 0)" bg-color="error") Permanent error
  9. w-flex.my12(align-center wrap)
  10. w-spinner(bounce)
  11. w-input Label
  12. w-checkbox Single option
  13. w-flex.my12
  14. w-button(@click="openDrawer = true" outline="")
  15. | Open drawer
  16. w-flex.my12(grow column)
  17. w-slider(:model-value="40" thumb-label step-label :step="20" color="primary-light3").mt12
  18. .mt4 v-model:
  19. code.ml1 {{ sliderVal }}
  20. w-flex.my12(:gap="3" align-center wrap)
  21. | Show menu on:
  22. w-menu
  23. template(#activator="{ on }")
  24. w-button(v-on="on") Show menu
  25. | Menu content
  26. w-badge.mr10(bg-color="error")
  27. template(#badge) 3
  28. w-icon(color="grey-light1" size="2.5em") mdi mdi-email
  29. SideBar(
  30. v-if="showSidebar"
  31. :pid="getPid"
  32. @updatePid="setPid"
  33. @hide="showSidebar = false"
  34. )
  35. RouterView(
  36. :pid="getPid"
  37. @updatePid="setPid"
  38. @show-sidebar="showSidebar = !showSidebar"
  39. )
  40. </template>
  41. <script>
  42. import 'wave-ui/dist/wave-ui.css'
  43. import SideBar from './components/SideBar.vue'
  44. import { Chatter, currentProfile, StonkAlert } from './services'
  45. import { surveyFactory } from './utils'
  46. const DEV_MODE = import.meta.env.VITE_DEV == 'true'
  47. const DEV_PID = 45
  48. export default {
  49. components: { SideBar },
  50. data: () => ({
  51. showSidebar: false,
  52. sliderVal: 1,
  53. openDrawer: false,
  54. }),
  55. computed: {
  56. getPid: () => (currentProfile.id.value ? currentProfile.id.value : 999),
  57. },
  58. async created() {
  59. /** Get questions so we can compare against profile responses */
  60. await surveyFactory.getQuestions()
  61. /**
  62. * Development mode turns router guards off so
  63. * we hard set the profile id instead of
  64. * using the login form
  65. */
  66. if (DEV_MODE) {
  67. this.setPid(DEV_PID)
  68. }
  69. if (currentProfile.isLoggedIn) {
  70. console.warn(`setting up Chatter and Toaster for ${this.getPid}...`)
  71. this.setupChatter()
  72. this.setupToaster()
  73. }
  74. console.log('---')
  75. },
  76. methods: {
  77. /**
  78. * Sync up this components state with
  79. * the currentProfile handler
  80. */
  81. setPid(profileId) {
  82. currentProfile.login(profileId)
  83. },
  84. /**
  85. * For push notifications and chat
  86. */
  87. setupToaster() {
  88. const t = new StonkAlert(this.getPid)
  89. },
  90. setupChatter() {
  91. const c = new Chatter()
  92. const testAccountUUID = import.meta.env.VITE_TEST_ACCOUNT_UUID
  93. c.setup(testAccountUUID)
  94. },
  95. },
  96. }
  97. </script>