Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 1 | <template> |
| 2 | <div> |
| 3 | <a href="#main-content">Skip to main content</a> |
| 4 | <header> |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 5 | <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 Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame^] | 10 | <b-nav-item @click="logout"> |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 11 | <user-avatar-20 /> |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame^] | 12 | Logout |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 13 | </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 Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 48 | </b-navbar> |
| 49 | </header> |
| 50 | </div> |
| 51 | </template> |
| 52 | |
| 53 | <script> |
| 54 | import UserAvatar20 from "@carbon/icons-vue/es/user--avatar/20"; |
| 55 | import Renew20 from "@carbon/icons-vue/es/renew/20"; |
| 56 | export default { |
| 57 | name: "AppHeader", |
| 58 | components: { Renew20, UserAvatar20 }, |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 59 | created() { |
| 60 | this.getHostInfo(); |
| 61 | }, |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 62 | data() { |
| 63 | return { |
| 64 | orgName: "OpenBMC", |
| 65 | serverName: "Server Name", |
| 66 | ipAddress: "127.0.0.0" |
| 67 | }; |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 68 | }, |
| 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 Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame^] | 80 | }, |
| 81 | logout() { |
| 82 | this.$store.dispatch("authentication/logout").then(() => { |
| 83 | this.$router.push("/login"); |
| 84 | }); |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 85 | } |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 86 | } |
| 87 | }; |
| 88 | </script> |
| 89 | |
Yoshie Muranaka | b8b6f79 | 2019-12-03 14:47:32 -0800 | [diff] [blame] | 90 | <style lang="scss" scoped> |
| 91 | .navbar-text { |
| 92 | padding: 0; |
| 93 | } |
| 94 | </style> |