chore: fix ui
This commit is contained in:
@ -34,6 +34,8 @@ const filtered = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function addDocument() {
|
function addDocument() {
|
||||||
|
if (editing.value)
|
||||||
|
return
|
||||||
editing.value = true
|
editing.value = true
|
||||||
selectedDocument.value = {}
|
selectedDocument.value = {}
|
||||||
for (const field of fields.value) {
|
for (const field of fields.value) {
|
||||||
@ -80,12 +82,16 @@ async function deleteDocument(document: any) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div ref="dbContainer">
|
<div ref="dbContainer">
|
||||||
<Navbar v-model:search="search" sticky top-0 p4 backdrop-blur z-10>
|
<Navbar v-model:search="search" sticky top-0 px4 py2 backdrop-blur z-10>
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<NButton icon="carbon:add" n="green" @click="addDocument">
|
<NButton icon="carbon:add" n="green" @click="addDocument">
|
||||||
Add Document
|
Add Document
|
||||||
</NButton>
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
|
<div op50>
|
||||||
|
<span v-if="search">{{ filtered.length }} matched · </span>
|
||||||
|
<span>{{ documents?.length }} documents in total</span>
|
||||||
|
</div>
|
||||||
</Navbar>
|
</Navbar>
|
||||||
<table v-if="documents?.length" w-full mb10 :class="{ 'editing-mode': editing }">
|
<table v-if="documents?.length" w-full mb10 :class="{ 'editing-mode': editing }">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@ -8,6 +8,10 @@ defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: 'Search...',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@ -20,11 +24,11 @@ function update(event: any) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div flex="~ col gap2" border="b base" flex-1 navbar-glass pb4 :class="[{ p4: !noPadding }]">
|
<div flex="~ col gap2" border="b base" flex-1 navbar-glass :class="[{ p4: !noPadding }]">
|
||||||
<div flex="~ gap4">
|
<div flex="~ gap4">
|
||||||
<slot name="search">
|
<slot name="search">
|
||||||
<NTextInput
|
<NTextInput
|
||||||
placeholder="Search..."
|
:placeholder="placeholder"
|
||||||
icon="carbon-search"
|
icon="carbon-search"
|
||||||
n="primary" flex-auto
|
n="primary" flex-auto
|
||||||
:class="{ 'px-5 py-2': !noPadding }"
|
:class="{ 'px-5 py-2': !noPadding }"
|
||||||
|
|||||||
@ -27,13 +27,13 @@ onMounted(() => {
|
|||||||
<PanelLeftRight :min-left="13" :max-left="20">
|
<PanelLeftRight :min-left="13" :max-left="20">
|
||||||
<template #left>
|
<template #left>
|
||||||
<div py1 px4>
|
<div py1 px4>
|
||||||
<div flex items-center p2>
|
<Navbar v-model:search="search" :placeholder="`${collections?.length ?? '-'} collection in total`" mt1>
|
||||||
<!-- TODO: -->
|
<div flex items-center gap2>
|
||||||
<NIconButton w-full mb2 icon="carbon-reset" title="Refresh" />
|
<NIconButton w-full mb1.5 icon="carbon-reset" title="Refresh" />
|
||||||
<NIconButton w-full mb2 icon="carbon-data-base" title="Connection Name" :class="connected ? 'text-green-5' : 'text-orange-5'" />
|
<NIconButton w-full mb1.5 icon="carbon-data-base" title="Connection Name" :class="connected ? 'text-green-5' : 'text-orange-5'" />
|
||||||
<NIconButton w-full mb2 icon="carbon-add" title="Create Table" @click="drawer = !drawer" />
|
<NIconButton w-full mb1.5 icon="carbon-add" title="Create Table" @click="drawer = !drawer" />
|
||||||
</div>
|
</div>
|
||||||
<NTextInput v-model="search" w-full p2 mb2 :placeholder="`${collections?.length ?? '-'} collection in total`" icon="carbon-search" />
|
</Navbar>
|
||||||
<div grid gird-cols-1 my2 mx1>
|
<div grid gird-cols-1 my2 mx1>
|
||||||
<NuxtLink v-for="table in filtered" :key="table.name" :to="{ name: 'index', query: { table: table.name } }" flex justify-between p2 my1 hover-bg-green hover-bg-opacity-5 hover-text-green rounded-lg :class="{ 'bg-green bg-opacity-5 text-green': selectedCollection === table.name }" @click="selectedCollection = table.name">
|
<NuxtLink v-for="table in filtered" :key="table.name" :to="{ name: 'index', query: { table: table.name } }" flex justify-between p2 my1 hover-bg-green hover-bg-opacity-5 hover-text-green rounded-lg :class="{ 'bg-green bg-opacity-5 text-green': selectedCollection === table.name }" @click="selectedCollection = table.name">
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
Reference in New Issue
Block a user