mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
fix submit handler
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="p-2 h-full">
|
||||
<div class="p-2 min-h-full">
|
||||
<NuxtPage />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
currentGroup{{ currentGroup }}
|
||||
<HaexPassGroup
|
||||
v-model="group"
|
||||
mode="edit"
|
||||
@ -26,8 +27,8 @@ const group = ref<SelectHaexPasswordsGroups>()
|
||||
|
||||
watch(
|
||||
currentGroup,
|
||||
(newGroup) => {
|
||||
group.value = JSON.parse(JSON.stringify(newGroup))
|
||||
() => {
|
||||
group.value = JSON.parse(JSON.stringify(currentGroup.value))
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
@ -43,7 +44,7 @@ const onClose = () => {
|
||||
|
||||
const { add } = useSnackbar()
|
||||
|
||||
const { updateAsync } = usePasswordGroupStore()
|
||||
const { updateAsync, syncGroupItemsAsync } = usePasswordGroupStore()
|
||||
|
||||
const onSaveAsync = async () => {
|
||||
try {
|
||||
@ -53,7 +54,7 @@ const onSaveAsync = async () => {
|
||||
if (errors.value.name.length || errors.value.description.length) return
|
||||
|
||||
await updateAsync(group.value)
|
||||
|
||||
syncGroupItemsAsync()
|
||||
add({ type: 'success', text: t('change.success') })
|
||||
onClose()
|
||||
} catch (error) {
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
<template>
|
||||
<div class="relative h-full">
|
||||
<div class="h-full relative">
|
||||
<div class="h-full">
|
||||
<HaexPassGroupBreadcrumbs
|
||||
:items="breadCrumbs"
|
||||
class="px-2 z-10 bg-base-200"
|
||||
v-show="breadCrumbs.length"
|
||||
/>
|
||||
<div class="h-full overflow-auto flex flex-col">
|
||||
<HaexPassGroupBreadcrumbs
|
||||
:items="breadCrumbs"
|
||||
class="px-2"
|
||||
v-show="breadCrumbs.length"
|
||||
/>
|
||||
|
||||
<HaexPassMobileMenu
|
||||
:menu-items="groupItems"
|
||||
ref="listRef"
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
:history="item.history"
|
||||
:read_only
|
||||
@close="onClose"
|
||||
@submit="onUpdateAsync"
|
||||
v-model:details="item.details"
|
||||
v-model:key-values-add="item.keyValuesAdd"
|
||||
v-model:key-values-delete="item.keyValuesDelete"
|
||||
@ -14,7 +15,7 @@
|
||||
class="fixed bottom-4 flex justify-between transition-all pointer-events-none right-0 sm:items-center items-end"
|
||||
:class="[isVisible ? 'left-15 ' : 'left-0']"
|
||||
>
|
||||
<div class="flex items-center justify-center w-full">
|
||||
<div class="flex items-center justify-center flex-1">
|
||||
<UiTooltip :tooltip="t('abort')">
|
||||
<UiButton
|
||||
class="btn-accent btn-square"
|
||||
@ -71,7 +72,7 @@
|
||||
</UiButton>
|
||||
</UiTooltip>
|
||||
|
||||
<div class="flex items-center justify-center w-full">
|
||||
<div class="flex items-center justify-center flex-1">
|
||||
<UiTooltip :tooltip="t('delete')">
|
||||
<UiButton
|
||||
class="btn-square btn-error"
|
||||
|
||||
@ -4,15 +4,16 @@
|
||||
:default-icon="currentGroup?.icon"
|
||||
:history="item.history"
|
||||
@close="onClose"
|
||||
@submit="onCreateAsync"
|
||||
v-model:details="item.details"
|
||||
v-model:key-values-add="item.keyValuesAdd"
|
||||
/>
|
||||
|
||||
<div
|
||||
class="fixed bottom-4 flex justify-between transition-all pointer-events-none right-15 sm:items-center items-end"
|
||||
class="fixed bottom-4 flex justify-between transition-all pointer-events-none right-0 sm:items-center items-end"
|
||||
:class="[isVisible ? 'left-15 ' : 'left-0']"
|
||||
>
|
||||
<div class="flex items-center justify-center w-full">
|
||||
<div class="flex items-center justify-center flex-1">
|
||||
<UiTooltip :tooltip="t('abort')">
|
||||
<UiButton
|
||||
class="btn-error btn-square"
|
||||
@ -33,7 +34,7 @@
|
||||
/>
|
||||
</UiButton>
|
||||
</UiTooltip>
|
||||
<div class="flex items-center justify-center w-full"></div>
|
||||
<div class="flex items-center justify-center flex-1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user