blob: ef88adb46aeb990cea50f262ec9b4330ae90db85 [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 Muranakae0b76c32020-02-28 14:18:20 -080018 <b-nav-item href="javascript:void(0)">
19 {{ $t('appNavigation.eventLog') }}
20 </b-nav-item>
21 <b-nav-item href="javascript:void(0)">
22 {{ $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">
37 <b-nav-item href="javascript:void(0)">
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>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080043 <b-nav-item href="javascript:void(0)">
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>
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080062 <b-nav-item href="javascript:void(0)">
63 {{ $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 {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800160 padding-top: $spacer;
161}
162
163.nav-item__nav {
Derick Montague42c19892020-01-17 16:10:34 -0600164 list-style: none;
165 padding-left: 0;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800166 margin-left: 0;
167
168 .nav-link {
169 padding-left: $spacer * 4;
170
171 &:not(.nav-link--current) {
172 font-weight: normal;
173 }
174 }
175}
176
177.btn-link {
178 width: 100%;
179 text-align: left;
180 text-decoration: none !important;
181 border-radius: 0;
182
183 &.collapsed {
184 .icon-expand {
185 transform: rotate(180deg);
186 }
187 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800188}
189
190.icon-expand {
191 float: right;
192 margin-top: $spacer / 4;
193}
194
195.btn-link,
196.nav-link {
197 position: relative;
198 font-weight: $headings-font-weight;
199 padding-left: $spacer; // defining consistent padding for links and buttons
200 padding-right: $spacer;
Derick Montague7f970a12020-03-02 17:56:09 -0600201 color: $secondary;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800202
203 &:hover {
Derick Montague66f903f2020-02-28 11:22:31 -0600204 background-color: $primary-nav-hover;
Derick Montague7f970a12020-03-02 17:56:09 -0600205 color: $dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800206 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800207
208 &:focus {
209 box-shadow: $btn-focus-box-shadow;
Derick Montague7f970a12020-03-02 17:56:09 -0600210 color: $dark;
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800211 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800212}
213
Derick Montague66f903f2020-02-28 11:22:31 -0600214.nav-link--current,
215.nav-link--current:hover,
216.nav-link--current:focus {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800217 font-weight: $headings-font-weight;
Derick Montague7f970a12020-03-02 17:56:09 -0600218 background-color: $secondary;
219 color: $light;
Derick Montague66f903f2020-02-28 11:22:31 -0600220 cursor: default;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800221
222 &::before {
223 content: '';
224 position: absolute;
225 top: 0;
226 bottom: 0;
227 left: 0;
228 width: 4px;
229 background-color: $primary;
230 }
Derick Montague42c19892020-01-17 16:10:34 -0600231}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800232
233.nav-container {
234 position: fixed;
235 width: $navigation-width;
236 top: $header-height;
237 bottom: 0;
238 left: 0;
239 z-index: $zindex-fixed;
240 overflow-y: auto;
Derick Montague66f903f2020-02-28 11:22:31 -0600241 background-color: $container-bgd;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800242 transform: translateX(-$navigation-width);
243 transition: transform $exit-easing--productive $duration--moderate-02;
244
245 &.open {
246 transform: translateX(0);
247 transition-timing-function: $entrance-easing--productive;
248 }
249
250 @include media-breakpoint-up($responsive-layout-bp) {
251 transition-duration: $duration--fast-01;
252 transform: translateX(0);
253 }
254}
255
256.nav-overlay {
257 position: fixed;
258 top: $header-height;
259 bottom: 0;
260 left: 0;
261 right: 0;
262 z-index: $zindex-fixed - 1;
263 background-color: $black;
264 opacity: 0.5;
265
266 &.fade-enter-active {
267 transition: opacity $duration--moderate-02 $entrance-easing--productive;
268 }
269
270 &.fade-leave-active {
271 transition: opacity $duration--fast-02 $exit-easing--productive;
272 }
273
274 &.fade-enter,
275 &.fade-leave-to {
276 opacity: 0;
277 }
278
279 @include media-breakpoint-up($responsive-layout-bp) {
280 display: none;
281 }
282}
Derick Montague42c19892020-01-17 16:10:34 -0600283</style>