Skip to content

Commit c6a6721

Browse files
author
v.malyshev
committed
multiple discs to work with
1 parent f0d4903 commit c6a6721

File tree

7 files changed

+46
-21
lines changed

7 files changed

+46
-21
lines changed

src/FileManager.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ export default {
8383
created() {
8484
// manual settings
8585
this.$store.commit('fm/settings/manualSettings', this.settings);
86+
if (typeof this.settings.currentDisc != "undefined"){
87+
this.$store.commit('fm/setCurrentDisk', this.settings.currentDisc);
88+
}
8689
8790
// initiate Axios
8891
this.$store.commit('fm/settings/initAxiosSettings');

src/components/manager/Manager.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="fm-content d-flex flex-column">
3-
<disk-list v-bind:manager="manager"/>
3+
<!-- <disk-list v-bind:manager="manager"/>-->
44
<breadcrumb v-bind:manager="manager"/>
55
<div class="fm-content-body" ref="managerWindow" v-on:dragover="dragging = true"
66
v-on:drop ="dragging = false"

src/store/actions.js

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,34 @@ export default {
2424
? response.data.config.rightDisk
2525
: getters.diskList[0];
2626

27+
if(getters.currentDisc){
28+
leftDisk = getters.currentDisc
29+
}
30+
2731
// paths
2832
let leftPath = response.data.config.leftPath;
2933
let rightPath = response.data.config.rightPath;
3034

3135
// find disk and path settings in the URL
32-
if (window.location.search) {
33-
const params = new URLSearchParams(window.location.search);
34-
35-
if (params.get('leftDisk')) {
36-
leftDisk = params.get('leftDisk');
37-
}
38-
39-
if (params.get('rightDisk')) {
40-
rightDisk = params.get('rightDisk');
41-
}
42-
43-
if (params.get('leftPath')) {
44-
leftPath = params.get('leftPath');
45-
}
46-
47-
if (params.get('rightPath')) {
48-
rightPath = params.get('rightPath');
49-
}
50-
}
36+
// if (window.location.search) {
37+
// const params = new URLSearchParams(window.location.search);
38+
//
39+
// if (params.get('leftDisk')) {
40+
// leftDisk = params.get('leftDisk');
41+
// }
42+
//
43+
// if (params.get('rightDisk')) {
44+
// rightDisk = params.get('rightDisk');
45+
// }
46+
//
47+
// if (params.get('leftPath')) {
48+
// leftPath = params.get('leftPath');
49+
// }
50+
//
51+
// if (params.get('rightPath')) {
52+
// rightPath = params.get('rightPath');
53+
// }
54+
// }
5155

5256
commit('left/setDisk', leftDisk);
5357

src/store/getters.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ export default {
88
return Object.keys(state.disks);
99
},
1010

11+
/**
12+
*
13+
* @param state
14+
* @returns {string}
15+
*/
16+
currentDisc(state) {
17+
return state.currentDisc;
18+
},
19+
1120
/**
1221
* Selected disk for active manager
1322
* @param state

src/store/mutations.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export default {
99
state.disks = disks;
1010
},
1111

12+
setCurrentDisk(state, disk) {
13+
state.currentDisc = disk;
14+
},
15+
1216

1317
/**
1418
* Set disks

src/store/settings/store.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export default {
3333
// axios headers
3434
headers: {},
3535

36+
//current selected Disc
37+
currentDisc: '',
38+
3639
// axios default URL
3740
baseUrl: null,
3841

src/store/state.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export default {
2020
// available disks
2121
disks: [],
2222

23+
currentDisc: '',
24+
2325
// file callback for ckeditor, ...
2426
fileCallback: null,
2527

@@ -33,6 +35,6 @@ export default {
3335
preloader: false,
3436

3537
// files from drag and drop FM
36-
filesFromDrag: []
38+
filesFromDrag: [],
3739

3840
};

0 commit comments

Comments
 (0)