bulk-operations merge with the improvements branch

This commit is contained in:
Milos Holba
2020-11-22 16:39:58 +01:00
26 changed files with 567 additions and 211 deletions

View File

@@ -205,21 +205,4 @@ class BrowseController extends Controller
// Collect folders and files to single array
return collect([$searched_folders, $searched_files])->collapse();
}
/**
* Get file record
*
* @param $unique_id
* @return mixed
*/
public function file_detail($unique_id)
{
// Get user id
$user_id = Auth::id();
return FileManagerFile::with(['shared:token,id,item_id,permission,protected,expire_in'])
->where('user_id', $user_id)
->where('unique_id', $unique_id)
->firstOrFail();
}
}

View File

@@ -3,7 +3,7 @@
"/css/app.css": "/css/app.css",
"/chunks/admin.js": "/chunks/admin.js?id=ed4125d0b85c16ac0a46",
"/chunks/admin-account.js": "/chunks/admin-account.js?id=9a87235c637bee9478da",
"/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js?id=10f4f9a88eaec9accb46",
"/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js?id=9ab2c60930e2adf92716",
"/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~3b77a26e.js": "/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~3b77a26e.js?id=1d8e3709b30ab1351939",
"/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/trash.js": "/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/trash.js?id=e39b0d32b4e27b4ddb2e",
"/chunks/app-appearance.js": "/chunks/app-appearance.js?id=2fcf9b6a8bcdcf0bf877",
@@ -22,12 +22,12 @@
"/chunks/contact-us.js": "/chunks/contact-us.js?id=f13ecb6e4405aa7e06d2",
"/chunks/contact-us~chunks/dynamic-page~chunks/landing-page.js": "/chunks/contact-us~chunks/dynamic-page~chunks/landing-page.js?id=8b11e9c64262b9275963",
"/chunks/create-new-password.js": "/chunks/create-new-password.js?id=abb47a424c09ace77d79",
"/chunks/dashboard.js": "/chunks/dashboard.js?id=050d76471e69594623a4",
"/chunks/dashboard.js": "/chunks/dashboard.js?id=74ec544ef21261233eb0",
"/chunks/dashboard~chunks/invoices~chunks/pages~chunks/plan-subscribers~chunks/plans~chunks/settings-i~0e2a0654.js": "/chunks/dashboard~chunks/invoices~chunks/pages~chunks/plan-subscribers~chunks/plans~chunks/settings-i~0e2a0654.js?id=ffd2f414666d7cc80b9d",
"/chunks/database.js": "/chunks/database.js?id=416a5164bdc53c97ea34",
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=464c8e70974d492ce7f6",
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=405847df44edd86e301a",
"/chunks/files.js": "/chunks/files.js?id=3808afc1c391c6aab947",
"/chunks/files.js": "/chunks/files.js?id=d5f7435cf2e921375ec0",
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/trash~chunks~3ea7670b.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/trash~chunks~3ea7670b.js?id=6cafd70cb9e5ae25f02a",
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js?id=1c9fd882721a3b0b62b9",
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=aba8c662fbc234892216",
@@ -55,7 +55,7 @@
"/chunks/settings-subscription.js": "/chunks/settings-subscription.js?id=367c9478591c7a4a2889",
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=7da589bd335deefd5f65",
"/chunks/shared-files.js": "/chunks/shared-files.js?id=50538c88a0471fe4db6f",
"/chunks/shared-page.js": "/chunks/shared-page.js?id=b992c7383bae4e317123",
"/chunks/shared-page.js": "/chunks/shared-page.js?id=4c1b302d65112aad96ea",
"/chunks/sign-in.js": "/chunks/sign-in.js?id=703fbd23d18816590337",
"/chunks/sign-up.js": "/chunks/sign-up.js?id=cedca52c29abfb3c58f1",
"/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=9dec4c59d5a32fb9b855",
@@ -160,5 +160,25 @@
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.838cfa19f37ed77438bd.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.838cfa19f37ed77438bd.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.a19bf8945f5729ba41cd.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.a19bf8945f5729ba41cd.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c874eeae279d9393a6f9.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.c874eeae279d9393a6f9.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.bb4044a52aae2297613f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.bb4044a52aae2297613f.hot-update.js"
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.bb4044a52aae2297613f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.bb4044a52aae2297613f.hot-update.js",
"/js/main.7737ad32e9238fa9b436.hot-update.js": "/js/main.7737ad32e9238fa9b436.hot-update.js",
"/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.7737ad32e9238fa9b436.hot-update.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.7737ad32e9238fa9b436.hot-update.js",
"/chunks/admin~chunks/files~chunks/settings~chunks/shared-files.js": "/chunks/admin~chunks/files~chunks/settings~chunks/shared-files.js?id=e01ffe50980acf2fe988",
"/chunks/dashboard.7737ad32e9238fa9b436.hot-update.js": "/chunks/dashboard.7737ad32e9238fa9b436.hot-update.js",
"/chunks/files.7737ad32e9238fa9b436.hot-update.js": "/chunks/files.7737ad32e9238fa9b436.hot-update.js",
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/user-subscription.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/user-subscription.js?id=64003a84d315f418a4d6",
"/chunks/files~chunks/shared-files.js": "/chunks/files~chunks/shared-files.js?id=9c7084d3f09ff58b2b45",
"/chunks/shared-files.7737ad32e9238fa9b436.hot-update.js": "/chunks/shared-files.7737ad32e9238fa9b436.hot-update.js",
"/chunks/shared-page.7737ad32e9238fa9b436.hot-update.js": "/chunks/shared-page.7737ad32e9238fa9b436.hot-update.js",
"/js/main.568beb7ae49b81d4fd2d.hot-update.js": "/js/main.568beb7ae49b81d4fd2d.hot-update.js",
"/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/shared-page.js": "/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/shared-page.js?id=54a833ec02385944db39",
"/chunks/files.568beb7ae49b81d4fd2d.hot-update.js": "/chunks/files.568beb7ae49b81d4fd2d.hot-update.js",
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js?id=8ccd35de575e8a91d02f",
"/chunks/files~chunks/shared-files~chunks/shared-page.js": "/chunks/files~chunks/shared-files~chunks/shared-page.js?id=d19baa0f176dfb93551b",
"/chunks/files~chunks/shared-page.js": "/chunks/files~chunks/shared-page.js?id=b013006caf6a7063b0b8",
"/chunks/shared-page.568beb7ae49b81d4fd2d.hot-update.js": "/chunks/shared-page.568beb7ae49b81d4fd2d.hot-update.js",
"/chunks/shared-page.9c73a06ce112ec901d14.hot-update.js": "/chunks/shared-page.9c73a06ce112ec901d14.hot-update.js",
"/js/main.95e784437847e5132bd4.hot-update.js": "/js/main.95e784437847e5132bd4.hot-update.js",
"/js/main.33c8cbc29b68d441ea2f.hot-update.js": "/js/main.33c8cbc29b68d441ea2f.hot-update.js",
"/chunks/files~chunks/shared-files~chunks/shared-page.a980a51882d1e44dac7f.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.a980a51882d1e44dac7f.hot-update.js"
}

