blob: 8dacd03d947afd3ed9ce31f0dcef5e5bb205765a [file] [log] [blame]
Derick Montaguea2988f42020-01-17 13:46:30 -06001<template>
2 <div>
3 <a href="#main-content">Skip to main content</a>
4 <header>
Yoshie Muranakab8b6f792019-12-03 14:47:32 -08005 <b-navbar toggleable="lg" variant="dark" type="dark">
6 <b-navbar-nav small>
7 <b-nav-text>BMC System Management</b-nav-text>
8 </b-navbar-nav>
9 <b-navbar-nav small class="ml-auto">
Derick Montaguee080a1a2019-12-04 16:30:08 -060010 <b-nav-item @click="logout">
Derick Montaguea2988f42020-01-17 13:46:30 -060011 <user-avatar-20 />
Derick Montaguee080a1a2019-12-04 16:30:08 -060012 Logout
Yoshie Muranakab8b6f792019-12-03 14:47:32 -080013 </b-nav-item>
14 </b-navbar-nav>
15 </b-navbar>
16 <b-navbar toggleable="lg" variant="light">
17 <b-navbar-nav>
18 <b-navbar-brand href="/">
19 {{ orgName }}
20 </b-navbar-brand>
21 </b-navbar-nav>
22 <b-navbar-nav>
23 <b-nav-text>{{ hostName }}</b-nav-text>
24 <b-nav-text>{{ ipAddress }}</b-nav-text>
25 </b-navbar-nav>
26 <b-navbar-nav class="ml-auto">
27 <b-nav>
28 <b-nav-item>
29 <b-button variant="link">
30 Server health
31 <b-badge pill variant="danger">Critical</b-badge>
32 </b-button>
33 </b-nav-item>
34 <b-nav-item>
35 <b-button variant="link">
36 Server power
37 <b-badge pill variant="success">Running</b-badge>
38 </b-button>
39 </b-nav-item>
40 <b-nav-item>
41 <b-button variant="link">
42 <Renew20 />
43 Refresh Data
44 </b-button>
45 </b-nav-item>
46 </b-nav>
47 </b-navbar-nav>
Derick Montaguea2988f42020-01-17 13:46:30 -060048 </b-navbar>
49 </header>
50 </div>
51</template>
52
53<script>
54import UserAvatar20 from "@carbon/icons-vue/es/user--avatar/20";
55import Renew20 from "@carbon/icons-vue/es/renew/20";
56export default {
57 name: "AppHeader",
58 components: { Renew20, UserAvatar20 },
Yoshie Muranakab8b6f792019-12-03 14:47:32 -080059 created() {
60 this.getHostInfo();
61 },
Derick Montaguea2988f42020-01-17 13:46:30 -060062 data() {
63 return {
64 orgName: "OpenBMC",
65 serverName: "Server Name",
66 ipAddress: "127.0.0.0"
67 };
Yoshie Muranakab8b6f792019-12-03 14:47:32 -080068 },
69 computed: {
70 hostName() {
71 return this.$store.getters["global/hostName"];
72 },
73 hostStatus() {
74 return this.$store.getters["global/hostStatus"];
75 }
76 },
77 methods: {
78 getHostInfo() {
79 this.$store.dispatch("global/getHostName");
Derick Montaguee080a1a2019-12-04 16:30:08 -060080 },
81 logout() {
82 this.$store.dispatch("authentication/logout").then(() => {
83 this.$router.push("/login");
84 });
Yoshie Muranakab8b6f792019-12-03 14:47:32 -080085 }
Derick Montaguea2988f42020-01-17 13:46:30 -060086 }
87};
88</script>
89
Yoshie Muranakab8b6f792019-12-03 14:47:32 -080090<style lang="scss" scoped>
91.navbar-text {
92 padding: 0;
93}
94</style>