Add Error prompt
parent
d0e7631bc8
commit
5b3b5aecaf
|
@ -10,6 +10,7 @@
|
||||||
"lint": "eslint --ext .js,.vue src"
|
"lint": "eslint --ext .js,.vue src"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"codemirror": "^5.27.4",
|
||||||
"filesize": "^3.5.10",
|
"filesize": "^3.5.10",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"moment": "^2.18.1",
|
"moment": "^2.18.1",
|
||||||
|
|
|
@ -171,6 +171,7 @@ export default {
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
|
this.$store.commit('showHover', 'error')
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route': 'fetchData',
|
'$route': 'fetchData',
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<template>
|
||||||
|
<div class="prompt error">
|
||||||
|
<i class="material-icons">error_outline</i>
|
||||||
|
<h3>Something went wrong</h3>
|
||||||
|
<pre>{{ error }}</pre>
|
||||||
|
<div>
|
||||||
|
<button @click="$store.commit('closeHovers')" autofocus>Close</button>
|
||||||
|
<button @click="reportIssue" class="cancel">Report Issue</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'error',
|
||||||
|
props: ['error'],
|
||||||
|
methods: {
|
||||||
|
reportIssue () {
|
||||||
|
window.open('https://github.com/hacdias/filemanager/issues/new')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -8,6 +8,7 @@
|
||||||
<delete v-else-if="showDelete"></delete>
|
<delete v-else-if="showDelete"></delete>
|
||||||
<info v-else-if="showInfo"></info>
|
<info v-else-if="showInfo"></info>
|
||||||
<move v-else-if="showMove"></move>
|
<move v-else-if="showMove"></move>
|
||||||
|
<error v-else-if="showError"></error>
|
||||||
|
|
||||||
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,6 +21,7 @@ import Delete from './Delete'
|
||||||
import Rename from './Rename'
|
import Rename from './Rename'
|
||||||
import Download from './Download'
|
import Download from './Download'
|
||||||
import Move from './Move'
|
import Move from './Move'
|
||||||
|
import Error from './Error'
|
||||||
import NewFile from './NewFile'
|
import NewFile from './NewFile'
|
||||||
import NewDir from './NewDir'
|
import NewDir from './NewDir'
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
@ -30,6 +32,7 @@ export default {
|
||||||
Info,
|
Info,
|
||||||
Delete,
|
Delete,
|
||||||
Rename,
|
Rename,
|
||||||
|
Error,
|
||||||
Download,
|
Download,
|
||||||
Move,
|
Move,
|
||||||
NewFile,
|
NewFile,
|
||||||
|
@ -38,6 +41,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['show']),
|
...mapState(['show']),
|
||||||
|
showError: function () { return this.show === 'error' },
|
||||||
showInfo: function () { return this.show === 'info' },
|
showInfo: function () { return this.show === 'info' },
|
||||||
showHelp: function () { return this.show === 'help' },
|
showHelp: function () { return this.show === 'help' },
|
||||||
showDelete: function () { return this.show === 'delete' },
|
showDelete: function () { return this.show === 'delete' },
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 13em;
|
width: 16em;
|
||||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||||
transition: .1s ease left;
|
transition: .1s ease left;
|
||||||
left: -14em;
|
left: -17em;
|
||||||
}
|
}
|
||||||
nav.active {
|
nav.active {
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
|
@ -64,6 +64,22 @@
|
||||||
background-color: #e9eaeb;
|
background-color: #e9eaeb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.prompt.error i {
|
||||||
|
color: #F44336;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto .15em;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prompt.error h3 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prompt.error button:not(.cancel) {
|
||||||
|
background-color: #F44336
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * *
|
||||||
* PROMPT - MOVE *
|
* PROMPT - MOVE *
|
||||||
|
|
Loading…
Reference in New Issue