ci: fix formatting using project ESLint rules
This commit is contained in:
parent
f0d359f67a
commit
88354a3446
@ -108,7 +108,9 @@ export default {
|
|||||||
return (matched && this.show) || null;
|
return (matched && this.show) || null;
|
||||||
},
|
},
|
||||||
showOverlay: function () {
|
showOverlay: function () {
|
||||||
return this.show !== null && this.show !== "search" && this.show !== "more";
|
return (
|
||||||
|
this.show !== null && this.show !== "search" && this.show !== "more"
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -15,7 +15,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-action">
|
<div class="card-action">
|
||||||
<button type="submit" @click="$store.commit('closeHovers')" class="button button--flat" :aria-label="$t('buttons.close')" :title="$t('buttons.close')">
|
<button
|
||||||
|
type="submit"
|
||||||
|
@click="$store.commit('closeHovers')"
|
||||||
|
class="button button--flat"
|
||||||
|
:aria-label="$t('buttons.close')"
|
||||||
|
:title="$t('buttons.close')"
|
||||||
|
>
|
||||||
{{ $t("buttons.close") }}
|
{{ $t("buttons.close") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -14,7 +14,8 @@ const getters = {
|
|||||||
return Math.ceil((sum / totalSize) * 100);
|
return Math.ceil((sum / totalSize) * 100);
|
||||||
},
|
},
|
||||||
filesInUploadCount: (state) => {
|
filesInUploadCount: (state) => {
|
||||||
let total = Object.keys(state.upload.uploads).length + state.upload.queue.length;
|
let total =
|
||||||
|
Object.keys(state.upload.uploads).length + state.upload.queue.length;
|
||||||
return total;
|
return total;
|
||||||
},
|
},
|
||||||
filesInUpload: (state) => {
|
filesInUpload: (state) => {
|
||||||
|
|||||||
@ -97,7 +97,9 @@ const actions = {
|
|||||||
{ leading: true, trailing: false }
|
{ leading: true, trailing: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
await api.post(item.path, item.file, item.overwrite, onUpload).catch(Vue.prototype.$showError);
|
await api
|
||||||
|
.post(item.path, item.file, item.overwrite, onUpload)
|
||||||
|
.catch(Vue.prototype.$showError);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.dispatch("finishUpload", item);
|
context.dispatch("finishUpload", item);
|
||||||
|
|||||||
@ -35,7 +35,8 @@ export default {
|
|||||||
$route: function () {
|
$route: function () {
|
||||||
this.$store.commit("resetSelected");
|
this.$store.commit("resetSelected");
|
||||||
this.$store.commit("multiple", false);
|
this.$store.commit("multiple", false);
|
||||||
if (this.$store.state.show !== "success") this.$store.commit("closeHovers");
|
if (this.$store.state.show !== "success")
|
||||||
|
this.$store.commit("closeHovers");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,20 +2,68 @@
|
|||||||
<div>
|
<div>
|
||||||
<header-bar showMenu showLogo>
|
<header-bar showMenu showLogo>
|
||||||
<search /> <title />
|
<search /> <title />
|
||||||
<action class="search-button" icon="search" :label="$t('buttons.search')" @action="openSearch()" />
|
<action
|
||||||
|
class="search-button"
|
||||||
|
icon="search"
|
||||||
|
:label="$t('buttons.search')"
|
||||||
|
@action="openSearch()"
|
||||||
|
/>
|
||||||
|
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<template v-if="!isMobile">
|
<template v-if="!isMobile">
|
||||||
<action v-if="headerButtons.share" icon="share" :label="$t('buttons.share')" show="share" />
|
<action
|
||||||
<action v-if="headerButtons.rename" icon="mode_edit" :label="$t('buttons.rename')" show="rename" />
|
v-if="headerButtons.share"
|
||||||
<action v-if="headerButtons.copy" id="copy-button" icon="content_copy" :label="$t('buttons.copyFile')" show="copy" />
|
icon="share"
|
||||||
<action v-if="headerButtons.move" id="move-button" icon="forward" :label="$t('buttons.moveFile')" show="move" />
|
:label="$t('buttons.share')"
|
||||||
<action v-if="headerButtons.delete" id="delete-button" icon="delete" :label="$t('buttons.delete')" show="delete" />
|
show="share"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.rename"
|
||||||
|
icon="mode_edit"
|
||||||
|
:label="$t('buttons.rename')"
|
||||||
|
show="rename"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.copy"
|
||||||
|
id="copy-button"
|
||||||
|
icon="content_copy"
|
||||||
|
:label="$t('buttons.copyFile')"
|
||||||
|
show="copy"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.move"
|
||||||
|
id="move-button"
|
||||||
|
icon="forward"
|
||||||
|
:label="$t('buttons.moveFile')"
|
||||||
|
show="move"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.delete"
|
||||||
|
id="delete-button"
|
||||||
|
icon="delete"
|
||||||
|
:label="$t('buttons.delete')"
|
||||||
|
show="delete"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<action v-if="headerButtons.shell" icon="code" :label="$t('buttons.shell')" @action="$store.commit('toggleShell')" />
|
<action
|
||||||
<action :icon="viewIcon" :label="$t('buttons.switchView')" @action="switchView" />
|
v-if="headerButtons.shell"
|
||||||
<action v-if="headerButtons.download" icon="file_download" :label="$t('buttons.download')" @action="download" :counter="selectedCount" />
|
icon="code"
|
||||||
|
:label="$t('buttons.shell')"
|
||||||
|
@action="$store.commit('toggleShell')"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
:icon="viewIcon"
|
||||||
|
:label="$t('buttons.switchView')"
|
||||||
|
@action="switchView"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.download"
|
||||||
|
icon="file_download"
|
||||||
|
:label="$t('buttons.download')"
|
||||||
|
@action="download"
|
||||||
|
:counter="selectedCount"
|
||||||
|
/>
|
||||||
<action
|
<action
|
||||||
v-if="headerButtons.upload"
|
v-if="headerButtons.upload"
|
||||||
icon="file_upload"
|
icon="file_upload"
|
||||||
@ -25,17 +73,46 @@
|
|||||||
@action="upload"
|
@action="upload"
|
||||||
/>
|
/>
|
||||||
<action icon="info" :label="$t('buttons.info')" show="info" />
|
<action icon="info" :label="$t('buttons.info')" show="info" />
|
||||||
<action icon="check_circle" :label="$t('buttons.selectMultiple')" @action="toggleMultipleSelection" />
|
<action
|
||||||
|
icon="check_circle"
|
||||||
|
:label="$t('buttons.selectMultiple')"
|
||||||
|
@action="toggleMultipleSelection"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</header-bar>
|
</header-bar>
|
||||||
|
|
||||||
<div v-if="isMobile" id="file-selection">
|
<div v-if="isMobile" id="file-selection">
|
||||||
<span v-if="selectedCount > 0">{{ selectedCount }} selected</span>
|
<span v-if="selectedCount > 0">{{ selectedCount }} selected</span>
|
||||||
<action v-if="headerButtons.share" icon="share" :label="$t('buttons.share')" show="share" />
|
<action
|
||||||
<action v-if="headerButtons.rename" icon="mode_edit" :label="$t('buttons.rename')" show="rename" />
|
v-if="headerButtons.share"
|
||||||
<action v-if="headerButtons.copy" icon="content_copy" :label="$t('buttons.copyFile')" show="copy" />
|
icon="share"
|
||||||
<action v-if="headerButtons.move" icon="forward" :label="$t('buttons.moveFile')" show="move" />
|
:label="$t('buttons.share')"
|
||||||
<action v-if="headerButtons.delete" icon="delete" :label="$t('buttons.delete')" show="delete" />
|
show="share"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.rename"
|
||||||
|
icon="mode_edit"
|
||||||
|
:label="$t('buttons.rename')"
|
||||||
|
show="rename"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.copy"
|
||||||
|
icon="content_copy"
|
||||||
|
:label="$t('buttons.copyFile')"
|
||||||
|
show="copy"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.move"
|
||||||
|
icon="forward"
|
||||||
|
:label="$t('buttons.moveFile')"
|
||||||
|
show="move"
|
||||||
|
/>
|
||||||
|
<action
|
||||||
|
v-if="headerButtons.delete"
|
||||||
|
icon="delete"
|
||||||
|
:label="$t('buttons.delete')"
|
||||||
|
show="delete"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="loading">
|
<div v-if="loading">
|
||||||
@ -54,8 +131,21 @@
|
|||||||
<i class="material-icons">sentiment_dissatisfied</i>
|
<i class="material-icons">sentiment_dissatisfied</i>
|
||||||
<span>{{ $t("files.lonely") }}</span>
|
<span>{{ $t("files.lonely") }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
<input style="display: none" type="file" id="upload-input" @change="uploadInput($event)" multiple />
|
<input
|
||||||
<input style="display: none" type="file" id="upload-folder-input" @change="uploadInput($event)" webkitdirectory multiple />
|
style="display: none"
|
||||||
|
type="file"
|
||||||
|
id="upload-input"
|
||||||
|
@change="uploadInput($event)"
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
style="display: none"
|
||||||
|
type="file"
|
||||||
|
id="upload-folder-input"
|
||||||
|
@change="uploadInput($event)"
|
||||||
|
webkitdirectory
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else id="listing" ref="listing" :class="user.viewMode">
|
<div v-else id="listing" ref="listing" :class="user.viewMode">
|
||||||
<div>
|
<div>
|
||||||
@ -135,12 +225,32 @@
|
|||||||
</item>
|
</item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input style="display: none" type="file" id="upload-input" @change="uploadInput($event)" multiple />
|
<input
|
||||||
<input style="display: none" type="file" id="upload-folder-input" @change="uploadInput($event)" webkitdirectory multiple />
|
style="display: none"
|
||||||
|
type="file"
|
||||||
|
id="upload-input"
|
||||||
|
@change="uploadInput($event)"
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
style="display: none"
|
||||||
|
type="file"
|
||||||
|
id="upload-folder-input"
|
||||||
|
@change="uploadInput($event)"
|
||||||
|
webkitdirectory
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
|
|
||||||
<div :class="{ active: $store.state.multiple }" id="multiple-selection">
|
<div :class="{ active: $store.state.multiple }" id="multiple-selection">
|
||||||
<p>{{ $t("files.multipleSelectionEnabled") }}</p>
|
<p>{{ $t("files.multipleSelectionEnabled") }}</p>
|
||||||
<div @click="$store.commit('multiple', false)" tabindex="0" role="button" :title="$t('files.clear')" :aria-label="$t('files.clear')" class="action">
|
<div
|
||||||
|
@click="$store.commit('multiple', false)"
|
||||||
|
tabindex="0"
|
||||||
|
role="button"
|
||||||
|
:title="$t('files.clear')"
|
||||||
|
:aria-label="$t('files.clear')"
|
||||||
|
class="action"
|
||||||
|
>
|
||||||
<i class="material-icons">clear</i>
|
<i class="material-icons">clear</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -181,7 +291,15 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["req", "selected", "user", "show", "multiple", "selected", "loading"]),
|
...mapState([
|
||||||
|
"req",
|
||||||
|
"selected",
|
||||||
|
"user",
|
||||||
|
"show",
|
||||||
|
"multiple",
|
||||||
|
"selected",
|
||||||
|
"loading",
|
||||||
|
]),
|
||||||
...mapGetters(["selectedCount", "filesInUploadCount"]),
|
...mapGetters(["selectedCount", "filesInUploadCount"]),
|
||||||
nameSorted() {
|
nameSorted() {
|
||||||
return this.req.sorting.by === "name";
|
return this.req.sorting.by === "name";
|
||||||
@ -419,7 +537,9 @@ export default {
|
|||||||
let items = [];
|
let items = [];
|
||||||
|
|
||||||
for (let item of this.$store.state.clipboard.items) {
|
for (let item of this.$store.state.clipboard.items) {
|
||||||
const from = item.from.endsWith("/") ? item.from.slice(0, -1) : item.from;
|
const from = item.from.endsWith("/")
|
||||||
|
? item.from.slice(0, -1)
|
||||||
|
: item.from;
|
||||||
const to = this.$route.path + encodeURIComponent(item.name);
|
const to = this.$route.path + encodeURIComponent(item.name);
|
||||||
items.push({ from, to, name: item.name });
|
items.push({ from, to, name: item.name });
|
||||||
}
|
}
|
||||||
@ -480,7 +600,9 @@ export default {
|
|||||||
},
|
},
|
||||||
colunmsResize() {
|
colunmsResize() {
|
||||||
// Update the columns size based on the window width.
|
// Update the columns size based on the window width.
|
||||||
let columns = Math.floor(document.querySelector("main").offsetWidth / this.columnWidth);
|
let columns = Math.floor(
|
||||||
|
document.querySelector("main").offsetWidth / this.columnWidth
|
||||||
|
);
|
||||||
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
|
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
|
||||||
if (columns === 0) columns = 1;
|
if (columns === 0) columns = 1;
|
||||||
items.style.width = `calc(${100 / columns}% - 1em)`;
|
items.style.width = `calc(${100 / columns}% - 1em)`;
|
||||||
@ -498,7 +620,9 @@ export default {
|
|||||||
|
|
||||||
if (currentPos > triggerPos) {
|
if (currentPos > triggerPos) {
|
||||||
// Quantity of items needed to fill 2x of the window height
|
// Quantity of items needed to fill 2x of the window height
|
||||||
const showQuantity = Math.ceil((window.innerHeight * 2) / this.itemWeight);
|
const showQuantity = Math.ceil(
|
||||||
|
(window.innerHeight * 2) / this.itemWeight
|
||||||
|
);
|
||||||
|
|
||||||
// Increase the number of displayed items
|
// Increase the number of displayed items
|
||||||
this.showLimit += showQuantity;
|
this.showLimit += showQuantity;
|
||||||
@ -540,9 +664,15 @@ export default {
|
|||||||
|
|
||||||
let files = await upload.scanFiles(dt);
|
let files = await upload.scanFiles(dt);
|
||||||
let items = this.req.items;
|
let items = this.req.items;
|
||||||
let path = this.$route.path.endsWith("/") ? this.$route.path : this.$route.path + "/";
|
let path = this.$route.path.endsWith("/")
|
||||||
|
? this.$route.path
|
||||||
|
: this.$route.path + "/";
|
||||||
|
|
||||||
if (el !== null && el.classList.contains("item") && el.dataset.dir === "true") {
|
if (
|
||||||
|
el !== null &&
|
||||||
|
el.classList.contains("item") &&
|
||||||
|
el.dataset.dir === "true"
|
||||||
|
) {
|
||||||
// Get url from ListingItem instance
|
// Get url from ListingItem instance
|
||||||
path = el.__vue__.url;
|
path = el.__vue__.url;
|
||||||
|
|
||||||
@ -574,7 +704,9 @@ export default {
|
|||||||
this.$store.commit("closeHovers");
|
this.$store.commit("closeHovers");
|
||||||
|
|
||||||
let files = event.currentTarget.files;
|
let files = event.currentTarget.files;
|
||||||
let folder_upload = files[0].webkitRelativePath !== undefined && files[0].webkitRelativePath !== "";
|
let folder_upload =
|
||||||
|
files[0].webkitRelativePath !== undefined &&
|
||||||
|
files[0].webkitRelativePath !== "";
|
||||||
|
|
||||||
if (folder_upload) {
|
if (folder_upload) {
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
@ -583,7 +715,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let path = this.$route.path.endsWith("/") ? this.$route.path : this.$route.path + "/";
|
let path = this.$route.path.endsWith("/")
|
||||||
|
? this.$route.path
|
||||||
|
: this.$route.path + "/";
|
||||||
let conflict = upload.checkConflict(files, this.req.items);
|
let conflict = upload.checkConflict(files, this.req.items);
|
||||||
|
|
||||||
if (conflict) {
|
if (conflict) {
|
||||||
@ -626,7 +760,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await users.update({ id: this.user.id, sorting: { by, asc } }, ["sorting"]);
|
await users.update({ id: this.user.id, sorting: { by, asc } }, [
|
||||||
|
"sorting",
|
||||||
|
]);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$showError(e);
|
this.$showError(e);
|
||||||
}
|
}
|
||||||
@ -704,7 +840,10 @@ export default {
|
|||||||
if (this.filesInUploadCount > 0) {
|
if (this.filesInUploadCount > 0) {
|
||||||
this.$store.commit("showHover", "uploadFiles");
|
this.$store.commit("showHover", "uploadFiles");
|
||||||
} else {
|
} else {
|
||||||
if (typeof window.DataTransferItem !== "undefined" && typeof DataTransferItem.prototype.webkitGetAsEntry !== "undefined") {
|
if (
|
||||||
|
typeof window.DataTransferItem !== "undefined" &&
|
||||||
|
typeof DataTransferItem.prototype.webkitGetAsEntry !== "undefined"
|
||||||
|
) {
|
||||||
this.$store.commit("showHover", "upload");
|
this.$store.commit("showHover", "upload");
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("upload-input").click();
|
document.getElementById("upload-input").click();
|
||||||
@ -730,7 +869,9 @@ export default {
|
|||||||
const windowHeight = window.innerHeight;
|
const windowHeight = window.innerHeight;
|
||||||
|
|
||||||
// Quantity of items needed to fill 2x of the window height
|
// Quantity of items needed to fill 2x of the window height
|
||||||
const showQuantity = Math.ceil((windowHeight + windowHeight * 2) / this.itemWeight);
|
const showQuantity = Math.ceil(
|
||||||
|
(windowHeight + windowHeight * 2) / this.itemWeight
|
||||||
|
);
|
||||||
|
|
||||||
// Less items to display than current
|
// Less items to display than current
|
||||||
if (this.showLimit > showQuantity && !fit) return;
|
if (this.showLimit > showQuantity && !fit) return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user