Files
wolk/_assets/src/components/Sidebar.vue
Henrique Dias 231e1e1147 Updates on search and something
Former-commit-id: 229baefa76ee3202dcf4aac3249a461b6cc51eed [formerly 2773046c33eee1ff79ef1d02238de37e14860726] [formerly 2d50f10c3f809c6135cc861eaf0360092a23ea3f [formerly 14ff4f2b74c440888b632a6bacd338067dd0b588]]
Former-commit-id: e766887e65390514cf827700c3ab0d5ed000c480 [formerly 7429be72884d3eb154e45dc638fd17dfcfdfaa62]
Former-commit-id: d23373bf316295d6579e4bbc780f5b963c632c4d
2017-07-04 17:15:38 +01:00

69 lines
2.0 KiB
Vue

<template>
<nav :class="{active}">
<router-link class="action" to="/files/" aria-label="My Files" title="My Files">
<i class="material-icons">folder</i>
<span>My Files</span>
</router-link>
<div v-if="user.allowNew">
<button @click="$store.commit('showHover', 'newDir')" aria-label="New directory" title="New directory" class="action">
<i class="material-icons">create_new_folder</i>
<span>New folder</span>
</button>
<button @click="$store.commit('showHover', 'newFile')" aria-label="New file" title="New file" class="action">
<i class="material-icons">note_add</i>
<span>New file</span>
</button>
</div>
<div v-for="plugin in plugins">
<button v-for="action in plugin.sidebar" @click="action.click" :aria-label="action.name" :title="action.name" class="action">
<i class="material-icons">{{ action.icon }}</i>
<span>{{ action.name }}</span>
</button>
</div>
<div>
<router-link class="action" to="/dashboard" aria-label="Settings" title="Settings">
<i class="material-icons">settings_applications</i>
<span>Settings</span>
</router-link>
<button @click="logout" class="action" id="logout" aria-label="Log out" title="Logout">
<i class="material-icons">exit_to_app</i>
<span>Logout</span>
</button>
</div>
<p class="credits">Served with <a rel="noopener noreferrer" href="https://github.com/hacdias/caddy-filemanager">File Manager</a>.<br><a @click="help">Help</a></p>
</nav>
</template>
<script>
import {mapState} from 'vuex'
import auth from '@/utils/auth'
export default {
name: 'sidebar',
data: () => {
return {
plugins: [],
active: false
}
},
computed: mapState(['user']),
mounted () {
if (window.plugins !== undefined || window.plugins !== null) {
this.plugins = window.plugins
}
},
methods: {
help: function () {
this.$store.commit('showHover', 'help')
},
logout: auth.logout
}
}
</script>