Add property list

This commit is contained in:
Jordan Goulder 2025-01-13 01:03:53 -05:00
parent 4ae049f5d4
commit 85e07598d4
2 changed files with 51 additions and 0 deletions

View File

@ -1,6 +1,7 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { getBiosParameterBlock } from '@/floppy/disk.ts'
import PropertyList from '@/components/PropertyList.vue'
const { data = new ArrayBuffer(0) } = defineProps<{ data: ArrayBuffer }>()
@ -12,6 +13,7 @@ const biosParameterBlock = computed(() => {
<template>
<section v-if="biosParameterBlock">
<h3>BIOS Parameter Block (BPB)</h3>
<PropertyList :obj="biosParameterBlock" />
<pre>{{ biosParameterBlock }}</pre>
</section>
</template>

View File

@ -0,0 +1,49 @@
<script lang="ts" setup>
const { obj = {} } = defineProps<{ obj: { [index: string]: unknown } }>()
</script>
<template>
<table>
<thead>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr v-for="property in Object.keys(obj)" :key="property">
<td>
<span>{{ property }}</span>
</td>
<td>
<span>{{ obj[property] }}</span>
</td>
</tr>
</tbody>
</table>
</template>
<style scoped>
table {
background-color: white;
border-collapse: collapse;
}
td,
th {
padding: 0.25em 0.5em;
border: 1px solid black;
}
td:first-child,
th:first-child {
text-align: right;
}
td:last-child span {
white-space: pre;
margin: 0.5em;
background: black;
color: white;
}
</style>