🚸 Select download path

This commit is contained in:
zhbaor 2023-03-04 18:18:39 +08:00
parent afc9c112cb
commit 3b5a998aaa
7 changed files with 303 additions and 18 deletions

View file

@ -57,14 +57,12 @@ const progress_info = computed(() => {
});
function start_download() {
axios.post("http://localhost:8000/download", {
parent_dir: "/home/zhao/Desktop/tmp",
});
axios.get("/download");
}
onMounted(() => {
setInterval(() => {
axios.get("http://localhost:8000/progress").then((resp) => {
axios.get("/progress").then((resp) => {
state_list.value = resp.data;
});
}, 200);

View file

@ -8,18 +8,38 @@ const nvlist = ref("");
const axios = inject("axios");
const path = ref("");
onMounted(() => {
input.value.focus();
});
function sendNVList() {
axios.post("http://localhost:8000/video", { nvlist: nvlist.value });
axios.post("/video", { nvlist: nvlist.value });
emit("change-stage");
}
function get_path() {
axios.get("/path").then(({ data }) => {
path.value = data;
input.value.focus();
});
}
</script>
<template>
<div class="container-fluid vh-100 bg-body-secondary d-flex flex-column p-3">
<div class="mb-3 row g-2">
<div class="col-auto">
<label class="col-form-label">Download Path:</label>
</div>
<div class="col">
<input class="form-control" type="text" v-model="path" />
</div>
<div class="col-auto">
<button class="btn btn-primary" @click="get_path">Choose</button>
</div>
</div>
<textarea
ref="input"
v-model="nvlist"