Former-commit-id: 58fd027bfbc32198c39d87fe7e575229d33a65c8 [formerly 17779d3221cb765d4ce3a5aeccb551ddbfc56f19] [formerly 2f28a4e0bb119490a69968e3c6df29aa3779cc11 [formerly c6348931e0dcbc77e6cfea3d393a5a9c4c5bb1c7]] Former-commit-id: 70b4148b16b7c8ac43dc6cb3f38fe5e7062c2af8 [formerly fa369137715c436e5f110b931386f4f6556e9733] Former-commit-id: 760257fd5ce7b37f48c3848042fe33a4fdd7a905
66 lines
1.9 KiB
Vue
66 lines
1.9 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('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: [],
|
|
active: false
|
|
}
|
|
},
|
|
computed: mapState(['user']),
|
|
mounted () {
|
|
if (window.plugins !== undefined || window.plugins !== null) {
|
|
this.plugins = window.plugins
|
|
}
|
|
},
|
|
methods: {
|
|
logout: auth.logout
|
|
}
|
|
}
|
|
</script>
|