blob: 1dfba11e253d9b027501863dace11d0175013871 [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">
Yoshie Muranaka74f86872020-02-10 12:28:37 -080062 <b-nav-item href="javascript:void(0)">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080063 {{ $t('appNavigation.firmware') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080064 </b-nav-item>
Dixsie Wolmersbb81d552020-02-26 19:52:28 -060065 <b-nav-item to="/configuration/network-settings">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080066 {{ $t('appNavigation.networkSettings') }}
67 </b-nav-item>
68 <b-nav-item href="javascript:void(0)">
69 {{ $t('appNavigation.snmpSettings') }}
70 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080071 </b-collapse>
72 </li>
Derick Montague42c19892020-01-17 16:10:34 -060073
Yoshie Muranaka74f86872020-02-10 12:28:37 -080074 <li class="nav-item">
75 <b-button v-b-toggle.access-control-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080076 <icon-access-control />
77 {{ $t('appNavigation.accessControl') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080078 <icon-expand class="icon-expand" />
79 </b-button>
80 <b-collapse id="access-control-menu" tag="ul" class="nav-item__nav">
Yoshie Muranakac4e38ab2020-04-09 12:41:27 -070081 <b-nav-item to="/access-control/ldap">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080082 {{ $t('appNavigation.ldap') }}
83 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080084 <b-nav-item to="/access-control/local-user-management">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080085 {{ $t('appNavigation.localUserManagement') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080086 </b-nav-item>
Yoshie Muranaka37393812020-03-24 15:25:24 -070087 <b-nav-item to="/access-control/ssl-certificates">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080088 {{ $t('appNavigation.sslCertificates') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080089 </b-nav-item>
90 </b-collapse>
91 </li>
92 </b-nav>
93 </nav>
94 </div>
95 <transition name="fade">
96 <div
97 v-if="isNavigationOpen"
Derick Montaguead2ceb62020-04-24 18:11:04 -050098 id="nav-overlay"
Yoshie Muranaka74f86872020-02-10 12:28:37 -080099 class="nav-overlay"
100 @click="toggleIsOpen"
101 ></div>
102 </transition>
103 </div>
Derick Montaguea2988f42020-01-17 13:46:30 -0600104</template>
105
106<script>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800107import IconAnalytics from '@carbon/icons-vue/es/analytics/16';
108import IconDataCheck from '@carbon/icons-vue/es/data--check/16';
109import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16';
110import IconSettings from '@carbon/icons-vue/es/settings/16';
111import IconPassword from '@carbon/icons-vue/es/password/16';
112import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
Derick Montaguea2988f42020-01-17 13:46:30 -0600113
114export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -0600115 name: 'AppNavigation',
Derick Montague42c19892020-01-17 16:10:34 -0600116 components: {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800117 iconOverview: IconAnalytics,
118 iconHealth: IconDataCheck,
119 iconControl: IconSettingsAdjust,
120 iconConfiguration: IconSettings,
121 iconAccessControl: IconPassword,
122 iconExpand: IconChevronUp
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800123 },
124 data() {
125 return {
126 isNavigationOpen: false
127 };
128 },
129 watch: {
130 $route: function() {
131 this.isNavigationOpen = false;
132 },
133 isNavigationOpen: function(isNavigationOpen) {
134 this.$root.$emit('change:isNavigationOpen', isNavigationOpen);
135 }
136 },
137 mounted() {
138 this.$root.$on('toggle:navigation', () => this.toggleIsOpen());
139 },
140 methods: {
141 toggleIsOpen() {
142 this.isNavigationOpen = !this.isNavigationOpen;
143 }
Derick Montague42c19892020-01-17 16:10:34 -0600144 }
Derick Montaguea2988f42020-01-17 13:46:30 -0600145};
146</script>
Derick Montague42c19892020-01-17 16:10:34 -0600147
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800148<style scoped lang="scss">
Derick Montague40865722020-04-13 17:01:19 -0500149@import 'src/assets/styles/helpers';
150
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800151svg {
Derick Montague66f903f2020-02-28 11:22:31 -0600152 fill: currentColor;
153 height: 1.2rem;
154 width: 1.2rem;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800155 margin-left: 0 !important; //!important overriding button specificity
156 vertical-align: text-bottom;
157 &:not(.icon-expand) {
158 margin-right: $spacer;
159 }
160}
161
162.nav {
SurenNeware057232b2020-06-08 20:53:26 +0530163 padding-top: $spacer / 4;
164 @include media-breakpoint-up($responsive-layout-bp) {
165 padding-top: $spacer;
166 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800167}
168
169.nav-item__nav {
Derick Montague42c19892020-01-17 16:10:34 -0600170 list-style: none;
171 padding-left: 0;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800172 margin-left: 0;
173
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700174 .nav-item {
175 outline: none;
176 }
177
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800178 .nav-link {
179 padding-left: $spacer * 4;
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700180 outline: none;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800181
182 &:not(.nav-link--current) {
183 font-weight: normal;
184 }
185 }
186}
187
188.btn-link {
189 width: 100%;
190 text-align: left;
191 text-decoration: none !important;
192 border-radius: 0;
193
194 &.collapsed {
195 .icon-expand {
196 transform: rotate(180deg);
197 }
198 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800199}
200
201.icon-expand {
202 float: right;
203 margin-top: $spacer / 4;
204}
205
206.btn-link,
207.nav-link {
208 position: relative;
209 font-weight: $headings-font-weight;
210 padding-left: $spacer; // defining consistent padding for links and buttons
211 padding-right: $spacer;
Derick Montague7f970a12020-03-02 17:56:09 -0600212 color: $secondary;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800213
214 &:hover {
Derick Montague66f903f2020-02-28 11:22:31 -0600215 background-color: $primary-nav-hover;
Derick Montague7f970a12020-03-02 17:56:09 -0600216 color: $dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800217 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800218
219 &:focus {
220 box-shadow: $btn-focus-box-shadow;
Derick Montague7f970a12020-03-02 17:56:09 -0600221 color: $dark;
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800222 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800223}
224
Derick Montague66f903f2020-02-28 11:22:31 -0600225.nav-link--current,
226.nav-link--current:hover,
227.nav-link--current:focus {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800228 font-weight: $headings-font-weight;
Derick Montague7f970a12020-03-02 17:56:09 -0600229 background-color: $secondary;
230 color: $light;
Derick Montague66f903f2020-02-28 11:22:31 -0600231 cursor: default;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800232
233 &::before {
234 content: '';
235 position: absolute;
236 top: 0;
237 bottom: 0;
238 left: 0;
239 width: 4px;
240 background-color: $primary;
241 }
Derick Montague42c19892020-01-17 16:10:34 -0600242}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800243
244.nav-container {
245 position: fixed;
246 width: $navigation-width;
247 top: $header-height;
248 bottom: 0;
249 left: 0;
250 z-index: $zindex-fixed;
251 overflow-y: auto;
Derick Montague66f903f2020-02-28 11:22:31 -0600252 background-color: $container-bgd;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800253 transform: translateX(-$navigation-width);
254 transition: transform $exit-easing--productive $duration--moderate-02;
SurenNeware057232b2020-06-08 20:53:26 +0530255 @include media-breakpoint-down(md) {
256 z-index: $zindex-fixed + 2;
257 }
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800258
Derick Montague74466b82020-06-28 10:17:32 -0500259 &.open,
260 &:focus-within {
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800261 transform: translateX(0);
262 transition-timing-function: $entrance-easing--productive;
263 }
264
265 @include media-breakpoint-up($responsive-layout-bp) {
266 transition-duration: $duration--fast-01;
267 transform: translateX(0);
268 }
269}
270
271.nav-overlay {
272 position: fixed;
273 top: $header-height;
274 bottom: 0;
275 left: 0;
276 right: 0;
SurenNeware057232b2020-06-08 20:53:26 +0530277 z-index: $zindex-fixed + 1;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800278 background-color: $black;
279 opacity: 0.5;
280
281 &.fade-enter-active {
282 transition: opacity $duration--moderate-02 $entrance-easing--productive;
283 }
284
285 &.fade-leave-active {
286 transition: opacity $duration--fast-02 $exit-easing--productive;
287 }
288
289 &.fade-enter,
290 &.fade-leave-to {
291 opacity: 0;
292 }
293
294 @include media-breakpoint-up($responsive-layout-bp) {
295 display: none;
296 }
297}
Derick Montague42c19892020-01-17 16:10:34 -0600298</style>