Add Error prompt
parent
d0e7631bc8
commit
5b3b5aecaf
|
@ -10,6 +10,7 @@
|
|||
"lint": "eslint --ext .js,.vue src"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "^5.27.4",
|
||||
"filesize": "^3.5.10",
|
||||
"hammerjs": "^2.0.8",
|
||||
"moment": "^2.18.1",
|
||||
|
|
|
@ -171,6 +171,7 @@ export default {
|
|||
},
|
||||
created () {
|
||||
this.fetchData()
|
||||
this.$store.commit('showHover', 'error')
|
||||
},
|
||||
watch: {
|
||||
'$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>
|
||||
<info v-else-if="showInfo"></info>
|
||||
<move v-else-if="showMove"></move>
|
||||
<error v-else-if="showError"></error>
|
||||
|
||||
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
||||
</div>
|
||||
|
@ -20,6 +21,7 @@ import Delete from './Delete'
|
|||
import Rename from './Rename'
|
||||
import Download from './Download'
|
||||
import Move from './Move'
|
||||
import Error from './Error'
|
||||
import NewFile from './NewFile'
|
||||
import NewDir from './NewDir'
|
||||
import { mapState } from 'vuex'
|
||||
|
@ -30,6 +32,7 @@ export default {
|
|||
Info,
|
||||
Delete,
|
||||
Rename,
|
||||
Error,
|
||||
Download,
|
||||
Move,
|
||||
NewFile,
|
||||
|
@ -38,6 +41,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
...mapState(['show']),
|
||||
showError: function () { return this.show === 'error' },
|
||||
showInfo: function () { return this.show === 'info' },
|
||||
showHelp: function () { return this.show === 'help' },
|
||||
showDelete: function () { return this.show === 'delete' },
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
z-index: 99999;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
width: 13em;
|
||||
width: 16em;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
transition: .1s ease left;
|
||||
left: -14em;
|
||||
left: -17em;
|
||||
}
|
||||
nav.active {
|
||||
left: 0;
|
||||
|
|
|
@ -64,6 +64,22 @@
|
|||
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 *
|
||||
|
|
Loading…
Reference in New Issue