[ui] add "rescan vault" button
parent
c596da7514
commit
ab95457768
|
@ -27,6 +27,10 @@
|
|||
addEmitter.emit("files", Array.from(fileInput.files));
|
||||
}
|
||||
}
|
||||
|
||||
function rescan() {
|
||||
fetch("/api/refresh", { method: "POST" });
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="header">
|
||||
|
@ -45,7 +49,7 @@
|
|||
<Icon name="search" slot="prefix" />
|
||||
</Input>
|
||||
</div>
|
||||
<button class="add-button" on:click={() => fileInput.click()}>
|
||||
<button class="button" on:click={() => fileInput.click()}>
|
||||
<Icon name="plus-circle" />
|
||||
<input
|
||||
type="file"
|
||||
|
@ -54,12 +58,16 @@
|
|||
on:change={onFileChange}
|
||||
/>
|
||||
</button>
|
||||
<button class="button" on:click={() => rescan()} title="Rescan vault">
|
||||
<Icon name="refresh" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .5rem;
|
||||
padding: 0 0.5rem;
|
||||
height: 3.5rem;
|
||||
border-bottom: 1px solid var(--foreground);
|
||||
|
@ -91,16 +99,14 @@
|
|||
}
|
||||
|
||||
.input {
|
||||
margin-left: 1em;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.add-button {
|
||||
.button {
|
||||
border: 1px solid var(--foreground);
|
||||
border-radius: 4px;
|
||||
background: var(--background-lighter);
|
||||
color: var(--foreground);
|
||||
margin: 0 0.5em;
|
||||
padding: 0.25em 1em;
|
||||
line-height: 1;
|
||||
display: block;
|
||||
|
|
Loading…
Reference in New Issue