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
-3
View File
@@ -85,9 +85,6 @@
this.$store.commit('SET_CONFIG', this.$root.$data.config)
},
mounted() {
//events.$emit('share-item')
// Handle VueFileManager width
var VueFileManager = document.getElementById('vue-file-manager');
new ResizeSensor(VueFileManager, this.handleAppResize);
+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;
}
+8 -4
View File
@@ -55,6 +55,7 @@ const Helpers = {
// Prevent submit empty files
if (files && files.length == 0) return
// Check storage size
if (! this.$isThisLocation(['public']) && this.$store.getters.app.storage.percentage >= 100) {
events.$emit('alert:open', {
emoji: '😬😬😬',
@@ -88,7 +89,8 @@ const Helpers = {
formData.append('parent_id', rootFolder)
// Upload data
await store.dispatch('uploadFiles', formData).then(() => {
await store.dispatch('uploadFiles', formData)
.then(() => {
// Progress file log
store.commit('UPDATE_FILE_COUNT_PROGRESS', {
current: fileCountSucceed,
@@ -104,7 +106,7 @@ const Helpers = {
}
}).catch(error => {
/*if (error.response.status === 423) {
if (error.response.status === 423) {
events.$emit('alert:open', {
emoji: '😬😬😬',
@@ -119,7 +121,7 @@ const Helpers = {
title: this.$t('popup_error.title'),
message: this.$t('popup_error.message'),
})
}*/
}
})
}
}
@@ -132,7 +134,8 @@ const Helpers = {
// Get files
const files = [...event.dataTransfer.items].map(item => item.getAsFile());
if (this.$store.getters.app.storage.percentage >= 100) {
// Check storage size
if (! this.$isThisLocation(['public']) && this.$store.getters.app.storage.percentage >= 100) {
events.$emit('alert:open', {
emoji: '😬😬😬',
title: this.$t('popup_exceed_limit.title'),
@@ -141,6 +144,7 @@ const Helpers = {
return
}
let fileCountSucceed = 1
store.commit('UPDATE_FILE_COUNT_PROGRESS', {
+2 -2
View File
@@ -2,14 +2,14 @@ import Vue from 'vue';
import VueI18n from 'vue-i18n';
import en from './lang/en.json'
import sk from './lang/sk.json'
//import sk from './lang/sk.json'
Vue.use(VueI18n);
const i18n = new VueI18n({
locale: config.locale,
messages: Object.assign({
en, sk
en
}),
});
+49 -2
View File
@@ -24,6 +24,13 @@
"button_create_account": "Create Account",
"have_an_account": "Do you have an account?"
},
"page_shared": {
"subtitle": "Please type the password to get shared content:",
"title": "Your Share Link is Protected",
"placeholder_pass": "Type password",
"download_file": "Download File",
"submit": "Submit"
},
"page_create_password": {
"title": "Only One Step to Log In",
"subtitle": "Create your new password here:",
@@ -71,11 +78,15 @@
"nothing_was_found": "Nothing was found"
},
"locations": {
"home": "Home",
"trash": "Trash"
"shared": "Shared",
"trash": "Trash",
"home": "Home"
},
"file_detail": {
"author_participant": "Public Participant",
"created_at": "Created at",
"shared": "Shared",
"author": "Author",
"where": "Where",
"size": "Size"
},
@@ -117,6 +128,7 @@
"profile_settings": "Profile Settings",
"create_folder": "Create Folder",
"empty_trash": "Empty Trash",
"share_edit": "Edit Sharing",
"add_folder": "Add Folder",
"download": "Download",
"log_out": "Log Out",
@@ -129,6 +141,7 @@
"move": "Move"
},
"sidebar": {
"shared": "Shared",
"locations": "Locations",
"favourites": "Favourites",
"favourites_empty": "Drag here your favourite folder.",
@@ -162,5 +175,39 @@
"popup_exceed_limit": {
"title": "Whooops, you exceed your storage limit :(",
"message": "Please contact your administrator to change your limit."
},
"popup_share_create": {
"title": "Share Your {item}"
},
"popup_share_edit": {
"title": "Update sharing options",
"change_pass": "Change Password",
"save": "Save Changes",
"stop": "Stop Sharing",
"confirm": "Confirm"
},
"shared": {
"empty_shared": "You Haven't Shared Anything Yet",
"editor": "Can edit and upload files",
"visitor": "Can only view and download",
"can_download": "Can download file"
},
"shared_form": {
"placeholder_permission": "Select your permission",
"label_password_protection": "Password Protected",
"button_done": "Awesome, Im done!",
"button_generate": "Generate Link",
"label_permission": "Permission",
"label_shared_url": "Share url"
},
"actions": {
"create_folder": "Create folder",
"preview": "Change preview",
"upload": "Upload file",
"delete": "Delete item"
},
"types": {
"folder": "Folder",
"file": "File"
}
}
+49 -2
View File
@@ -24,6 +24,13 @@
"button_create_account": "Vytvoriť účet",
"have_an_account": "Máš už účet?"
},
"page_shared": {
"subtitle": "Prosím vložte heslo pre získanie prístupu k obsahu:",
"title": "Zdieľaný odkaz je chránený",
"placeholder_pass": "Vložte heslo",
"download_file": "Stiahnúť súbor",
"submit": "Potvrdiť"
},
"page_create_password": {
"title": "Iba jeden krok pre prihlásenie",
"subtitle": "Vytvorte si nové heslo tu:",
@@ -71,12 +78,16 @@
"nothing_was_found": "Nič sa nenašlo"
},
"locations": {
"shared": "Zdieľané",
"home": "Domov",
"trash": "Kôš"
},
"file_detail": {
"author_participant": "Verejný účastník",
"created_at": "Vytvorené",
"where": "Umiestnenie",
"shared": "Zdieľané",
"author": "Autor",
"size": "Veľkosť"
},
"empty_page": {
@@ -116,19 +127,21 @@
"add_to_favourites": "Pridať do obľúbených",
"profile_settings": "Nastavenia profilu",
"create_folder": "Vytvoriť priečinok",
"share_edit": "Upraviť zdieľanie",
"empty_trash": "Vyprázdniť kôš",
"add_folder": "Nový priečinok",
"download": "Stiahnúť",
"log_out": "Odhlásiť sa",
"download": "Stiahnúť",
"rename": "Premenovať",
"restore": "Obnoviť",
"upload": "Nahrať",
"detail": "Detail",
"rename": "Premenovať",
"delete": "Vymazať",
"share": "Zdieľať",
"move": "Presunúť"
},
"sidebar": {
"shared": "Zdieľané",
"locations": "Umiestnenie",
"favourites": "Obľúbené",
"favourites_empty": "Presuňte sem svoj obľúbený priečinok.",
@@ -162,5 +175,39 @@
"popup_exceed_limit": {
"title": "Ups, presiahli ste limit úložiska",
"message": "Prosím, kontaktujte administrátora pre navyšenie limitu."
},
"popup_share_create": {
"title": "Zdieľaj {item}"
},
"popup_share_edit": {
"title": "Upraviť nastavenia zdieľania",
"change_pass": "Zmeniť heslo",
"save": "Uložiť zmeny",
"stop": "Zastaviť zdieľanie",
"confirm": "Potvrdiť"
},
"shared": {
"empty_shared": "Zatiaľ ste nič nezdieľali",
"editor": "Môže upravovať a nahrávať súbory",
"visitor": "Môže len vidieť a sťahovať súbory",
"can_download": "Môže stiahnúť súbor"
},
"shared_form": {
"placeholder_permission": "Zvoľte oprávnenia",
"label_password_protection": "Chrániť heslom",
"button_done": "Super, som hotový!",
"button_generate": "Vygenerovať link",
"label_permission": "Oprávnenie",
"label_shared_url": "Zdieľací odkaz"
},
"actions": {
"create_folder": "Vytvoriť priečinok",
"preview": "Zmeniť náhľad",
"upload": "Nahrať súbory",
"delete": "Vymazať položku"
},
"types": {
"folder": "Priečinok",
"file": "Súbor"
}
}
-1
View File
@@ -1,6 +1,5 @@
import Vue from 'vue'
import Router from 'vue-router'
import store from '@/store'
import Index from './views/Auth/SignIn'
import SignUp from './views/Auth/SignUp'
+20 -10
View File
@@ -43,7 +43,9 @@ 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)
@@ -61,12 +63,22 @@ const actions = {
if (!init) context.commit('ADD_BROWSER_HISTORY', currentFolder)
}
})
.catch(() => {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
.catch(error => {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
context.commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
} else {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
}
})
},
getShared: (context, back = false) => {
@@ -187,7 +199,7 @@ const actions = {
if (getters.sharedDetail && getters.sharedDetail.protected)
route = '/api/navigation/private'
else if (getters.sharedDetail && ! getters.sharedDetail.protected)
else if (getters.sharedDetail && !getters.sharedDetail.protected)
route = '/api/navigation/public/' + router.currentRoute.params.token
else
route = '/api/navigation'
@@ -209,8 +221,6 @@ const actions = {
})
})
})
},
}
+3 -2
View File
@@ -3,7 +3,6 @@ import router from '@/router'
import {events} from '@/bus'
import axios from 'axios'
const actions = {
moveItem: ({commit, getters}, [item_from, to_item]) => {
@@ -86,9 +85,11 @@ const actions = {
if (response.data.folder_id == getters.currentFolder.unique_id)
commit('ADD_NEW_ITEMS', response.data)
commit('UPDATE_RECENT_UPLOAD', response.data)
commit('UPLOADING_FILE_PROGRESS', 0)
if (getters.permission === 'master')
commit('UPDATE_RECENT_UPLOAD', response.data)
resolve(response)
})
.catch(error => {
+5 -3
View File
@@ -6,12 +6,12 @@ import axios from 'axios'
const defaultState = {
permissionOptions: [
{
label: 'Can edit and upload files',
label: i18n.t('shared.editor'),
value: 'editor',
icon: 'user-edit',
},
{
label: 'Can only view and download',
label: i18n.t('shared.visitor'),
value: 'visitor',
icon: 'user',
},
@@ -74,7 +74,9 @@ const actions = {
},
getSingleFile: ({commit, state}) => {
let route = state.sharedDetail.protected ? '/api/files/private' : '/api/files/' + router.currentRoute.params.token + '/public'
let route = state.sharedDetail.protected
? '/api/files/private'
: '/api/files/' + router.currentRoute.params.token + '/public'
axios.get(route)
.then(response => {
+6 -3
View File
@@ -5,12 +5,12 @@ import router from '@/router'
const defaultState = {
authorized: undefined,
permission: 'master', // master | editor | visitor,
permission: 'master', // master | editor | visitor
app: undefined,
}
const actions = {
getAppData: ({commit, dispatch, getters}) => {
getAppData: ({commit, getters}) => {
axios
.get(getters.api + '/user')
@@ -19,8 +19,11 @@ const actions = {
}).catch((error) => {
if (error.response.status == 401) {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
}
}
)
+10 -28
View File
@@ -47,36 +47,18 @@
},
mounted() {
// Set default directory
if (this.config.directory) {
// Set start directory
this.$store.commit('SET_START_DIRECTORY', this.config.directory)
// Load folder
this.$store.dispatch('getFolder', [
{
unique_id: this.config.directory.unique_id,
name: this.config.directory.name,
location: 'base',
},
false,
true
])
} else {
let homeDirectory = {
unique_id: 0,
name: 'Home',
location: 'base',
}
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('getFolder', [homeDirectory, false, true])
let homeDirectory = {
name: this.$t('locations.home'),
location: 'base',
unique_id: 0,
}
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('getFolder', [homeDirectory, false, true])
var filesView = document.getElementById('files-view');
new ResizeSensor(filesView, this.handleContentResize);
}
+1 -1
View File
@@ -85,7 +85,7 @@
import axios from 'axios'
export default {
name: 'UserSettings',
name: 'Profile',
components: {
ValidationProvider,
ValidationObserver,
+39 -40
View File
@@ -16,17 +16,17 @@
<!--Verify share link by password-->
<AuthContent class="center" name="password" :visible="true">
<img class="logo" :src="config.app_logo" :alt="config.app_name">
<h1>Your Share Link is Protected</h1>
<h2>Please type the password to get shared content:</h2>
<h1>{{ $t('page_shared.title') }}</h1>
<h2>{{ $t('page_shared.subtitle') }}</h2>
<ValidationObserver @submit.prevent="authenticateProtected" ref="authenticateProtected" v-slot="{ invalid }" tag="form" class="form inline-form">
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Password" rules="required" v-slot="{ errors }">
<input v-model="password" placeholder="Type password" type="password" :class="{'is-error': errors[0]}"/>
<input v-model="password" :placeholder="$t('page_shared.placeholder_pass')" type="password" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
<AuthButton icon="chevron-right" text="Submit" :loading="isLoading" :disabled="isLoading" />
<AuthButton icon="chevron-right" :text="$t('page_shared.submit')" :loading="isLoading" :disabled="isLoading" />
</ValidationObserver>
</AuthContent>
</div>
@@ -38,7 +38,7 @@
<FileItemGrid v-if="sharedFile" :data="sharedFile"/>
<ButtonBase @click.native="download" class="download-button" button-style="theme">
Download File
{{ $t('page_shared.download_file') }}
</ButtonBase>
</div>
</div>
@@ -64,8 +64,8 @@
</template>
<script>
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
import FileItemGrid from '@/components/FilesView/FileItemGrid'
import FileBrowser from '@/components/FilesView/FileBrowser'
import ContextMenu from '@/components/FilesView/ContextMenu'
@@ -129,7 +129,7 @@
axios
.post('/api/shared/authenticate/' + this.$route.params.token, {
password: this.password
}).then(response => {
}).then(() => {
// End loading
this.isLoading = false
@@ -140,20 +140,46 @@
// Get protected files
this.getFiles();
})
}).catch(error => {
/*.catch((error) => {
/!*if (error.response.status == 401) {
if (error.response.status == 401) {
this.$refs.authenticateProtected.setErrors({
'Password': [error.response.data.message]
});
}*!/
}
// End loading
this.isLoading = false
})*/
})
},
getFiles() {
// Show folder
if (this.sharedDetail.type === 'folder') {
let homeDirectory = {
unique_id: this.sharedDetail.item_id,
name: this.$t('locations.home'),
location: 'public',
}
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('browseShared', [homeDirectory, false, true])
.then(() => {
var filesView = document.getElementById('files-view')
new ResizeSensor(filesView, this.handleContentResize)
})
}
// Get file
if (this.sharedDetail.type === 'file') {
this.$store.dispatch('getSingleFile')
}
},
download() {
this.$downloadFile(this.sharedFile.file_url, this.sharedFile.name + '.' + this.sharedFile.mimetype)
@@ -176,33 +202,6 @@
else if (filesView >= 960)
this.$store.commit('SET_FILES_VIEW_SIZE', 'full-scale')
},
getFiles() {
// Show folder
if (this.sharedDetail.type === 'folder') {
let homeDirectory = {
unique_id: this.sharedDetail.item_id,
name: 'Home',
}
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('browseShared', [homeDirectory, false, true])
.then(() => {
var filesView = document.getElementById('files-view')
new ResizeSensor(filesView, this.handleContentResize)
})
}
// Get file
if (this.sharedDetail.type === 'file') {
this.$store.dispatch('getSingleFile')
}
}
},
created() {
+6 -5
View File
@@ -1,7 +1,8 @@
<?php
return [
'user_not_fount' => 'We can\'t find a user with that e-mail address.',
'home' => 'Home',
'time' => '%d. %B. %Y at %H:%M',
];
return [
'user_not_fount' => 'We can\'t find a user with that e-mail address.',
'home' => 'Home',
'time' => '%d. %B. %Y at %H:%M',
'incorrect_password' => 'Sorry, your password is incorrect.',
];
+4 -3
View File
@@ -1,7 +1,8 @@
<?php
return [
'user_not_fount' => 'Uživateľ s touto emailovou adresou sa nenašiel.',
'home' => 'Domov',
'time' => '%d. %B. %Y o %H:%M',
'user_not_fount' => 'Uživateľ s touto emailovou adresou sa nenašiel.',
'home' => 'Domov',
'time' => '%d. %B. %Y o %H:%M',
'incorrect_password' => 'Prepáč, zadané heslo je nesprávne',
];
+7 -1
View File
@@ -34,7 +34,7 @@
}
.icon {
background: $theme_light;
background: $theme;
padding: 14px 18px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
@@ -54,4 +54,10 @@
font-weight: 700;
margin-bottom: 5px;
display: block;
}
@media (prefers-color-scheme: dark) {
.input-label {
color: $dark_mode_text_primary;
}
}
-1
View File
@@ -3,7 +3,6 @@ $text: #1b2539;
$text-muted: #667b90;
$theme: #00BC7E;
$theme_light: #4ECDA5;
$light_mode_border: rgba(0, 0, 0, 0.02);
$danger: #fd397a;