feat: code cleanup, new features and v2.0

We're merging this to continue https://github.com/filebrowser/filebrowser/pull/575 and setup translations auto-updating.
This commit is contained in:
Henrique Dias authored and GitHub committed 2019-01-05 16:12:09 +00:00
1 parent 2642333928
commit 39be89780e
155 files changed
+16498 -6582

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@
export default {
name: 'copy-button',
methods: {
show: function (event) {
show: function () {
this.$store.commit('showHover', 'copy')
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
export default {
name: 'delete-button',
methods: {
show: function (event) {
show: function () {
this.$store.commit('showHover', 'delete')
}
}
+4 -8
View File
@@ -8,30 +8,26 @@
<script>
import {mapGetters, mapState} from 'vuex'
import * as api from '@/utils/api'
import { files as api } from '@/api'
export default {
name: 'download-button',
computed: {
...mapState(['req', 'selected']),
...mapGetters(['selectedCount'])
...mapGetters(['isListing', 'selectedCount'])
},
methods: {
download: function (event) {
// If we are not on a listing, download the current file.
if (this.req.kind !== 'listing') {
download: function () {
if (!this.isListing) {
api.download(null, this.$route.path)
return
}
// If we are on a listing and there is one element selected,
// download it.
if (this.selectedCount === 1 && !this.req.items[this.selected[0]].isDir) {
api.download(null, this.req.items[this.selected[0]].url)
return
}
// Otherwise show the prompt to choose the formt of the download.
this.$store.commit('showHover', 'download')
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
export default {
name: 'info-button',
methods: {
show: function (event) {
show: function () {
this.$store.commit('showHover', 'info')
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
export default {
name: 'move-button',
methods: {
show: function (event) {
show: function () {
this.$store.commit('showHover', 'move')
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
export default {
name: 'rename-button',
methods: {
show: function (event) {
show: function () {
this.$store.commit('showHover', 'rename')
}
}
-21
View File
@@ -1,21 +0,0 @@
<template>
<button @click="show"
:aria-label="$t('buttons.schedule')"
:title="$t('buttons.schedule')"
id="schedule-button"
class="action">
<i class="material-icons">alarm</i>
<span>{{ $t('buttons.schedule') }}</span>
</button>
</template>
<script>
export default {
name: 'schedule-button',
methods: {
show: function (event) {
this.$store.commit('showHover', 'schedule')
}
}
}
</script>
+1 -1
View File
@@ -9,7 +9,7 @@
export default {
name: 'share-button',
methods: {
show (event) {
show () {
this.$store.commit('showHover', 'share')
}
}
+17
View File
@@ -0,0 +1,17 @@
<template>
<button @click="show" :aria-label="$t('buttons.shell')" :title="$t('buttons.shell')" class="action">
<i class="material-icons">code</i>
<span>{{ $t('buttons.shell') }}</span>
</button>
</template>
<script>
export default {
name: 'shell-button',
methods: {
show: function () {
this.$store.commit('toggleShell')
}
}
}
</script>
+14 -10
View File
@@ -7,7 +7,7 @@
<script>
import { mapState, mapMutations } from 'vuex'
import { updateUser } from '@/utils/api'
import { users as api } from '@/api'
export default {
name: 'switch-button',
@@ -19,17 +19,21 @@ export default {
}
},
methods: {
...mapMutations(['updateUser']),
change: function (event) {
// If we are on mobile we should close the dropdown.
this.$store.commit('closeHovers')
...mapMutations([ 'updateUser', 'closeHovers' ]),
change: async function () {
this.closeHovers()
let user = {...this.user}
user.viewMode = (this.icon === 'view_list') ? 'list' : 'mosaic'
const data = {
id: this.user.id,
viewMode: (this.icon === 'view_list') ? 'list' : 'mosaic'
}
updateUser(user, 'partial').then(() => {
this.updateUser({ viewMode: user.viewMode })
}).catch(this.$showError)
try {
await api.update(data, ['viewMode'])
this.updateUser(data)
} catch (e) {
this.$showError(e)
}
}
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
export default {
name: 'upload-button',
methods: {
upload: function (event) {
upload: function () {
document.getElementById('upload-input').click()
}
}