mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-07-01 21:52:58 +00:00
fix: mitigate unprotected shares
This commit is contained in:
parent
364f391017
commit
2b5d6cbb99
@ -32,16 +32,6 @@
|
|||||||
<i class="material-icons">content_paste</i>
|
<i class="material-icons">content_paste</i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<td class="small" v-if="hasDownloadLink()">
|
|
||||||
<button
|
|
||||||
class="action copy-clipboard"
|
|
||||||
:aria-label="$t('buttons.copyDownloadLinkToClipboard')"
|
|
||||||
:title="$t('buttons.copyDownloadLinkToClipboard')"
|
|
||||||
@click="copyToClipboard(buildDownloadLink(link))"
|
|
||||||
>
|
|
||||||
<i class="material-icons">content_paste_go</i>
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
<td class="small">
|
<td class="small">
|
||||||
<button
|
<button
|
||||||
class="action"
|
class="action"
|
||||||
@ -142,7 +132,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapActions, mapState } from "pinia";
|
import { mapActions, mapState } from "pinia";
|
||||||
import { useFileStore } from "@/stores/file";
|
import { useFileStore } from "@/stores/file";
|
||||||
import { share as api, pub as pub_api } from "@/api";
|
import { share as api } from "@/api";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useLayoutStore } from "@/stores/layout";
|
import { useLayoutStore } from "@/stores/layout";
|
||||||
import { copy } from "@/utils/clipboard";
|
import { copy } from "@/utils/clipboard";
|
||||||
@ -257,14 +247,6 @@ export default {
|
|||||||
buildLink(share) {
|
buildLink(share) {
|
||||||
return api.getShareURL(share);
|
return api.getShareURL(share);
|
||||||
},
|
},
|
||||||
hasDownloadLink() {
|
|
||||||
return (
|
|
||||||
this.selected.length === 1 && !this.req.items[this.selected[0]].isDir
|
|
||||||
);
|
|
||||||
},
|
|
||||||
buildDownloadLink(share) {
|
|
||||||
return pub_api.getDownloadURL(share);
|
|
||||||
},
|
|
||||||
sort() {
|
sort() {
|
||||||
this.links = this.links.sort((a, b) => {
|
this.links = this.links.sort((a, b) => {
|
||||||
if (a.expire === 0) return -1;
|
if (a.expire === 0) return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user