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

Former-commit-id: 9f1f09311813203910d5b323ba80712553ee2741 [formerly 0be00be1de305d786affc6bf0886aed9b20fbc51] [formerly 04597463117e94830b24b87faaaccf3d35284427 [formerly 3f2dc3f1c56a7a636a836d36b94c052f55f32d93]] Former-commit-id: 8d26cc1d96faed73c7974ea7e5e78bf268af3ad9 [formerly a083ac8f68c90a636843c3565bd349657c0ec383] Former-commit-id: ef10f3b3c388d65ceac40785b45dbac190a6cc99
52 lines
1.1 KiB
Vue
52 lines
1.1 KiB
Vue
<template>
|
|
<div class="prompt">
|
|
<h3>New directory</h3>
|
|
<p>Write the name of the new directory.</p>
|
|
<input autofocus type="text" @keyup.enter="submit" v-model.trim="name">
|
|
<div>
|
|
<button class="ok" @click="submit">Create</button>
|
|
<button class="cancel" @click="cancel">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import page from '../utils/page'
|
|
import webdav from '../utils/webdav'
|
|
|
|
export default {
|
|
name: 'new-dir-prompt',
|
|
data: function () {
|
|
return {
|
|
name: ''
|
|
}
|
|
},
|
|
methods: {
|
|
cancel: function () {
|
|
this.$store.commit('showNewDir', false)
|
|
},
|
|
submit: function (event) {
|
|
event.preventDefault()
|
|
if (this.new === '') return
|
|
|
|
let url = window.location.pathname + this.name + '/'
|
|
url = url.replace('//', '/')
|
|
|
|
// buttons.setLoading('newDir')
|
|
webdav.create(url)
|
|
.then(() => {
|
|
// buttons.setDone('newDir')
|
|
page.open(url)
|
|
})
|
|
.catch(e => {
|
|
// buttons.setDone('newDir', false)
|
|
console.log(e)
|
|
})
|
|
|
|
this.$store.commit('showNewDir', false)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|