mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-19 19:55:02 +00:00
editing with shared items in public
This commit is contained in:
@@ -31,13 +31,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MobileMenu from '@/components/VueFileManagerComponents/FilesView/MobileMenu'
|
||||
import ShareCreate from '@/components/VueFileManagerComponents/Others/ShareCreate'
|
||||
import ShareEdit from '@/components/VueFileManagerComponents/Others/ShareEdit'
|
||||
import MoveItem from '@/components/VueFileManagerComponents/Others/MoveItem'
|
||||
import Vignette from '@/components/VueFileManagerComponents/Others/Vignette'
|
||||
import Sidebar from '@/components/VueFileManagerComponents/Sidebar/Sidebar'
|
||||
import Alert from '@/components/VueFileManagerComponents/FilesView/Alert'
|
||||
import MobileMenu from '@/components/FilesView/MobileMenu'
|
||||
import ShareCreate from '@/components/Others/ShareCreate'
|
||||
import ShareEdit from '@/components/Others/ShareEdit'
|
||||
import MoveItem from '@/components/Others/MoveItem'
|
||||
import Vignette from '@/components/Others/Vignette'
|
||||
import Sidebar from '@/components/Sidebar/Sidebar'
|
||||
import Alert from '@/components/FilesView/Alert'
|
||||
import {ResizeSensor} from 'css-element-queries'
|
||||
import { includes } from 'lodash'
|
||||
import {mapGetters} from 'vuex'
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ButtonBase from '@/components/VueFileManagerComponents/FilesView/ButtonBase'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import {events} from '@/bus'
|
||||
|
||||
export default {
|
||||
+7
-9
@@ -46,7 +46,7 @@
|
||||
<div class="toolbar-button-wrapper">
|
||||
<ToolbarButton
|
||||
:source="preview"
|
||||
action=""
|
||||
action="Change Preview"
|
||||
@click.native="$store.dispatch('changePreviewType')"
|
||||
/>
|
||||
<ToolbarButton
|
||||
@@ -62,10 +62,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ToolbarButtonUpload from '@/components/VueFileManagerComponents/FilesView/ToolbarButtonUpload'
|
||||
import UploadProgress from '@/components/VueFileManagerComponents/FilesView/UploadProgress'
|
||||
import ToolbarButton from '@/components/VueFileManagerComponents/FilesView/ToolbarButton'
|
||||
import SearchBar from '@/components/VueFileManagerComponents/FilesView/SearchBar'
|
||||
import ToolbarButtonUpload from '@/components/FilesView/ToolbarButtonUpload'
|
||||
import UploadProgress from '@/components/FilesView/UploadProgress'
|
||||
import ToolbarButton from '@/components/FilesView/ToolbarButton'
|
||||
import SearchBar from '@/components/FilesView/SearchBar'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
|
||||
@@ -97,9 +97,6 @@
|
||||
preview() {
|
||||
return this.FilePreviewType === 'list' ? 'th' : 'th-list'
|
||||
},
|
||||
isTrash() {
|
||||
return this.currentFolder.location === 'trash' || this.currentFolder.location === 'trash-root'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -130,7 +127,8 @@
|
||||
events.$emit('items:delete')
|
||||
},
|
||||
createFolder() {
|
||||
if (! this.isTrash) this.$createFolder()
|
||||
if (! this.$isThisLocation(['trash', 'trash-root']))
|
||||
this.$createFolder()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
+2
-2
@@ -35,8 +35,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ButtonUpload from '@/components/VueFileManagerComponents/FilesView/ButtonUpload'
|
||||
import Spinner from '@/components/VueFileManagerComponents/FilesView/Spinner'
|
||||
import ButtonUpload from '@/components/FilesView/ButtonUpload'
|
||||
import Spinner from '@/components/FilesView/Spinner'
|
||||
import {mapGetters} from 'vuex'
|
||||
|
||||
export default {
|
||||
+8
-8
@@ -83,14 +83,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MobileToolbar from '@/components/VueFileManagerComponents/FilesView/MobileToolbar'
|
||||
import MobileActions from '@/components/VueFileManagerComponents/FilesView/MobileActions'
|
||||
import FileInfoPanel from '@/components/VueFileManagerComponents/FilesView/FileInfoPanel'
|
||||
import FileItemList from '@/components/VueFileManagerComponents/FilesView/FileItemList'
|
||||
import FileItemGrid from '@/components/VueFileManagerComponents/FilesView/FileItemGrid'
|
||||
import EmptyMessage from '@/components/VueFileManagerComponents/FilesView/EmptyMessage'
|
||||
import EmptyPage from '@/components/VueFileManagerComponents/FilesView/EmptyPage'
|
||||
import SearchBar from '@/components/VueFileManagerComponents/FilesView/SearchBar'
|
||||
import MobileToolbar from '@/components/FilesView/MobileToolbar'
|
||||
import MobileActions from '@/components/FilesView/MobileActions'
|
||||
import FileInfoPanel from '@/components/FilesView/FileInfoPanel'
|
||||
import FileItemList from '@/components/FilesView/FileItemList'
|
||||
import FileItemGrid from '@/components/FilesView/FileItemGrid'
|
||||
import EmptyMessage from '@/components/FilesView/EmptyMessage'
|
||||
import EmptyPage from '@/components/FilesView/EmptyPage'
|
||||
import SearchBar from '@/components/FilesView/SearchBar'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FilePreview from '@/components/VueFileManagerComponents/FilesView/FilePreview'
|
||||
import CopyInput from '@/components/VueFileManagerComponents/Others/Forms/CopyInput'
|
||||
import FilePreview from '@/components/FilesView/FilePreview'
|
||||
import CopyInput from '@/components/Others/Forms/CopyInput'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from "@/bus"
|
||||
|
||||
+17
-7
@@ -7,7 +7,7 @@
|
||||
>
|
||||
<!--Grid preview-->
|
||||
<div
|
||||
:draggable="! isDeleted"
|
||||
:draggable="canDrag"
|
||||
@dragstart="$emit('dragstart')"
|
||||
@drop="
|
||||
$emit('drop')
|
||||
@@ -49,11 +49,17 @@
|
||||
</b>
|
||||
|
||||
<div class="item-info">
|
||||
|
||||
<!--Shared Icon-->
|
||||
<div v-if="$checkPermission('master') && data.shared" class="item-shared">
|
||||
<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-->
|
||||
<span v-if="! isFolder" class="item-size">{{ data.filesize }}</span>
|
||||
|
||||
@@ -65,8 +71,8 @@
|
||||
</div>
|
||||
|
||||
<span @click.stop="showItemActions" class="show-actions" v-if="$isMobile()">
|
||||
<FontAwesomeIcon icon="ellipsis-h" class="icon-action"></FontAwesomeIcon>
|
||||
</span>
|
||||
<FontAwesomeIcon icon="ellipsis-h" class="icon-action"></FontAwesomeIcon>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -77,7 +83,7 @@
|
||||
import {events} from '@/bus'
|
||||
|
||||
export default {
|
||||
name: 'FileItem',
|
||||
name: 'FileItemGrid',
|
||||
props: ['data'],
|
||||
computed: {
|
||||
...mapGetters(['FilePreviewType']),
|
||||
@@ -91,7 +97,10 @@
|
||||
return this.data.type === 'image'
|
||||
},
|
||||
canEditName() {
|
||||
return ! this.$isMobile() && ! this.$isThisLocation(['trash', 'trash-root']) && ! this.$checkPermission('visitor')
|
||||
return !this.$isMobile() && !this.$isThisLocation(['trash', 'trash-root']) && !this.$checkPermission('visitor')
|
||||
},
|
||||
canDrag() {
|
||||
return !this.isDeleted && this.$checkPermission(['master', 'editor'])
|
||||
},
|
||||
timeStamp() {
|
||||
return this.data.deleted_at ? this.$t('item_thumbnail.deleted_at', this.data.deleted_at) : this.data.created_at
|
||||
@@ -136,7 +145,7 @@
|
||||
if (this.$isMobile() && this.isFolder) {
|
||||
|
||||
// Go to folder
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
if (this.$isThisLocation('public')) {
|
||||
this.$store.dispatch('browseShared', [this.data, false])
|
||||
} else {
|
||||
this.$store.dispatch('getFolder', [this.data, false])
|
||||
@@ -170,7 +179,7 @@
|
||||
|
||||
if (this.isFolder) {
|
||||
// Go to folder
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
if (this.$isThisLocation('public')) {
|
||||
this.$store.dispatch('browseShared', [this.data, false])
|
||||
} else {
|
||||
this.$store.dispatch('getFolder', [this.data, false])
|
||||
@@ -364,6 +373,7 @@
|
||||
height: 110px;
|
||||
border-radius: 5px;
|
||||
margin: 0 auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.folder-icon {
|
||||
+9
-8
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<div
|
||||
@click.stop="clickedItem" @dblclick="goToItem"
|
||||
class="file-wrapper"
|
||||
@click.stop="clickedItem"
|
||||
@dblclick="goToItem"
|
||||
spellcheck="false"
|
||||
>
|
||||
<!--List preview-->
|
||||
<div
|
||||
:draggable="! isDeleted"
|
||||
:draggable="canDrag"
|
||||
@dragstart="$emit('dragstart')"
|
||||
@drop="
|
||||
$emit('drop')
|
||||
@@ -84,7 +85,7 @@
|
||||
import {events} from '@/bus'
|
||||
|
||||
export default {
|
||||
name: 'FileItem',
|
||||
name: 'FileItemList',
|
||||
props: ['data'],
|
||||
computed: {
|
||||
...mapGetters(['FilePreviewType']),
|
||||
@@ -100,6 +101,9 @@
|
||||
canEditName() {
|
||||
return ! this.$isMobile() && ! this.$isThisLocation(['trash', 'trash-root']) && ! this.$checkPermission('visitor')
|
||||
},
|
||||
canDrag() {
|
||||
return ! this.isDeleted && this.$checkPermission(['master', 'editor'])
|
||||
},
|
||||
timeStamp() {
|
||||
return this.data.deleted_at ? this.$t('item_thumbnail.deleted_at', {time: this.data.deleted_at}) : this.data.created_at
|
||||
},
|
||||
@@ -169,11 +173,7 @@
|
||||
// Get target classname
|
||||
let itemClass = e.target.className
|
||||
|
||||
if (
|
||||
['name', 'icon', 'file-link', 'file-icon-text'].includes(
|
||||
itemClass
|
||||
)
|
||||
)
|
||||
if (['name', 'icon', 'file-link', 'file-icon-text'].includes(itemClass))
|
||||
return
|
||||
},
|
||||
goToItem() {
|
||||
@@ -380,6 +380,7 @@
|
||||
border-radius: 5px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
|
||||
<!--ContextMenu for Base location with MASTER permission-->
|
||||
<div v-if="$isThisLocation(['base', 'shared']) && $checkPermission(['master', 'editor'])" class="mobile-actions">
|
||||
<div v-if="$isThisLocation(['base', 'shared', 'public']) && $checkPermission(['master', 'editor'])" class="mobile-actions">
|
||||
<MobileActionButton @click.native="createFolder" icon="folder-plus">
|
||||
{{ $t('context_menu.add_folder') }}
|
||||
</MobileActionButton>
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
|
||||
<!--ContextMenu for Base location with VISITOR permission-->
|
||||
<div v-if="$isThisLocation(['base', 'shared']) && $checkPermission('visitor')" class="mobile-actions">
|
||||
<div v-if="$isThisLocation(['base', 'shared', 'public']) && $checkPermission('visitor')" class="mobile-actions">
|
||||
<MobileActionButton @click.native="switchPreview" :icon="previewIcon">
|
||||
{{ previewText }}
|
||||
</MobileActionButton>
|
||||
@@ -37,9 +37,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MobileActionButtonUpload from '@/components/VueFileManagerComponents/FilesView/MobileActionButtonUpload'
|
||||
import MobileActionButton from '@/components/VueFileManagerComponents/FilesView/MobileActionButton'
|
||||
import UploadProgress from '@/components/VueFileManagerComponents/FilesView/UploadProgress'
|
||||
import MobileActionButtonUpload from '@/components/FilesView/MobileActionButtonUpload'
|
||||
import MobileActionButton from '@/components/FilesView/MobileActionButton'
|
||||
import UploadProgress from '@/components/FilesView/UploadProgress'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {debounce} from 'lodash'
|
||||
import {events} from '@/bus'
|
||||
+2
-2
@@ -64,7 +64,7 @@
|
||||
</ul>
|
||||
|
||||
<!--Mobile for Base location with EDITOR permission-->
|
||||
<ul v-if="$isThisLocation(['base']) && $checkPermission('editor')" class="menu-options">
|
||||
<ul v-if="$isThisLocation(['base', 'public']) && $checkPermission('editor')" class="menu-options">
|
||||
<li class="menu-option" @click="renameItem" v-if="fileInfoDetail">
|
||||
{{ $t('context_menu.rename') }}
|
||||
</li>
|
||||
@@ -77,7 +77,7 @@
|
||||
</ul>
|
||||
|
||||
<!--Mobile for Base location with VISITOR permission-->
|
||||
<ul v-if="$isThisLocation(['base']) && $checkPermission('visitor')" class="menu-options">
|
||||
<ul v-if="$isThisLocation(['base', 'public']) && $checkPermission('visitor')" class="menu-options">
|
||||
<li class="menu-option" @click="downloadItem" v-if="! isFolder">
|
||||
{{ $t('context_menu.download') }}
|
||||
</li>
|
||||
+5
-5
@@ -14,8 +14,8 @@
|
||||
<div class="directory-name">{{ directoryName }}</div>
|
||||
|
||||
<!--More Actions-->
|
||||
<div class="more-actions-button" @click="showSidebarMenu">
|
||||
<div class="tap-area">
|
||||
<div class="more-actions-button">
|
||||
<div class="tap-area" @click="showSidebarMenu" v-if="$checkPermission('master')">
|
||||
<FontAwesomeIcon icon="bars" v-if="isSmallAppSize"></FontAwesomeIcon>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,9 +23,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ToolbarButtonUpload from '@/components/VueFileManagerComponents/FilesView/ToolbarButtonUpload'
|
||||
import ToolbarButton from '@/components/VueFileManagerComponents/FilesView/ToolbarButton'
|
||||
import SearchBar from '@/components/VueFileManagerComponents/FilesView/SearchBar'
|
||||
import ToolbarButtonUpload from '@/components/FilesView/ToolbarButtonUpload'
|
||||
import ToolbarButton from '@/components/FilesView/ToolbarButton'
|
||||
import SearchBar from '@/components/FilesView/SearchBar'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ProgressBar from '@/components/VueFileManagerComponents/FilesView/ProgressBar'
|
||||
import ProgressBar from '@/components/FilesView/ProgressBar'
|
||||
import {mapGetters} from 'vuex'
|
||||
|
||||
export default {
|
||||
+12
-12
@@ -4,15 +4,15 @@
|
||||
<PopupHeader :title="$t('popup_move_item.title')" />
|
||||
|
||||
<!--Content-->
|
||||
<PopupContent type="height-limited" v-if="app && pickedItem">
|
||||
<PopupContent type="height-limited" v-if="pickedItem">
|
||||
|
||||
<!--Show Spinner when loading folders-->
|
||||
<Spinner v-if="isLoadingTree"/>
|
||||
|
||||
<!--Folder tree-->
|
||||
<div v-if="! isLoadingTree">
|
||||
<div v-if="! isLoadingTree && navigation">
|
||||
<ThumbnailItem class="item-thumbnail" :item="pickedItem" info="location"/>
|
||||
<TreeMenu :depth="1" :nodes="items" v-for="items in app.folders" :key="items.unique_id"/>
|
||||
<TreeMenu :depth="1" :nodes="items" v-for="items in navigation" :key="items.unique_id"/>
|
||||
</div>
|
||||
</PopupContent>
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopupWrapper from '@/components/VueFileManagerComponents/Others/Popup/PopupWrapper'
|
||||
import PopupActions from '@/components/VueFileManagerComponents/Others/Popup/PopupActions'
|
||||
import PopupContent from '@/components/VueFileManagerComponents/Others/Popup/PopupContent'
|
||||
import PopupHeader from '@/components/VueFileManagerComponents/Others/Popup/PopupHeader'
|
||||
import ThumbnailItem from '@/components/VueFileManagerComponents/Others/ThumbnailItem'
|
||||
import ButtonBase from '@/components/VueFileManagerComponents/FilesView/ButtonBase'
|
||||
import Spinner from '@/components/VueFileManagerComponents/FilesView/Spinner'
|
||||
import TreeMenu from '@/components/VueFileManagerComponents/Others/TreeMenu'
|
||||
import PopupWrapper from '@/components/Others/Popup/PopupWrapper'
|
||||
import PopupActions from '@/components/Others/Popup/PopupActions'
|
||||
import PopupContent from '@/components/Others/Popup/PopupContent'
|
||||
import PopupHeader from '@/components/Others/Popup/PopupHeader'
|
||||
import ThumbnailItem from '@/components/Others/ThumbnailItem'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import Spinner from '@/components/FilesView/Spinner'
|
||||
import TreeMenu from '@/components/Others/TreeMenu'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
Spinner,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['app']),
|
||||
...mapGetters(['navigation']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
+9
-9
@@ -65,16 +65,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopupWrapper from '@/components/VueFileManagerComponents/Others/Popup/PopupWrapper'
|
||||
import PopupActions from '@/components/VueFileManagerComponents/Others/Popup/PopupActions'
|
||||
import PopupContent from '@/components/VueFileManagerComponents/Others/Popup/PopupContent'
|
||||
import PopupWrapper from '@/components/Others/Popup/PopupWrapper'
|
||||
import PopupActions from '@/components/Others/Popup/PopupActions'
|
||||
import PopupContent from '@/components/Others/Popup/PopupContent'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import PopupHeader from '@/components/VueFileManagerComponents/Others/Popup/PopupHeader'
|
||||
import SwitchInput from '@/components/VueFileManagerComponents/Others/Forms/SwitchInput'
|
||||
import SelectInput from '@/components/VueFileManagerComponents/Others/Forms/SelectInput'
|
||||
import ThumbnailItem from '@/components/VueFileManagerComponents/Others/ThumbnailItem'
|
||||
import CopyInput from '@/components/VueFileManagerComponents/Others/Forms/CopyInput'
|
||||
import ButtonBase from '@/components/VueFileManagerComponents/FilesView/ButtonBase'
|
||||
import PopupHeader from '@/components/Others/Popup/PopupHeader'
|
||||
import SwitchInput from '@/components/Others/Forms/SwitchInput'
|
||||
import SelectInput from '@/components/Others/Forms/SelectInput'
|
||||
import ThumbnailItem from '@/components/Others/ThumbnailItem'
|
||||
import CopyInput from '@/components/Others/Forms/CopyInput'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
+10
-10
@@ -67,17 +67,17 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopupWrapper from '@/components/VueFileManagerComponents/Others/Popup/PopupWrapper'
|
||||
import PopupActions from '@/components/VueFileManagerComponents/Others/Popup/PopupActions'
|
||||
import PopupContent from '@/components/VueFileManagerComponents/Others/Popup/PopupContent'
|
||||
import PopupWrapper from '@/components/Others/Popup/PopupWrapper'
|
||||
import PopupActions from '@/components/Others/Popup/PopupActions'
|
||||
import PopupContent from '@/components/Others/Popup/PopupContent'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import PopupHeader from '@/components/VueFileManagerComponents/Others/Popup/PopupHeader'
|
||||
import SwitchInput from '@/components/VueFileManagerComponents/Others/Forms/SwitchInput'
|
||||
import SelectInput from '@/components/VueFileManagerComponents/Others/Forms/SelectInput'
|
||||
import ThumbnailItem from '@/components/VueFileManagerComponents/Others/ThumbnailItem'
|
||||
import ActionButton from '@/components/VueFileManagerComponents/Others/ActionButton'
|
||||
import CopyInput from '@/components/VueFileManagerComponents/Others/Forms/CopyInput'
|
||||
import ButtonBase from '@/components/VueFileManagerComponents/FilesView/ButtonBase'
|
||||
import PopupHeader from '@/components/Others/Popup/PopupHeader'
|
||||
import SwitchInput from '@/components/Others/Forms/SwitchInput'
|
||||
import SelectInput from '@/components/Others/Forms/SelectInput'
|
||||
import ThumbnailItem from '@/components/Others/ThumbnailItem'
|
||||
import ActionButton from '@/components/Others/ActionButton'
|
||||
import CopyInput from '@/components/Others/Forms/CopyInput'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TreeMenu from '@/components/VueFileManagerComponents/Others/TreeMenu'
|
||||
import TreeMenu from '@/components/Others/TreeMenu'
|
||||
import {events} from "@/bus"
|
||||
|
||||
export default {
|
||||
+5
-5
@@ -73,11 +73,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FileListItemThumbnail from '@/components/VueFileManagerComponents/Sidebar/FileListItemThumbnail'
|
||||
import UserHeadline from '@/components/VueFileManagerComponents/Sidebar/UserHeadline'
|
||||
import ButtonBase from '@/components/VueFileManagerComponents/FilesView/ButtonBase'
|
||||
import StorageSize from '@/components/VueFileManagerComponents/Sidebar/StorageSize'
|
||||
import TextLabel from '@/components/VueFileManagerComponents/Others/TextLabel'
|
||||
import FileListItemThumbnail from '@/components/Sidebar/FileListItemThumbnail'
|
||||
import UserHeadline from '@/components/Sidebar/UserHeadline'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import StorageSize from '@/components/Sidebar/StorageSize'
|
||||
import TextLabel from '@/components/Others/TextLabel'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ProgressBar from '@/components/VueFileManagerComponents/FilesView/ProgressBar'
|
||||
import ProgressBar from '@/components/FilesView/ProgressBar'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
Vendored
-1
@@ -5,7 +5,6 @@ import store from '@/store'
|
||||
import Index from './views/Auth/SignIn'
|
||||
import SignUp from './views/Auth/SignUp'
|
||||
import SharedContent from './views/Shared/SharedContent'
|
||||
import VerifyByPassword from './views/Shared/VerifyByPassword'
|
||||
import ForgottenPassword from './views/Auth/ForgottenPassword'
|
||||
import CreateNewPassword from './views/Auth/CreateNewPassword'
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
const defaultState = {
|
||||
fileInfoPanelVisible: localStorage.getItem('file_info_visibility') == 'true' || false,
|
||||
FilePreviewType: localStorage.getItem('FilePreviewType') || 'list',
|
||||
FilePreviewType: localStorage.getItem('preview_type') || 'list',
|
||||
appSize: undefined,
|
||||
config: undefined,
|
||||
}
|
||||
@@ -20,8 +20,8 @@ const actions = {
|
||||
|
||||
} else {
|
||||
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
dispatch('browseShared', [this.currentFolder(), false, true])
|
||||
if ( getters.currentFolder.location === 'public' ) {
|
||||
dispatch('browseShared', [getters.currentFolder, false, true])
|
||||
} else {
|
||||
dispatch('getFolder', [getters.currentFolder, false, true])
|
||||
}
|
||||
|
||||
+48
-9
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios'
|
||||
import {events} from '@/bus'
|
||||
import router from '@/router'
|
||||
import { includes } from 'lodash'
|
||||
import {includes} from 'lodash'
|
||||
import i18n from '@/i18n/index'
|
||||
|
||||
const defaultState = {
|
||||
@@ -11,6 +11,7 @@ const defaultState = {
|
||||
homeDirectory: undefined,
|
||||
uploadingFileProgress: 0,
|
||||
filesViewWidth: undefined,
|
||||
navigation: undefined,
|
||||
isSearching: false,
|
||||
browseHistory: [],
|
||||
isLoading: true,
|
||||
@@ -22,7 +23,7 @@ const actions = {
|
||||
events.$emit('show:content')
|
||||
|
||||
// Go to files view
|
||||
if ( ! includes(['Files', 'SharedContent'], router.currentRoute.name) ) {
|
||||
if (!includes(['Files', 'SharedContent'], router.currentRoute.name)) {
|
||||
router.push({name: 'Files'})
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ const actions = {
|
||||
location: folder.deleted_at || folder.location === 'trash' ? 'trash' : 'base'
|
||||
}
|
||||
|
||||
let url = currentFolder.location === 'trash' ?'/folders/' + currentFolder.unique_id + '?trash=true' : '/folders/' + currentFolder.unique_id
|
||||
let url = currentFolder.location === 'trash' ? '/folders/' + currentFolder.unique_id + '?trash=true' : '/folders/' + currentFolder.unique_id
|
||||
|
||||
axios
|
||||
.get(context.getters.api + url)
|
||||
@@ -76,9 +77,9 @@ const actions = {
|
||||
router.push({name: 'Files'})
|
||||
}
|
||||
|
||||
if (! back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
if (!back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
|
||||
// Create shared object for history
|
||||
let trash = {
|
||||
@@ -113,9 +114,9 @@ const actions = {
|
||||
router.push({name: 'Files'})
|
||||
}
|
||||
|
||||
if (! back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
if (!back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
|
||||
// Create trash object for history
|
||||
let trash = {
|
||||
@@ -177,9 +178,46 @@ const actions = {
|
||||
})
|
||||
})
|
||||
},
|
||||
getFolderTree: ({commit, getters}) => {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
// Get route
|
||||
let route = undefined
|
||||
|
||||
if (getters.sharedDetail && getters.sharedDetail.protected)
|
||||
route = '/api/navigation/private'
|
||||
else if (getters.sharedDetail && ! getters.sharedDetail.protected)
|
||||
route = '/api/navigation/public/' + router.currentRoute.params.token
|
||||
else
|
||||
route = '/api/navigation'
|
||||
|
||||
axios
|
||||
.get(route)
|
||||
.then(response => {
|
||||
resolve(response)
|
||||
|
||||
commit('UPDATE_FOLDER_TREE', response.data)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
|
||||
// Show error message
|
||||
events.$emit('alert:open', {
|
||||
title: i18n.t('popup_error.title'),
|
||||
message: i18n.t('popup_error.message'),
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
UPDATE_FOLDER_TREE(state, tree) {
|
||||
state.navigation = tree
|
||||
},
|
||||
LOADING_STATE(state, val) {
|
||||
state.isLoading = val
|
||||
},
|
||||
@@ -274,6 +312,7 @@ const getters = {
|
||||
currentFolder: state => state.currentFolder,
|
||||
browseHistory: state => state.browseHistory,
|
||||
isSearching: state => state.isSearching,
|
||||
navigation: state => state.navigation,
|
||||
isLoading: state => state.isLoading,
|
||||
data: state => state.data,
|
||||
}
|
||||
|
||||
+37
-9
@@ -1,11 +1,19 @@
|
||||
import axios from 'axios'
|
||||
import {events} from '@/bus'
|
||||
import i18n from '@/i18n/index'
|
||||
import router from '@/router'
|
||||
import {events} from '@/bus'
|
||||
import axios from 'axios'
|
||||
|
||||
|
||||
const actions = {
|
||||
moveItem: ({commit, getters}, [item_from, to_item]) => {
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && ! getters.sharedDetail.protected
|
||||
? '/api/move/' + item_from.unique_id + '/public/' + router.currentRoute.params.token
|
||||
: '/api/move/' + item_from.unique_id
|
||||
|
||||
axios
|
||||
.patch(getters.api + '/move-item/' + item_from.unique_id, {
|
||||
.patch(route, {
|
||||
from_type: item_from.type,
|
||||
to_unique_id: to_item.unique_id
|
||||
})
|
||||
@@ -16,11 +24,15 @@ const actions = {
|
||||
.catch(() => isSomethingWrong())
|
||||
},
|
||||
createFolder: ({commit, getters}, folderName) => {
|
||||
const parent_id = getters.currentFolder ? getters.currentFolder.unique_id : 0
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && ! getters.sharedDetail.protected
|
||||
? '/api/create-folder/public/' + router.currentRoute.params.token
|
||||
: '/api/create-folder'
|
||||
|
||||
axios
|
||||
.post(getters.api + '/create-folder', {
|
||||
parent_id: parent_id,
|
||||
.post(route, {
|
||||
parent_id: getters.currentFolder.unique_id,
|
||||
name: folderName
|
||||
})
|
||||
.then(response => {
|
||||
@@ -34,8 +46,13 @@ const actions = {
|
||||
if (getters.permission === 'master' && data.type === 'folder')
|
||||
commit('UPDATE_NAME_IN_FAVOURITES', data)
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && ! getters.sharedDetail.protected
|
||||
? '/api/rename-item/' + data.unique_id + '/public/' + router.currentRoute.params.token
|
||||
: '/api/rename-item/' + data.unique_id
|
||||
|
||||
axios
|
||||
.patch(getters.api + '/rename-item/' + data.unique_id, {
|
||||
.patch(route, {
|
||||
name: data.name,
|
||||
type: data.type,
|
||||
})
|
||||
@@ -46,8 +63,14 @@ const actions = {
|
||||
},
|
||||
uploadFiles: ({commit, getters}, files) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && ! getters.sharedDetail.protected
|
||||
? '/api/upload/public/' + router.currentRoute.params.token
|
||||
: '/api/upload'
|
||||
|
||||
axios
|
||||
.post(getters.api + '/upload-file', files, {
|
||||
.post(route, files, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
@@ -114,8 +137,13 @@ const actions = {
|
||||
// Remove file preview
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
// Get route
|
||||
let route = getters.sharedDetail && ! getters.sharedDetail.protected
|
||||
? '/api/remove-item/' + data.unique_id + '/public/' + router.currentRoute.params.token
|
||||
: '/api/remove-item/' + data.unique_id
|
||||
|
||||
axios
|
||||
.delete(getters.api + '/remove-item/' + data.unique_id, {
|
||||
.delete(route, {
|
||||
data: {
|
||||
type: data.type,
|
||||
force_delete: data.deleted_at ? true : false
|
||||
|
||||
-25
@@ -68,37 +68,12 @@ const actions = {
|
||||
})
|
||||
})
|
||||
},
|
||||
getFolderTree: (context) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(context.getters.api + '/folder-tree')
|
||||
.then(response => {
|
||||
resolve(response)
|
||||
|
||||
context.commit('UPDATE_FOLDER_TREE', response.data)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
|
||||
// Show error message
|
||||
events.$emit('alert:open', {
|
||||
title: i18n.t('popup_error.title'),
|
||||
message: i18n.t('popup_error.message'),
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
RETRIEVE_APP_DATA(state, app) {
|
||||
state.app = app
|
||||
},
|
||||
UPDATE_FOLDER_TREE(state, tree) {
|
||||
state.app.folders = tree
|
||||
},
|
||||
SET_PERMISSION(state, role) {
|
||||
state.permission = role
|
||||
},
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthContentWrapper from '@/components/VueFileManagerComponents/Auth/AuthContentWrapper'
|
||||
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import AuthContent from '@/components/VueFileManagerComponents/Auth/AuthContent'
|
||||
import AuthButton from '@/components/VueFileManagerComponents/Auth/AuthButton'
|
||||
import AuthContent from '@/components/Auth/AuthContent'
|
||||
import AuthButton from '@/components/Auth/AuthButton'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthContentWrapper from '@/components/VueFileManagerComponents/Auth/AuthContentWrapper'
|
||||
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import AuthContent from '@/components/VueFileManagerComponents/Auth/AuthContent'
|
||||
import AuthButton from '@/components/VueFileManagerComponents/Auth/AuthButton'
|
||||
import AuthContent from '@/components/Auth/AuthContent'
|
||||
import AuthButton from '@/components/Auth/AuthButton'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -60,10 +60,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthContentWrapper from '@/components/VueFileManagerComponents/Auth/AuthContentWrapper'
|
||||
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import AuthContent from '@/components/VueFileManagerComponents/Auth/AuthContent'
|
||||
import AuthButton from '@/components/VueFileManagerComponents/Auth/AuthButton'
|
||||
import AuthContent from '@/components/Auth/AuthContent'
|
||||
import AuthButton from '@/components/Auth/AuthButton'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthContentWrapper from '@/components/VueFileManagerComponents/Auth/AuthContentWrapper'
|
||||
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import AuthContent from '@/components/VueFileManagerComponents/Auth/AuthContent'
|
||||
import AuthButton from '@/components/VueFileManagerComponents/Auth/AuthButton'
|
||||
import AuthContent from '@/components/Auth/AuthContent'
|
||||
import AuthButton from '@/components/Auth/AuthButton'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DesktopToolbar from '@/components/VueFileManagerComponents/FilesView/DesktopToolbar'
|
||||
import FileBrowser from '@/components/VueFileManagerComponents/FilesView/FileBrowser'
|
||||
import ContextMenu from '@/components/VueFileManagerComponents/FilesView/ContextMenu'
|
||||
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
|
||||
import FileBrowser from '@/components/FilesView/FileBrowser'
|
||||
import ContextMenu from '@/components/FilesView/ContextMenu'
|
||||
import {ResizeSensor} from 'css-element-queries'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
|
||||
@@ -74,10 +74,10 @@
|
||||
|
||||
<script>
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import UserImageInput from '@/components/VueFileManagerComponents/Others/UserImageInput'
|
||||
import ButtonBase from '@/components/VueFileManagerComponents/FilesView/ButtonBase'
|
||||
import PageHeader from '@/components/VueFileManagerComponents/Others/PageHeader'
|
||||
import ThemeLabel from '@/components/VueFileManagerComponents/Others/ThemeLabel'
|
||||
import UserImageInput from '@/components/Others/UserImageInput'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import PageHeader from '@/components/Others/PageHeader'
|
||||
import ThemeLabel from '@/components/Others/ThemeLabel'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {debounce} from 'lodash'
|
||||
|
||||
@@ -44,6 +44,9 @@
|
||||
</div>
|
||||
<div v-if="sharedDetail.type === 'folder'" @contextmenu.prevent.capture="contextMenu($event, undefined)" @click="fileViewClick">
|
||||
|
||||
<!--Move item setup-->
|
||||
<MoveItem />
|
||||
|
||||
<!--Mobile Menu-->
|
||||
<MobileMenu/>
|
||||
|
||||
@@ -61,18 +64,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DesktopToolbar from '@/components/VueFileManagerComponents/FilesView/DesktopToolbar'
|
||||
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import FileItemGrid from '@/components/VueFileManagerComponents/FilesView/FileItemGrid'
|
||||
import FileBrowser from '@/components/VueFileManagerComponents/FilesView/FileBrowser'
|
||||
import ContextMenu from '@/components/VueFileManagerComponents/FilesView/ContextMenu'
|
||||
import ButtonBase from '@/components/VueFileManagerComponents/FilesView/ButtonBase'
|
||||
import MobileMenu from '@/components/VueFileManagerComponents/FilesView/MobileMenu'
|
||||
import AuthContent from '@/components/VueFileManagerComponents/Auth/AuthContent'
|
||||
import AuthButton from '@/components/VueFileManagerComponents/Auth/AuthButton'
|
||||
import Spinner from '@/components/VueFileManagerComponents/FilesView/Spinner'
|
||||
import Vignette from '@/components/VueFileManagerComponents/Others/Vignette'
|
||||
import Alert from '@/components/VueFileManagerComponents/FilesView/Alert'
|
||||
import FileItemGrid from '@/components/FilesView/FileItemGrid'
|
||||
import FileBrowser from '@/components/FilesView/FileBrowser'
|
||||
import ContextMenu from '@/components/FilesView/ContextMenu'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import MobileMenu from '@/components/FilesView/MobileMenu'
|
||||
import AuthContent from '@/components/Auth/AuthContent'
|
||||
import AuthButton from '@/components/Auth/AuthButton'
|
||||
import Spinner from '@/components/FilesView/Spinner'
|
||||
import MoveItem from '@/components/Others/MoveItem'
|
||||
import Vignette from '@/components/Others/Vignette'
|
||||
import Alert from '@/components/FilesView/Alert'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {ResizeSensor} from 'css-element-queries'
|
||||
import {mapGetters} from 'vuex'
|
||||
@@ -92,6 +96,7 @@
|
||||
AuthButton,
|
||||
MobileMenu,
|
||||
ButtonBase,
|
||||
MoveItem,
|
||||
required,
|
||||
Vignette,
|
||||
Spinner,
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
<template>
|
||||
<AuthContentWrapper ref="auth">
|
||||
|
||||
<!--Verify share link by password-->
|
||||
<AuthContent name="password" :visible="true">
|
||||
|
||||
</AuthContent>
|
||||
</AuthContentWrapper>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthContentWrapper from '@/components/VueFileManagerComponents/Auth/AuthContentWrapper'
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import AuthContent from '@/components/VueFileManagerComponents/Auth/AuthContent'
|
||||
import AuthButton from '@/components/VueFileManagerComponents/Auth/AuthButton'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
name: 'SharedContent',
|
||||
components: {
|
||||
AuthContentWrapper,
|
||||
ValidationProvider,
|
||||
ValidationObserver,
|
||||
AuthContent,
|
||||
AuthButton,
|
||||
required,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['config']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkedAccount: undefined,
|
||||
password: 'tvojpenis',
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async sharedProtected() {
|
||||
|
||||
// Validate fields
|
||||
const isValid = await this.$refs.sharedProtected.validate();
|
||||
|
||||
if (!isValid) return;
|
||||
|
||||
// Start loading
|
||||
this.isLoading = true
|
||||
|
||||
// Send request to get verify account
|
||||
axios
|
||||
.post('/api/shared/authenticate/' + this.$route.params.token, {
|
||||
password: this.password
|
||||
})
|
||||
.then(response => {
|
||||
|
||||
// End loading
|
||||
this.isLoading = false
|
||||
|
||||
// Commit shared item options
|
||||
this.$store.commit('SET_PERMISSION', response.data.permission)
|
||||
|
||||
// Redirect to file browser page
|
||||
this.$router.push({name: 'SharedContent', params: {token: this.$route.params.token}})
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
if (error.response.status == 401) {
|
||||
|
||||
this.$refs.sharedProtected.setErrors({
|
||||
'Password': [error.response.data.message]
|
||||
});
|
||||
}
|
||||
|
||||
// End loading
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "@assets/app.scss";
|
||||
@import '@assets/vue-file-manager/_forms';
|
||||
@import '@assets/vue-file-manager/_auth';
|
||||
</style>
|
||||
Reference in New Issue
Block a user