Skip to content

Commit

Permalink
fix: scandir
Browse files Browse the repository at this point in the history
  • Loading branch information
phillychi3 committed Dec 26, 2024
1 parent 298ebe7 commit 4a01bf4
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions frontend/web/src/routes/app/setting/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@
error = null
}
function handleSelect() {
console.log('selected path:', currentPath)
closeModal()
}
async function handleScan() {
try {
scanStatus = '掃描中...'
Expand Down Expand Up @@ -185,7 +181,6 @@
</div>
{/if}
{#if activeTab === 'directory'}
<!-- 原有的目錄選擇介面 -->
<div class="form-control mb-4">
<div class="input-group flex flex-row">
<input
Expand Down Expand Up @@ -236,12 +231,12 @@
</ul>
</div>
<div class="max-h-96 overflow-y-auto">
<table class="table table-zebra">
<table class="table-zebra table">
<tbody> </tbody><tbody>
{#each dirs as dir}
<tr class="hover cursor-pointer" onclick={() => handleDirClick(dir)}>
<td>
<Folder size={20} class="mr-2 inline text-primary" />
<Folder size={20} class="text-primary mr-2 inline" />
{dir}
</td>
</tr>
Expand All @@ -251,7 +246,7 @@
</div>
<div class="modal-action">
<button class="btn btn-ghost" onclick={closeModal}>取消</button>
<button class="btn btn-primary" onclick={handleSelect}>開始掃描</button>
<button class="btn btn-primary" onclick={handleScanDir}>開始掃描</button>
</div>
{:else}
<div class="form-control">
Expand Down Expand Up @@ -310,20 +305,20 @@
</div>
{/if}
<div class="max-h-96 overflow-y-auto">
<table class="table table-zebra">
<table class="table-zebra table">
<tbody>
{#each dirs as dir}
<tr class="hover cursor-pointer" onclick={() => handleDirClick(dir)}>
<td>
<Folder size={20} class="mr-2 inline text-primary" />
<Folder size={20} class="text-primary mr-2 inline" />
{dir}
</td>
</tr>
{/each}
{#each files as file}
<tr class="hover" onclick={() => handleFileClick(file)}>
<td>
<File size={20} class="mr-2 inline text-secondary" />
<File size={20} class="text-secondary mr-2 inline" />
{file}
</td>
</tr>
Expand All @@ -334,11 +329,7 @@
</div>
<div class="modal-action">
<button class="btn btn-ghost" onclick={closeModal}>取消</button>
<button
class="btn btn-primary"
onclick={handleScanDir}
disabled={scanStatus === '掃描中...'}
>
<button class="btn btn-primary" onclick={handleScan} disabled={scanStatus === '掃描中...'}>
{scanStatus === '掃描中...' ? '掃描中...' : '開始掃描'}
</button>
</div>
Expand Down

0 comments on commit 4a01bf4

Please sign in to comment.