You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

77 lines
1.9 KiB

<urban-filemanager>
<div class="bucket-filemanager">
<div class="file-table">
<urban-filemanager-parent></urban-filemanager-parent>
<template each={ file in state.files }>
<urban-filemanager-file
if={ file.is_file }
file={ file }
handleClick={ handleFileClick }
handleMarked={ handleMarked }
></urban-filemanager-file>
<urban-filemanager-directory
if={ !file.is_file }
file={ file }
handleClick={ handleDirectoryClick }
handleMarked={ handleMarked }
></urban-filemanager-directory>
</template>
</div>
</div>
<script>
import axios from 'axios'
import File from './file.riot'
import Directory from './directory.riot'
import Parent from './parent.riot'
riot.register('urban-filemanager-file', File)
riot.register('urban-filemanager-directory', Directory)
riot.register('urban-filemanager-parent', Parent)
export default {
state: {
files: [
],
path: [
]
},
onBeforeMount(props, state) {
state.files = props.files
},
handleFileClick() {
},
/**
*
*
*
*/
handleDirectoryClick(event, file) {
this.state.path.push(file)
axios.get('/api/file/' + this.props.id, {
params: {
path: this.state.path.join('/')
}
}).then((response) => {
this.state.files = response.data.files
this.update()
})
},
handleMarked() {
console.log('ddd')
}
}
</script>
</urban-filemanager>