View File

@@ -19,6 +19,9 @@
<ShareCreate/>
<ShareEdit/>
<!--Rename folder or file item-->
<RenameItem/>
<!--Move item setup-->
<MoveItem/>
@@ -58,6 +61,7 @@
import MobileMenu from '@/components/FilesView/MobileMenu'
import ShareCreate from '@/components/Others/ShareCreate'
import Confirm from '@/components/Others/Popup/Confirm'
import RenameItem from '@/components/Others/RenameItem'
import ShareEdit from '@/components/Others/ShareEdit'
import MoveItem from '@/components/Others/MoveItem'
import Vignette from '@/components/Others/Vignette'
@@ -76,6 +80,7 @@
FileFullPreview,
ToastrWrapper,
ShareCreate,
RenameItem,
MobileMenu,
ShareEdit,
MoveItem,

View File

@@ -96,7 +96,7 @@
<!--ContextMenu for Base location with MASTER permission-->
<div v-if="$isThisLocation(['shared']) && $checkPermission('master') && !showFromPreview" id="menu-list" class="menu-options">
<ul class="menu-option-group" v-if="item && isFolder && multiSelectContextMenu">
<ul class="menu-option-group" v-if="item && isFolder && multiSelectContextMenu">
<li class="menu-option" @click="addToFavourites">
<div class="icon">
<star-icon size="17"></star-icon>
@@ -111,6 +111,14 @@
</li>
</ul>
<ul class="menu-option-group" v-if="item">
<li class="menu-option" @click="renameItem">
<div class="icon">
<edit2-icon size="17"></edit2-icon>
</div>
<div class="text-label">
{{ $t('context_menu.rename') }}
</div>
</li>
<li class="menu-option" @click="shareItem" v-if="multiSelectContextMenu">
<div class="icon">
<link-icon size="17"></link-icon>
@@ -180,6 +188,14 @@
</li>
</ul>
<ul class="menu-option-group" v-if="item">
<li class="menu-option" @click="renameItem">
<div class="icon">
<edit2-icon size="17"></edit2-icon>
</div>
<div class="text-label">
{{ $t('context_menu.rename') }}
</div>
</li>
<li class="menu-option" @click="moveItem">
<div class="icon">
<corner-down-right-icon size="17"></corner-down-right-icon>
@@ -242,6 +258,14 @@
</li>
</ul>
<ul class="menu-option-group" v-if="item">
<li class="menu-option" @click="renameItem">
<div class="icon">
<edit2-icon size="17"></edit2-icon>
</div>
<div class="text-label">
{{ $t('context_menu.rename') }}
</div>
</li>
<li class="menu-option" @click="moveItem">
<div class="icon">
<corner-down-right-icon size="17"></corner-down-right-icon>
@@ -381,33 +405,17 @@ export default {
methods: {
renameItem() {
let itemName = prompt(this.$t('popup_rename.title'), this.item.name)
if (itemName && itemName !== '') {
let item = {
unique_id: this.item.unique_id,
type: this.item.type,
name: itemName
}
this.$store.dispatch('renameItem', item)
// Change item name if is mobile device or prompted
if (this.$isMobile()) {
events.$emit('change:name', item)
}
}
events.$emit('popup:open', { name: 'rename-item', item: this.item })
},
moveItem() {
// Open move item popup
events.$emit('popup:open', { name: 'move', item: [this.item] })
},
shareItem() {
if (this.item.shared) {
// Open share item popup
// Open edit share popup
events.$emit('popup:open', { name: 'share-edit', item: this.item })
} else {
// Open share item popup
// Open create share popup
events.$emit('popup:open', { name: 'share-create', item: this.item })
}
},

View File

@@ -3,7 +3,7 @@
<div class="name-wrapper">
<x-icon @click="closeFullPreview" size="22" class="icon-close"></x-icon>
<div class="name-count-wrapper">
<p class="title">{{ fileInfoDetail[0].name }}</p>
<p class="title">{{ fileInfoDetail[0].name }}</p>
<span class="file-count"> ({{ showingImageIndex + ' ' + $t('pronouns.of') + ' ' + filteredFiles.length }}) </span>
</div>
<span id="fast-preview-menu" class="fast-menu-icon" @click="menuOpen" v-if="$checkPermission(['master', 'editor'])">
@@ -17,7 +17,7 @@
<div class="navigation-icons">
<div class="navigation-tool-wrapper">
<ToolbarButton source="download" class="mobile-hide" @click.native="downloadItem" :action="$t('actions.download')" />
<ToolbarButton source="share" class="mobile-hide" :class="{ 'is-inactive': canShareInView }" :action="$t('actions.share')" @click.native="shareItem" />
<ToolbarButton v-if="canShowShareView" :class="{ 'is-inactive': canShareInView }" @click.native="shareItem" source="share" class="mobile-hide" :action="$t('actions.share')" />
<ToolbarButton v-if="this.fileInfoDetail[0].type === 'image'" source="print" :action="$t('actions.print')" @click.native="printMethod()" />
</div>
</div>
@@ -54,8 +54,11 @@ export default {
})
return activeIndex
},
canShowShareView() {
return this.$isThisLocation(['base', 'participant_uploads', 'latest', 'shared'])
},
canShareInView() {
return !this.$isThisLocation(['base', 'participant_uploads', 'latest', 'shared', 'public'])
return ! this.$isThisLocation(['base', 'participant_uploads', 'latest', 'shared'])
}
},
data() {

View File

@@ -395,25 +395,7 @@ export default {
this.$store.dispatch("deleteItem");
},
renameItem() {
let itemName = prompt(
this.$t("popup_rename.title"),
this.fileInfoDetail[0].name
);
if (itemName && itemName !== "") {
let item = {
unique_id: this.fileInfoDetail[0].unique_id,
type: this.fileInfoDetail[0].type,
name: itemName,
};
this.$store.dispatch("renameItem", item);
// Change item name if is mobile device or prompted
if (this.$isMobile()) {
events.$emit("change:name", item);
}
}
events.$emit('popup:open', { name: 'rename-item', item: this.fileInfoDetail[0] })
},
closeAndResetContextMenu() {
//If emit to show menu coming from MediaFullPreview dont reset data

View File

@@ -13,21 +13,28 @@
{{ $t('uploading.progress', {current:uploadingFilesCount.current, total: uploadingFilesCount.total, progress: uploadingFileProgress}) }}
</span>
</div>
<ProgressBar :progress="uploadingFileProgress" />
<div class="progress-wrapper">
<ProgressBar :progress="uploadingFileProgress" />
<span @click="cancelUpload" :title="$t('uploading.cancel')" class="cancel-icon">
<x-icon size="16" @click="cancelUpload"></x-icon>
</span>
</div>
</div>
</transition>
</template>
<script>
import ProgressBar from '@/components/FilesView/ProgressBar'
import { RefreshCwIcon } from 'vue-feather-icons'
import { RefreshCwIcon, XIcon } from 'vue-feather-icons'
import {mapGetters} from 'vuex'
import {events} from '@/bus'
export default {
name: 'UploadProgress',
components: {
RefreshCwIcon,
ProgressBar,
XIcon,
},
computed: {
...mapGetters([
@@ -35,6 +42,11 @@
'uploadingFilesCount',
'isProcessingFile',
])
},
methods: {
cancelUpload() {
events.$emit('cancel-upload')
}
}
}
</script>
@@ -78,6 +90,22 @@
position: relative;
z-index: 1;
.progress-wrapper {
display: flex;
.cancel-icon {
cursor: pointer;
padding: 0 13px;
&:hover {
line {
stroke: $theme;
}
}
}
}
.progress-title {
font-weight: 700;
text-align: center;
@@ -88,6 +116,16 @@
}
}
@media only screen and (max-width: 690px) {
.upload-progress {
.progress-wrapper .cancel-icon {
padding: 0 9px;
}
}
}
@media (prefers-color-scheme: dark) {
.progress-bar {
background: $dark_mode_foreground;

View File

@@ -1,5 +1,9 @@
<template>
<div class="dropzone" :class="{ 'is-error': error }">
<div v-if="imagePreview" @click="resetImage" class="reset-image">
<x-icon size="14" class="close-icon"></x-icon>
</div>
<input
ref="file"
type="file"
@@ -26,7 +30,7 @@
</template>
<script>
import ImageIcon from "vue-feather-icons/icons/ImageIcon";
import { XIcon, ImageIcon } from 'vue-feather-icons'
export default {
name: 'ImageInput',
@@ -35,6 +39,7 @@
],
components: {
ImageIcon,
XIcon,
},
data() {
return {
@@ -47,6 +52,10 @@
},
},
methods: {
resetImage() {
this.imagePreview = undefined
this.$emit('input', undefined)
},
showImagePreview(event) {
const imgPath = event.target.files[0].name,
extn = imgPath
@@ -152,6 +161,30 @@
@include font-size(12);
}
}
.reset-image {
z-index: 2;
background: white;
border-radius: 50px;
display: block;
position: absolute;
right: 0;
top: 0;
cursor: pointer;
@include transform(translateY(-50%) translateX(50%));
padding: 0px 4px;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
.close-icon {
vertical-align: middle;
line {
path {
fill: $text;
}
}
}
}
}
@media (prefers-color-scheme: dark) {

View File

@@ -3,6 +3,7 @@
<div class="icon">
<corner-down-right-icon v-if="icon === 'move'" size="15" class="title-icon"></corner-down-right-icon>
<link-icon v-if="icon === 'share'" size="17" class="title-icon"></link-icon>
<edit2-icon v-if="icon === 'edit'" size="17" class="title-icon"></edit2-icon>
</div>
<div class="label">
<h1 class="title">{{ title }}</h1>
@@ -12,7 +13,7 @@
</template>
<script>
import {CornerDownRightIcon, LinkIcon, XIcon} from 'vue-feather-icons'
import {CornerDownRightIcon, LinkIcon, XIcon, Edit2Icon} from 'vue-feather-icons'
import {events} from '@/bus'
export default {
@@ -22,6 +23,7 @@
],
components: {
CornerDownRightIcon,
Edit2Icon,
LinkIcon,
XIcon,
},

View File

@@ -0,0 +1,129 @@
<template>
<PopupWrapper name="rename-item">
<!--Title-->
<PopupHeader :title="$t('popup_rename.title', {item: itemTypeTitle})" icon="edit" />
<!--Content-->
<PopupContent>
<!--Item Thumbnail-->
<ThumbnailItem class="item-thumbnail" :item="pickedItem" info="metadata"/>
<!--Form to set sharing-->
<ValidationObserver @submit.prevent="changeName" ref="renameForm" v-slot="{ invalid }" tag="form" class="form-wrapper">
<!--Set password-->
<ValidationProvider tag="div" mode="passive" class="input-wrapper password" name="Password" rules="required" v-slot="{ errors }">
<label class="input-label">{{ $t('popup_rename.label') }}:</label>
<input v-model="pickedItem.name" :class="{'is-error': errors[0]}" type="text" :placeholder="$t('popup_rename.placeholder')">
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</ValidationObserver>
</PopupContent>
<!--Actions-->
<PopupActions>
<ButtonBase
class="popup-button"
@click.native="$closePopup()"
button-style="secondary"
>{{ $t('popup_move_item.cancel') }}
</ButtonBase>
<ButtonBase
class="popup-button"
@click.native="changeName"
button-style="theme"
>{{ $t('popup_share_edit.save') }}
</ButtonBase>
</PopupActions>
</PopupWrapper>
</template>
<script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
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 ActionButton from '@/components/Others/ActionButton'
import ButtonBase from '@/components/FilesView/ButtonBase'
import {required} from 'vee-validate/dist/rules'
import {events} from '@/bus'
import axios from 'axios'
export default {
name: 'RenameItem',
components: {
ValidationProvider,
ValidationObserver,
ThumbnailItem,
ActionButton,
PopupWrapper,
PopupActions,
PopupContent,
PopupHeader,
ButtonBase,
required,
},
computed: {
itemTypeTitle() {
return this.pickedItem && this.pickedItem.type === 'folder' ? this.$t('types.folder') : this.$t('types.file')
},
},
data() {
return {
pickedItem: undefined,
}
},
methods: {
changeName() {
if (this.pickedItem.name && this.pickedItem.name !== '') {
let item = {
unique_id: this.pickedItem.unique_id,
type: this.pickedItem.type,
name: this.pickedItem.name
}
// Rename item request
this.$store.dispatch('renameItem', item)
// Rename item in view
events.$emit('change:name', item)
this.$closePopup()
}
},
},
mounted() {
// Show popup
events.$on('popup:open', args => {
if (args.name !== 'rename-item') return
// Store picked item
this.pickedItem = args.item
})
// Close popup
events.$on('popup:close', () => {
// Restore data
setTimeout(() => {
//
}, 150)
})
}
}
</script>
<style scoped lang="scss">
@import "@assets/vue-file-manager/_inapp-forms.scss";
@import '@assets/vue-file-manager/_forms';
.item-thumbnail {
margin-bottom: 20px;
}
</style>

View File

@@ -1,25 +1,109 @@
<template>
<div class="content-group">
<TextLabel>{{ title }}</TextLabel>
<slot></slot>
<div class="content-group" :class="{'is-collapsed': ! isVisible, 'collapsable': canCollapse}">
<div class="group-title" @click="hideGroup">
<TextLabel class="title">{{ title }}</TextLabel>
<chevron-up-icon v-if="canCollapseWrapper" size="12" class="icon" />
</div>
<transition name="list">
<div class="wrapper" v-show="isVisible">
<slot></slot>
</div>
</transition>
</div>
</template>
<script>
import TextLabel from '@/components/Others/TextLabel'
import { ChevronUpIcon } from 'vue-feather-icons'
export default {
name: 'ContentGroup',
props: ['title'],
props: ['title', 'canCollapse', 'slug'],
components: {
ChevronUpIcon,
TextLabel,
},
data() {
return {
isVisible: true,
canCollapseWrapper: false
}
},
methods: {
hideGroup() {
if (! this.canCollapseWrapper)
return
this.isVisible = !this.isVisible
localStorage.setItem('panel-group-' + this.slug, this.isVisible)
}
},
created() {
if (this.canCollapse) {
let savedVisibility = localStorage.getItem('panel-group-' + this.slug)
this.isVisible = savedVisibility ? !!JSON.parse(String(savedVisibility).toLowerCase()) : true
this.canCollapseWrapper = true
}
}
}
</script>
<style scoped lang="scss">
@import '@assets/vue-file-manager/_mixins';
.content-group {
margin-bottom: 30px;
transition: all 300ms;
.group-title {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 5px;
.title {
margin-bottom: 0;
}
.icon {
margin-right: 19px;
opacity: 0.25;
@include transition;
}
}
&.collapsable {
.group-title {
cursor: pointer;
}
}
&.is-collapsed {
margin-bottom: 15px;
.icon {
@include transform(rotate(180deg));
}
}
}
.list-enter,
.list-leave-to {
visibility: hidden;
height: 0;
margin: 0;
padding: 0;
opacity: 0;
}
.list-enter-active,
.list-leave-active {
transition: all 300ms;
}
</style>

View File

@@ -20,19 +20,13 @@
</div>
</router-link>
<router-link :to="{name: 'Trash'}" :title="$t('locations.trash')" class="icon-navigation-item trash">
<div class="button-icon">
<trash-2-icon size="19"></trash-2-icon>
</div>
</router-link>
<router-link :to="{name: 'Profile'}" :class="{'is-active': isUserProfileRoute}" class="icon-navigation-item settings">
<router-link :to="{name: 'Profile'}" :class="{'is-active': isUserProfileRoute}" :title="$t('locations.profile')" class="icon-navigation-item settings">
<div class="button-icon">
<user-icon size="19"></user-icon>
</div>
</router-link>
<router-link v-if="user.data.attributes.role === 'admin'" :to="{name: 'Dashboard'}" :class="{'is-active': $isThisRoute($route, adminRoutes)}" class="icon-navigation-item users">
<router-link v-if="user.data.attributes.role === 'admin'" :to="{name: 'Dashboard'}" :class="{'is-active': $isThisRoute($route, adminRoutes)}" :title="$t('locations.settings')" class="icon-navigation-item users">
<div class="button-icon">
<settings-icon size="19"></settings-icon>
</div>
@@ -41,7 +35,7 @@
<!--User avatar & Logout-->
<ul class="icon-navigation logout">
<li @click="$store.dispatch('logOut')" class="icon-navigation-item">
<li @click="$store.dispatch('logOut')" :title="$t('locations.logout')" class="icon-navigation-item">
<div class="button-icon">
<power-icon size="19"></power-icon>
</div>

View File

@@ -357,7 +357,10 @@
"locations": {
"home": "首页",
"shared": "已分享",
"trash": "垃圾箱"
"trash": "垃圾箱",
"profile": "Profile",
"settings": "Settings",
"logout": "Log Out"
},
"menu": {
"admin": "Admin",
@@ -548,7 +551,9 @@
"title": "File is too large"
},
"popup_rename": {
"title": "修改文件/夹名称"
"title": "Rename Your {item}",
"label": "Edit Name",
"placeholder": "Type your title"
},
"popup_set_card": {
"message": "您的卡将被设置为默认卡,并且在以后的结算中始终会收取费用。",
@@ -578,10 +583,6 @@
"message": "您的订阅已重新激活,并且将按原始计费周期计费。",
"title": "订阅已取消"
},
"popup_trashed": {
"message": "现在,您的垃圾箱已经被完全清空。",
"title": "您的垃圾箱已清空!"
},
"preview_type": {
"grid": "方块",
"list": "列表"
@@ -717,6 +718,7 @@
"href": "Please confirm your payment."
},
"uploading": {
"cancel": "Cancel Uploading",
"processing_file": "Processing File...",
"progress_single_upload": "上传文件 {progress}%",
"progress": "上传文件 {progress}% - {current}/{total}"

View File

@@ -359,7 +359,10 @@
"locations": {
"home": "Home",
"shared": "Shared",
"trash": "Trash"
"trash": "Trash",
"profile": "Profile",
"settings": "Settings",
"logout": "Log Out"
},
"menu": {
"admin": "Administration",
@@ -550,7 +553,9 @@
"title": "File is too large"
},
"popup_rename": {
"title": "Change your item name"
"title": "Rename Your {item}",
"label": "Edit Name",
"placeholder": "Type your title"
},
"popup_set_card": {
"message": "Your card will be set as default and will be always charged for the next billings.",
@@ -580,10 +585,6 @@
"message": "Your subscription was re-activated, and they will be billed on the original billing cycle.",
"title": "Subscription Was Resumed"
},
"popup_trashed": {
"message": "So now, you have clear and empty trash.",
"title": "Your trash was erased!"
},
"preview_type": {
"grid": "Grid",
"list": "List"
@@ -719,6 +720,7 @@
"href": "Please confirm your payment."
},
"uploading": {
"cancel": "Cancel Uploading",
"processing_file": "Processing File...",
"progress_single_upload": "Uploading File {progress}%",
"progress": "Uploading File {progress}% - {current}/{total}"

View File

@@ -359,7 +359,10 @@
"locations": {
"home": "Domov",
"shared": "Zdieľané",
"trash": "Kôš"
"trash": "Kôš",
"profile": "Profil",
"settings": "Nastavenia",
"logout": "Odhlásiť sa"
},
"menu": {
"admin": "Administrácia",
@@ -550,7 +553,9 @@
"title": "Súbor je príliš veľký"
},
"popup_rename": {
"title": "Zmeňte názov položky"
"title": "Zmeňte názov {item}",
"label": "Zmeniť názov",
"placeholder": "Napíš názov..."
},
"popup_set_card": {
"message": "Vaša karta bude nastavená ako predvolená a bude vám z nej vždy stiahnutá čiastka za nasledujúce obdobie fakturácie.",
@@ -580,10 +585,6 @@
"message": "Váš odber bol znova aktivovaný a budú vám účtované poplatky podľa pôvodného fakturačného cyklu.",
"title": "Predplatné bolo obnovené"
},
"popup_trashed": {
"message": "Od teraz máte prázdny a čistý kôš",
"title": "Váš kôš bol vymazaný!"
},
"preview_type": {
"grid": "Mriežka",
"list": "List"
@@ -719,6 +720,7 @@
"href": "Prosím potvrďte Vašu platbu."
},
"uploading": {
"cancel": "Zrušiť nahrávanie",
"processing_file": "Spracuvávam súbor...",
"progress_single_upload": "Nahrávam súbor {progress}%",
"progress": "Nahrávam súbory {progress}% - {current}/{total}"

View File

@@ -382,15 +382,6 @@ const routesUser = [
requiresAuth: true
},
},
{
name: 'Trash',
path: '/trash',
component: () =>
import(/* webpackChunkName: "chunks/trash" */ './views/FilePages/Trash'),
meta: {
requiresAuth: true
},
},
{
name: 'Settings',
path: '/settings',

View File

@@ -172,14 +172,6 @@ const actions = {
})
.catch(() => isSomethingWrong())
},
getFileDetail: ({commit, getters}, file) => {
axios
.get(getters.api + '/file-detail/' + file.unique_id)
.then(response => {
commit('LOAD_FILEINFO_DETAIL', response.data)
})
.catch(() => isSomethingWrong())
},
getFolderTree: ({commit, getters}) => {
return new Promise((resolve, reject) => {

View File

@@ -68,9 +68,11 @@ const actions = {
events.$emit('scrollTop')
if ( getters.currentFolder.location !== 'public' ) {
if ( getters.currentFolder.location !== 'public' )
dispatch('getAppData')
}
if ( getters.currentFolder.location === 'public')
dispatch('getFolderTree')
})
.catch(() => isSomethingWrong())
},
@@ -96,6 +98,8 @@ const actions = {
if (data.type === 'folder' && getters.currentFolder.location !== 'public')
dispatch('getAppData')
if (data.type === 'folder' && getters.currentFolder.location === 'public')
dispatch('getFolderTree')
})
.catch(() => isSomethingWrong())
},
@@ -107,8 +111,13 @@ const actions = {
? '/api/upload/public/' + router.currentRoute.params.token
: '/api/upload'
// Create cancel token for axios cancelation
const CancelToken = axios.CancelToken;
const source = CancelToken.source();
axios
.post(route, form, {
cancelToken: source.token,
headers: {
'Content-Type': 'application/octet-stream'
},
@@ -170,6 +179,15 @@ const actions = {
// Reset uploader
commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
})
// Cancel the upload request
events.$on('cancel-upload', () => {
source.cancel();
// Hide upload progress bar
commit('PROCESSING_FILE', false)
commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
})
})
},
restoreItem: ({commit, getters}, item) => {
@@ -262,12 +280,15 @@ const actions = {
dispatch('getFolder', [{folder: last(getters.browseHistory), back: true, init: false}])
}
}
}
})
if ( getters.currentFolder.location !== 'public' )
dispatch('getAppData')
dispatch('getAppData')
if ( getters.currentFolder.location === 'public')
dispatch('getFolderTree')
})
.catch(() => isSomethingWrong())
},
@@ -286,12 +307,6 @@ const actions = {
// Remove file preview
commit('CLEAR_FILEINFO_DETAIL')
// Show success message
events.$emit('success:open', {
title: i18n.t('popup_trashed.title'),
message: i18n.t('popup_trashed.message'),
})
})
.catch(() => isSomethingWrong())
},

