mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-16 22:20:51 +01:00
minor imps
This commit is contained in:
@ -23,6 +23,10 @@
|
|||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
<li class="ml-2">
|
<li class="ml-2">
|
||||||
|
<UiTooltip
|
||||||
|
:tooltip="t('edit')"
|
||||||
|
class="[--placement:bottom]"
|
||||||
|
>
|
||||||
<NuxtLinkLocale
|
<NuxtLinkLocale
|
||||||
:to="{
|
:to="{
|
||||||
name: 'passwordGroupEdit',
|
name: 'passwordGroupEdit',
|
||||||
@ -31,15 +35,27 @@
|
|||||||
>
|
>
|
||||||
<Icon name="mdi:pencil" />
|
<Icon name="mdi:pencil" />
|
||||||
</NuxtLinkLocale>
|
</NuxtLinkLocale>
|
||||||
|
</UiTooltip>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { UiTooltip } from '#components'
|
||||||
import type { SelectHaexPasswordsGroups } from '~~/src-tauri/database/schemas/vault'
|
import type { SelectHaexPasswordsGroups } from '~~/src-tauri/database/schemas/vault'
|
||||||
|
|
||||||
const groups = defineProps<{ items: SelectHaexPasswordsGroups[] }>()
|
const groups = defineProps<{ items: SelectHaexPasswordsGroups[] }>()
|
||||||
|
|
||||||
const lastGroup = computed(() => groups.items.at(-1))
|
const lastGroup = computed(() => groups.items.at(-1))
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<i18n lang="yaml">
|
||||||
|
de:
|
||||||
|
edit: Bearbeiten
|
||||||
|
|
||||||
|
en:
|
||||||
|
edit: Edit
|
||||||
|
</i18n>
|
||||||
|
|||||||
@ -95,7 +95,6 @@ const onClickItemAsync = async (item: IPasswordMenuItem) => {
|
|||||||
|
|
||||||
if (!selectedItems.value.size) longPressedHook.value = false
|
if (!selectedItems.value.size) longPressedHook.value = false
|
||||||
} else {
|
} else {
|
||||||
search.value = ''
|
|
||||||
if (item.type === 'group')
|
if (item.type === 'group')
|
||||||
await navigateTo(
|
await navigateTo(
|
||||||
localePath({
|
localePath({
|
||||||
@ -114,6 +113,7 @@ const onClickItemAsync = async (item: IPasswordMenuItem) => {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
search.value = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,13 +11,10 @@
|
|||||||
</slot>
|
</slot>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
class="tooltip-content tooltip-shown:opacity-100 tooltip-shown:visible z-40 pointer-events-none"
|
class="tooltip-content tooltip-shown:opacity-100 tooltip-shown:visible pointer-events-none z-50"
|
||||||
role="tooltip"
|
role="tooltip"
|
||||||
>
|
>
|
||||||
<span
|
<span class="tooltip-body">
|
||||||
class="tooltip-body"
|
|
||||||
v-bind="$attrs"
|
|
||||||
>
|
|
||||||
{{ tooltip }}
|
{{ tooltip }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -57,8 +54,4 @@ const props = defineProps({
|
|||||||
default: 'hover',
|
default: 'hover',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
defineOptions({
|
|
||||||
inheritAttrs: false,
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<button
|
<button
|
||||||
ref="sidebarToogleRef"
|
ref="sidebarToogleRef"
|
||||||
type="button"
|
type="button"
|
||||||
class="btn btn-text btn-square me-2 z-50"
|
class="btn btn-text btn-square me-2 z-30"
|
||||||
aria-haspopup="dialog"
|
aria-haspopup="dialog"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
aria-controls="sidebar"
|
aria-controls="sidebar"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="h-full overflow-auto px-2 relative">
|
<div class="h-full overflow-auto p-2 relative">
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<div class="min-h-full flex flex-col">
|
<div class="min-h-full flex flex-col">
|
||||||
<HaexPassGroupBreadcrumbs
|
<HaexPassGroupBreadcrumbs
|
||||||
:items="breadCrumbs"
|
:items="breadCrumbs"
|
||||||
class="px-2 sticky top-0 z-10 bg-base-200"
|
class="px-2 sticky -top-2 z-10 bg-base-200"
|
||||||
v-show="breadCrumbs.length"
|
v-show="breadCrumbs.length"
|
||||||
/>
|
/>
|
||||||
<div class="flex-1 overflow-auto py-1">
|
<div class="flex-1 overflow-auto py-1">
|
||||||
|
|||||||
@ -110,6 +110,7 @@
|
|||||||
|
|
||||||
<HaexPassDialogUnsavedChanges
|
<HaexPassDialogUnsavedChanges
|
||||||
:has-changes="hasChanges"
|
:has-changes="hasChanges"
|
||||||
|
v-model:ignore-changes="ignoreChanges"
|
||||||
@abort="showUnsavedChangesDialog = false"
|
@abort="showUnsavedChangesDialog = false"
|
||||||
@confirm="onConfirmIgnoreChanges"
|
@confirm="onConfirmIgnoreChanges"
|
||||||
v-model:open="showUnsavedChangesDialog"
|
v-model:open="showUnsavedChangesDialog"
|
||||||
@ -189,6 +190,7 @@ const { deleteAsync, updateAsync } = usePasswordItemStore()
|
|||||||
const { syncGroupItemsAsync } = usePasswordGroupStore()
|
const { syncGroupItemsAsync } = usePasswordGroupStore()
|
||||||
const { currentGroupId, inTrashGroup } = storeToRefs(usePasswordGroupStore())
|
const { currentGroupId, inTrashGroup } = storeToRefs(usePasswordGroupStore())
|
||||||
|
|
||||||
|
const ignoreChanges = ref(false)
|
||||||
const onUpdateAsync = async () => {
|
const onUpdateAsync = async () => {
|
||||||
try {
|
try {
|
||||||
const newId = await updateAsync({
|
const newId = await updateAsync({
|
||||||
@ -200,16 +202,17 @@ const onUpdateAsync = async () => {
|
|||||||
})
|
})
|
||||||
if (newId) add({ type: 'success', text: t('success.update') })
|
if (newId) add({ type: 'success', text: t('success.update') })
|
||||||
syncGroupItemsAsync(currentGroupId.value)
|
syncGroupItemsAsync(currentGroupId.value)
|
||||||
onClose(true)
|
ignoreChanges.value = true
|
||||||
|
onClose()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
add({ type: 'error', text: t('error.update') })
|
add({ type: 'error', text: t('error.update') })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClose = (ignoreChanges?: boolean) => {
|
const onClose = () => {
|
||||||
if (showConfirmDeleteDialog.value || showUnsavedChangesDialog.value) return
|
if (showConfirmDeleteDialog.value || showUnsavedChangesDialog.value) return
|
||||||
|
|
||||||
if (hasChanges.value && !ignoreChanges)
|
if (hasChanges.value && !ignoreChanges.value)
|
||||||
return (showUnsavedChangesDialog.value = true)
|
return (showUnsavedChangesDialog.value = true)
|
||||||
|
|
||||||
read_only.value = true
|
read_only.value = true
|
||||||
@ -222,7 +225,7 @@ const deleteItemAsync = async () => {
|
|||||||
showConfirmDeleteDialog.value = false
|
showConfirmDeleteDialog.value = false
|
||||||
add({ type: 'success', text: t('success.delete') })
|
add({ type: 'success', text: t('success.delete') })
|
||||||
await syncGroupItemsAsync(currentGroupId.value)
|
await syncGroupItemsAsync(currentGroupId.value)
|
||||||
onClose(true)
|
onClose()
|
||||||
} catch (errro) {
|
} catch (errro) {
|
||||||
add({
|
add({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
@ -244,7 +247,8 @@ const hasChanges = computed(
|
|||||||
const showUnsavedChangesDialog = ref(false)
|
const showUnsavedChangesDialog = ref(false)
|
||||||
const onConfirmIgnoreChanges = () => {
|
const onConfirmIgnoreChanges = () => {
|
||||||
showUnsavedChangesDialog.value = false
|
showUnsavedChangesDialog.value = false
|
||||||
onClose(true)
|
ignoreChanges.value = true
|
||||||
|
onClose()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user