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

Commit 10e9422

Browse files
committed
fix
1 parent 46c7c60 commit 10e9422

File tree

16 files changed

+270
-135
lines changed

16 files changed

+270
-135
lines changed

demo/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const store = new Vuex.Store({
1313
})
1414

1515
Vue.config.productionTip = process.env.NODE_ENV === 'production'
16+
1617
Vue.prototype.$request = request(store)
1718

1819
Vue.use(FileManager, { store })

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"main": "src/init.js",
1414
"scripts": {
1515
"serve": "vue-cli-service serve ./demo/main.js",
16-
"build": "vue-cli-service build",
16+
"build": "vue-cli-service build ./src/init.js",
1717
"lint": "vue-cli-service lint",
1818
"test:unit": "vue-cli-service test:unit"
1919
},
@@ -35,7 +35,7 @@
3535
"devDependencies": {
3636
"@babel/plugin-proposal-optional-chaining": "^7.13.0",
3737
"@babel/plugin-transform-runtime": "^7.13.5",
38-
"@feugene/mu": "^2.20.1",
38+
"@feugene/mu": "^2.20.4",
3939
"@feugene/request": "^0.1.2",
4040
"@vue/cli-plugin-babel": "~4.5.11",
4141
"@vue/cli-plugin-eslint": "~4.5.11",
@@ -59,6 +59,12 @@
5959
"sass-loader": "^10.1.1",
6060
"vue": "^2.6.12",
6161
"vue-template-compiler": "^2.6.12",
62-
"vuex": "^3.6.2"
62+
"vuex": "^3.6.2",
63+
64+
"@rollup/plugin-commonjs": "^17.1.0",
65+
"@rollup/plugin-node-resolve": "^11.2.0",
66+
"@rollup/plugin-replace": "^2.4.1",
67+
"rollup": "^2.41.0",
68+
"rollup-plugin-vue": "^6.0.0"
6369
}
6470
}

src/FileManager.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</template>
3535

3636
<script>
37-
import '@/plugins'
37+
import './plugins'
3838
/* eslint-disable import/no-duplicates, no-param-reassign */
3939
import { mapState } from 'vuex'
4040
// import {request} from './utils/request'

src/components/blocks/mixins/contextMenuActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import HTTP from '../../../http/get'
2-
import GET from '@/http/get'
2+
import GET from '../../../http/get'
33

