Remove unused buckets and directory_upload pages
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
<script>
|
||||
import { onMount, createEventDispatcher } from "svelte";
|
||||
import { fs_create_directory } from "../FilesystemAPI.svelte";
|
||||
import { fs_mkdir } from "../FilesystemAPI.js";
|
||||
let dispatch = createEventDispatcher()
|
||||
|
||||
export let state;
|
||||
let name_input;
|
||||
let create_dir_name = ""
|
||||
let new_dir_name = ""
|
||||
let create_dir = () => {
|
||||
dispatch("loading", true)
|
||||
|
||||
let form = new FormData()
|
||||
form.append("type", "dir")
|
||||
|
||||
fs_create_directory(
|
||||
state.root.id, state.base.path, create_dir_name,
|
||||
fs_mkdir(
|
||||
state.root.id, state.base.path+"/"+new_dir_name,
|
||||
).then(resp => {
|
||||
create_dir_name = "" // Clear input field
|
||||
new_dir_name = "" // Clear input field
|
||||
}).catch(err => {
|
||||
alert("Error: "+err)
|
||||
}).finally(() => {
|
||||
@@ -28,7 +28,7 @@ onMount(() => { name_input.focus() })
|
||||
|
||||
<form class="create_dir highlight_shaded" on:submit|preventDefault={create_dir}>
|
||||
<img src="/res/img/mime/folder.png" class="icon" alt="icon"/>
|
||||
<input class="dirname" type="text" style="width: 100%;" bind:this={name_input} bind:value={create_dir_name} />
|
||||
<input class="dirname" type="text" style="width: 100%;" bind:this={name_input} bind:value={new_dir_name} />
|
||||
<input class="submit" type="submit" value="create"/>
|
||||
</form>
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { fs_delete_node } from './../FilesystemAPI.svelte'
|
||||
import { fs_delete } from './../FilesystemAPI.js'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import CreateDirectory from './CreateDirectory.svelte'
|
||||
import FileUploader from './FileUploader.svelte'
|
||||
@@ -67,7 +67,7 @@ const delete_selected = () => {
|
||||
let promises = []
|
||||
state.children.forEach(child => {
|
||||
if (!child.fm_selected) { return }
|
||||
promises.push(fs_delete_node(state.root.id, child.path))
|
||||
promises.push(fs_delete(state.root.id, child.path))
|
||||
})
|
||||
|
||||
// Wait for all the promises to finish
|
||||
|
@@ -67,17 +67,13 @@ const upload_file = () => {
|
||||
|
||||
console.log(job);
|
||||
|
||||
let form = new FormData();
|
||||
form.append("type", "file");
|
||||
form.append("file", job.file);
|
||||
|
||||
let url = window.api_endpoint+"/filesystem/"+bucket_id+encodeURIComponent(job.target_dir + "/" + job.file.name)
|
||||
if (write_password) {
|
||||
url += "?write_password="+write_password
|
||||
}
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url, true);
|
||||
xhr.open("PUT", url, true);
|
||||
xhr.timeout = 21600000; // 6 hours, to account for slow connections
|
||||
|
||||
// Report progress updates back to the caller
|
||||
@@ -147,7 +143,8 @@ const upload_file = () => {
|
||||
|
||||
upload_jobs = upload_jobs;
|
||||
};
|
||||
xhr.send(form);
|
||||
|
||||
xhr.send(job.file);
|
||||
};
|
||||
|
||||
// File input dialog handling
|
||||
|
@@ -49,8 +49,9 @@ const node_icon = node => {
|
||||
<div class="directory">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>name</td>
|
||||
<td>size</td>
|
||||
<td>Name</td>
|
||||
<td>Size</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{#each state.children as child, index (child.path)}
|
||||
<a
|
||||
@@ -71,6 +72,13 @@ const node_icon = node => {
|
||||
{formatDataVolume(child.file_size, 3)}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{#if child.id}
|
||||
<a href="/d/{child.id}" on:click|stopPropagation>
|
||||
<i class="icon" title="This file / directory is shared. Click to open public link">share</i>
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user