New Backend changes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<UDashboardNavbar title="Home">
|
||||
<!-- <UDashboardNavbar title="Home">
|
||||
<template #right>
|
||||
<!-- <UTooltip text="Notifications" :shortcuts="['N']">
|
||||
<UButton color="gray" variant="ghost" square @click="isNotificationsSlideoverOpen = true">
|
||||
@@ -57,7 +57,7 @@
|
||||
<display-open-tasks/>
|
||||
</UDashboardCard>
|
||||
</UPageGrid>
|
||||
</UDashboardPanelContent>
|
||||
</UDashboardPanelContent>-->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
@@ -22,10 +22,7 @@ const mode = ref("list")
|
||||
const items = ref([])
|
||||
const item = ref({})
|
||||
|
||||
|
||||
|
||||
const setupPage = async (sort_column = null,sort_direction = null) => {
|
||||
loaded.value = false
|
||||
const setupPage = async () => {
|
||||
|
||||
if(await useCapacitor().getIsPhone()) {
|
||||
setPageLayout("mobile")
|
||||
@@ -35,18 +32,23 @@ const setupPage = async (sort_column = null,sort_direction = null) => {
|
||||
|
||||
if(mode.value === "show") {
|
||||
//Load Data for Show
|
||||
//item.value = await useSupabaseSelectSingle(type, route.params.id, dataType.supabaseSelectWithInformation || "*")
|
||||
item.value = await useEntities(type).selectSingle(route.params.id,"*",true)
|
||||
} else if(mode.value === "edit") {
|
||||
//Load Data for Edit
|
||||
//const data = JSON.stringify((await supabase.from(type).select().eq("id", route.params.id).single()).data)
|
||||
//await useSupabaseSelectSingle(type, route.params.id)
|
||||
item.value = JSON.stringify(await useEntities(type).selectSingle(route.params.id))
|
||||
//item.value = data
|
||||
|
||||
} else if(mode.value === "create") {
|
||||
//Load Data for Create
|
||||
item.value = JSON.stringify({})
|
||||
|
||||
console.log(item.value)
|
||||
} else if(mode.value === "list") {
|
||||
//Load Data for List
|
||||
items.value = await useEntities(type).select(dataType.supabaseSelectWithInformation, sort_column || dataType.supabaseSortColumn , sort_direction === "asc")
|
||||
items.value = await useEntities(type).select()
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
@@ -66,19 +68,17 @@ setupPage()
|
||||
:platform="platform"
|
||||
/>
|
||||
<EntityEdit
|
||||
v-else-if="(mode === 'edit' || mode === 'create')"
|
||||
v-else-if="loaded && (mode === 'edit' || mode === 'create')"
|
||||
:type="route.params.type"
|
||||
:item="item"
|
||||
:mode="mode"
|
||||
:platform="platform"
|
||||
/>
|
||||
<EntityList
|
||||
:loading="!loaded"
|
||||
v-else-if="mode === 'list'"
|
||||
v-else-if="loaded && mode === 'list'"
|
||||
:type="type"
|
||||
:items="items"
|
||||
:platform="platform"
|
||||
@sort="(i) => setupPage(i.sort_column, i.sort_direction)"
|
||||
/>
|
||||
<UProgress
|
||||
v-else
|
||||
|
||||
Reference in New Issue
Block a user