vuefilemanager v1.5-alpha.1

This commit is contained in:
carodej
2020-04-29 11:32:08 +02:00
parent 2614efe601
commit 0f3cbaec3d
50 changed files with 426 additions and 355 deletions
+2 -2
View File
@@ -56,7 +56,7 @@
this.button = this.$t('alerts.error_confirm')
this.emoji = '😢😢😢'
this.buttonStyle = 'danger'
this.buttonStyle = 'danger-solid'
if (args.emoji) {
this.emoji = args.emoji
@@ -109,7 +109,7 @@
top: 50%;
transform: translateY(-50%) scale(1);
margin: 0 auto;
padding: 40px;
padding: 20px;
box-shadow: $light_mode_popup_shadow;
border-radius: 8px;
text-align: center;
@@ -34,7 +34,7 @@
{{ $t('context_menu.delete') }}
</li>
<li class="menu-option" @click="shareItem" v-if="item">
{{ item.shared ? 'Edit Sharing' : $t('context_menu.share') }}
{{ item.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li>
<li class="menu-option" @click="ItemDetail" v-if="item">
{{ $t('context_menu.detail') }}
@@ -59,7 +59,7 @@
{{ $t('context_menu.move') }}
</li>
<li class="menu-option" @click="shareItem" v-if="item">
{{ item.shared ? 'Edit Sharing' : $t('context_menu.share') }}
{{ item.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li>
<li class="menu-option" @click="ItemDetail" v-if="item">
{{ $t('context_menu.detail') }}
@@ -28,17 +28,17 @@
<div class="toolbar-button-wrapper" v-if="$checkPermission(['master', 'editor'])">
<ToolbarButtonUpload
source="upload"
action="Upload file"
:action="$t('actions.upload')"
/>
<ToolbarButton
source="trash-alt"
action="Delete"
:action="$t('actions.delete')"
@click.native="deleteItems"
/>
<ToolbarButton
@click.native="createFolder"
source="folder-plus"
action="Create folder"
:action="$t('actions.create_folder')"
/>
</div>
@@ -46,7 +46,7 @@
<div class="toolbar-button-wrapper">
<ToolbarButton
:source="preview"
action="Change Preview"
:action="$t('actions.preview')"
@click.native="$store.dispatch('changePreviewType')"
/>
<ToolbarButton
@@ -1,47 +1,55 @@
<template>
<div class="empty-message">
<div class="message">
<FontAwesomeIcon class="icon" :icon="icon" />
<p>{{ message }}</p>
</div>
</div>
<div class="empty-message">
<div class="message">
<FontAwesomeIcon class="icon" :icon="icon"/>
<p>{{ message }}</p>
</div>
</div>
</template>
<script>
export default {
name: 'EmptyMessage',
props: ['icon', 'message']
}
export default {
name: 'EmptyMessage',
props: ['icon', 'message']
}
</script>
<style scoped lang="scss">
@import "@assets/app.scss";
@import "@assets/app.scss";
.empty-message {
text-align: center;
display: flex;
align-items: center;
height: 100%;
.empty-message {
text-align: center;
display: flex;
align-items: center;
height: 100%;
.message {
margin: 0 auto;
.message {
margin: 0 auto;
p {
margin-top: 10px;
max-width: 130px;
@include font-size(14);
font-weight: 500;
color: $text-muted;
}
p {
margin-top: 10px;
max-width: 130px;
@include font-size(14);
font-weight: 500;
color: $text-muted;
}
.icon {
@include font-size(36);
color: $text;
.icon {
@include font-size(36);
color: $text;
path {
color: $text;
}
}
}
}
path {
fill: $text;
}
}
}
}
@media (prefers-color-scheme: dark) {
.empty-message .message .icon {
path {
fill: $dark_mode_text_secondary;
}
}
}
</style>
@@ -4,7 +4,7 @@
<!--Shared empty message-->
<div class="text-content" v-if="$isThisLocation(['shared']) && ! isLoading">
<h1 class="title">You Haven't Shared Anything Yet</h1>
<h1 class="title">{{ $t('shared.empty_shared') }}</h1>
</div>
<!--Trash empty message-->
@@ -203,26 +203,6 @@
// On items delete
events.$on('items:delete', () => {
this.$store.dispatch('deleteItem', this.fileInfoDetail)
//let ids = []
//let items = []
// Get ids
/*this.$children[0].$children.filter(item => {
if (item.isClicked) {
ids.push(item.data.unique_id)
items.push({
unique_id: item.data.unique_id,
type: item.data.type,
})
}
})*/
// Dispatch action
/*this.$store.dispatch('removeItems', [ids, items])*/
})
}
}
@@ -299,4 +279,10 @@
.file-leave-active {
position: absolute;
}
@media only screen and (max-width: 660px) {
.file-info-container {
display: none;
}
}
</style>
@@ -1,7 +1,6 @@
<template>
<div class="file-info-content" v-if="fileInfoDetail">
<div class="file-headline" spellcheck="false">
<FilePreview />
<!--File info-->
@@ -29,8 +28,8 @@
<!--Latest change-->
<li v-if="$checkPermission(['master']) && fileInfoDetail.user_scope !== 'master'" class="list-info-item">
<b>Author</b>
<span>Public Participant</span>
<b>{{ $t('file_detail.author') }}</b>
<span>{{ $t('file_detail.author_participant') }}</span>
</li>
<!--Latest change-->
@@ -50,7 +49,7 @@
<!--Parent-->
<li v-if="$checkPermission('master') && fileInfoDetail.shared" class="list-info-item">
<b>Shared</b>
<b>{{ $t('file_detail.shared') }}</b>
<div class="action-button" @click="shareItemOptions">
<FontAwesomeIcon class="icon" :icon="sharedIcon" />
<span>{{ sharedInfo }}</span>
@@ -77,7 +76,7 @@
CopyInput,
},
computed: {
...mapGetters(['fileInfoDetail']),
...mapGetters(['fileInfoDetail', 'permissionOptions']),
filePreviewIcon() {
switch (this.fileInfoDetail.type) {
case 'folder':
@@ -98,16 +97,13 @@
}
},
sharedInfo() {
switch (this.fileInfoDetail.shared.permission) {
case 'editor':
return 'Can edit and upload files'
break
case 'visitor':
return 'Can only view and download'
break
default:
return 'Can download file'
}
// Get permission title
let title = this.permissionOptions.find(option => {
return option.value === this.fileInfoDetail.shared.permission
})
return title ? title.label : this.$t('shared.can_download')
},
sharedIcon() {
switch (this.fileInfoDetail.shared.permission) {
@@ -133,7 +129,6 @@
moveItem() {
// Move item fire popup
events.$emit('popup:open', {name: 'move', item: this.fileInfoDetail})
}
}
}
@@ -229,7 +224,7 @@
margin-right: 2px;
path {
fill: $theme_light;
fill: $theme;
}
}
}
@@ -313,5 +308,22 @@
}
}
}
.sharelink {
.lock-icon {
path {
fill: $dark_mode_text_primary;
}
&:hover {
path {
fill: $theme;
}
}
}
}
}
</style>
@@ -52,7 +52,7 @@
<!--Shared Icon-->
<div v-if="$checkPermission('master') && data.shared" class="item-shared">
<FontAwesomeIcon class="shared-icon" icon="user-friends"/>
<FontAwesomeIcon class="shared-icon" icon="share"/>
</div>
<!--Participant owner Icon-->
@@ -86,7 +86,9 @@
name: 'FileItemGrid',
props: ['data'],
computed: {
...mapGetters(['FilePreviewType']),
...mapGetters([
'FilePreviewType', 'sharedDetail'
]),
isFolder() {
return this.data.type === 'folder'
},
@@ -97,7 +99,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')
&& (this.sharedDetail && this.sharedDetail.type !== 'file')
},
canDrag() {
return !this.isDeleted && this.$checkPermission(['master', 'editor'])
@@ -51,7 +51,7 @@
<!--Shared Icon-->
<div v-if="$checkPermission('master') && data.shared" class="item-shared">
<FontAwesomeIcon class="shared-icon" icon="user-friends"/>
<FontAwesomeIcon class="shared-icon" icon="share"/>
</div>
<!--Participant owner Icon-->
@@ -31,7 +31,7 @@
{{ $t('context_menu.rename') }}
</li>
<li class="menu-option" @click="shareItem" v-if="fileInfoDetail">
{{ fileInfoDetail.shared ? 'Edit Sharing' : $t('context_menu.share') }}
{{ fileInfoDetail.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li>
<li class="menu-option" @click="downloadItem" v-if="! isFolder">
{{ $t('context_menu.download') }}
@@ -53,7 +53,7 @@
{{ $t('context_menu.move') }}
</li>
<li class="menu-option" @click="shareItem" v-if="fileInfoDetail">
{{ fileInfoDetail.shared ? 'Edit Sharing' : $t('context_menu.share') }}
{{ fileInfoDetail.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li>
<li class="menu-option" @click="downloadItem" v-if="! isFolder">
{{ $t('context_menu.download') }}
@@ -22,7 +22,7 @@
.label {
@include font-size(12);
color: $theme_light;
color: $theme;
font-weight: 600;
text-decoration: underline;
}
@@ -33,7 +33,7 @@
margin-right: 2px;
path {
fill: $theme_light;
fill: $theme;
}
}
}
@@ -75,4 +75,16 @@
}
}
}
@media (prefers-color-scheme: dark) {
.copy-input {
input {
color: $dark_mode_text_primary;
&:disabled {
}
}
}
}
</style>
@@ -14,7 +14,7 @@
<!--If is empty-->
<div class="not-selected" v-if="! selected">
<span class="option-value placehoder">Selected your permision</span>
<span class="option-value placehoder">{{ placeholder }}</span>
</div>
<FontAwesomeIcon icon="chevron-down" class="chevron"/>
@@ -37,7 +37,7 @@
<script>
export default {
name:'SelectInput',
props: ['options', 'isError', 'default'],
props: ['options', 'isError', 'default', 'placeholder'],
data() {
return {
selected: undefined,
@@ -28,7 +28,6 @@
},
methods: {
changeState() {
this.isSwitched = ! this.isSwitched
this.$emit('input', this.isSwitched)
}
@@ -90,4 +89,10 @@
}
}
}
@media (prefers-color-scheme: dark) {
.switch {
background: $dark_mode_foreground;
}
}
</style>
@@ -31,7 +31,8 @@
// Open called popup
events.$on('popup:open', ({name}) => {
if (this.name === name) this.isVisibleWrapper = true
if (this.name === name)
this.isVisibleWrapper = true
})
// Close popup
@@ -1,7 +1,7 @@
<template>
<PopupWrapper name="share-create">
<!--Title-->
<PopupHeader :title="'Share Your ' + itemTypeTitle" />
<PopupHeader :title="$t('popup_share_create.title', {item: itemTypeTitle})" />
<!--Content-->
<PopupContent>
@@ -14,22 +14,22 @@
<!--Permision Select-->
<ValidationProvider v-if="isFolder" tag="div" mode="passive" class="input-wrapper" name="Permission" rules="required" v-slot="{ errors }">
<label class="input-label">Permission:</label>
<SelectInput v-model="shareOptions.permission" :options="permissionOptions" :isError="errors[0]"/>
<label class="input-label">{{ $t('shared_form.label_permission') }}:</label>
<SelectInput v-model="shareOptions.permission" :options="permissionOptions" :placeholder="$t('shared_form.placeholder_permission')" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
<!--Password Switch-->
<div class="input-wrapper">
<div class="inline-wrapper">
<label class="input-label">Password Protected:</label>
<label class="input-label">{{ $t('shared_form.label_password_protection') }}:</label>
<SwitchInput v-model="shareOptions.isPassword" class="switch" :state="0"/>
</div>
</div>
<!--Set password-->
<ValidationProvider v-if="shareOptions.isPassword" tag="div" mode="passive" class="input-wrapper password" name="Password" rules="required" v-slot="{ errors }">
<input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" placeholder="Type your password">
<input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" :placeholder="$t('page_sign_in.placeholder_password')">
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</ValidationObserver>
@@ -37,7 +37,7 @@
<!--Copy generated link-->
<div v-if="isGeneratedShared" class="form-wrapper">
<div class="input-wrapper">
<label class="input-label">Share url:</label>
<label class="input-label">{{ $t('shared_form.label_shared_url') }}:</label>
<CopyInput size="small" :value="shareLink" />
</div>
</div>
@@ -65,10 +65,10 @@
</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 {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import PopupHeader from '@/components/Others/Popup/PopupHeader'
import SwitchInput from '@/components/Others/Forms/SwitchInput'
import SelectInput from '@/components/Others/Forms/SelectInput'
@@ -99,13 +99,13 @@
computed: {
...mapGetters(['app', 'permissionOptions']),
itemTypeTitle() {
return this.pickedItem && this.pickedItem.type === 'folder' ? 'Folder' : 'File'
return this.pickedItem && this.pickedItem.type === 'folder' ? this.$t('types.folder') : this.$t('types.file')
},
isFolder() {
return this.pickedItem && this.pickedItem.type === 'folder'
},
submitButtonText() {
return this.isGeneratedShared ? 'Awesome, Im done!' : 'Generate Link'
return this.isGeneratedShared ? this.$t('shared_form.button_done') : this.$t('shared_form.button_generate')
}
},
data() {
+11 -12
View File
@@ -1,7 +1,7 @@
<template>
<PopupWrapper name="share-edit">
<!--Title-->
<PopupHeader title="Update sharing options" />
<PopupHeader :title="$t('popup_share_edit.title')" />
<!--Content-->
<PopupContent v-if="pickedItem && pickedItem.shared">
@@ -14,29 +14,29 @@
<!--Share link-->
<div class="input-wrapper">
<label class="input-label">Share url:</label>
<label class="input-label">{{ $t('shared_form.label_shared_url') }}:</label>
<CopyInput size="small" :value="pickedItem.shared.link" />
</div>
<!--Permision Select-->
<ValidationProvider v-if="isFolder" tag="div" mode="passive" class="input-wrapper" name="Permission" rules="required" v-slot="{ errors }">
<label class="input-label">Permission:</label>
<SelectInput v-model="shareOptions.permission" :options="permissionOptions" :default="shareOptions.permission" :isError="errors[0]"/>
<label class="input-label">{{ $t('shared_form.label_permission') }}:</label>
<SelectInput v-model="shareOptions.permission" :options="permissionOptions" :default="shareOptions.permission" :placeholder="$t('shared_form.placeholder_permission')" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
<!--Password Switch-->
<div class="input-wrapper">
<div class="inline-wrapper">
<label class="input-label">Password Protected:</label>
<label class="input-label">{{ $t('shared_form.label_password_protection') }}:</label>
<SwitchInput v-model="shareOptions.isProtected" :state="shareOptions.isProtected" class="switch"/>
</div>
<ActionButton v-if="(pickedItem.shared.protected && canChangePassword) && shareOptions.isProtected" @click.native="changePassword" icon="pencil-alt">Change Password</ActionButton>
<ActionButton v-if="(pickedItem.shared.protected && canChangePassword) && shareOptions.isProtected" @click.native="changePassword" icon="pencil-alt">{{ $t('popup_share_edit.change_pass') }}</ActionButton>
</div>
<!--Set password-->
<ValidationProvider v-if="shareOptions.isProtected && ! canChangePassword" tag="div" mode="passive" class="input-wrapper password" name="Password" rules="required" v-slot="{ errors }">
<input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" placeholder="Type your password">
<input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" :placeholder="$t('page_sign_in.placeholder_password')">
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
@@ -60,17 +60,17 @@
button-style="theme"
:loading="isLoading"
:disabled="isLoading"
>Ok
>{{ $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 {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import PopupHeader from '@/components/Others/Popup/PopupHeader'
import SwitchInput from '@/components/Others/Forms/SwitchInput'
import SelectInput from '@/components/Others/Forms/SelectInput'
@@ -106,7 +106,7 @@
return this.pickedItem && this.pickedItem.type === 'folder'
},
destroyButtonText() {
return this.isConfirmedDestroy ? 'Confirm' : 'Stop Sharing'
return this.isConfirmedDestroy ? this.$t('popup_share_edit.confirm') : this.$t('popup_share_edit.stop')
},
destroyButtonStyle() {
return this.isConfirmedDestroy ? 'danger-solid' : 'secondary'
@@ -144,7 +144,6 @@
axios
.delete('/api/share/' + this.pickedItem.shared.token)
.then(() => {
// Remove item from file browser
if ( this.isSharedLocation ) {
this.$store.commit('REMOVE_ITEM', this.pickedItem.unique_id)
@@ -154,7 +153,7 @@
this.$store.commit('FLUSH_SHARED', this.pickedItem.unique_id)
// End deleting spinner button
this.isDeleting = false
setTimeout(() => this.isDeleting = false, 150)
this.$closePopup()
})
@@ -159,7 +159,7 @@
.small {
.file-item {
padding: 0 15px;
margin-bottom: 15px;
margin-bottom: 25px;
}
}
@@ -24,7 +24,7 @@
<span class="name" >{{ file.name }}</span>
<!--Other attributes-->
<span v-if="! isFolder" class="item-size">{{ file.filesize }}, {{ file.created_at }}</span>
<span v-if="! isFolder" class="item-size">{{ file.filesize }}</span>
<span v-if="isFolder" class="item-length">{{ file.items == 0 ? $t('folder.empty') : $tc('folder.item_counts', folderItems) }}, {{ file.created_at }}</span>
</div>
+2 -2
View File
@@ -18,7 +18,7 @@
</li>
<li class="menu-list-item" :class="{'is-active': isSharedLocation}" @click="getShared">
<FontAwesomeIcon class="icon" icon="share"/>
<span class="label">Shared</span>
<span class="label">{{ $t('locations.shared') }}</span>
</li>
<li class="menu-list-item" :class="{'is-active': isTrashLocation}" @click="getTrash">
<FontAwesomeIcon class="icon" icon="trash-alt"/>
@@ -394,7 +394,7 @@
@media (prefers-color-scheme: dark) {
#sidebar {
background: $dark_mode_foreground;
background: $dark_mode_background;
}
.menu-list-wrapper {
@@ -176,7 +176,7 @@
@media (prefers-color-scheme: dark) {
.user-headline {
background: $dark_mode_foreground;
background: $dark_mode_background;
padding: 0;
&:hover {
@@ -197,6 +197,10 @@
.menu-option {
color: $dark_mode_text_primary;
a {
color: $dark_mode_text_primary;
}
&:hover {
background: $dark_mode_foreground;
}