View File

@@ -160,7 +160,7 @@
}
&.widgets-coll-3 {
grid-template-columns: repeat(auto-fill, 33%);
grid-template-columns: repeat(auto-fill, 33.3%);
}
.widget {

View File

@@ -3,6 +3,7 @@
<ContentSidebar>
<!--Empty storage warning-->
<ContentGroup v-if="config.storageLimit && storage.used > 95">
<UpgradeSidebarBanner />
</ContentGroup>
@@ -27,11 +28,20 @@
{{ $t('sidebar.latest') }}
</div>
</a>
<a class="menu-list-item link trash" :class="{'is-active-trash': $isThisLocation(['trash', 'trash-root'])}"
@click="getTrash">
<div class="icon">
<trash2-icon size="17"></trash2-icon>
</div>
<div class="label">
{{ $t('locations.trash') }}
</div>
</a>
</div>
</ContentGroup>
<!--Navigator-->
<ContentGroup :title="$t('sidebar.navigator_title')" class="navigator">
<ContentGroup :title="$t('sidebar.navigator_title')" slug="navigator" :can-collapse="true" class="navigator">
<span class="empty-note navigator" v-if="tree.length == 0">
{{ $t('sidebar.folders_empty') }}
</span>
@@ -40,7 +50,7 @@
</ContentGroup>
<!--Favourites-->
<ContentGroup :title="$t('sidebar.favourites')">
<ContentGroup :title="$t('sidebar.favourites')" slug="favourites" :can-collapse="true">
<div class="menu-list-wrapper vertical favourites"
:class="{ 'is-dragenter': area }"
@@ -84,6 +94,7 @@
import {
UploadCloudIcon,
FolderIcon,
Trash2Icon,
HomeIcon,
XIcon,
} from 'vue-feather-icons'
@@ -98,6 +109,7 @@
UploadCloudIcon,
ContentGroup,
FolderIcon,
Trash2Icon,
HomeIcon,
XIcon,
},
@@ -120,6 +132,9 @@
}
},
methods: {
getTrash() {
this.$store.dispatch('getTrash')
},
getLatest() {
this.$store.dispatch('getLatest')
},
@@ -173,7 +188,21 @@
// Listen for dragstart folder items
events.$on('dragstart', (item) => this.draggedItem = item)
}
},
beforeRouteLeave(to, from, next) {
// Inquire user about his willing to step back to sign in page
if (to.name === 'SignIn') {
const answer = window.confirm('Do you really want to leave?')
if (answer) {
next()
} else {
next(false)
}
} else {
next()
}
},
}
</script>

