lint: linting (grumble, grumble)
This commit is contained in:
parent
d676d5d7f6
commit
97e08ebb15
@ -55,7 +55,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["currentPromptName"]),
|
...mapGetters(["currentPromptName"]),
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -22,14 +22,16 @@
|
|||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
<template v-if="user.perm.create">
|
<template v-if="user.perm.create">
|
||||||
<button
|
<button
|
||||||
class="button button--flat"
|
class="button button--flat"
|
||||||
@click="createDir()"
|
@click="createDir()"
|
||||||
:aria-label="$t('sidebar.newFolder')"
|
:aria-label="$t('sidebar.newFolder')"
|
||||||
:title="$t('sidebar.newFolder')"
|
:title="$t('sidebar.newFolder')"
|
||||||
>
|
>
|
||||||
<span style="vertical-align: bottom;">{{ $t("sidebar.newFolder") }}</span>
|
<span style="vertical-align: bottom">{{
|
||||||
</button>
|
$t("sidebar.newFolder")
|
||||||
|
}}</span>
|
||||||
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -143,17 +145,17 @@ export default {
|
|||||||
this.selected = event.currentTarget.dataset.url;
|
this.selected = event.currentTarget.dataset.url;
|
||||||
this.$emit("update:selected", this.selected);
|
this.$emit("update:selected", this.selected);
|
||||||
},
|
},
|
||||||
createDir: async function (){
|
createDir: async function () {
|
||||||
this.$store.commit('showHover', {
|
this.$store.commit("showHover", {
|
||||||
prompt: 'newDir',
|
prompt: "newDir",
|
||||||
action: null,
|
action: null,
|
||||||
confirm: null,
|
confirm: null,
|
||||||
props:{
|
props: {
|
||||||
redirect: false,
|
redirect: false,
|
||||||
base: this.current === this.$route.path ? null : this.current,
|
base: this.current === this.$route.path ? null : this.current,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -98,7 +98,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
action(overwrite, rename);
|
action(overwrite, rename);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -68,13 +68,10 @@ export default {
|
|||||||
|
|
||||||
// Build the path of the new directory.
|
// Build the path of the new directory.
|
||||||
let uri;
|
let uri;
|
||||||
if (this.base)
|
|
||||||
uri = this.base;
|
if (this.base) uri = this.base;
|
||||||
else if (this.isFiles)
|
else if (this.isFiles) uri = this.$route.path + "/";
|
||||||
uri = this.$route.path + "/";
|
else uri = "/";
|
||||||
else
|
|
||||||
uri = "/";
|
|
||||||
|
|
||||||
|
|
||||||
if (!this.isListing) {
|
if (!this.isListing) {
|
||||||
uri = url.removeLastDir(uri) + "/";
|
uri = url.removeLastDir(uri) + "/";
|
||||||
@ -82,13 +79,11 @@ export default {
|
|||||||
|
|
||||||
uri += encodeURIComponent(this.name) + "/";
|
uri += encodeURIComponent(this.name) + "/";
|
||||||
uri = uri.replace("//", "/");
|
uri = uri.replace("//", "/");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await api.post(uri);
|
await api.post(uri);
|
||||||
if (this.redirect) {
|
if (this.redirect) {
|
||||||
this.$router.push({ path: uri });
|
this.$router.push({ path: uri });
|
||||||
}
|
} else if (!this.base) {
|
||||||
else if (!this.base){
|
|
||||||
const res = await api.fetch(url.removeLastDir(uri) + "/");
|
const res = await api.fetch(url.removeLastDir(uri) + "/");
|
||||||
this.$store.commit("updateRequest", res);
|
this.$store.commit("updateRequest", res);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<component v-if="showOverlay" :ref="currentPromptName" :is="currentPromptName" v-bind="currentPrompt.props"></component>
|
<component
|
||||||
|
v-if="showOverlay"
|
||||||
|
:ref="currentPromptName"
|
||||||
|
:is="currentPromptName"
|
||||||
|
v-bind="currentPrompt.props"
|
||||||
|
>
|
||||||
|
</component>
|
||||||
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -87,10 +93,8 @@ export default {
|
|||||||
showOverlay: function () {
|
showOverlay: function () {
|
||||||
return (
|
return (
|
||||||
this.currentPrompt !== null &&
|
this.currentPrompt !== null &&
|
||||||
this.currentPrompt.prompt
|
this.currentPrompt.prompt !== "search" &&
|
||||||
!== "search" &&
|
this.currentPrompt.prompt !== "more"
|
||||||
this.currentPrompt.prompt
|
|
||||||
!== "more"
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -44,11 +44,13 @@ const getters = {
|
|||||||
return files.sort((a, b) => a.progress - b.progress);
|
return files.sort((a, b) => a.progress - b.progress);
|
||||||
},
|
},
|
||||||
currentPrompt: (state) => {
|
currentPrompt: (state) => {
|
||||||
return state.prompts.length > 0 ? state.prompts[state.prompts.length - 1] : null;
|
return state.prompts.length > 0
|
||||||
|
? state.prompts[state.prompts.length - 1]
|
||||||
|
: null;
|
||||||
},
|
},
|
||||||
currentPromptName: (_, getters) => {
|
currentPromptName: (_, getters) => {
|
||||||
return getters.currentPrompt?.prompt;
|
return getters.currentPrompt?.prompt;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default getters;
|
export default getters;
|
||||||
|
|||||||
@ -23,8 +23,8 @@ const mutations = {
|
|||||||
prompt: value.prompt, // Should not be null
|
prompt: value.prompt, // Should not be null
|
||||||
confirm: value?.confirm,
|
confirm: value?.confirm,
|
||||||
action: value?.action,
|
action: value?.action,
|
||||||
props: value?.props
|
props: value?.props,
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
showError: (state) => {
|
showError: (state) => {
|
||||||
state.prompts.push("error");
|
state.prompts.push("error");
|
||||||
|
|||||||
@ -297,14 +297,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([
|
...mapState(["req", "selected", "user", "multiple", "selected", "loading"]),
|
||||||
"req",
|
|
||||||
"selected",
|
|
||||||
"user",
|
|
||||||
"multiple",
|
|
||||||
"selected",
|
|
||||||
"loading",
|
|
||||||
]),
|
|
||||||
...mapGetters(["selectedCount", "currentPrompt"]),
|
...mapGetters(["selectedCount", "currentPrompt"]),
|
||||||
nameSorted() {
|
nameSorted() {
|
||||||
return this.req.sorting.by === "name";
|
return this.req.sorting.by === "name";
|
||||||
|
|||||||
@ -89,7 +89,7 @@ export default {
|
|||||||
return this.$route.path === "/settings/users/new";
|
return this.$route.path === "/settings/users/new";
|
||||||
},
|
},
|
||||||
...mapState(["loading"]),
|
...mapState(["loading"]),
|
||||||
...mapGetters(["currentPrompt", "currentPromptName"])
|
...mapGetters(["currentPrompt", "currentPromptName"]),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route: "fetchData",
|
$route: "fetchData",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user