44
/**
55
* Context menu actions

src/components/modals/views/AudioPlayer.vue

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,29 @@
99
</button>
1010
</div>
1111
<div class="modal-body">
12-
<audio ref="fmAudio" controls/>
13-
<hr>
14-
<div class="d-flex justify-content-between py-2 px-2"
15-
v-bind:class="playingIndex === index ? 'bg-light' : ''"
16-
v-for="(item, index) in audioFiles"
17-
v-bind:key="index">
12+
<audio ref="fmAudio" controls />
13+
<hr />
14+
<div
15+
class="d-flex justify-content-between py-2 px-2"
16+
v-bind:class="playingIndex === index ? 'bg-light' : ''"
17+
v-for="(item, index) in audioFiles"
18+
v-bind:key="index"
19+
>
1820
<div class="w-75 text-truncate">
1921
<span class="text-muted pr-2">{{ index }}.</span>
2022
{{ item.basename }}
2123
</div>
2224
<template v-if="playingIndex === index">
2325
<div v-if="status === 'playing'">
24-
<i v-on:click="togglePlay()" class="fas fa-play active"/>
26+
<i v-on:click="togglePlay()" class="fas fa-play active" />
2527
</div>
2628
<div v-else>
27-
<i v-on:click="togglePlay()" class="fas fa-pause"/>
29+
<i v-on:click="togglePlay()" class="fas fa-pause" />
2830
</div>
2931
</template>
3032
<template v-else>
3133
<div>
32-
<i v-on:click="selectTrack(index)" class="fas fa-play"/>
34+
<i v-on:click="selectTrack(index)" class="fas fa-play" />
3335
</div>
3436
</template>
3537
</div>
@@ -41,7 +43,7 @@
4143
import Plyr from 'plyr'
4244
import modal from '../mixins/modal'
4345
import translate from '../../../mixins/translate'
44-
import GET from '@/http/get'
46+
import GET from '../../../http/get'
4547
4648
export default {
4749
name: 'Player',
@@ -128,10 +130,14 @@ export default {
128130
this.player.source = {
129131
type: 'audio',
130132
title: this.audioFiles[index].filename,
131-
sources: [{
132-
src: GET.makeURL(`/stream-file?disk=${this.selectedDisk}&path=${encodeURIComponent(this.audioFiles[index].path)}`),
133-
type: `audio/${this.audioFiles[index].extension}`,
134-
}],
133+
sources: [
134+
{
135+
src: GET.makeURL(
136+
`/stream-file?disk=${this.selectedDisk}&path=${encodeURIComponent(this.audioFiles[index].path)}`
137+
),
138+
type: `audio/${this.audioFiles[index].extension}`,
139+
},
140+
],
135141
}
136142
},
137143

src/components/modals/views/Preview.vue

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,27 @@
1111
</div>
1212
<div class="modal-body text-center">
1313
<template v-if="showCropperModule">
14-
<cropper-module v-bind:imgSrc="imgSrc"
15-
v-bind:maxHeight="maxHeight"
16-
v-on:closeCropper="closeCropper"/>
14+
<cropper-module v-bind:imgSrc="imgSrc" v-bind:maxHeight="maxHeight" v-on:closeCropper="closeCropper" />
1715
</template>
1816
<transition v-else name="fade" mode="out-in">
19-
<i v-if="!imgSrc" class="fas fa-spinner fa-spin fa-5x p-5 text-muted"/>
20-
<img v-else
21-
v-bind:src="imgSrc"
22-
v-bind:alt="selectedItem.basename"
23-
v-bind:style="{'max-height': maxHeight+'px'}">
17+
<i v-if="!imgSrc" class="fas fa-spinner fa-spin fa-5x p-5 text-muted" />
18+
<img
19+
v-else
20+
v-bind:src="imgSrc"
21+
v-bind:alt="selectedItem.basename"
22+
v-bind:style="{ 'max-height': maxHeight + 'px' }"
23+
/>
2424
</transition>
2525
</div>
2626
<div v-if="showFooter" class="d-flex justify-content-between">
27-
<span class="d-block">
28-
<button class="btn btn-info"
29-
v-bind:title="lang.modal.cropper.title" v-on:click="showCropperModule = true">
30-
<i class="fas fa-crop-alt"/>
31-
</button>
32-
</span>
3327
<span class="d-block">
34-
<button class="btn btn-light" v-on:click="hideModal">{{ lang.btn.cancel }}</button>
35-
</span>
28+
<button class="btn btn-info" v-bind:title="lang.modal.cropper.title" v-on:click="showCropperModule = true">
29+
<i class="fas fa-crop-alt" />
30+
</button>
31+
</span>
32+
<span class="d-block">
33+
<button class="btn btn-light" v-on:click="hideModal">{{ lang.btn.cancel }}</button>
34+
</span>
3635
</div>
3736
</div>
3837
</template>
@@ -42,7 +41,7 @@ import CropperModule from '../additions/Cropper.vue'
4241
import modal from '../mixins/modal'
4342
import translate from '../../../mixins/translate'
4443
import helper from '../../../mixins/helper'
45-
import GET from '@/http/get'
44+
import GET from '../../../http/get'
4645
4746
export default {
4847
name: 'Preview',
@@ -126,18 +125,18 @@ export default {
126125
loadImage() {
127126
// if authorization required
128127
if (this.auth) {
129-
GET.preview(
130-
this.selectedDisk,
131-
this.selectedItem.path,
132-
)
133-
.then((response) => {
134-
const mimeType = response.headers['content-type'].toLowerCase()
135-
const imgBase64 = Buffer.from(response.data, 'binary').toString('base64')
128+
GET.preview(this.selectedDisk, this.selectedItem.path).then(response => {
129+
const mimeType = response.headers['content-type'].toLowerCase()
130+
const imgBase64 = Buffer.from(response.data, 'binary').toString('base64')
136131
137-
this.imgSrc = `data:${mimeType};base64,${imgBase64}`
138-
})
132+
this.imgSrc = `data:${mimeType};base64,${imgBase64}`
133+
})
139134
} else {
140-
this.imgSrc = GET.makeURL(`/preview?disk=${this.selectedDisk}&path=${encodeURIComponent(this.selectedItem.path)}&v=${this.selectedItem.timestamp}`)
135+
this.imgSrc = GET.makeURL(
136+
`/preview?disk=${this.selectedDisk}&path=${encodeURIComponent(this.selectedItem.path)}&v=${
137+
this.selectedItem.timestamp
138+
}`
139+
)
141140
}
142141
},
143142
},
@@ -146,7 +145,6 @@ export default {
146145

147146
<style lang="scss">
148147
.fm-modal-preview {
149-
150148
.modal-body {
151149
padding: 0;
152150

src/components/modals/views/VideoPlayer.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</button>
1010
</div>
1111
<div class="modal-body">
12-
<video ref="fmVideo" controls/>
12+
<video ref="fmVideo" controls />
1313
</div>
1414
</div>
1515
</template>
@@ -18,7 +18,7 @@
1818
import Plyr from 'plyr'
1919
import modal from '../mixins/modal'
2020
import translate from '../../../mixins/translate'
21-
import GET from '@/http/get'
21+
import GET from '../../../http/get'
2222
2323
export default {
2424
name: 'Player',
@@ -35,10 +35,12 @@ export default {
3535
this.player.source = {
3636
type: 'video',
3737
title: this.videoFile.filename,
38-
sources: [{
39-
src: GET.makeURL(`/stream-file?disk=${this.selectedDisk}&path=${encodeURIComponent(this.videoFile.path)}`),
40-
type: `audio/${this.videoFile.extension}`,
41-
}],
38+
sources: [
39+
{
40+
src: GET.makeURL(`/stream-file?disk=${this.selectedDisk}&path=${encodeURIComponent(this.videoFile.path)}`),
41+
type: `audio/${this.videoFile.extension}`,
42+
},
43+
],
4244
}
4345
},
4446
beforeDestroy() {
@@ -67,6 +69,5 @@ export default {
6769

6870
<style lang="scss">
6971
.fm-modal-video-player {
70-
7172
}
7273
</style>

src/http/get.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import request from '@/request'
1+
import request from '../request'
22

33
export default {
44
/**

src/http/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import request from '@/request'
1+
import request from '../request'
22

33
export default {
44
/**

src/request/LoadingInterceptor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import EventBus from '@/eventBus'
1+
import EventBus from '../eventBus'
22

33
export const LoadingRequestInterceptor = options => [
44
config => {

src/request/ResponseNoticeInterceptor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import EventBus from '@/eventBus'
1+
import EventBus from '../eventBus'
22

33
const ResponseNoticeInterceptor = options => [
44
null,

src/request/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Vue from 'vue'
2-
import { LoadingRequestInterceptor, LoadingResponseInterceptor } from '@/request/LoadingInterceptor'
3-
import ResponseNoticeInterceptor from '@/request/ResponseNoticeInterceptor'
2+
import { LoadingRequestInterceptor, LoadingResponseInterceptor } from '../request/LoadingInterceptor'
3+
import ResponseNoticeInterceptor from '../request/ResponseNoticeInterceptor'
44

55
const fmApiPath = process.env.VUE_APP_LFM_PATH || 'file-manager'
66

src/store/manager/actions.js

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable object-curly-newline */
2-
import GET from '@/http/get'
2+
import GET from '../../http/get'
33