View File

@@ -1,51 +0,0 @@
<template>
<section id="viewport">
<ContentSidebar>
<!--Tools-->
<ContentGroup :title="$t('sidebar.tools_title')" class="navigator">
<div class="menu-list-wrapper vertical">
<div class="menu-list-item link" @click="emptyTrash()">
<div class="icon">
<trash-icon size="17"></trash-icon>
</div>
<div class="label">
{{ $t('context_menu.empty_trash') }}
</div>
</div>
</div>
</ContentGroup>
</ContentSidebar>
<ContentFileView/>
</section>
</template>
<script>
import ContentFileView from '@/components/Others/ContentFileView'
import ContentSidebar from '@/components/Sidebar/ContentSidebar'
import ContentGroup from '@/components/Sidebar/ContentGroup'
import {
TrashIcon,
} from 'vue-feather-icons'
export default {
name: 'FilesView',
components: {
ContentFileView,
ContentSidebar,
ContentGroup,
TrashIcon,
},
methods: {
emptyTrash() {
this.$store.dispatch('emptyTrash')
},
},
created() {
this.$store.dispatch('getTrash')
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -9,9 +9,13 @@
<!--Move item setup-->
<MoveItem />
<!-- Mobile Menu for Multiselected items -->
<MobileMultiSelectMenu/>
<!--Rename folder or file item-->
<RenameItem/>
<!--Mobile Menu-->
<MobileMenu/>
@@ -22,7 +26,7 @@
<Vignette/>
<!--Password verification-->
<div v-if="currentPage === 'page-password'" id="password-view">
<div v-if="isPagePasswordVerification" id="password-view">
<!--Verify share link by password-->
<AuthContent class="center" name="password" :visible="true">
@@ -44,43 +48,77 @@
</AuthContent>
</div>
<!--File browser-->
<div v-if="currentPage === 'page-files'" id="files-view">
<div id="single-file" v-if="sharedDetail.type === 'file'">
<div class="single-file-wrapper">
<FileItemGrid v-if="sharedFile" :data="sharedFile" :context-menu="false"/>
<!--Single file page-->
<div v-if="sharedDetail.type === 'file' && isPageFiles" id="single-file">
<div class="single-file-wrapper">
<FileItemGrid v-if="sharedFile" :data="sharedFile" :context-menu="false"/>
<ButtonBase @click.native="download" class="download-button" button-style="theme">
{{ $t('page_shared.download_file') }}
</ButtonBase>
</div>
</div>
<div v-if="sharedDetail.type === 'folder'" @contextmenu.prevent.capture="contextMenu($event, undefined)" @click="fileViewClick">
<!--Context menu-->
<ContextMenu/>
<!--Desktop Toolbar-->
<DesktopToolbar/>
<!--File browser-->
<FileBrowser/>
<ButtonBase @click.native="download" class="download-button" button-style="theme">
{{ $t('page_shared.download_file') }}
</ButtonBase>
</div>
</div>
<!--Multiple items view page-->
<div v-if="sharedDetail.type === 'folder' && isPageFiles"
@contextmenu.prevent.capture="contextMenu($event, undefined)"
@click="fileViewClick"
id="viewport">
<ContentSidebar v-if="navigationTree">
<!--Locations-->
<ContentGroup :title="$t('sidebar.locations_title')">
<div class="menu-list-wrapper vertical">
<a class="menu-list-item link" @click="goHome">
<div class="icon">
<home-icon size="17"></home-icon>
</div>
<div class="label">
{{ $t('sidebar.home') }}
</div>
</a>
</div>
</ContentGroup>
<!--Navigator-->
<ContentGroup :title="$t('sidebar.navigator_title')" class="navigator">
<span class="empty-note navigator" v-if="navigationTree.length == 0">
{{ $t('sidebar.folders_empty') }}
</span>
<TreeMenuNavigator class="folder-tree" :depth="0" :nodes="items" v-for="items in navigationTree" :key="items.unique_id"/>
</ContentGroup>
</ContentSidebar>
<div id="files-view">
<!--Context menu-->
<ContextMenu/>
<!--Desktop Toolbar-->
<DesktopToolbar/>
<!--File browser-->
<FileBrowser/>
</div>
</div>
</div>
</template>
<script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import MobileMultiSelectMenu from '@/components/FilesView/MobileMultiSelectMenu'
import TreeMenuNavigator from '@/components/Others/TreeMenuNavigator'
import FileFullPreview from '@/components/FilesView/FileFullPreview'
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
import FileFullPreview from "@/components/FilesView/FileFullPreview";
import ContentSidebar from '@/components/Sidebar/ContentSidebar'
import FileItemGrid from '@/components/FilesView/FileItemGrid'
import ContentGroup from '@/components/Sidebar/ContentGroup'
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 RenameItem from '@/components/Others/RenameItem'
import AuthButton from '@/components/Auth/AuthButton'
import Spinner from '@/components/FilesView/Spinner'
import MoveItem from '@/components/Others/MoveItem'
@@ -90,6 +128,9 @@
import {mapGetters} from 'vuex'
import {events} from '@/bus'
import axios from 'axios'
import {
HomeIcon,
} from 'vue-feather-icons'
export default {
name: 'SharedPage',
@@ -97,15 +138,20 @@
MobileMultiSelectMenu,
ValidationProvider,
ValidationObserver,
TreeMenuNavigator,
FileFullPreview,
DesktopToolbar,
ContentSidebar,
FileItemGrid,
ContentGroup,
AuthContent,
FileBrowser,
ContextMenu,
AuthButton,
MobileMenu,
ButtonBase,
RenameItem,
HomeIcon,
MoveItem,
required,
Vignette,
@@ -113,7 +159,21 @@
Alert,
},
computed: {
...mapGetters(['config', 'sharedDetail', 'sharedFile']),
...mapGetters([
'config',
'sharedDetail',
'sharedFile',
'navigation'
]),
navigationTree() {
return this.navigation ? this.navigation[0].folders : undefined
},
isPageFiles() {
return this.currentPage === 'page-files'
},
isPagePasswordVerification() {
return this.currentPage === 'page-password'
}
},
data() {
return {
@@ -121,10 +181,14 @@
password: '',
isLoading: false,
isPageLoading: true,
currentPage: undefined
currentPage: undefined,
homeDirectory: undefined,
}
},
methods: {
goHome() {
this.$store.dispatch('browseShared', [{folder: this.homeDirectory, back: false, init: true}])
},
async authenticateProtected() {
// Validate fields
@@ -168,14 +232,17 @@
// Show folder
if (this.sharedDetail.type === 'folder') {
let homeDirectory = {
this.homeDirectory = {
unique_id: this.sharedDetail.item_id,
name: this.$t('locations.home'),
location: 'public',
}
// Get folder tree
this.$store.dispatch('getFolderTree')
// Load folder
this.$store.dispatch('browseShared', [{folder: homeDirectory, back: false, init: true}])
this.goHome()
}
// Get file
@@ -293,4 +360,11 @@
}
}
.empty-note {
&.navigator {
padding: 5px 25px 10px;
}
}
</style>

View File

@@ -130,6 +130,22 @@
display: flex;
align-items: center;
&.trash {
&.is-active-trash,
&:hover {
svg {
path, line, polyline, rect, circle, ellipse {
stroke: $danger;
}
}
.label {
color: $danger;
}
}
}
&.is-active,
&.router-link-exact-active,
&:hover {
@@ -209,6 +225,10 @@
.menu-list-item {
padding: 8px 23px;
.label {
max-width: 140px;
}
.icon {
margin-right: 5px;
width: 20px;

View File

@@ -27,7 +27,7 @@
@mixin widget-card {
padding: 20px;
border-radius: 8px;
box-shadow: 0 3px 15px 2px hsla(220, 36%, 16%, 0.05);
box-shadow: 0 5px 10px -6px rgba(26, 36, 55, 0.15);
background: white;
}

View File

@@ -19,7 +19,7 @@ $shadow: 0 7px 25px 1px rgba(0, 0, 0, 0.12);
$light_mode_input_background: hsla(210, 10%, 98%, 1);
$light_mode_popup_shadow: 0 15px 50px 10px rgba(26,38,74,0.12);
$light_mode_vignette: rgba(9, 8, 12, 0.35);
$light_mode_vignette: rgba(255, 255, 255, 0.7);
// Dark Mode
$dark_mode_vignette: rgba(0, 0, 0, 0.3);

View File

@@ -99,7 +99,6 @@ Route::group(['middleware' => ['auth:api', 'auth.master', 'scope:master']], func
// Browse
Route::get('/participant-uploads', 'FileBrowser\BrowseController@participant_uploads');
Route::get('/file-detail/{unique_id}', 'FileBrowser\BrowseController@file_detail');
Route::get('/navigation', 'FileBrowser\BrowseController@navigation_tree');
Route::get('/folders/{unique_id}', 'FileBrowser\BrowseController@folder');
Route::get('/shared-all', 'FileBrowser\BrowseController@shared');