From 963837ef1dc6e2e84fcf924606ce388ac30f3891 Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Thu, 16 Jan 2020 12:55:25 +0000 Subject: [PATCH 1/3] fix: multiple selection count - Only add files to selected list that arent on it. - Only shift key select when there are selected files. --- frontend/src/components/files/ListingItem.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 81e97973..7826d49a 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -132,7 +132,7 @@ export default { return } - if (event.shiftKey) { + if (event.shiftKey && this.selected.length > 0) { let fi = 0 let la = 0 @@ -145,7 +145,9 @@ export default { } for (; fi <= la; fi++) { - this.addSelected(fi) + if (this.$store.state.selected.indexOf(fi) == -1) { + this.addSelected(fi) + } } return From dd40b0d9b9cc6268a611306ac4684a1af852b79d Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Thu, 16 Jan 2020 13:47:21 +0000 Subject: [PATCH 2/3] fix: frontend token validation fix filebrowser/filebrowser#638 --- frontend/src/utils/auth.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/src/utils/auth.js b/frontend/src/utils/auth.js index ae050ba3..7ae6c1fe 100644 --- a/frontend/src/utils/auth.js +++ b/frontend/src/utils/auth.js @@ -12,10 +12,6 @@ export function parseToken (token) { const data = JSON.parse(Base64.decode(parts[1])) - if (Math.round(new Date().getTime() / 1000) > data.exp) { - throw new Error('token expired') - } - localStorage.setItem('jwt', token) store.commit('setJWT', token) store.commit('setUser', data.user) From 82c883f95eead9eebe215e230f74773c945f864a Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Thu, 16 Jan 2020 14:25:35 +0000 Subject: [PATCH 3/3] fix: save event hook fix filebrowser/filebrowser#696 --- http/resource.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/http/resource.go b/http/resource.go index 274b3ac5..95224083 100644 --- a/http/resource.go +++ b/http/resource.go @@ -93,6 +93,11 @@ var resourcePostPutHandler = withUser(func(w http.ResponseWriter, r *http.Reques } } + action := "upload" + if r.Method == http.MethodPut { + action = "save" + } + err := d.RunHook(func() error { dir, _ := filepath.Split(r.URL.Path) err := d.user.Fs.MkdirAll(dir, 0775) @@ -120,7 +125,7 @@ var resourcePostPutHandler = withUser(func(w http.ResponseWriter, r *http.Reques etag := fmt.Sprintf(`"%x%x"`, info.ModTime().UnixNano(), info.Size()) w.Header().Set("ETag", etag) return nil - }, "upload", r.URL.Path, "", d.user) + }, action, r.URL.Path, "", d.user) return errToStatus(err), err })