-
-
-
@@ -14,8 +13,8 @@ import { files as api } from '@/api'
export default {
name: 'download-button',
computed: {
- ...mapState(['req', 'selected', 'shared']),
- ...mapGetters(['isListing', 'selectedCount', 'isSharing', 'sharedSelectedCount'])
+ ...mapState(['req', 'selected']),
+ ...mapGetters(['isListing', 'selectedCount', 'isSharing'])
},
methods: {
download: function () {
@@ -29,11 +28,6 @@ export default {
return
}
- if (this.sharedSelectedCount === 1 && !this.shared.req.items[this.shared.selected[0]].isDir) {
- api.download(null, this.shared.req.items[this.shared.selected[0]].url)
- return
- }
-
this.$store.commit('showHover', 'download')
}
}
diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue
index 82159a3f..2419e7c2 100644
--- a/frontend/src/components/files/ListingItem.vue
+++ b/frontend/src/components/files/ListingItem.vue
@@ -48,7 +48,7 @@ export default {
props: ['name', 'isDir', 'url', 'type', 'size', 'modified', 'index'],
computed: {
...mapState(['user', 'selected', 'req', 'user', 'jwt']),
- ...mapGetters(['selectedCount']),
+ ...mapGetters(['selectedCount', 'isSharing']),
isSelected () {
return (this.selected.indexOf(this.index) !== -1)
},
@@ -63,7 +63,7 @@ export default {
return this.user.perm.rename
},
canDrop () {
- if (!this.isDir) return false
+ if (!this.isDir || this.isSharing) return false
for (let i of this.selected) {
if (this.req.items[i].url === this.url) {
diff --git a/frontend/src/components/files/SharedItem.vue b/frontend/src/components/files/SharedItem.vue
deleted file mode 100644
index 2ea89292..00000000
--- a/frontend/src/components/files/SharedItem.vue
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
- {{ icon }}
-
-
-
-
{{ name }}
-
-
—
-
{{ humanSize() }}
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/src/components/prompts/Download.vue b/frontend/src/components/prompts/Download.vue
index 07deb904..fa129590 100644
--- a/frontend/src/components/prompts/Download.vue
+++ b/frontend/src/components/prompts/Download.vue
@@ -25,20 +25,12 @@ import { files as api } from '@/api'
export default {
name: 'download',
computed: {
- ...mapState(['selected', 'req', 'shared']),
- ...mapGetters(['selectedCount', 'isSharing' ,'sharedSelectedCount'])
+ ...mapState(['selected', 'req']),
+ ...mapGetters(['selectedCount'])
},
methods: {
download: function (format) {
- if (this.isSharing) {
- let files = []
-
- for (let i of this.shared.selected) {
- files.push(this.shared.req.items[i].url)
- }
-
- api.download(format, ...files)
- } else if (this.selectedCount === 0) {
+ if (this.selectedCount === 0) {
api.download(format, this.$route.path)
} else {
let files = []
diff --git a/frontend/src/css/_share.css b/frontend/src/css/_share.css
index ede56aef..967d91d5 100644
--- a/frontend/src/css/_share.css
+++ b/frontend/src/css/_share.css
@@ -54,12 +54,6 @@
border-right: 0;
border-bottom: 0;
border-top: 1px solid rgba(0, 0, 0, 0.1);
- -webkit-user-select:none;
- -khtml-user-select:none;
- -moz-user-select:none;
- -ms-user-select:none;
- -o-user-select:none;
- user-select:none;
}
.share__box__items #listing.list .item .name {
diff --git a/frontend/src/css/mobile.css b/frontend/src/css/mobile.css
index c34dc9d8..556ca033 100644
--- a/frontend/src/css/mobile.css
+++ b/frontend/src/css/mobile.css
@@ -28,7 +28,7 @@
height: 100%;
background-color: rgba(0, 0, 0, 0.1);
}
- .dropdown {
+ #dropdown {
position: fixed;
top: 1em;
right: 1em;
@@ -40,23 +40,23 @@
transform-origin: top right;
z-index: 99999;
}
- .dropdown > div {
+ #dropdown > div {
display: block;
}
- .dropdown.active {
+ #dropdown.active {
transform: scale(1);
}
- .dropdown .action {
+ #dropdown .action {
display: flex;
align-items: center;
border-radius: 0;
width: 100%;
}
- .dropdown .action span:not(.counter) {
+ #dropdown .action span:not(.counter) {
display: inline-block;
padding: .4em;
}
- .dropdown .counter {
+ #dropdown .counter {
left: 2.25em;
}
#file-selection {
diff --git a/frontend/src/store/getters.js b/frontend/src/store/getters.js
index b2e971f1..70c9cd0e 100644
--- a/frontend/src/store/getters.js
+++ b/frontend/src/store/getters.js
@@ -4,7 +4,7 @@ const getters = {
isListing: (state, getters) => getters.isFiles && state.req.isDir,
isEditor: (state, getters) => getters.isFiles && (state.req.type === 'text' || state.req.type === 'textImmutable'),
isPreview: state => state.previewMode,
- isSharing: state => state.shared.loaded && state.route.name === 'Share',
+ isSharing: state => !state.loading && state.route.name === 'Share',
selectedCount: state => state.selected.length,
progress : state => {
if (state.upload.progress.length == 0) {
@@ -13,8 +13,7 @@ const getters = {
let sum = state.upload.progress.reduce((acc, val) => acc + val)
return Math.ceil(sum / state.upload.size * 100);
- },
- sharedSelectedCount: state => state.shared.selected.length
+ }
}
export default getters
diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js
index 6670c7f8..e5b22510 100644
--- a/frontend/src/store/index.js
+++ b/frontend/src/store/index.js
@@ -7,7 +7,18 @@ import upload from './modules/upload'
Vue.use(Vuex)
const state = {
- user: null,
+ user: {
+ perm: {
+ admin: false,
+ create: false,
+ delete: false,
+ download: false,
+ execute: false,
+ modify: false,
+ rename: false,
+ share: false
+ }
+ },
req: {},
oldReq: {},
clipboard: {
@@ -25,13 +36,7 @@ const state = {
showMessage: null,
showConfirm: null,
previewMode: false,
- shared: {
- req: {},
- hash: '',
- loaded: false,
- selected: [],
- multiple: false
- }
+ hash: ''
}
export default new Vuex.Store({
diff --git a/frontend/src/store/mutations.js b/frontend/src/store/mutations.js
index 65e8714f..923ee503 100644
--- a/frontend/src/store/mutations.js
+++ b/frontend/src/store/mutations.js
@@ -27,12 +27,8 @@ const mutations = {
state.show = 'success'
state.showMessage = value
},
- setLoading: (state, value) => {
- state.loading = value
- },
- setReload: (state, value) => {
- state.reload = value
- },
+ setLoading: (state, value) => { state.loading = value },
+ setReload: (state, value) => { state.reload = value },
setUser: (state, value) => {
if (value === null) {
state.user = null
@@ -91,19 +87,7 @@ const mutations = {
setPreviewMode(state, value) {
state.previewMode = value
},
- addSharedSelected: (state, value) => (state.shared.selected.push(value)),
- removeSharedSelected: (state, value) => {
- let i = state.shared.selected.indexOf(value)
- if (i === -1) return
- state.shared.selected.splice(i, 1)
- },
- resetSharedSelected: (state) => {
- state.shared.selected = []
- },
- sharedMultiple: (state, value) => (state.shared.multiple = value),
- updateSharedRequest: (state, value) => (state.shared.req = value),
- setSharedHash: (state, value) => (state.shared.hash = value),
- toggleSharedLoaded: (state, value) => (state.shared.loaded = value)
+ setHash: (state, value) => (state.hash = value),
}
export default mutations
diff --git a/frontend/src/views/Share.vue b/frontend/src/views/Share.vue
index 7084d874..a08a6ef4 100644
--- a/frontend/src/views/Share.vue
+++ b/frontend/src/views/Share.vue
@@ -1,7 +1,7 @@
-
+
-
+
home
@@ -13,13 +13,13 @@
{{ icon }}
- {{ $t('prompts.displayName') }} {{ shared.req.name }}
+ {{ $t('prompts.displayName') }} {{ req.name }}
{{ $t('prompts.lastModified') }}: {{ humanTime }}
@@ -34,12 +34,12 @@
-
-