blob: d0fee43fd675445f2dd5be02b6024e057c632087 [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 }">
4 <nav ref="nav">
5 <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 Muranakae0b76c32020-02-28 14:18:20 -080078 <b-nav-item href="javascript:void(0)">
79 {{ $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>
84 <b-nav-item href="javascript:void(0)">
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"
95 class="nav-overlay"
96 @click="toggleIsOpen"
97 ></div>
98 </transition>
99 </div>
Derick Montaguea2988f42020-01-17 13:46:30 -0600100</template>
101
102<script>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800103import IconAnalytics from '@carbon/icons-vue/es/analytics/16';
104import IconDataCheck from '@carbon/icons-vue/es/data--check/16';
105import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16';
106import IconSettings from '@carbon/icons-vue/es/settings/16';
107import IconPassword from '@carbon/icons-vue/es/password/16';
108import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
Derick Montaguea2988f42020-01-17 13:46:30 -0600109
110export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -0600111 name: 'AppNavigation',
Derick Montague42c19892020-01-17 16:10:34 -0600112 components: {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800113 iconOverview: IconAnalytics,
114 iconHealth: IconDataCheck,
115 iconControl: IconSettingsAdjust,
116 iconConfiguration: IconSettings,
117 iconAccessControl: IconPassword,
118 iconExpand: IconChevronUp
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800119 },
120 data() {
121 return {
122 isNavigationOpen: false
123 };
124 },
125 watch: {
126 $route: function() {
127 this.isNavigationOpen = false;
128 },
129 isNavigationOpen: function(isNavigationOpen) {
130 this.$root.$emit('change:isNavigationOpen', isNavigationOpen);
131 }
132 },
133 mounted() {
134 this.$root.$on('toggle:navigation', () => this.toggleIsOpen());
135 },
136 methods: {
137 toggleIsOpen() {
138 this.isNavigationOpen = !this.isNavigationOpen;
139 }
Derick Montague42c19892020-01-17 16:10:34 -0600140 }
Derick Montaguea2988f42020-01-17 13:46:30 -0600141};
142</script>
Derick Montague42c19892020-01-17 16:10:34 -0600143
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800144<style scoped lang="scss">
145svg {
Derick Montague66f903f2020-02-28 11:22:31 -0600146 fill: currentColor;
147 height: 1.2rem;
148 width: 1.2rem;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800149 margin-left: 0 !important; //!important overriding button specificity
150 vertical-align: text-bottom;
151 &:not(.icon-expand) {
152 margin-right: $spacer;
153 }
154}
155
156.nav {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800157 padding-top: $spacer;
158}
159
160.nav-item__nav {
Derick Montague42c19892020-01-17 16:10:34 -0600161 list-style: none;
162 padding-left: 0;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800163 margin-left: 0;
164
165 .nav-link {
166 padding-left: $spacer * 4;
167
168 &:not(.nav-link--current) {
169 font-weight: normal;
170 }
171 }
172}
173
174.btn-link {
175 width: 100%;
176 text-align: left;
177 text-decoration: none !important;
178 border-radius: 0;
179
180 &.collapsed {
181 .icon-expand {
182 transform: rotate(180deg);
183 }
184 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800185}
186
187.icon-expand {
188 float: right;
189 margin-top: $spacer / 4;
190}
191
192.btn-link,
193.nav-link {
194 position: relative;
195 font-weight: $headings-font-weight;
196 padding-left: $spacer; // defining consistent padding for links and buttons
197 padding-right: $spacer;
Derick Montague7f970a12020-03-02 17:56:09 -0600198 color: $secondary;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800199
200 &:hover {
Derick Montague66f903f2020-02-28 11:22:31 -0600201 background-color: $primary-nav-hover;
Derick Montague7f970a12020-03-02 17:56:09 -0600202 color: $dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800203 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800204
205 &:focus {
206 box-shadow: $btn-focus-box-shadow;
Derick Montague7f970a12020-03-02 17:56:09 -0600207 color: $dark;
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800208 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800209}
210
Derick Montague66f903f2020-02-28 11:22:31 -0600211.nav-link--current,
212.nav-link--current:hover,
213.nav-link--current:focus {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800214 font-weight: $headings-font-weight;
Derick Montague7f970a12020-03-02 17:56:09 -0600215 background-color: $secondary;
216 color: $light;
Derick Montague66f903f2020-02-28 11:22:31 -0600217 cursor: default;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800218
219 &::before {
220 content: '';
221 position: absolute;
222 top: 0;
223 bottom: 0;
224 left: 0;
225 width: 4px;
226 background-color: $primary;
227 }
Derick Montague42c19892020-01-17 16:10:34 -0600228}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800229
230.nav-container {
231 position: fixed;
232 width: $navigation-width;
233 top: $header-height;
234 bottom: 0;
235 left: 0;
236 z-index: $zindex-fixed;
237 overflow-y: auto;
Derick Montague66f903f2020-02-28 11:22:31 -0600238 background-color: $container-bgd;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800239 transform: translateX(-$navigation-width);
240 transition: transform $exit-easing--productive $duration--moderate-02;
241
242 &.open {
243 transform: translateX(0);
244 transition-timing-function: $entrance-easing--productive;
245 }
246
247 @include media-breakpoint-up($responsive-layout-bp) {
248 transition-duration: $duration--fast-01;
249 transform: translateX(0);
250 }
251}
252
253.nav-overlay {
254 position: fixed;
255 top: $header-height;
256 bottom: 0;
257 left: 0;
258 right: 0;
259 z-index: $zindex-fixed - 1;
260 background-color: $black;
261 opacity: 0.5;
262
263 &.fade-enter-active {
264 transition: opacity $duration--moderate-02 $entrance-easing--productive;
265 }
266
267 &.fade-leave-active {
268 transition: opacity $duration--fast-02 $exit-easing--productive;
269 }
270
271 &.fade-enter,
272 &.fade-leave-to {
273 opacity: 0;
274 }
275
276 @include media-breakpoint-up($responsive-layout-bp) {
277 display: none;
278 }
279}
Derick Montague42c19892020-01-17 16:10:34 -0600280</style>