1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Additions

This commit is contained in:
2020-06-10 19:29:10 +02:00
parent beb48eaf2e
commit 1c3323b537
14 changed files with 320 additions and 100 deletions

View File

@ -0,0 +1,56 @@
<template>
<div v-if="results" class="table table-hover">
<div class="thead">
<div class="tr">
<div
v-for="field in results.fields"
:key="field.name"
class="th"
>
{{ field.name }}
</div>
</div>
</div>
<div class="tbody">
<div
v-for="(row, rKey) in results.rows"
:key="rKey"
class="tr"
tabindex="0"
>
<div
v-for="(col, cKey) in row"
:key="cKey"
class="td"
:class="fieldType(col)"
>
{{ col }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'WorkspaceQueryTable',
props: {
results: Object
},
methods: {
fieldType (col) {
let type = typeof col;
if (type === 'object')
if (col instanceof Date) type = 'date';
if (col instanceof Uint8Array) type = 'blob';
if (col === null) type = 'null';
return `type-${type}`;
}
}
};
</script>
<style>
</style>