v1.6 released

This commit is contained in:
carodej
2020-05-28 13:00:54 +02:00
parent a76d1dec3b
commit 252b6fd0bf
63 changed files with 1205 additions and 938 deletions
@@ -12,7 +12,6 @@
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'
@@ -0,0 +1,166 @@
<template>
<div class="dropzone" :class="{ 'is-error': error }">
<input
ref="file"
type="file"
@change="showImagePreview($event)"
class="dummy"
/>
<img
ref="image"
:src="imagePreview"
class="image-preview"
v-if="imagePreview"
/>
<div class="dropzone-message" v-show="! isData">
<upload-icon size="19" class="icon-upload"></upload-icon>
<span class="dropzone-title">
{{ $t('input_image.title') }}
</span>
<span class="dropzone-description">
{{ $t('input_image.supported') }}
</span>
</div>
</div>
</template>
<script>
import { UploadIcon } from 'vue-feather-icons'
export default {
name: 'ImageInput',
props: [
'image', 'error'
],
components: {
UploadIcon
},
data() {
return {
imagePreview: undefined
}
},
computed: {
isData() {
return typeof this.imagePreview === 'undefined' || this.imagePreview === '' ? false : true
},
},
methods: {
showImagePreview(event) {
const imgPath = event.target.files[0].name,
extn = imgPath
.substring(imgPath.lastIndexOf('.') + 1)
.toLowerCase()
if (['png', 'jpg', 'jpeg'].includes(extn)) {
const file = event.target.files[0],
reader = new FileReader()
reader.onload = () => (this.imagePreview = reader.result)
reader.readAsDataURL(file)
// Update user avatar
this.$emit('input', event.target.files[0])
} else {
alert( this.$t('validation_errors.wrong_image') )
}
}
},
created() {
// If has default image then load
if (this.image) this.imagePreview = this.image
}
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
.dropzone {
border: 1px dashed #a1abc2;
border-radius: 8px;
position: relative;
text-align: center;
display: flex;
align-items: center;
min-height: 210px;
&.is-error {
border: 2px dashed rgba(253, 57, 122, 0.3);
.dropzone-title {
color: $danger;
}
.icon-upload path {
fill: $danger
}
}
input[type='file'] {
opacity: 0;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
width: 100%;
cursor: pointer;
}
.image-preview {
position: absolute;
width: 100%;
height: 100%;
object-fit: contain;
left: 0;
padding: 7px;
display: block;
&.fit-image {
object-fit: cover;
border-radius: 12px;
overflow: hidden;
}
}
.dropzone-message {
padding: 50px 0;
width: 100%;
.dropzone-title {
@include font-size(16);
font-weight: 700;
display: block;
}
.dropzone-description {
color: $text_muted;
@include font-size(12);
}
}
}
@media (prefers-color-scheme: dark) {
.dropzone {
.dropzone-message {
.icon-upload {
path, polyline, line {
stroke: $theme;
}
}
.dropzone-description {
color: $dark_mode_text_secondary;
}
}
}
}
</style>
@@ -115,9 +115,9 @@
}
.input-area {
border: 1px solid #ebebeb;
justify-content: space-between;
background: $light_mode_input_background;
border: 1px solid transparent;
@include transition(150ms);
align-items: center;
border-radius: 8px;
@@ -182,6 +182,7 @@
.input-area {
background: $dark_mode_foreground;
border-color: $dark_mode_foreground;
.option-icon {
path {
@@ -25,7 +25,6 @@
@include font-size(19);
margin-bottom: 15px;
display: block;
//color: $theme;
}
.description {
@@ -46,6 +45,19 @@
}
}
/deep/ input {
&[type='text'],
&[type='number'],
.input-area {
background: white;
}
}
/deep/ .input-area {
background: white;
}
/deep/ .form {
margin-top: 20px;
@@ -83,6 +95,16 @@
@media only screen and (max-width: 690px) {
.setup-box {
padding: 15px;
.title {
@include font-size(17);
margin-bottom: 10px;
}
.description {
@include font-size(14);
}
/deep/ .form.block-form {
@@ -64,7 +64,7 @@
{
icon: 'settings',
title: this.$t('menu.settings'),
routeName: 'MobileSettings',
routeName: 'Profile',
isVisible: true,
},
{
@@ -45,7 +45,7 @@
.fade-enter-active,
.fade-leave-active {
transition: 0.8s ease;
transition: 0.3s ease;
}
.fade-enter,
@@ -107,6 +107,7 @@
justify-content: center;
padding: 0;
font-size: 20px;
margin-right: 10px;
}
&.success {
@@ -133,4 +134,28 @@
}
}
}
@media only screen and (max-width: 690px) {
.toastr-item {
margin-bottom: 0;
margin-top: 20px;
max-width: 100%;
}
.fade-enter,
.fade-leave-to {
opacity: 0;
@include transform(translateY(100%));
}
}
@media (prefers-color-scheme: dark) {
.toastr-item {
&.success, &.danger {
background: $dark_mode_foreground;
}
}
}
</style>
@@ -48,4 +48,15 @@
top: 30px;
z-index: 10;
}
@media only screen and (max-width: 690px) {
#toastr-wrapper {
top: initial;
right: 15px;
left: 15px;
bottom: 15px;
}
}
</style>
+14 -22
View File
@@ -1,7 +1,7 @@
<template>
<div class="page-header" @click="goHome">
<div class="icon" v-if="isSmallAppSize">
<FontAwesomeIcon icon="chevron-left" />
<div class="page-header">
<div class="go-back" v-if="canBack" @click="$router.back()">
<chevron-left-icon size="17"></chevron-left-icon>
</div>
<div class="content">
<h1 class="title">{{ title }}</h1>
@@ -10,28 +10,16 @@
</template>
<script>
import {mapGetters} from 'vuex'
import {events} from '@/bus'
import { ChevronLeftIcon } from 'vue-feather-icons'
export default {
name: 'PageHeader',
props: [
'title'
'title', 'canBack'
],
computed: {
...mapGetters(['appSize']),
isSmallAppSize() {
return this.appSize === 'small'
}
components: {
ChevronLeftIcon
},
methods: {
goHome() {
if (this.isSmallAppSize) {
events.$emit('show:sidebar')
this.$router.push({name: 'Files'})
}
}
}
}
</script>
@@ -55,10 +43,14 @@
color: $text;
}
.icon {
@include font-size(16);
margin-right: 15px;
.go-back {
margin-right: 10px;
cursor: pointer;
svg {
vertical-align: middle;
margin-top: -4px;
}
}
}
@@ -173,6 +173,7 @@
.table {
width: 100%;
border-collapse: collapse;
overflow-x: auto;
tr {
width: 100%;
@@ -194,13 +195,13 @@
tr {
td {
padding-top: 10px;
padding-bottom: 10px;
padding: 12px;
span {
color: #AFAFAF;
font-weight: 700;
@include font-size(12);
white-space: nowrap;
}
&.sortable {
@@ -243,8 +244,7 @@
}
td {
padding-top: 12px;
padding-bottom: 12px;
padding: 12px;
&:last-child {
button {
@@ -332,6 +332,18 @@
}
}
@media only screen and (max-width: 690px) {
.paginator-wrapper {
display: block;
text-align: center;
.paginator-info {
margin-top: 10px;
display: block;
}
}
}
@media (prefers-color-scheme: dark) {
.table {
@@ -80,8 +80,8 @@
}
.image-preview {
width: 56px;
height: 56px;
width: 62px;
height: 62px;
object-fit: cover;
border-radius: 8px;
}