2017-06-28 10:45:41 +00:00
|
|
|
<template>
|
|
|
|
<div id="app">
|
|
|
|
<header>
|
2017-06-28 18:26:07 +00:00
|
|
|
<div id="first-bar">
|
|
|
|
<img src="./assets/logo.svg" alt="File Manager">
|
|
|
|
<search></search>
|
|
|
|
</div>
|
|
|
|
<div id="second-bar">
|
|
|
|
<info-button></info-button>
|
|
|
|
</div>
|
|
|
|
<!-- <div id="click-overlay"></div> -->
|
2017-06-28 10:45:41 +00:00
|
|
|
</header>
|
|
|
|
<nav id="sidebar">
|
2017-06-28 15:05:30 +00:00
|
|
|
<a class="action" :href="baseURL + '/'">
|
2017-06-28 10:45:41 +00:00
|
|
|
<i class="material-icons">folder</i>
|
|
|
|
<span>My Files</span>
|
|
|
|
</a>
|
|
|
|
<div class="action" id="logout" tabindex="0" role="button" aria-label="Log out">
|
|
|
|
<i class="material-icons" title="Logout">exit_to_app</i>
|
|
|
|
<span>Logout</span>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
<main>
|
2017-06-28 15:05:30 +00:00
|
|
|
<listing v-if="page.kind == 'listing'"></listing>
|
2017-06-28 10:45:41 +00:00
|
|
|
</main>
|
|
|
|
|
2017-06-28 15:05:30 +00:00
|
|
|
<preview v-if="page.kind == 'preview'"></preview>
|
2017-06-28 10:45:41 +00:00
|
|
|
|
|
|
|
<div class="overlay"></div>
|
|
|
|
<!-- TODO: show on listing and allowedit -->
|
|
|
|
<div class="floating">
|
|
|
|
<div tabindex="0" role="button" class="action" id="new">
|
|
|
|
<i class="material-icons" title="New file or directory">add</i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- TODO ??? -->
|
|
|
|
<div id="multiple-selection" class="mobile-only">
|
|
|
|
<p>Multiple selection enabled</p>
|
|
|
|
<div tabindex="0" role="button" class="action" id="multiple-selection-cancel">
|
|
|
|
<i class="material-icons" title="Clear">clear</i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<footer>Served with <a rel="noopener noreferrer" href="https://github.com/hacdias/caddy-filemanager">File Manager</a>.</footer>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Search from './components/Search'
|
|
|
|
import Preview from './components/Preview'
|
|
|
|
import Listing from './components/Listing'
|
2017-06-28 18:26:07 +00:00
|
|
|
import InfoButton from './components/InfoButton'
|
2017-06-28 15:05:30 +00:00
|
|
|
import css from './css.js'
|
|
|
|
|
|
|
|
function updateColumnSizes () {
|
|
|
|
let columns = Math.floor(document.querySelector('main').offsetWidth / 300)
|
|
|
|
let items = css(['#listing.mosaic .item', '.mosaic#listing .item'])
|
|
|
|
|
|
|
|
items.style.width = `calc(${100 / columns}% - 1em)`
|
|
|
|
}
|
2017-06-28 10:45:41 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'app',
|
2017-06-28 18:26:07 +00:00
|
|
|
components: { Search, Preview, Listing, InfoButton },
|
2017-06-28 15:05:30 +00:00
|
|
|
mounted: function () {
|
|
|
|
updateColumnSizes()
|
|
|
|
window.addEventListener('resize', updateColumnSizes)
|
2017-06-28 15:18:22 +00:00
|
|
|
window.history.replaceState({ url: window.location.pathname, name: document.title }, document.title, window.location.pathname)
|
2017-06-28 10:45:41 +00:00
|
|
|
},
|
2017-06-28 15:05:30 +00:00
|
|
|
data: function () {
|
|
|
|
return window.info
|
2017-06-28 10:45:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
@import './css/styles.css';
|
|
|
|
</style>
|