mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-06-29 20:53:04 +00:00
fix: exclude to-be-moved folder from move dialog (#5235)
This commit is contained in:
parent
10684e5390
commit
7354eb6cf9
@ -35,6 +35,12 @@ import { StatusError } from "@/api/utils.js";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "file-list",
|
name: "file-list",
|
||||||
|
props: {
|
||||||
|
exclude: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
items: [],
|
items: [],
|
||||||
@ -90,6 +96,7 @@ export default {
|
|||||||
// move options.
|
// move options.
|
||||||
for (const item of req.items) {
|
for (const item of req.items) {
|
||||||
if (!item.isDir) continue;
|
if (!item.isDir) continue;
|
||||||
|
if (this.exclude?.includes(item.url)) continue;
|
||||||
|
|
||||||
this.items.push({
|
this.items.push({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<file-list
|
<file-list
|
||||||
ref="fileList"
|
ref="fileList"
|
||||||
@update:selected="(val) => (dest = val)"
|
@update:selected="(val) => (dest = val)"
|
||||||
|
:exclude="excludedFolders"
|
||||||
tabindex="1"
|
tabindex="1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -76,6 +77,11 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState(useFileStore, ["req", "selected"]),
|
...mapState(useFileStore, ["req", "selected"]),
|
||||||
...mapState(useAuthStore, ["user"]),
|
...mapState(useAuthStore, ["user"]),
|
||||||
|
excludedFolders() {
|
||||||
|
return this.selected
|
||||||
|
.filter((idx) => this.req.items[idx].isDir)
|
||||||
|
.map((idx) => this.req.items[idx].url);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useLayoutStore, ["showHover", "closeHovers"]),
|
...mapActions(useLayoutStore, ["showHover", "closeHovers"]),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user