feat: add uploadFiles prompt

This commit is contained in:
filippofinke 2022-02-15 22:22:31 +01:00
parent cff50715a0
commit 7f421b421f
4 changed files with 76 additions and 18 deletions

View File

@ -19,6 +19,7 @@ import Replace from "./Replace";
import ReplaceRename from "./ReplaceRename";
import Share from "./Share";
import Upload from "./Upload";
import UploadFiles from "./UploadFiles";
import ShareDelete from "./ShareDelete";
import { mapState } from "vuex";
import buttons from "@/utils/buttons";
@ -40,6 +41,7 @@ export default {
ReplaceRename,
Upload,
ShareDelete,
UploadFiles,
},
data: function () {
return {
@ -99,15 +101,14 @@ export default {
"replace-rename",
"share",
"upload",
"uploadFiles",
"share-delete",
].indexOf(this.show) >= 0;
return (matched && this.show) || null;
},
showOverlay: function () {
return (
this.show !== null && this.show !== "search" && this.show !== "more"
);
return this.show !== null && this.show !== "search" && this.show !== "more";
},
},
methods: {

View File

@ -0,0 +1,36 @@
<template>
<div class="upload-files">
<div class="card floating">
<div class="card-title">
<h2>{{ $t("prompts.uploadFiles") }}</h2>
</div>
<div class="card-content">
<div class="file" v-for="file in filesInUpload" :key="file.id">
<div class="file-name">{{ file.name }}</div>
<div class="file-progress">
<div v-bind:style="{ width: file.progress + '%' }"></div>
</div>
</div>
</div>
<div class="card-action">
<button type="submit" @click="$store.commit('closeHovers')" class="button button--flat" :aria-label="$t('buttons.close')" :title="$t('buttons.close')">
{{ $t("buttons.close") }}
</button>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
name: "uploadFiles",
computed: {
...mapGetters(["filesInUpload"]),
},
methods: {},
};
</script>

View File

@ -116,30 +116,50 @@ main {
}
.progress {
position: absolute;
bottom: 0;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 30px;
height: 3px;
z-index: 9999999999;
}
.progress div,
.files div div {
.progress div {
height: 100%;
background-color: #40c4ff;
width: 0;
transition: 0.2s ease width;
display: flex;
align-items: center;
justify-content: center;
}
.files div div {
height: 30px;
overflow: hidden;
background-color: #329fd1;
}
.break-word {
word-break: break-all;
}
.upload-files .card.floating {
top: 4em;
left: auto;
right: 0;
transform: none;
}
.upload-files .file {
margin-bottom: 8px;
}
.upload-files .file .file-name {
font-size: 1.1em;
}
.upload-files .file .file-progress {
margin-top: 2px;
width: 100%;
height: 5px;
}
.upload-files .file .file-progress div {
height: 100%;
background-color: #40c4ff;
width: 0;
transition: 0.2s ease width;
border-radius: 10px;
}

View File

@ -100,7 +100,7 @@
"ru": "Русский",
"sk": "Slovenčina",
"svSE": "Swedish (Sweden)",
"tr" : "Türkçe",
"tr": "Türkçe",
"ua": "Українська",
"zhCN": "中文 (简体)",
"zhTW": "中文 (繁體)"
@ -151,6 +151,7 @@
"show": "Show",
"size": "Size",
"upload": "Upload",
"uploadFiles": "Files in upload",
"uploadMessage": "Select an option to upload.",
"optionalPassword": "Optional password"
},