44
export default {
55
/**
@@ -17,26 +17,21 @@ export default {
1717
commit('clearDirectoryContent')
1818

1919
// get content for the selected directory
20-
return GET.content(state.selectedDisk, path)
21-
.then((response) => {
22-
commit('resetSelected')
23-
commit('resetSortSettings')
24-
commit('setDirectoryContent', response.data())
25-
commit('setSelectedDirectory', path)
20+
return GET.content(state.selectedDisk, path).then(response => {
21+
commit('resetSelected')
22+
commit('resetSortSettings')
23+
commit('setDirectoryContent', response.data())
24+
commit('setSelectedDirectory', path)
2625

27-
if (history) {
28-
commit('addToHistory', path)
29-
}
26+
if (history) {
27+
commit('addToHistory', path)
28+
}
3029

31-
// if directories tree is shown, not main directory and directory have subdirectories
32-
if (
33-
rootState.fm.settings.windowsConfig === 2
34-
&& path
35-
&& response.data().directories.length
36-
) {
37-
dispatch('fm/tree/showSubdirectories', path, { root: true })
38-
}
39-
})
30+
// if directories tree is shown, not main directory and directory have subdirectories
31+
if (rootState.fm.settings.windowsConfig === 2 && path && response.data().directories.length) {
32+
dispatch('fm/tree/showSubdirectories', path, { root: true })
33+
}
34+
})
4035
},
4136

4237
/**
@@ -48,7 +43,7 @@ export default {
4843
*/
4944
refreshDirectory({ state, commit, dispatch }) {
5045
GET.content(state.selectedDisk, state.selectedDirectory)
51-
.then((response) => {
46+
.then(response => {
5247
commit('resetSelected')
5348
commit('resetSortSettings')
5449
commit('resetHistory')

src/store/settings/mutations.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Vue from 'vue'
2-
import request from '@/request'
32

43
export default {
54
/**
@@ -8,10 +7,9 @@ export default {
87
* @param {{}} data
98
*/
109
customSettings(state, data) {
11-
12-
/* if (data.baseURL) {
13-
state.baseURL = data.baseURL
14-
}*/
10+
/* if (data.baseURL) {
11+
state.baseURL = data.baseURL
12+
}*/
1513

1614
// overwrite request headers
1715
if (data.headers) {
@@ -35,16 +33,16 @@ export default {
3533
* @param state
3634
*/
3735
/*initAxiosSettings(state) {
38-
const config = request().wrapper.config
36+
const config = request().wrapper.config
3937
40-
if (!state.baseURL) {
41-
state.baseURL = config.baseURL
42-
}
38+
if (!state.baseURL) {
39+
state.baseURL = config.baseURL
40+
}
4341
44-
if (!state.headers) {
45-
state.headers = config.headers
46-
}
47-
},*/
42+
if (!state.headers) {
43+
state.headers = config.headers
44+
}
45+
},*/
4846

4947
/**
5048
* Initialize App settings from server

0 commit comments

Comments
 (0)