Skip to content

Commit

Permalink
website: Add Logs page to website
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoMario109 committed Jul 24, 2024
1 parent 2af4464 commit d64d4ac
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
15 changes: 14 additions & 1 deletion website/src/layouts/default/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
<v-app-bar-title>
BlueOS Store Apps
</v-app-bar-title>
<v-spacer></v-spacer>
<v-btn :to="buttonRoute">{{ buttonText }}</v-btn>
</v-app-bar>
</template>

<script lang="ts" setup>
//
import { computed } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const buttonText = computed(() => {
return route.path === '/logs' ? 'Home' : 'Logs'
})
const buttonRoute = computed(() => {
return route.path === '/logs' ? '/' : '/logs'
})
</script>
5 changes: 5 additions & 0 deletions website/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const routes = [
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "home" */ '@/views/Home.vue'),
},
{
path: 'logs',
name: 'Logs',
component: () => import(/* webpackChunkName: "logs" */ '@/views/Logs.vue'),
},
],
},
]
Expand Down
35 changes: 35 additions & 0 deletions website/src/views/Logs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<div>
<h1>Generation Logs</h1>
<JsonViewer
:value="data"
:expand-depth=5
copyable
sort
/>
</div>
</template>

<script lang="ts" setup>
import { onMounted, ref } from 'vue'
// @ts-expect-error Lib does not have types
import JsonViewer from 'vue-json-viewer'

const data = ref({})

onMounted(async () => {
try {
const response = await fetch("manifest.log")
data.value = await response.json()
} catch (e) {
console.error('Failed to load manifest.log', e)
}
})
</script>

<style scoped>
h1 {
text-align: center;
margin-bottom: 20px;
}
</style>

0 comments on commit d64d4ac

Please sign in to comment.