diff --git a/.eslintrc.js b/.eslintrc.js
index 7e5241d..1a3f86b 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,12 +1,13 @@
module.exports = {
extends: [
// add more generic rulesets here, such as:
+ 'eslint:recommended',
'plugin:vue/recommended'
],
rules: {
// override/add rules settings here, such as:
- 'vue/no-unused-vars': 'error',
+ 'no-unused-vars': 'error',
'vue/require-prop-types': 0,
- 'vue/require-default-prop': 0
+ 'vue/max-attributes-per-line': 10
}
}
diff --git a/.travis.yml b/.travis.yml
index 43c20ef..f867e1d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,9 +9,11 @@ before_script:
- cp configuration_sample.php configuration.php
- composer self-update
- composer install --no-interaction
+ - npm install
script:
- vendor/bin/phpunit --coverage-clover=coverage.xml
+ - npm run lint
after_success:
- bash <(curl -s https://codecov.io/bash)
diff --git a/frontend/App.vue b/frontend/App.vue
index 3790eb2..7bf127a 100644
--- a/frontend/App.vue
+++ b/frontend/App.vue
@@ -1,8 +1,8 @@
-
-
-
-
+
diff --git a/frontend/views/Browser.vue b/frontend/views/Browser.vue
index 6c1357a..ae3dd5e 100644
--- a/frontend/views/Browser.vue
+++ b/frontend/views/Browser.vue
@@ -1,23 +1,21 @@
+ @dragover="dropZone = can('upload') && ! isLoading ? true : false"
+ @dragleave="dropZone = false"
+ @drop="dropZone = false"
+ >
+
-
+
-
-
-
+
{{ lang('Drop files to upload') }}
-
-
-
+
+
-
@@ -36,45 +34,45 @@
@@ -89,65 +87,61 @@
:row-class="(row) => 'file-row type-'+row.type"
:checked-rows.sync="checked"
:loading="isLoading"
- checkable>
-
+ checkable
+ >
+
+
+
+ {{ props.row.name }}
+
+
-
-
- {{ props.row.name }}
-
-
+
+ {{ props.row.type == 'back' || props.row.type == 'dir' ? lang('Folder') : formatBytes(props.row.size) }}
+
-
- {{ props.row.type == 'back' || props.row.type == 'dir' ? lang('Folder') : formatBytes(props.row.size) }}
-
+
+ {{ props.row.time ? formatDate(props.row.time) : '' }}
+
-
- {{ props.row.time ? formatDate(props.row.time) : '' }}
-
+
+
+
-
-
-
-
-
- {{ lang('Download') }}
-
-
- {{ lang('Copy') }}
-
-
- {{ lang('Move') }}
-
-
- {{ lang('Rename') }}
-
-
- {{ lang('Unzip') }}
-
-
- {{ lang('Zip') }}
-
-
- {{ lang('Delete') }}
-
-
- {{ lang('Copy link') }}
-
-
-
-
-
-
-
-
- {{ lang('Selected', checked.length, totalCount) }}
-
+
+ {{ lang('Download') }}
+
+
+ {{ lang('Copy') }}
+
+
+ {{ lang('Move') }}
+
+
+ {{ lang('Rename') }}
+
+
+ {{ lang('Unzip') }}
+
+
+ {{ lang('Zip') }}
+
+
+ {{ lang('Delete') }}
+
+
+ {{ lang('Copy link') }}
+
+
+
+
+
+ {{ lang('Selected', checked.length, totalCount) }}
+
-
@@ -161,6 +155,7 @@ import Pagination from './partials/Pagination'
import Upload from './partials/Upload'
import api from '../api/api'
import VueClipboard from 'vue-clipboard2'
+import _ from 'lodash'
Vue.use(VueClipboard)
@@ -178,32 +173,6 @@ export default {
files: [],
}
},
- mounted() {
- if (this.can('read')) {
- this.loadFiles()
- }
- },
- watch: {
- '$route' (to, from) {
- this.isLoading = true
- this.checked = []
- this.currentPage = 1
- api.changeDir({
- to: to.query.cd
- })
- .then(ret => {
- this.$store.commit('setCwd', {
- content: ret.files,
- location: ret.location,
- })
- this.isLoading = false
- })
- .catch(error => {
- this.isLoading = false
- this.handleError(error)
- })
- },
- },
computed: {
breadcrumbs() {
let path = ''
@@ -228,6 +197,32 @@ export default {
}) || 0
},
},
+ watch: {
+ '$route' (to) {
+ this.isLoading = true
+ this.checked = []
+ this.currentPage = 1
+ api.changeDir({
+ to: to.query.cd
+ })
+ .then(ret => {
+ this.$store.commit('setCwd', {
+ content: ret.files,
+ location: ret.location,
+ })
+ this.isLoading = false
+ })
+ .catch(error => {
+ this.isLoading = false
+ this.handleError(error)
+ })
+ },
+ },
+ mounted() {
+ if (this.can('read')) {
+ this.loadFiles()
+ }
+ },
methods: {
loadFiles() {
api.getDir({
@@ -281,7 +276,7 @@ export default {
destination: dir.path,
items: item ? [item] : this.getSelected(),
})
- .then(res => {
+ .then(() => {
this.isLoading = false
})
.catch(error => {
@@ -305,7 +300,7 @@ export default {
destination: dir.path,
items: item ? [item] : this.getSelected(),
})
- .then(res => {
+ .then(() => {
this.isLoading = false
})
.catch(error => {
@@ -366,7 +361,7 @@ export default {
item: item.path,
destination: this.$store.state.cwd.location,
})
- .then(res => {
+ .then(() => {
this.isLoading = false
this.loadFiles()
})
@@ -399,7 +394,7 @@ export default {
items: item ? [item] : this.getSelected(),
destination: this.$store.state.cwd.location,
})
- .then(ret => {
+ .then(() => {
this.isLoading = false
this.loadFiles()
})
@@ -428,7 +423,7 @@ export default {
to: value,
destination: this.$store.state.cwd.location,
})
- .then(res => {
+ .then(() => {
this.isLoading = false
this.loadFiles()
})
@@ -457,7 +452,7 @@ export default {
destination: this.$store.state.cwd.location,
})
// TODO: cors is triggering this too early?
- .then(ret => {
+ .then(() => {
this.isLoading = false
this.loadFiles()
})
@@ -480,7 +475,7 @@ export default {
api.removeItems({
items: item ? [item] : this.getSelected(),
})
- .then(ret => {
+ .then(() => {
this.isLoading = false
this.loadFiles()
})
diff --git a/frontend/views/Login.vue b/frontend/views/Login.vue
index 698ab8f..ea6e05f 100644
--- a/frontend/views/Login.vue
+++ b/frontend/views/Login.vue
@@ -1,7 +1,7 @@
-
-
+
+
@@ -13,10 +13,10 @@
-
+
-
+
@@ -28,12 +28,10 @@
{{ error }}
-
-
diff --git a/frontend/views/Users.vue b/frontend/views/Users.vue
index 24ffff1..5ac41a6 100644
--- a/frontend/views/Users.vue
+++ b/frontend/views/Users.vue
@@ -1,56 +1,55 @@
diff --git a/frontend/views/partials/Menu.vue b/frontend/views/partials/Menu.vue
index 38bdb6b..2324fd9 100644
--- a/frontend/views/partials/Menu.vue
+++ b/frontend/views/partials/Menu.vue
@@ -5,33 +5,32 @@
![]()
-
-
-
-
+
+
+
+
-
diff --git a/frontend/views/partials/Pagination.vue b/frontend/views/partials/Pagination.vue
index 8c1fdd4..3bd0773 100644
--- a/frontend/views/partials/Pagination.vue
+++ b/frontend/views/partials/Pagination.vue
@@ -1,11 +1,19 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/frontend/views/partials/Profile.vue b/frontend/views/partials/Profile.vue
index 270c35f..8f088d2 100644
--- a/frontend/views/partials/Profile.vue
+++ b/frontend/views/partials/Profile.vue
@@ -1,22 +1,28 @@
diff --git a/frontend/views/partials/Tree.vue b/frontend/views/partials/Tree.vue
index 2ab8407..9c0a1bf 100644
--- a/frontend/views/partials/Tree.vue
+++ b/frontend/views/partials/Tree.vue
@@ -1,17 +1,21 @@
diff --git a/frontend/views/partials/TreeNode.vue b/frontend/views/partials/TreeNode.vue
index 1ce9950..1c5b925 100644
--- a/frontend/views/partials/TreeNode.vue
+++ b/frontend/views/partials/TreeNode.vue
@@ -6,7 +6,7 @@
{{ node.name }}
@@ -26,12 +26,6 @@ export default {
button_type: 'is-primary'
}
},
- mounted() {
- if (this.node.path == '/') {
- this.$store.commit('resetTree')
- this.toggleButton(this.node)
- }
- },
computed: {
icon() {
return {
@@ -42,6 +36,12 @@ export default {
}
},
},
+ mounted() {
+ if (this.node.path == '/') {
+ this.$store.commit('resetTree')
+ this.toggleButton(this.node)
+ }
+ },
methods: {
toggleButton(node) {
if (! this.active) {
diff --git a/frontend/views/partials/Upload.vue b/frontend/views/partials/Upload.vue
index c4a2896..3216fcd 100644
--- a/frontend/views/partials/Upload.vue
+++ b/frontend/views/partials/Upload.vue
@@ -6,7 +6,7 @@
-
+
{{ lang('Uploading files', Math.round(resumable.progress()*100), formatBytes(resumable.getSize())) }}
@@ -20,10 +20,10 @@
@@ -34,12 +34,12 @@
{{ file.relativePath != '/' ? file.relativePath : '' }}/{{ file.fileName }}
@@ -69,6 +69,11 @@ export default {
progress: 0,
}
},
+ computed: {
+ activeUploads() {
+ return this.resumable.files.length && this.resumable.progress() < 1
+ },
+ },
watch: {
'files' (files) {
this.visible = true
@@ -132,11 +137,6 @@ export default {
file.file.uploadingError = true
})
},
- computed: {
- activeUploads() {
- return this.resumable.files.length && this.resumable.progress() < 1
- },
- },
methods: {
closeWindow() {
if (this.activeUploads) {
diff --git a/frontend/views/partials/UserEdit.vue b/frontend/views/partials/UserEdit.vue
index 5765bd8..4c9eab3 100644
--- a/frontend/views/partials/UserEdit.vue
+++ b/frontend/views/partials/UserEdit.vue
@@ -1,36 +1,39 @@
- {{ user.name }}
+
+ {{ user.name }}
+
-
@@ -73,8 +79,6 @@ import _ from 'lodash'
export default {
name: 'UserEdit',
props: [ 'user', 'action' ],
- computed: {
- },
data() {
return {
formFields: {
@@ -95,6 +99,8 @@ export default {
}
}
},
+ computed: {
+ },
watch: {
'permissions.read' (val) {
if (!val) {