frequi_origin/src/App.vue

93 lines
1.9 KiB
Vue
Raw Normal View History

2020-05-04 04:31:12 +00:00
<template>
<div id="app">
2020-05-04 18:34:59 +00:00
<header class="bg-secondary">
2020-05-04 05:20:02 +00:00
<nav class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
2020-05-06 05:09:27 +00:00
<h3 class="text-white header-title">
<img class="logo" src="./assets/freqtrade-logo.png" alt />
Freqtrade UI
</h3>
2020-05-06 19:24:12 +00:00
<ul class="navbar-nav mr-auto">
2020-05-06 05:09:27 +00:00
<li>
<router-link to="/" exact>Home</router-link>
</li>
<li>
<router-link to="/trade">Trade</router-link>
</li>
<li>
<router-link to="/about">About</router-link>
2020-05-04 04:50:09 +00:00
</li>
</ul>
2020-05-06 19:24:12 +00:00
<ul class="navbar-nav ">
<li class="nav-item" v-if="loggedIn">
<router-link to="/" v-on:click.native="logout()">Logout</router-link>
</li>
<li class="nav-item" v-else>
<!-- should open Modal window! -->
2020-05-07 17:45:12 +00:00
<Login />
2020-05-06 19:24:12 +00:00
</li>
</ul>
2020-05-04 04:50:09 +00:00
</nav>
</header>
2020-05-04 18:56:11 +00:00
<main class="container-fluid">
2020-05-06 05:09:27 +00:00
<router-view />
2020-05-04 05:20:02 +00:00
</main>
2020-05-04 04:31:12 +00:00
</div>
</template>
2020-05-06 19:24:12 +00:00
<script>
import { mapActions, mapState } from 'vuex';
2020-05-07 17:45:12 +00:00
import Login from './views/Login.vue';
2020-05-04 04:31:12 +00:00
2020-05-06 19:24:12 +00:00
export default {
2020-05-07 17:45:12 +00:00
components: { Login },
2020-05-06 19:24:12 +00:00
computed: {
...mapState('user', ['loggedIn']),
},
methods: {
...mapActions('user', ['logout']),
},
};
</script>
2020-05-06 05:09:27 +00:00
<style scoped>
2020-05-04 04:31:12 +00:00
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
2020-05-04 04:50:09 +00:00
}
2020-05-06 05:09:27 +00:00
.logo {
vertical-align: middle;
height: 30px;
}
.header-title {
margin-right: 2em;
}
#nav {
padding: 30px;
2020-05-04 04:50:09 +00:00
}
2020-05-06 05:09:27 +00:00
2020-05-04 04:50:09 +00:00
ul {
padding: 3px;
display: flex;
2020-05-06 05:09:27 +00:00
list-style-type: none;
2020-05-04 04:50:09 +00:00
}
2020-05-06 05:09:27 +00:00
li {
margin-right: 15px;
}
.router-link-active {
color: white;
2020-05-04 04:50:09 +00:00
}
2020-05-06 05:09:27 +00:00
nav a {
color: #ccc;
2020-05-04 04:31:12 +00:00
}
</style>
<style>
/* Global styles - populating to child elementes */
.card-header {
font-size: 1.3em;
}
</style>