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

Former-commit-id: 46ef678067f79997b35a86931a324e8404d4db98 [formerly 16e52ff387b32d4dcbec9bfe6132ea71192f331a] [formerly 985b6e3050f66c3131f1c62aab9a5dbe025437f2 [formerly fc71509dd032eb5cdbbfeb8de9a25d836bb2d61c]] Former-commit-id: acffffe9de1e64b90cc0cc0eb2dff9e367c70d88 [formerly af4f7056c6fb45b96e115b182e7ab2303fc39159] Former-commit-id: 17d369064f83ebf81d7374b92245c9003f86efbe
65 lines
1.9 KiB
Vue
65 lines
1.9 KiB
Vue
<template>
|
|
<nav>
|
|
<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('showPrompt', '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('showPrompt', '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>.</p>
|
|
</nav>
|
|
</template>
|
|
|
|
<script>
|
|
import {mapState} from 'vuex'
|
|
import auth from '@/utils/auth'
|
|
|
|
export default {
|
|
name: 'sidebar',
|
|
data: () => {
|
|
return {
|
|
plugins: []
|
|
}
|
|
},
|
|
computed: mapState(['user']),
|
|
mounted () {
|
|
if (window.plugins !== undefined || window.plugins !== null) {
|
|
this.plugins = window.plugins
|
|
}
|
|
},
|
|
methods: {
|
|
logout: auth.logout
|
|
}
|
|
}
|
|
</script>
|