mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-08 19:22:57 +00:00

Former-commit-id: d417ce53c631d7cc0f48fef57457f9e6b047bf72 [formerly 468200ae5d76f89ad7cd3f591318ca5db80e30cd] [formerly 6f72a7698b8cbc08271a02920fef8db4e3715a4f [formerly a70c3b4106b193676ecad71f7846f0b1ae74ffc9]] Former-commit-id: 157ae87bae0808109fca2c293b04396a1fb8ea16 [formerly a8a8393eaf59abb16bb858c6467650b0b70724f2] Former-commit-id: 01645a195e1373cf310f8e0bf281b3a7107adb69
100 lines
2.8 KiB
Vue
100 lines
2.8 KiB
Vue
<template>
|
|
<div>
|
|
<help v-if="showHelp" ></help>
|
|
<download v-else-if="showDownload"></download>
|
|
<new-file v-else-if="showNewFile"></new-file>
|
|
<new-dir v-else-if="showNewDir"></new-dir>
|
|
<rename v-else-if="showRename"></rename>
|
|
<delete v-else-if="showDelete"></delete>
|
|
<info v-else-if="showInfo"></info>
|
|
<move v-else-if="showMove"></move>
|
|
<error v-else-if="showError"></error>
|
|
<success v-else-if="showSuccess"></success>
|
|
|
|
<template v-for="plugin in plugins">
|
|
<form class="prompt"
|
|
v-for="prompt in plugin.prompts"
|
|
:key="prompt.name"
|
|
v-if="show === prompt.name"
|
|
@submit="prompt.submit($event, pluginData, $route)">
|
|
<h3>{{ prompt.title }}</h3>
|
|
<p>{{ prompt.description }}</p>
|
|
<input v-for="input in prompt.inputs"
|
|
:key="input.name"
|
|
:type="input.type"
|
|
:name="input.name"
|
|
:placeholder="input.placeholder">
|
|
<div>
|
|
<input type="submit" class="ok" :value="prompt.ok">
|
|
<button class="cancel" @click.prevent="$store.commit('closeHovers')">Cancel</button>
|
|
</div>
|
|
</form>
|
|
</template>
|
|
|
|
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Help from './Help'
|
|
import Info from './Info'
|
|
import Delete from './Delete'
|
|
import Rename from './Rename'
|
|
import Download from './Download'
|
|
import Move from './Move'
|
|
import Error from './Error'
|
|
import Success from './Success'
|
|
import NewFile from './NewFile'
|
|
import NewDir from './NewDir'
|
|
import { mapState } from 'vuex'
|
|
import buttons from '@/utils/buttons'
|
|
import api from '@/utils/api'
|
|
|
|
export default {
|
|
name: 'prompts',
|
|
components: {
|
|
Info,
|
|
Delete,
|
|
Rename,
|
|
Error,
|
|
Download,
|
|
Success,
|
|
Move,
|
|
NewFile,
|
|
NewDir,
|
|
Help
|
|
},
|
|
data: function () {
|
|
return {
|
|
pluginData: {
|
|
api,
|
|
buttons,
|
|
'store': this.$store,
|
|
'router': this.$router
|
|
}
|
|
}
|
|
},
|
|
computed: {
|
|
...mapState(['show', 'plugins']),
|
|
showError: function () { return this.show === 'error' },
|
|
showSuccess: function () { return this.show === 'success' },
|
|
showInfo: function () { return this.show === 'info' },
|
|
showHelp: function () { return this.show === 'help' },
|
|
showDelete: function () { return this.show === 'delete' },
|
|
showRename: function () { return this.show === 'rename' },
|
|
showMove: function () { return this.show === 'move' },
|
|
showNewFile: function () { return this.show === 'newFile' },
|
|
showNewDir: function () { return this.show === 'newDir' },
|
|
showDownload: function () { return this.show === 'download' },
|
|
showOverlay: function () {
|
|
return (this.show !== null && this.show !== 'search' && this.show !== 'more')
|
|
}
|
|
},
|
|
methods: {
|
|
resetPrompts () {
|
|
this.$store.commit('closeHovers')
|
|
}
|
|
}
|
|
}
|
|
</script>
|