Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Fixed the error where the browser path became /app/ due to navigating… #274

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ui/src/components/BreadCrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ export default {
? ["Home", ...path.slice(0, path.length - 1)]
: ["Home"];
return path;
}
},
},
methods: {
link(idx) {
const crumbs = this.crumbs;
const crumbsArr = this.crumbs;
let path = "";
if (idx > 0) path = crumbs.slice(1, idx + 1).join("/") + "/";
if (idx > 0) path = crumbsArr.slice(1, idx + 1).join("/") + "/";

return "/app/browser/" + path;
},
Expand Down
18 changes: 11 additions & 7 deletions ui/src/components/FileBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,10 @@ tbody {

<tr v-if="path.length > 0">
<td>
<router-link to="../">
<a
href="javascript:null"
v-on:click="back"
>..</a
>
<router-link v-bind:to="upperDirectory">
<span v-on:click="back">
..
</span>
</router-link>
</td>
</tr>
Expand Down Expand Up @@ -535,6 +533,7 @@ tbody {
import axios from "axios";
import FileEntry from "./FileEntry.vue";
import BreadCrumbs from "./BreadCrumbs.vue";

export default {
data: () => ({
s3: null,
Expand All @@ -551,6 +550,12 @@ export default {
dragAndDropDisplay: false,
}),
computed: {
upperDirectory() {
const pathArr = this.path.split("/");
pathArr.splice(-2, 1);
const path = pathArr.length > 1 ? pathArr.join('/'): "";
return "/app/browser/" + path;
},
createFolderEnabled() {
return (
this.createFolderInput.trim().length > 0 &&
Expand Down Expand Up @@ -676,7 +681,6 @@ export default {
async back() {
this.createFolderInputShow = false;
await this.$store.dispatch("openDropdown", null);
await this.$store.dispatch("files/back");
},
async buttonUpload() {
const fileInputElement = this.$refs.fileInput;
Expand Down