Skip to content

Commit 4057c84

Browse files
committed
new version - 2
1 parent 0e878f0 commit 4057c84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+618
-490
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VUE_APP_AXIOS_BASE_URL=

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
# Editor directories and files
55
/.idea/
6+
/.env.local

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
77
![Laravel File Manager](https://raw.github.com/alexusmai/vue-laravel-file-manager/master/src/assets/laravel-file-manager.gif?raw=true)
88

9+
# v 2.0.0
10+
11+
* Audio player (mp3, ogg, wav, aac), Video player (webm, mp4) - ([Plyr](https://github.com/sampotts/plyr))
12+
* Code editor - ([Code Mirror](https://github.com/codemirror/codemirror))
13+
* Image cropper - ([Cropper.js](https://github.com/fengyuanchen/cropperjs))
14+
* Zip / Unzip - only for local disks
15+
16+
917
## Installation
1018

1119
### NPM
@@ -41,6 +49,30 @@ Vue.use(FileManager, {store});
4149

4250
`The application store module will be registered under the name 'fm'`
4351

52+
You can overwrite some default settings
53+
54+
```
55+
Vue.use(FileManager, {
56+
store, // required
57+
58+
// not required params
59+
headers: {'Authorization': 'Bearer ...'}, // add header
60+
// OR
61+
headers: {'X-CSRF-TOKEN': 'token'}, // overwrite default header Axios
62+
baseUrl: 'http://my_url:80/file-manager/', // overwrite base url Axios
63+
windowsConfig: 2,
64+
lang: 'de', // set language
65+
translation: { // add new translation
66+
name: de,
67+
content: {
68+
about: 'Über',
69+
back: 'Zurück',
70+
... see lang file structure
71+
},
72+
},
73+
}
74+
```
75+
4476
Now vue component is registered and you can use it in your app
4577
```
4678
<file-manager></file-manager>
@@ -55,4 +87,4 @@ Don't forget add a csrf token to head block in your Laravel view and add bootstr
5587
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
5688
```
5789

58-
Warning! Package use axios (Promise) - use babel-polyfill for ie11
90+
Warning! Package use axios (Promise) - use babel-polyfill for ie11

babel.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = {
22
presets: [
3-
'@vue/app',
3+
[ '@vue/app', {
4+
useBuiltIns: 'entry'
5+
}]
46
],
57
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@vue/test-utils": "^1.0.0-beta.20",
3636
"babel-core": "7.0.0-bridge.0",
3737
"babel-jest": "^23.0.1",
38+
"babel-polyfill": "^6.26.0",
3839
"node-sass": "^4.9.0",
3940
"sass-loader": "^7.0.1",
4041
"vue-template-compiler": "^2.5.17"

public/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
88
<title>new-file-manager</title>
9-
<!--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
10-
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">-->
11-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
12-
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
9+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
10+
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
1311
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css"
1412
integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
1513
</head>
1614
<body>
1715
<noscript>
18-
<strong>We're sorry but new-file-manager doesn't work properly without JavaScript enabled. Please enable it to
16+
<strong>We're sorry but file-manager doesn't work properly without JavaScript enabled. Please enable it to
1917
continue.</strong>
2018
</noscript>
2119
<div class="container">

src/FileManager.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export default {
6666
}),
6767
},
6868
created() {
69+
// init base url
70+
this.$store.commit('fm/settings/initBaseUrl');
71+
6972
// add axios request interceptor
7073
requestInterceptor();
7174
538 KB
Loading

src/components/blocks/mixins/contextMenu.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { apiURL } from '../../../http/helper';
2-
31
export default {
42
computed: {
53
/**
@@ -109,7 +107,7 @@ export default {
109107
* @returns {string}
110108
*/
111109
downloadLink() {
112-
return `${apiURL()}download?disk=${this.selectedDisk}&path=${encodeURIComponent(this.selectedItems[0].path)}`;
110+
return `${this.$store.getters['fm/settings/baseUrl']}download?disk=${this.selectedDisk}&path=${encodeURIComponent(this.selectedItems[0].path)}`;
113111
},
114112
},
115113
};

src/components/manager/GridView.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
<script>
5454
import translate from './../../mixins/translate';
5555
import helper from './../../mixins/helper';
56-
import managerHelper from './../../mixins/manager';
57-
import { apiURL } from '../../http/helper';
56+
import managerHelper from './mixins/manager';
5857
5958
export default {
6059
name: 'grid-view',
@@ -104,7 +103,7 @@ export default {
104103
* @returns {string}
105104
*/
106105
createImgUrl(path) {
107-
return `${apiURL()}thumbnails?disk=${this.disk}&path=${path}`;
106+
return `${this.$store.getters['fm/settings/baseUrl']}thumbnails?disk=${this.disk}&path=${path}`;
108107
},
109108
},
110109
};

0 commit comments

Comments
 (0)