blob: 62ffe9829f0db765602b177f68e70af065d30ac8 [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 Muranakae0b76c32020-02-28 14:18:20 -080013 <icon-health />{{ $t('appNavigation.health') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080014 <icon-expand class="icon-expand" />
15 </b-button>
16 <b-collapse id="health-menu" tag="ul" class="nav-item__nav">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080017 <b-nav-item href="javascript:void(0)">
18 {{ $t('appNavigation.eventLog') }}
19 </b-nav-item>
20 <b-nav-item href="javascript:void(0)">
21 {{ $t('appNavigation.hardwareStatus') }}
22 </b-nav-item>
23 <b-nav-item href="javascript:void(0)">
24 {{ $t('appNavigation.sensors') }}
25 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080026 </b-collapse>
27 </li>
Derick Montague42c19892020-01-17 16:10:34 -060028
Yoshie Muranaka74f86872020-02-10 12:28:37 -080029 <li class="nav-item">
30 <b-button v-b-toggle.control-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080031 <icon-control />
32 {{ $t('appNavigation.control') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080033 <icon-expand class="icon-expand" />
34 </b-button>
35 <b-collapse id="control-menu" tag="ul" class="nav-item__nav">
36 <b-nav-item href="javascript:void(0)">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080037 {{ $t('appNavigation.managePowerUsage') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080038 </b-nav-item>
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080039 <b-nav-item to="/control/reboot-bmc">
40 {{ $t('appNavigation.rebootBmc') }}
41 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080042 <b-nav-item href="javascript:void(0)">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080043 {{ $t('appNavigation.serverLed') }}
44 </b-nav-item>
45 <b-nav-item href="javascript:void(0)">
46 {{ $t('appNavigation.serverPowerOperations') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080047 </b-nav-item>
48 </b-collapse>
49 </li>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -080050
Yoshie Muranaka74f86872020-02-10 12:28:37 -080051 <li class="nav-item">
52 <b-button v-b-toggle.configuration-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080053 <icon-configuration />
54 {{ $t('appNavigation.configuration') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080055 <icon-expand class="icon-expand" />
56 </b-button>
57 <b-collapse id="configuration-menu" tag="ul" class="nav-item__nav">
Yoshie Muranaka74f86872020-02-10 12:28:37 -080058 <b-nav-item href="javascript:void(0)">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080059 {{ $t('appNavigation.firmware') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080060 </b-nav-item>
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080061 <b-nav-item href="javascript:void(0)">
62 {{ $t('appNavigation.networkSettings') }}
63 </b-nav-item>
64 <b-nav-item href="javascript:void(0)">
65 {{ $t('appNavigation.snmpSettings') }}
66 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080067 </b-collapse>
68 </li>
Derick Montague42c19892020-01-17 16:10:34 -060069
Yoshie Muranaka74f86872020-02-10 12:28:37 -080070 <li class="nav-item">
71 <b-button v-b-toggle.access-control-menu variant="link">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080072 <icon-access-control />
73 {{ $t('appNavigation.accessControl') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080074 <icon-expand class="icon-expand" />
75 </b-button>
76 <b-collapse id="access-control-menu" tag="ul" class="nav-item__nav">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080077 <b-nav-item href="javascript:void(0)">
78 {{ $t('appNavigation.ldap') }}
79 </b-nav-item>
Yoshie Muranaka74f86872020-02-10 12:28:37 -080080 <b-nav-item to="/access-control/local-user-management">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080081 {{ $t('appNavigation.localUserManagement') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080082 </b-nav-item>
83 <b-nav-item href="javascript:void(0)">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080084 {{ $t('appNavigation.sslCertificates') }}
Yoshie Muranaka74f86872020-02-10 12:28:37 -080085 </b-nav-item>
86 </b-collapse>
87 </li>
88 </b-nav>
89 </nav>
90 </div>
91 <transition name="fade">
92 <div
93 v-if="isNavigationOpen"
94 class="nav-overlay"
95 @click="toggleIsOpen"
96 ></div>
97 </transition>
98 </div>
Derick Montaguea2988f42020-01-17 13:46:30 -060099</template>
100
101<script>
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800102import IconAnalytics from '@carbon/icons-vue/es/analytics/16';
103import IconDataCheck from '@carbon/icons-vue/es/data--check/16';
104import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16';
105import IconSettings from '@carbon/icons-vue/es/settings/16';
106import IconPassword from '@carbon/icons-vue/es/password/16';
107import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16';
Derick Montaguea2988f42020-01-17 13:46:30 -0600108
109export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -0600110 name: 'AppNavigation',
Derick Montague42c19892020-01-17 16:10:34 -0600111 components: {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800112 iconOverview: IconAnalytics,
113 iconHealth: IconDataCheck,
114 iconControl: IconSettingsAdjust,
115 iconConfiguration: IconSettings,
116 iconAccessControl: IconPassword,
117 iconExpand: IconChevronUp
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800118 },
119 data() {
120 return {
121 isNavigationOpen: false
122 };
123 },
124 watch: {
125 $route: function() {
126 this.isNavigationOpen = false;
127 },
128 isNavigationOpen: function(isNavigationOpen) {
129 this.$root.$emit('change:isNavigationOpen', isNavigationOpen);
130 }
131 },
132 mounted() {
133 this.$root.$on('toggle:navigation', () => this.toggleIsOpen());
134 },
135 methods: {
136 toggleIsOpen() {
137 this.isNavigationOpen = !this.isNavigationOpen;
138 }
Derick Montague42c19892020-01-17 16:10:34 -0600139 }
Derick Montaguea2988f42020-01-17 13:46:30 -0600140};
141</script>
Derick Montague42c19892020-01-17 16:10:34 -0600142
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800143<style scoped lang="scss">
144svg {
Derick Montague66f903f2020-02-28 11:22:31 -0600145 fill: currentColor;
146 height: 1.2rem;
147 width: 1.2rem;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800148 margin-left: 0 !important; //!important overriding button specificity
149 vertical-align: text-bottom;
150 &:not(.icon-expand) {
151 margin-right: $spacer;
152 }
153}
154
155.nav {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800156 padding-top: $spacer;
157}
158
159.nav-item__nav {
Derick Montague42c19892020-01-17 16:10:34 -0600160 list-style: none;
161 padding-left: 0;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800162 margin-left: 0;
163
164 .nav-link {
165 padding-left: $spacer * 4;
166
167 &:not(.nav-link--current) {
168 font-weight: normal;
169 }
170 }
171}
172
173.btn-link {
174 width: 100%;
175 text-align: left;
176 text-decoration: none !important;
177 border-radius: 0;
178
179 &.collapsed {
180 .icon-expand {
181 transform: rotate(180deg);
182 }
183 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800184}
185
186.icon-expand {
187 float: right;
188 margin-top: $spacer / 4;
189}
190
191.btn-link,
192.nav-link {
193 position: relative;
194 font-weight: $headings-font-weight;
195 padding-left: $spacer; // defining consistent padding for links and buttons
196 padding-right: $spacer;
Derick Montague66f903f2020-02-28 11:22:31 -0600197 color: $secondary-dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800198
199 &:hover {
Derick Montague66f903f2020-02-28 11:22:31 -0600200 background-color: $primary-nav-hover;
201 color: $secondary-dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800202 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800203
204 &:focus {
205 box-shadow: $btn-focus-box-shadow;
Derick Montague66f903f2020-02-28 11:22:31 -0600206 color: $secondary-dark;
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800207 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800208}
209
Derick Montague66f903f2020-02-28 11:22:31 -0600210.nav-link--current,
211.nav-link--current:hover,
212.nav-link--current:focus {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800213 font-weight: $headings-font-weight;
Derick Montague66f903f2020-02-28 11:22:31 -0600214 background-color: $secondary-dark;
215 color: $secondary-light;
216 cursor: default;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800217
218 &::before {
219 content: '';
220 position: absolute;
221 top: 0;
222 bottom: 0;
223 left: 0;
224 width: 4px;
225 background-color: $primary;
226 }
Derick Montague42c19892020-01-17 16:10:34 -0600227}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800228
229.nav-container {
230 position: fixed;
231 width: $navigation-width;
232 top: $header-height;
233 bottom: 0;
234 left: 0;
235 z-index: $zindex-fixed;
236 overflow-y: auto;
Derick Montague66f903f2020-02-28 11:22:31 -0600237 background-color: $container-bgd;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800238 transform: translateX(-$navigation-width);
239 transition: transform $exit-easing--productive $duration--moderate-02;
240
241 &.open {
242 transform: translateX(0);
243 transition-timing-function: $entrance-easing--productive;
244 }
245
246 @include media-breakpoint-up($responsive-layout-bp) {
247 transition-duration: $duration--fast-01;
248 transform: translateX(0);
249 }
250}
251
252.nav-overlay {
253 position: fixed;
254 top: $header-height;
255 bottom: 0;
256 left: 0;
257 right: 0;
258 z-index: $zindex-fixed - 1;
259 background-color: $black;
260 opacity: 0.5;
261
262 &.fade-enter-active {
263 transition: opacity $duration--moderate-02 $entrance-easing--productive;
264 }
265
266 &.fade-leave-active {
267 transition: opacity $duration--fast-02 $exit-easing--productive;
268 }
269
270 &.fade-enter,
271 &.fade-leave-to {
272 opacity: 0;
273 }
274
275 @include media-breakpoint-up($responsive-layout-bp) {
276 display: none;
277 }
278}
Derick Montague42c19892020-01-17 16:10:34 -0600279</style>