Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/JunaYa/ddu
Browse files Browse the repository at this point in the history
  • Loading branch information
JunaYa committed Nov 20, 2024
2 parents c628367 + df865ad commit fcb94fd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 82 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jobs:
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
args: ""
- platform: "windows-latest"
args: ""

runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -40,16 +36,8 @@ jobs:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.

- name: install frontend dependencies
run: pnpm install # change this to npm, pnpm or bun depending on which one you use.
run: npm i -g pnpm && pnpm i # change this to npm, pnpm or bun depending on which one you use.

- uses: tauri-apps/tauri-action@v0
env:
Expand All @@ -60,4 +48,4 @@ jobs:
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
args: ${{ matrix.args }}
62 changes: 0 additions & 62 deletions .github/workflows/test-build-only.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/SnapVault.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const isAscending = ref(false)
async function loadData() {
const val = await store.get<{ value: string }>('screenshot_path')
const entries = await readDir(`${val?.value}/images` ?? '')
const entries = await readDir(val?.value ? `${val?.value}/images` : '')
list.value = entries.filter(entry => entry.isFile && FileSizeFormatter.isPictureFile(entry.name)).map(entry => ({
id: entry.name,
Expand Down
11 changes: 6 additions & 5 deletions src/components/SnapVaultItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
import { confirm } from '@tauri-apps/plugin-dialog'
import { remove } from '@tauri-apps/plugin-fs'
import { useElementHover } from '@vueuse/core'
import { ref } from 'vue'
import { defineEmits, defineProps, ref } from 'vue'
import Button from '~/components/Button.vue'
import FileInfo from './FileInfo.vue'
import PictureReview from './PictureReview.vue'
defineProps<{
item: { id: string, image: string }
change?: () => void
}>()
const emit = defineEmits<{
(e: 'change'): void
}>()
const snapHoverableElement = ref()
const isHovered = useElementHover(snapHoverableElement)
const deleteLoading = ref(false)
async function handleDelete(path: string) {
console.log(path)
deleteLoading.value = true
const confirmation = await confirm(
'是否确认删除该文件?',
Expand All @@ -34,11 +36,10 @@ async function handleDelete(path: string) {
</script>

<template>
<div ref="snapHoverableElement" class="relative rounded-md bg-card p-2">
<div ref="snapHoverableElement" class="relative rounded-md bg-card p-2">
<PictureReview :image-path="item.image" />
<!-- button group delete | rename | copy -->
<div v-if="isHovered" class="absolute right-3 top-3 z-11 flex flex-row gap-2">
<Button class="btn-action-icon" anim @click="handleDelete(item.image)">
<Button class="btn-action-icon" anim @click="()=>handleDelete(item.image)">
<i class="h-4 w-4">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><path d="M12 12h2v12h-2z" fill="currentColor" /><path d="M18 12h2v12h-2z" fill="currentColor" /><path d="M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z" fill="currentColor" /><path d="M12 2h8v2h-8z" fill="currentColor" /></svg>
</i>
Expand Down

0 comments on commit fcb94fd

Please sign in to comment.