2020-07-06 19:08:34 +02:00
|
|
|
<template>
|
2020-07-15 16:39:24 +02:00
|
|
|
<div id="app" class="container">
|
|
|
|
<header>
|
|
|
|
<b-navbar>
|
2020-09-27 15:18:07 +02:00
|
|
|
<b-navbar-brand :to="{ name: 'home' }" exact exact-active-class="active">
|
2020-07-15 16:39:24 +02:00
|
|
|
<img alt="Yunohost logo" src="./assets/logo.png">
|
|
|
|
</b-navbar-brand>
|
|
|
|
<b-navbar-nav class="ml-auto">
|
|
|
|
<li class="nav-item">
|
|
|
|
<b-button href="/yunohost/sso"
|
|
|
|
variant="primary" size="sm" block
|
|
|
|
>
|
|
|
|
{{ $t('user_interface_link') }} <icon iname="user" />
|
|
|
|
</b-button>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item" v-show="connected">
|
|
|
|
<b-button @click.prevent="logout" to="/logout"
|
|
|
|
variant="outline-dark" block size="sm"
|
|
|
|
>
|
|
|
|
{{ $t('logout') }} <icon iname="sign-out" />
|
|
|
|
</b-button>
|
|
|
|
</li>
|
|
|
|
</b-navbar-nav>
|
|
|
|
</b-navbar>
|
|
|
|
</header>
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-27 11:19:32 +02:00
|
|
|
<breadcrumb v-if="$route.meta.breadcrumb" />
|
|
|
|
|
|
|
|
<main id="main">
|
2020-09-27 15:18:07 +02:00
|
|
|
<router-view />
|
2020-07-15 16:39:24 +02:00
|
|
|
</main>
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
<footer>
|
|
|
|
<nav>
|
2020-09-27 15:18:07 +02:00
|
|
|
<b-nav class="justify-content-center">
|
2020-07-15 16:39:24 +02:00
|
|
|
<b-nav-item href="https://yunohost.org/docs" target="_blank" link-classes="text-secondary">
|
2020-09-27 15:18:07 +02:00
|
|
|
<icon iname="book" /> {{ $t('footer.documentation') }}
|
2020-07-15 16:39:24 +02:00
|
|
|
</b-nav-item>
|
|
|
|
<b-nav-item href="https://yunohost.org/help" target="_blank" link-classes="text-secondary">
|
2020-09-27 15:18:07 +02:00
|
|
|
<icon iname="life-ring" /> {{ $t('footer.help') }}
|
2020-07-15 16:39:24 +02:00
|
|
|
</b-nav-item>
|
|
|
|
<b-nav-item href="https://donate.yunohost.org/" target="_blank" link-classes="text-secondary">
|
2020-09-27 15:18:07 +02:00
|
|
|
<icon iname="heart" /> {{ $t('footer.donate') }}
|
2020-07-15 16:39:24 +02:00
|
|
|
</b-nav-item>
|
2020-09-27 15:18:07 +02:00
|
|
|
<i18n
|
|
|
|
v-if="yunohost" path="footer.version" tag="b-nav-text"
|
|
|
|
id="yunohost-version" class="ml-md-auto text-center"
|
2020-07-15 16:39:24 +02:00
|
|
|
>
|
|
|
|
<template v-slot:ynh>
|
|
|
|
<b-link href="https://yunohost.org">
|
|
|
|
YunoHost
|
|
|
|
</b-link>
|
|
|
|
</template>
|
|
|
|
<template v-slot:version>
|
2020-08-27 18:30:45 +02:00
|
|
|
{{ yunohost.version }}
|
2020-07-15 16:39:24 +02:00
|
|
|
</template>
|
|
|
|
<template v-slot:repo>
|
2020-08-27 18:30:45 +02:00
|
|
|
{{ yunohost.repo }}
|
2020-07-15 16:39:24 +02:00
|
|
|
</template>
|
|
|
|
</i18n>
|
|
|
|
</b-nav>
|
|
|
|
</nav>
|
|
|
|
</footer>
|
|
|
|
</div>
|
2020-07-06 19:08:34 +02:00
|
|
|
</template>
|
2020-07-07 13:54:01 +02:00
|
|
|
|
2020-07-10 18:42:40 +02:00
|
|
|
<script>
|
2020-08-27 18:30:45 +02:00
|
|
|
import { mapGetters } from 'vuex'
|
2020-07-10 18:42:40 +02:00
|
|
|
|
|
|
|
export default {
|
2020-07-15 16:39:24 +02:00
|
|
|
name: 'App',
|
2020-08-28 18:54:18 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
computed: {
|
2020-08-27 18:30:45 +02:00
|
|
|
...mapGetters(['connected', 'yunohost'])
|
2020-07-15 16:39:24 +02:00
|
|
|
},
|
2020-08-28 18:54:18 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
methods: {
|
|
|
|
async logout () {
|
2020-09-27 15:18:07 +02:00
|
|
|
this.$store.dispatch('LOGOUT')
|
2020-07-15 16:39:24 +02:00
|
|
|
}
|
|
|
|
},
|
2020-08-28 18:54:18 +02:00
|
|
|
|
|
|
|
// This hook is only triggered at page first load
|
2020-07-15 16:39:24 +02:00
|
|
|
async created () {
|
2020-08-28 18:54:18 +02:00
|
|
|
// From this hook the value of `connected` always come from the localStorage.
|
2020-09-27 15:18:07 +02:00
|
|
|
// This state may be `true` but session may have expired, by querying
|
|
|
|
// yunohost infos, api may respond with `Unauthorized` in which case the `connected`
|
|
|
|
// state will be automaticly reseted and user will be prompt with the login view.
|
|
|
|
if (this.connected) {
|
|
|
|
this.$store.dispatch('GET_YUNOHOST_INFOS')
|
2020-07-15 16:39:24 +02:00
|
|
|
}
|
|
|
|
}
|
2020-07-10 18:42:40 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-07-07 13:54:01 +02:00
|
|
|
<style lang="scss">
|
|
|
|
@import '@/scss/main.scss';
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-14 22:44:09 +02:00
|
|
|
#app > header {
|
2020-07-16 14:49:34 +02:00
|
|
|
border-bottom: $thin-border;
|
2020-07-15 16:39:24 +02:00
|
|
|
padding-top: 1rem;
|
|
|
|
margin-bottom: 1rem;
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
.navbar {
|
|
|
|
padding: 1rem 0;
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
img {
|
|
|
|
width: 70px;
|
|
|
|
}
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
.navbar-nav {
|
|
|
|
flex-direction: column;
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
li {
|
|
|
|
margin: .2rem 0;
|
|
|
|
}
|
|
|
|
icon {
|
|
|
|
margin-left: .5rem;
|
|
|
|
}
|
2020-07-07 18:56:12 +02:00
|
|
|
}
|
2020-07-15 16:39:24 +02:00
|
|
|
}
|
2020-07-07 18:56:12 +02:00
|
|
|
}
|
|
|
|
|
2020-07-14 22:44:09 +02:00
|
|
|
#app > footer {
|
2020-07-15 16:39:24 +02:00
|
|
|
padding: 1rem 0;
|
|
|
|
border-top: 1px solid #eee;
|
|
|
|
font-size: 0.875rem;
|
|
|
|
margin-top: 2rem;
|
2020-07-07 18:56:12 +02:00
|
|
|
|
2020-07-15 16:39:24 +02:00
|
|
|
.nav-item {
|
|
|
|
& + .nav-item a::before {
|
|
|
|
content: "•";
|
|
|
|
width: 1rem;
|
|
|
|
display: inline-block;
|
|
|
|
margin-left: -1.15rem;
|
|
|
|
}
|
|
|
|
&:first-child {
|
|
|
|
margin-left: -1rem;
|
2020-07-07 18:56:12 +02:00
|
|
|
}
|
2020-07-15 16:39:24 +02:00
|
|
|
}
|
2020-07-07 18:56:12 +02:00
|
|
|
}
|
2020-07-07 13:54:01 +02:00
|
|
|
</style>
|