mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Additions
This commit is contained in:
56
src/renderer/components/WorkspaceQueryTable.vue
Normal file
56
src/renderer/components/WorkspaceQueryTable.vue
Normal 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>
|
Reference in New Issue
Block a user