index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!-- eslint-disable max-len -->
  2. <script setup lang="ts">
  3. import { ref, watch, watchEffect } from 'vue'
  4. import { useDevtoolsHook } from '../composables/useDevtoolsHook'
  5. const { scene, connected, state } = useDevtoolsHook()
  6. /* watch(scene, () => {
  7. console.log('scene changed', scene.value)
  8. }, {
  9. immediate: true,
  10. }) */
  11. // Scene scene
  12. </script>
  13. <template>
  14. <div class="panel-grids-center h-full">
  15. <div class="max-w-300 w-full px20 ma">
  16. <div class="flex flex-wrap gap2">
  17. <RouterLink
  18. to="/scene-graph"
  19. class="p4 replace min-w-40 p4 theme-card-lime flex-col flex-auto"
  20. >
  21. <Icon
  22. class="text-4xl"
  23. name="i-carbon-web-services-container"
  24. />
  25. <code>Scene Graph</code>
  26. </RouterLink>
  27. <RouterLink
  28. to="/scene-graph"
  29. class="p4 replace min-w-40 p4 theme-card-lime flex-col flex-auto"
  30. >
  31. <Icon
  32. class="text-4xl"
  33. name="i-iconoir-dashboard-speed"
  34. />
  35. <code>Performance</code>
  36. </RouterLink>
  37. </div>
  38. </div>
  39. <!-- <div
  40. v-if="scene.objects > 0"
  41. class="flex flex-col gap-2"
  42. >
  43. <NSectionBlock
  44. icon="i-iconoir-movie"
  45. text="Scene Graph"
  46. :description="`Total Objects ${scene.objects}`"
  47. >
  48. <SceneGraphItem :item="scene.graph" />
  49. </NSectionBlock>
  50. <NSectionBlock
  51. icon="i-iconoir-dashboard-speed"
  52. text="Performance"
  53. >
  54. <template #actions>
  55. <NBadge n="green">
  56. FPS: {{ fps.value }}
  57. </NBadge>
  58. <NBadge
  59. n="yellow"
  60. >
  61. Memory: {{ Math.round(memory?.currentMem) }}MB
  62. </NBadge>
  63. </template>
  64. <template #default>
  65. <PerformanceMonitor />
  66. </template>
  67. </NSectionBlock>
  68. </div>
  69. <div v-else-if="scene.objects === 0">
  70. <div class="p4 h-full">
  71. <NLoading />
  72. </div>
  73. </div>
  74. <div v-else>
  75. <NTip n="yellow">
  76. Failed to connect to the client. Did you open this page inside Nuxt DevTools?
  77. </NTip>
  78. </div> -->
  79. </div>
  80. </template>