This commit is contained in:
Elia Zammuto
2024-03-13 21:29:18 +01:00
committed by TheElixZammuto
parent 9ef63ca829
commit d1845df0ea
3 changed files with 61 additions and 14 deletions

View File

@@ -29,6 +29,11 @@
<a class="nav-link" href="/troubleshooting"><i class="fas fa-fw fa-info"></i> Troubleshooting</a>
</li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="#" @click="logout"><i class="fas fa-fw fa-right-from-bracket"></i> Logout</a>
</li>
</ul>
</div>
</div>
</nav>
@@ -74,6 +79,11 @@ export default {
methods: {
onLogin(){
this.modal.toggle();
},
logout(){
fetch("/api/logout",{method: "POST"}).then(r => {
document.location.href = '/';
})
}
}
}

View File

@@ -8,14 +8,16 @@
<body id="app">
<main role="main" style="max-width: 1200px; margin: 1em auto">
<div class="d-flex justify-content-center gap-4">
<div class="card p-4">
<div class="p-4 card">
<header>
<h1 class="mb-0">
<h1 class="mb-2">
<img src="/images/logo-sunshine-45.png" height="45" alt="" style="vertical-align: bottom;">
Welcome to Sunshine!
Hello, Sunshine!
</h1>
</header>
<Login-Form @loggedin="onLogin"></Login-Form>
</div>
<div>
<Resource-Card />
</div>
</div>
@@ -31,13 +33,13 @@
'ResourceCard': ResourceCard,
'LoginForm': LoginForm
},
data(){
data() {
return {
a: 1
}
},
mounted(){
console.log("Ciao!",this.$el)
mounted() {
console.log("Ciao!", this.$el)
},
methods: {
onLogin() {
@@ -45,6 +47,6 @@
}
}
});
console.log("App",app);
console.log("App", app);
app.mount("#app");
</script>