mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 18:40:39 +00:00
protected sharing update
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
</ul>
|
||||
|
||||
<!--ContextMenu for Base location with EDITOR permission-->
|
||||
<ul v-if="$isThisLocation(['base']) && $checkPermission('editor')" class="menu-options" ref="list">
|
||||
<ul v-if="$isThisLocation(['base', 'public']) && $checkPermission('editor')" class="menu-options" ref="list">
|
||||
<li class="menu-option" @click="createFolder">
|
||||
{{ $t('context_menu.create_folder') }}
|
||||
</li>
|
||||
@@ -89,7 +89,7 @@
|
||||
</ul>
|
||||
|
||||
<!--ContextMenu for Base location with VISITOR permission-->
|
||||
<ul v-if="$isThisLocation(['base']) && $checkPermission('visitor')" class="menu-options" ref="list">
|
||||
<ul v-if="$isThisLocation(['base', 'public']) && $checkPermission('visitor')" class="menu-options" ref="list">
|
||||
<li class="menu-option" @click="ItemDetail" v-if="item">
|
||||
{{ $t('context_menu.detail') }}
|
||||
</li>
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
<span>{{ fileInfoDetail.filesize }}</span>
|
||||
</li>
|
||||
|
||||
<!--Latest change-->
|
||||
<li v-if="$checkPermission(['master']) && fileInfoDetail.user_scope !== 'master'" class="list-info-item">
|
||||
<b>Author</b>
|
||||
<span>Public Participant</span>
|
||||
</li>
|
||||
|
||||
<!--Latest change-->
|
||||
<li class="list-info-item">
|
||||
<b>{{ $t('file_detail.created_at') }}</b>
|
||||
@@ -34,7 +40,7 @@
|
||||
</li>
|
||||
|
||||
<!--Parent-->
|
||||
<li v-if="$checkPermission(['master', 'editor'])" class="list-info-item">
|
||||
<li v-if="$checkPermission(['master'])" class="list-info-item">
|
||||
<b>{{ $t('file_detail.where') }}</b>
|
||||
<div class="action-button" @click="moveItem">
|
||||
<FontAwesomeIcon class="icon" icon="pencil-alt" />
|
||||
@@ -49,7 +55,10 @@
|
||||
<FontAwesomeIcon class="icon" :icon="sharedIcon" />
|
||||
<span>{{ sharedInfo }}</span>
|
||||
</div>
|
||||
<CopyInput class="copy-sharelink" size="small" :value="fileInfoDetail.shared.link" />
|
||||
<div class="sharelink">
|
||||
<FontAwesomeIcon class="lock-icon" :icon="lockIcon" @click="shareItemOptions" />
|
||||
<CopyInput class="copy-sharelink" size="small" :value="fileInfoDetail.shared.link" />
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -112,6 +121,9 @@
|
||||
return 'download'
|
||||
}
|
||||
},
|
||||
lockIcon() {
|
||||
return this.fileInfoDetail.shared.protected ? 'lock' : 'lock-open'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
shareItemOptions() {
|
||||
@@ -142,7 +154,7 @@
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: top;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.icon-preview {
|
||||
@@ -238,8 +250,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
.copy-sharelink {
|
||||
.sharelink {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
|
||||
.lock-icon {
|
||||
@include font-size(10);
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
margin-right: 9px;
|
||||
cursor: pointer;
|
||||
|
||||
path {
|
||||
fill: $text;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
path {
|
||||
fill: $theme;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.copy-sharelink {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<!--Name-->
|
||||
<b
|
||||
ref="name"
|
||||
@input="changeItemName"
|
||||
@input="renameItem"
|
||||
:contenteditable="canEditName"
|
||||
class="name"
|
||||
>
|
||||
@@ -177,12 +177,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
changeItemName: debounce(function (e) {
|
||||
renameItem: debounce(function (e) {
|
||||
|
||||
// Prevent submit empty string
|
||||
if (e.target.innerText === '') return
|
||||
|
||||
this.$store.dispatch('changeItemName', {
|
||||
this.$store.dispatch('renameItem', {
|
||||
unique_id: this.data.unique_id,
|
||||
type: this.data.type,
|
||||
name: e.target.innerText
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<!--Name-->
|
||||
<b
|
||||
ref="name"
|
||||
@input="changeItemName"
|
||||
@input="renameItem"
|
||||
:contenteditable="canEditName"
|
||||
class="name"
|
||||
>
|
||||
@@ -53,6 +53,11 @@
|
||||
<FontAwesomeIcon class="shared-icon" icon="user-friends"/>
|
||||
</div>
|
||||
|
||||
<!--Participant owner Icon-->
|
||||
<div v-if="$checkPermission('master') && data.user_scope !== 'master'" class="item-shared">
|
||||
<FontAwesomeIcon class="shared-icon" icon="user-edit"/>
|
||||
</div>
|
||||
|
||||
<!--Filesize and timestamp-->
|
||||
<span v-if="! isFolder" class="item-size">{{ data.filesize }}, {{ timeStamp }}</span>
|
||||
|
||||
@@ -192,12 +197,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
changeItemName: debounce(function (e) {
|
||||
renameItem: debounce(function (e) {
|
||||
|
||||
// Prevent submit empty string
|
||||
if (e.target.innerText === '') return
|
||||
|
||||
this.$store.dispatch('changeItemName', {
|
||||
this.$store.dispatch('renameItem', {
|
||||
unique_id: this.data.unique_id,
|
||||
type: this.data.type,
|
||||
name: e.target.innerText
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
name: itemName
|
||||
}
|
||||
|
||||
this.$store.dispatch('changeItemName', item)
|
||||
this.$store.dispatch('renameItem', item)
|
||||
|
||||
// Change item name if is mobile device or prompted
|
||||
if (this.$isMobile()) {
|
||||
|
||||
Vendored
+3
-3
@@ -55,7 +55,7 @@ const Helpers = {
|
||||
// Prevent submit empty files
|
||||
if (files && files.length == 0) return
|
||||
|
||||
if (this.$store.getters.app.storage.percentage >= 100) {
|
||||
if (! this.$isThisLocation(['public']) && this.$store.getters.app.storage.percentage >= 100) {
|
||||
events.$emit('alert:open', {
|
||||
emoji: '😬😬😬',
|
||||
title: this.$t('popup_exceed_limit.title'),
|
||||
@@ -104,7 +104,7 @@ const Helpers = {
|
||||
}
|
||||
}).catch(error => {
|
||||
|
||||
if (error.response.status == 423) {
|
||||
/*if (error.response.status === 423) {
|
||||
|
||||
events.$emit('alert:open', {
|
||||
emoji: '😬😬😬',
|
||||
@@ -119,7 +119,7 @@ const Helpers = {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
}
|
||||
}*/
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -9,6 +9,8 @@ import Helpers from './helpers'
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||
import {
|
||||
faLock,
|
||||
faLockOpen,
|
||||
faDownload,
|
||||
faUserFriends,
|
||||
faCheck,
|
||||
@@ -44,6 +46,8 @@ import {
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
|
||||
library.add(
|
||||
faLock,
|
||||
faLockOpen,
|
||||
faDownload,
|
||||
faUserFriends,
|
||||
faCheck,
|
||||
|
||||
+4
-4
@@ -77,8 +77,8 @@ const actions = {
|
||||
}
|
||||
|
||||
if (! back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
|
||||
// Create shared object for history
|
||||
let trash = {
|
||||
@@ -114,8 +114,8 @@ const actions = {
|
||||
}
|
||||
|
||||
if (! back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
|
||||
// Create trash object for history
|
||||
let trash = {
|
||||
|
||||
+12
-7
@@ -29,10 +29,10 @@ const actions = {
|
||||
})
|
||||
.catch(() => isSomethingWrong())
|
||||
},
|
||||
changeItemName: ({commit, getters}, data) => {
|
||||
renameItem: ({commit, getters}, data) => {
|
||||
|
||||
// Updated name in favourites panel
|
||||
if (data.type === 'folder')
|
||||
if (getters.permission === 'master' && data.type === 'folder')
|
||||
commit('UPDATE_NAME_IN_FAVOURITES', data)
|
||||
|
||||
axios
|
||||
@@ -69,7 +69,8 @@ const actions = {
|
||||
.catch(error => {
|
||||
reject(error)
|
||||
|
||||
context.commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
|
||||
// Reset uploader
|
||||
commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -100,10 +101,14 @@ const actions = {
|
||||
// Remove file
|
||||
commit('REMOVE_ITEM', data.unique_id)
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
else
|
||||
commit('REMOVE_ITEM_FROM_RECENT_UPLOAD', data.unique_id)
|
||||
// Remove item from sidebar
|
||||
if (getters.permission === 'master') {
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
else
|
||||
commit('REMOVE_ITEM_FROM_RECENT_UPLOAD', data.unique_id)
|
||||
}
|
||||
|
||||
// Remove file preview
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
+4
-8
@@ -37,15 +37,11 @@ const actions = {
|
||||
location: 'public'
|
||||
}
|
||||
|
||||
let route = getters.sharedDetail.protected ? '/api/browse-private/' : '/api/browse-public/'
|
||||
let route = getters.sharedDetail.protected ? '/api/browse-private/' : '/api/browse-public/' + router.currentRoute.params.token +'/'
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(route + currentFolder.unique_id, {
|
||||
params: {
|
||||
token: router.currentRoute.params.token
|
||||
}
|
||||
})
|
||||
.get(route + currentFolder.unique_id)
|
||||
.then(response => {
|
||||
|
||||
commit('LOADING_STATE', false)
|
||||
@@ -76,9 +72,9 @@ const actions = {
|
||||
},
|
||||
getSingleFile: ({commit, state}) => {
|
||||
|
||||
let route = state.sharedDetail.protected ? '/api/file-private/' : '/api/file-public/'
|
||||
let route = state.sharedDetail.protected ? '/api/file-private/' : '/api/file-public/' + router.currentRoute.params.token
|
||||
|
||||
axios.get(route + router.currentRoute.params.token)
|
||||
axios.get(route)
|
||||
.then(response => {
|
||||
commit('STORE_SHARED_FILE', response.data)
|
||||
})
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
<!--Loading Spinenr-->
|
||||
<Spinner v-if="isPageLoading"/>
|
||||
|
||||
<!--System alerts-->
|
||||
<Alert />
|
||||
|
||||
<!--Background vignette-->
|
||||
<Vignette/>
|
||||
|
||||
<!--Password verification-->
|
||||
<div v-if="currentPage === 'page-password'" id="password-view">
|
||||
|
||||
@@ -37,15 +43,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="sharedDetail.type === 'folder'" @contextmenu.prevent.capture="contextMenu($event, undefined)" @click="fileViewClick">
|
||||
<!--Move item window-->
|
||||
<MoveItem/>
|
||||
|
||||
<!--Mobile Menu-->
|
||||
<MobileMenu/>
|
||||
|
||||
<!--Background vignette-->
|
||||
<Vignette/>
|
||||
|
||||
<!--Context menu-->
|
||||
<ContextMenu/>
|
||||
|
||||
@@ -71,7 +72,7 @@
|
||||
import AuthButton from '@/components/VueFileManagerComponents/Auth/AuthButton'
|
||||
import Spinner from '@/components/VueFileManagerComponents/FilesView/Spinner'
|
||||
import Vignette from '@/components/VueFileManagerComponents/Others/Vignette'
|
||||
import MoveItem from '@/components/VueFileManagerComponents/Others/MoveItem'
|
||||
import Alert from '@/components/VueFileManagerComponents/FilesView/Alert'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {ResizeSensor} from 'css-element-queries'
|
||||
import {mapGetters} from 'vuex'
|
||||
@@ -93,8 +94,8 @@
|
||||
ButtonBase,
|
||||
required,
|
||||
Vignette,
|
||||
MoveItem,
|
||||
Spinner,
|
||||
Alert,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['config', 'filesViewWidth', 'sharedDetail', 'sharedFile']),
|
||||
@@ -150,10 +151,7 @@
|
||||
})*/
|
||||
},
|
||||
download() {
|
||||
this.$downloadFile(
|
||||
this.item.file_url,
|
||||
this.item.name + '.' + this.item.mimetype
|
||||
)
|
||||
this.$downloadFile(this.sharedFile.file_url, this.sharedFile.name + '.' + this.sharedFile.mimetype)
|
||||
},
|
||||
fileViewClick() {
|
||||
events.$emit('contextMenu:hide')
|
||||
|
||||
Reference in New Issue
Block a user