blob: 175b0aa0dc24a72c9d67826a2349d86acaafeca4 [file] [log] [blame]
Derick Montaguea2988f42020-01-17 13:46:30 -06001<template>
Yoshie Muranaka74f86872020-02-10 12:28:37 -08002 <div>
3 <div class="nav-container" :class="{ open: isNavigationOpen }">
Derick Montague68592032020-04-04 14:02:34 -05004 <nav ref="nav" :aria-label="$t('appNavigation.primaryNavigation')">
Yoshie Muranaka74f86872020-02-10 12:28:37 -08005 <b-nav vertical>
Yoshie Muranakae0b76c32020-02-28 14:18:20 -08006 <b-nav-item to="/">
7 <icon-overview />
8 {{ $t('appNavigation.overview') }}
9 </b-nav-item>
Derick Montague42c19892020-01-17 16:10:34 -060010
Yoshie Muranaka74f86872020-02-10 12:28:37 -080011 <li class="nav-item">
12 <b-button v-b-toggle.health-menu variant="link">
Yoshie Muranaka9fc3f902020-03-04 10:36:57 -080013 <icon-health />
14 {{ $t('appNavigation.health') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080015 <icon-expand class="icon-expand" />
16 </b-button>
17 <b-collapse id="health-menu" tag="ul" class="nav-item__nav">
Yoshie Muranaka6f102342020-05-05 09:45:39 -070018 <b-nav-item to="/health/event-logs">
19 {{ $t('appNavigation.eventLogs') }}
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080020 </b-nav-item>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070021 <b-nav-item to="/health/hardware-status">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080022 {{ $t('appNavigation.hardwareStatus') }}
23 </b-nav-item>
Yoshie Muranaka30abccb2020-03-11 12:44:24 -070024 <b-nav-item to="/health/sensors">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080025 {{ $t('appNavigation.sensors') }}
26 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080027 </b-collapse>
28 </li>
Derick Montague42c19892020-01-17 16:10:34 -060029
Yoshie Muranaka74f86872020-02-10 12:28:37 -080030 <li class="nav-item">
31 <b-button v-b-toggle.control-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080032 <icon-control />
33 {{ $t('appNavigation.control') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080034 <icon-expand class="icon-expand" />
35 </b-button>
36 <b-collapse id="control-menu" tag="ul" class="nav-item__nav">
Sukanya Pandey9055d982020-03-31 17:37:53 +053037 <b-nav-item to="/control/manage-power-usage">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080038 {{ $t('appNavigation.managePowerUsage') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080039 </b-nav-item>
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080040 <b-nav-item to="/control/reboot-bmc">
41 {{ $t('appNavigation.rebootBmc') }}
42 </b-nav-item>
Sukanya Pandey96f69ca2020-05-20 15:32:57 +053043 <b-nav-item to="/control/serial-over-lan">
44 {{ $t('appNavigation.serialOverLan') }}
45 </b-nav-item>
SurenNeware090c2d42020-04-01 14:07:27 +053046 <b-nav-item to="/control/server-led">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080047 {{ $t('appNavigation.serverLed') }}
48 </b-nav-item>
Yoshie Muranakafa1512b2020-02-25 15:54:07 -080049 <b-nav-item to="/control/server-power-operations">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080050 {{ $t('appNavigation.serverPowerOperations') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080051 </b-nav-item>
52 </b-collapse>
53 </li>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -080054
Yoshie Muranaka74f86872020-02-10 12:28:37 -080055 <li class="nav-item">
56 <b-button v-b-toggle.configuration-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080057 <icon-configuration />
58 {{ $t('appNavigation.configuration') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080059 <icon-expand class="icon-expand" />
60 </b-button>
61 <b-collapse id="configuration-menu" tag="ul" class="nav-item__nav">
Dixsie Wolmers739e4592020-06-05 07:00:06 -050062 <b-nav-item to="/configuration/date-time-settings">
63 {{ $t('appNavigation.dateTimeSettings') }}
64 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080065 <b-nav-item href="javascript:void(0)">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080066 {{ $t('appNavigation.firmware') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080067 </b-nav-item>
Dixsie Wolmersbb81d552020-02-26 19:52:28 -060068 <b-nav-item to="/configuration/network-settings">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080069 {{ $t('appNavigation.networkSettings') }}
70 </b-nav-item>
71 <b-nav-item href="javascript:void(0)">
72 {{ $t('appNavigation.snmpSettings') }}
73 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080074 </b-collapse>
75 </li>
Derick Montague42c19892020-01-17 16:10:34 -060076
Yoshie Muranaka74f86872020-02-10 12:28:37 -080077 <li class="nav-item">
78 <b-button v-b-toggle.access-control-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080079 <icon-access-control />
80 {{ $t('appNavigation.accessControl') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080081 <icon-expand class="icon-expand" />
82 </b-button>
83 <b-collapse id="access-control-menu" tag="ul" class="nav-item__nav">
Yoshie Muranakac4e38ab2020-04-09 12:41:27 -070084 <b-nav-item to="/access-control/ldap">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080085 {{ $t('appNavigation.ldap') }}
86 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080087 <b-nav-item to="/access-control/local-user-management">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080088 {{ $t('appNavigation.localUserManagement') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080089 </b-nav-item>
Yoshie Muranaka37393812020-03-24 15:25:24 -070090 <b-nav-item to="/access-control/ssl-certificates">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080091 {{ $t('appNavigation.sslCertificates') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080092 </b-nav-item>
93 </b-collapse>
94 </li>
95 </b-nav>
96 </nav>
97 </div>
98 <transition name="fade">
99 <div
100 v-if="isNavigationOpen"
Derick Montaguead2ceb62020-04-24 18:11:04 -0500101 id="nav-overlay"
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800102 class="nav-overlay"
103 @click="toggleIsOpen"
104 ></div>
105 </transition>
106 </div>
Derick Montaguea2988f42020-01-17 13:46:30 -0600107</template>
108
109<script>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800110import IconAnalytics from '@carbon/icons-vue/es/analytics/16';
111import IconDataCheck from '@carbon/icons-vue/es/data--check/16';
112import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16';
113import IconSettings from '@carbon/icons-vue/es/settings/16';
114import IconPassword from '@carbon/icons-vue/es/password/16';
115import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
Derick Montaguea2988f42020-01-17 13:46:30 -0600116
117export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -0600118 name: 'AppNavigation',
Derick Montague42c19892020-01-17 16:10:34 -0600119 components: {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800120 iconOverview: IconAnalytics,
121 iconHealth: IconDataCheck,
122 iconControl: IconSettingsAdjust,
123 iconConfiguration: IconSettings,
124 iconAccessControl: IconPassword,
125 iconExpand: IconChevronUp
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800126 },
127 data() {
128 return {
129 isNavigationOpen: false
130 };
131 },
132 watch: {
133 $route: function() {
134 this.isNavigationOpen = false;
135 },
136 isNavigationOpen: function(isNavigationOpen) {
137 this.$root.$emit('change:isNavigationOpen', isNavigationOpen);
138 }
139 },
140 mounted() {
141 this.$root.$on('toggle:navigation', () => this.toggleIsOpen());
142 },
143 methods: {
144 toggleIsOpen() {
145 this.isNavigationOpen = !this.isNavigationOpen;
146 }
Derick Montague42c19892020-01-17 16:10:34 -0600147 }
Derick Montaguea2988f42020-01-17 13:46:30 -0600148};
149</script>
Derick Montague42c19892020-01-17 16:10:34 -0600150
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800151<style scoped lang="scss">
Derick Montague40865722020-04-13 17:01:19 -0500152@import 'src/assets/styles/helpers';
153
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800154svg {
Derick Montague66f903f2020-02-28 11:22:31 -0600155 fill: currentColor;
156 height: 1.2rem;
157 width: 1.2rem;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800158 margin-left: 0 !important; //!important overriding button specificity
159 vertical-align: text-bottom;
160 &:not(.icon-expand) {
161 margin-right: $spacer;
162 }
163}
164
165.nav {
SurenNeware057232b2020-06-08 20:53:26 +0530166 padding-top: $spacer / 4;
167 @include media-breakpoint-up($responsive-layout-bp) {
168 padding-top: $spacer;
169 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800170}
171
172.nav-item__nav {
Derick Montague42c19892020-01-17 16:10:34 -0600173 list-style: none;
174 padding-left: 0;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800175 margin-left: 0;
176
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700177 .nav-item {
178 outline: none;
179 }
180
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800181 .nav-link {
182 padding-left: $spacer * 4;
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700183 outline: none;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800184
185 &:not(.nav-link--current) {
186 font-weight: normal;
187 }
188 }
189}
190
191.btn-link {
192 width: 100%;
193 text-align: left;
194 text-decoration: none !important;
195 border-radius: 0;
196
197 &.collapsed {
198 .icon-expand {
199 transform: rotate(180deg);
200 }
201 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800202}
203
204.icon-expand {
205 float: right;
206 margin-top: $spacer / 4;
207}
208
209.btn-link,
210.nav-link {
211 position: relative;
212 font-weight: $headings-font-weight;
213 padding-left: $spacer; // defining consistent padding for links and buttons
214 padding-right: $spacer;
Derick Montague7f970a12020-03-02 17:56:09 -0600215 color: $secondary;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800216
217 &:hover {
Derick Montague66f903f2020-02-28 11:22:31 -0600218 background-color: $primary-nav-hover;
Derick Montague7f970a12020-03-02 17:56:09 -0600219 color: $dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800220 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800221
222 &:focus {
223 box-shadow: $btn-focus-box-shadow;
Derick Montague7f970a12020-03-02 17:56:09 -0600224 color: $dark;
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800225 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800226}
227
Derick Montague66f903f2020-02-28 11:22:31 -0600228.nav-link--current,
229.nav-link--current:hover,
230.nav-link--current:focus {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800231 font-weight: $headings-font-weight;
Derick Montague7f970a12020-03-02 17:56:09 -0600232 background-color: $secondary;
233 color: $light;
Derick Montague66f903f2020-02-28 11:22:31 -0600234 cursor: default;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800235
236 &::before {
237 content: '';
238 position: absolute;
239 top: 0;
240 bottom: 0;
241 left: 0;
242 width: 4px;
243 background-color: $primary;
244 }
Derick Montague42c19892020-01-17 16:10:34 -0600245}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800246
247.nav-container {
248 position: fixed;
249 width: $navigation-width;
250 top: $header-height;
251 bottom: 0;
252 left: 0;
253 z-index: $zindex-fixed;
254 overflow-y: auto;
Derick Montague66f903f2020-02-28 11:22:31 -0600255 background-color: $container-bgd;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800256 transform: translateX(-$navigation-width);
257 transition: transform $exit-easing--productive $duration--moderate-02;
SurenNeware057232b2020-06-08 20:53:26 +0530258 @include media-breakpoint-down(md) {
259 z-index: $zindex-fixed + 2;
260 }
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800261
Derick Montague74466b82020-06-28 10:17:32 -0500262 &.open,
263 &:focus-within {
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800264 transform: translateX(0);
265 transition-timing-function: $entrance-easing--productive;
266 }
267
268 @include media-breakpoint-up($responsive-layout-bp) {
269 transition-duration: $duration--fast-01;
270 transform: translateX(0);
271 }
272}
273
274.nav-overlay {
275 position: fixed;
276 top: $header-height;
277 bottom: 0;
278 left: 0;
279 right: 0;
SurenNeware057232b2020-06-08 20:53:26 +0530280 z-index: $zindex-fixed + 1;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800281 background-color: $black;
282 opacity: 0.5;
283
284 &.fade-enter-active {
285 transition: opacity $duration--moderate-02 $entrance-easing--productive;
286 }
287
288 &.fade-leave-active {
289 transition: opacity $duration--fast-02 $exit-easing--productive;
290 }
291
292 &.fade-enter,
293 &.fade-leave-to {
294 opacity: 0;
295 }
296
297 @include media-breakpoint-up($responsive-layout-bp) {
298 display: none;
299 }
300}
Derick Montague42c19892020-01-17 16:10:34 -0600301</style>