Skip to content

Commit b2eb4a4

Browse files
committed
Auth functionality added.
1 parent 5c59d35 commit b2eb4a4

26 files changed

+123
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "laravel-frontend-file-manager",
3-
"version": "3.0.44",
3+
"version": "3.0.52",
44
"description": "File manager for Laravel",
55
"keywords": [
66
"laravel",

src/FileManager.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ export default {
9494
this.responseInterceptor();
9595
9696
// initialize app settings
97+
// Mohammad Ashrafuddin Ferdousi : 1
98+
// Mohammad Ashrafuddin Ferdousi : 2
9799
this.$store.dispatch('fm/initializeApp');
98100
},
99101
destroyed() {

src/components/blocks/NavbarBlock.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ export default {
252252
/**
253253
* Refresh file manager
254254
*/
255+
// Mohammad Ashrafuddin Ferdousi : 2
255256
refreshAll() {
257+
// Mohammad Ashrafuddin Ferdousi : 2
256258
this.$store.dispatch('fm/refreshAll');
257259
},
258260
@@ -294,7 +296,9 @@ export default {
294296
/**
295297
* Paste
296298
*/
299+
// Mohammad Ashrafuddin Ferdousi : 17
297300
paste() {
301+
// Mohammad Ashrafuddin Ferdousi : 17
298302
this.$store.dispatch('fm/paste');
299303
},
300304

src/components/blocks/mixins/contextMenuActions.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ export default {
6464
/**
6565
* Select file
6666
*/
67+
// Mohammad Ashrafuddin Ferdousi : 5
6768
selectAction() {
6869
// file callback
70+
// Mohammad Ashrafuddin Ferdousi : 5
6971
this.$store
7072
.dispatch('fm/url', {
7173
disk: this.selectedDisk,
@@ -81,13 +83,15 @@ export default {
8183
/**
8284
* Download file
8385
*/
86+
// Mohammad Ashrafuddin Ferdousi : 10
8487
downloadAction() {
8588
const tempLink = document.createElement('a');
8689
tempLink.style.display = 'none';
8790
tempLink.setAttribute('download', this.selectedItems[0].basename);
8891

8992
// download file with authorization
9093
if (this.$store.getters['fm/settings/authHeader']) {
94+
// Mohammad Ashrafuddin Ferdousi : 10
9195
HTTP.download(this.selectedDisk, this.selectedItems[0].path).then((response) => {
9296
tempLink.href = window.URL.createObjectURL(new Blob([response.data]));
9397
document.body.appendChild(tempLink);
@@ -134,8 +138,10 @@ export default {
134138
/**
135139
* Paste copied or cut items
136140
*/
141+
// Mohammad Ashrafuddin Ferdousi : 17
137142
pasteAction() {
138143
// paste items in the selected folder
144+
// Mohammad Ashrafuddin Ferdousi : 17
139145
this.$store.dispatch('fm/paste');
140146
},
141147

src/components/manager/DiskList.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ export default {
4343
* Select disk
4444
* @param disk
4545
*/
46+
// Mohammad Ashrafuddin Ferdousi : 3
47+
// Mohammad Ashrafuddin Ferdousi : 2
4648
selectDisk(disk) {
4749
if (this.selectedDisk !== disk) {
50+
// Mohammad Ashrafuddin Ferdousi : 2
51+
// Mohammad Ashrafuddin Ferdousi : 3
4852
this.$store.dispatch('fm/selectDisk', {
4953
disk,
5054
manager: this.manager,

src/components/manager/Thumbnail.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ export default {
6666
/**
6767
* Load image
6868
*/
69+
// Mohammad Ashrafuddin Ferdousi : 8
6970
loadImage() {
7071
// if authorization required
7172
if (this.auth) {
72-
GET.thumbnail(this.disk, this.file.path).then((response) => {
73+
// Mohammad Ashrafuddin Ferdousi : 8
74+
GET.thumbnail(this.disk, `${this.file.path}&token=${window.localStorage.getItem('_token')}`).then((response) => {
7375
// FIXED: Mohammad Ashrafuddin Ferdousi
7476
const mimeType = response.data.headers['Content-Type'].toLowerCase();
7577
//const imgBase64 = Buffer.from(response.data, 'binary').toString('base64');
@@ -78,7 +80,7 @@ export default {
7880
} else {
7981
this.src = `${this.$store.getters['fm/settings/baseUrl']}thumbnails?disk=${
8082
this.disk
81-
}&path=${encodeURIComponent(this.file.path)}&v=${this.file.timestamp}`;
83+
}&path=${encodeURIComponent(this.file.path)}&v=${this.file.timestamp}&token=${window.localStorage.getItem('_token')}`;
8284
}
8385
},
8486
},

src/components/manager/mixins/manager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,12 @@ export default {
146146
* @param path
147147
* @param extension
148148
*/
149+
// Mohammad Ashrafuddin Ferdousi : 7
150+
// Mohammad Ashrafuddin Ferdousi : 5
149151
selectAction(path, extension) {
150152
// if is set fileCallback
151153
if (this.$store.state.fm.fileCallback) {
154+
// Mohammad Ashrafuddin Ferdousi : 5
152155
this.$store
153156
.dispatch('fm/url', {
154157
disk: this.selectedDisk,
@@ -195,6 +198,7 @@ export default {
195198
});
196199
} else if (extension.toLowerCase() === 'pdf') {
197200
// show pdf document
201+
// Mohammad Ashrafuddin Ferdousi : 7
198202
this.$store.dispatch('fm/openPDF', {
199203
disk: this.selectedDisk,
200204
path,

src/components/modals/additions/CropperModule.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ export default {
234234
/**
235235
* Save cropped image
236236
*/
237+
// Mohammad Ashrafuddin Ferdousi : 12
237238
cropSave() {
238239
this.cropper.getCroppedCanvas().toBlob(
239240
(blob) => {
@@ -245,6 +246,7 @@ export default {
245246
// new image
246247
formData.append('file', blob, this.selectedItem.basename);
247248
249+
// Mohammad Ashrafuddin Ferdousi : 12
248250
this.$store.dispatch('fm/updateFile', formData).then((response) => {
249251
// if file updated successfully
250252
if (response.data.result.status === 'success') {

src/components/modals/views/AudioPlayerModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default {
131131
{
132132
src: `${this.$store.getters['fm/settings/baseUrl']}stream-file?disk=${
133133
this.selectedDisk
134-
}&path=${encodeURIComponent(this.audioFiles[index].path)}`,
134+
}&path=${encodeURIComponent(this.audioFiles[index].path)}&token=${window.localStorage.getItem('_token')}`,
135135
type: `audio/${this.audioFiles[index].extension}`,
136136
},
137137
],

src/components/modals/views/DeleteModal.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ export default {
4141
/**
4242
* Delete selected directories and files
4343
*/
44+
// Mohammad Ashrafuddin Ferdousi : 15
4445
deleteItems() {
4546
// create items list for delete
4647
const items = this.selectedItems.map((item) => ({
4748
path: item.path,
4849
type: item.type,
4950
}));
50-
51+
// Mohammad Ashrafuddin Ferdousi : 15
5152
this.$store.dispatch('fm/delete', items).then(() => {
5253
this.hideModal();
5354
});

0 commit comments

Comments
 (0)