blob: 9c5295ad151f0e126249bf0975fb1478da29bc1e [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>
SurenNeware090c2d42020-04-01 14:07:27 +053043 <b-nav-item to="/control/server-led">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080044 {{ $t('appNavigation.serverLed') }}
45 </b-nav-item>
Yoshie Muranakafa1512b2020-02-25 15:54:07 -080046 <b-nav-item to="/control/server-power-operations">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080047 {{ $t('appNavigation.serverPowerOperations') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080048 </b-nav-item>
49 </b-collapse>
50 </li>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -080051
Yoshie Muranaka74f86872020-02-10 12:28:37 -080052 <li class="nav-item">
53 <b-button v-b-toggle.configuration-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080054 <icon-configuration />
55 {{ $t('appNavigation.configuration') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080056 <icon-expand class="icon-expand" />
57 </b-button>
58 <b-collapse id="configuration-menu" tag="ul" class="nav-item__nav">
Yoshie Muranaka74f86872020-02-10 12:28:37 -080059 <b-nav-item href="javascript:void(0)">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080060 {{ $t('appNavigation.firmware') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080061 </b-nav-item>
Dixsie Wolmersbb81d552020-02-26 19:52:28 -060062 <b-nav-item to="/configuration/network-settings">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080063 {{ $t('appNavigation.networkSettings') }}
64 </b-nav-item>
65 <b-nav-item href="javascript:void(0)">
66 {{ $t('appNavigation.snmpSettings') }}
67 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080068 </b-collapse>
69 </li>
Derick Montague42c19892020-01-17 16:10:34 -060070
Yoshie Muranaka74f86872020-02-10 12:28:37 -080071 <li class="nav-item">
72 <b-button v-b-toggle.access-control-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080073 <icon-access-control />
74 {{ $t('appNavigation.accessControl') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080075 <icon-expand class="icon-expand" />
76 </b-button>
77 <b-collapse id="access-control-menu" tag="ul" class="nav-item__nav">
Yoshie Muranakac4e38ab2020-04-09 12:41:27 -070078 <b-nav-item to="/access-control/ldap">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080079 {{ $t('appNavigation.ldap') }}
80 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080081 <b-nav-item to="/access-control/local-user-management">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080082 {{ $t('appNavigation.localUserManagement') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080083 </b-nav-item>
Yoshie Muranaka37393812020-03-24 15:25:24 -070084 <b-nav-item to="/access-control/ssl-certificates">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080085 {{ $t('appNavigation.sslCertificates') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080086 </b-nav-item>
87 </b-collapse>
88 </li>
89 </b-nav>
90 </nav>
91 </div>
92 <transition name="fade">
93 <div
94 v-if="isNavigationOpen"
Derick Montaguead2ceb62020-04-24 18:11:04 -050095 id="nav-overlay"
Yoshie Muranaka74f86872020-02-10 12:28:37 -080096 class="nav-overlay"
97 @click="toggleIsOpen"
98 ></div>
99 </transition>
100 </div>
Derick Montaguea2988f42020-01-17 13:46:30 -0600101</template>
102
103<script>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800104import IconAnalytics from '@carbon/icons-vue/es/analytics/16';
105import IconDataCheck from '@carbon/icons-vue/es/data--check/16';
106import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16';
107import IconSettings from '@carbon/icons-vue/es/settings/16';
108import IconPassword from '@carbon/icons-vue/es/password/16';
109import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
Derick Montaguea2988f42020-01-17 13:46:30 -0600110
111export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -0600112 name: 'AppNavigation',
Derick Montague42c19892020-01-17 16:10:34 -0600113 components: {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800114 iconOverview: IconAnalytics,
115 iconHealth: IconDataCheck,
116 iconControl: IconSettingsAdjust,
117 iconConfiguration: IconSettings,
118 iconAccessControl: IconPassword,
119 iconExpand: IconChevronUp
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800120 },
121 data() {
122 return {
123 isNavigationOpen: false
124 };
125 },
126 watch: {
127 $route: function() {
128 this.isNavigationOpen = false;
129 },
130 isNavigationOpen: function(isNavigationOpen) {
131 this.$root.$emit('change:isNavigationOpen', isNavigationOpen);
132 }
133 },
134 mounted() {
135 this.$root.$on('toggle:navigation', () => this.toggleIsOpen());
136 },
137 methods: {
138 toggleIsOpen() {
139 this.isNavigationOpen = !this.isNavigationOpen;
140 }
Derick Montague42c19892020-01-17 16:10:34 -0600141 }
Derick Montaguea2988f42020-01-17 13:46:30 -0600142};
143</script>
Derick Montague42c19892020-01-17 16:10:34 -0600144
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800145<style scoped lang="scss">
Derick Montague40865722020-04-13 17:01:19 -0500146@import 'src/assets/styles/helpers';
147
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800148svg {
Derick Montague66f903f2020-02-28 11:22:31 -0600149 fill: currentColor;
150 height: 1.2rem;
151 width: 1.2rem;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800152 margin-left: 0 !important; //!important overriding button specificity
153 vertical-align: text-bottom;
154 &:not(.icon-expand) {
155 margin-right: $spacer;
156 }
157}
158
159.nav {
SurenNeware057232b2020-06-08 20:53:26 +0530160 padding-top: $spacer / 4;
161 @include media-breakpoint-up($responsive-layout-bp) {
162 padding-top: $spacer;
163 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800164}
165
166.nav-item__nav {
Derick Montague42c19892020-01-17 16:10:34 -0600167 list-style: none;
168 padding-left: 0;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800169 margin-left: 0;
170
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700171 .nav-item {
172 outline: none;
173 }
174
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800175 .nav-link {
176 padding-left: $spacer * 4;
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700177 outline: none;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800178
179 &:not(.nav-link--current) {
180 font-weight: normal;
181 }
182 }
183}
184
185.btn-link {
186 width: 100%;
187 text-align: left;
188 text-decoration: none !important;
189 border-radius: 0;
190
191 &.collapsed {
192 .icon-expand {
193 transform: rotate(180deg);
194 }
195 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800196}
197
198.icon-expand {
199 float: right;
200 margin-top: $spacer / 4;
201}
202
203.btn-link,
204.nav-link {
205 position: relative;
206 font-weight: $headings-font-weight;
207 padding-left: $spacer; // defining consistent padding for links and buttons
208 padding-right: $spacer;
Derick Montague7f970a12020-03-02 17:56:09 -0600209 color: $secondary;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800210
211 &:hover {
Derick Montague66f903f2020-02-28 11:22:31 -0600212 background-color: $primary-nav-hover;
Derick Montague7f970a12020-03-02 17:56:09 -0600213 color: $dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800214 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800215
216 &:focus {
217 box-shadow: $btn-focus-box-shadow;
Derick Montague7f970a12020-03-02 17:56:09 -0600218 color: $dark;
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800219 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800220}
221
Derick Montague66f903f2020-02-28 11:22:31 -0600222.nav-link--current,
223.nav-link--current:hover,
224.nav-link--current:focus {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800225 font-weight: $headings-font-weight;
Derick Montague7f970a12020-03-02 17:56:09 -0600226 background-color: $secondary;
227 color: $light;
Derick Montague66f903f2020-02-28 11:22:31 -0600228 cursor: default;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800229
230 &::before {
231 content: '';
232 position: absolute;
233 top: 0;
234 bottom: 0;
235 left: 0;
236 width: 4px;
237 background-color: $primary;
238 }
Derick Montague42c19892020-01-17 16:10:34 -0600239}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800240
241.nav-container {
242 position: fixed;
243 width: $navigation-width;
244 top: $header-height;
245 bottom: 0;
246 left: 0;
247 z-index: $zindex-fixed;
248 overflow-y: auto;
Derick Montague66f903f2020-02-28 11:22:31 -0600249 background-color: $container-bgd;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800250 transform: translateX(-$navigation-width);
251 transition: transform $exit-easing--productive $duration--moderate-02;
SurenNeware057232b2020-06-08 20:53:26 +0530252 @include media-breakpoint-down(md) {
253 z-index: $zindex-fixed + 2;
254 }
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800255
Derick Montague74466b82020-06-28 10:17:32 -0500256 &.open,
257 &:focus-within {
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800258 transform: translateX(0);
259 transition-timing-function: $entrance-easing--productive;
260 }
261
262 @include media-breakpoint-up($responsive-layout-bp) {
263 transition-duration: $duration--fast-01;
264 transform: translateX(0);
265 }
266}
267
268.nav-overlay {
269 position: fixed;
270 top: $header-height;
271 bottom: 0;
272 left: 0;
273 right: 0;
SurenNeware057232b2020-06-08 20:53:26 +0530274 z-index: $zindex-fixed + 1;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800275 background-color: $black;
276 opacity: 0.5;
277
278 &.fade-enter-active {
279 transition: opacity $duration--moderate-02 $entrance-easing--productive;
280 }
281
282 &.fade-leave-active {
283 transition: opacity $duration--fast-02 $exit-easing--productive;
284 }
285
286 &.fade-enter,
287 &.fade-leave-to {
288 opacity: 0;
289 }
290
291 @include media-breakpoint-up($responsive-layout-bp) {
292 display: none;
293 }
294}
Derick Montague42c19892020-01-17 16:10:34 -0600295</style>