blob: cc024c8635d00550d3d454e6d65e9f6aaddc7d42 [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 {
145 fill: $gray-900;
146 margin-left: 0 !important; //!important overriding button specificity
147 vertical-align: text-bottom;
148 &:not(.icon-expand) {
149 margin-right: $spacer;
150 }
151}
152
153.nav {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800154 padding-top: $spacer;
155}
156
157.nav-item__nav {
Derick Montague42c19892020-01-17 16:10:34 -0600158 list-style: none;
159 padding-left: 0;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800160 margin-left: 0;
161
162 .nav-link {
163 padding-left: $spacer * 4;
164
165 &:not(.nav-link--current) {
166 font-weight: normal;
167 }
168 }
169}
170
171.btn-link {
172 width: 100%;
173 text-align: left;
174 text-decoration: none !important;
175 border-radius: 0;
176
177 &.collapsed {
178 .icon-expand {
179 transform: rotate(180deg);
180 }
181 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800182}
183
184.icon-expand {
185 float: right;
186 margin-top: $spacer / 4;
187}
188
189.btn-link,
190.nav-link {
191 position: relative;
192 font-weight: $headings-font-weight;
193 padding-left: $spacer; // defining consistent padding for links and buttons
194 padding-right: $spacer;
195 color: $gray-900 !important; //using important to avoid styling states
196
197 &:hover {
198 background-color: $gray-300;
199 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800200
201 &:focus {
202 box-shadow: $btn-focus-box-shadow;
203 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800204}
205
206.nav-link--current {
207 font-weight: $headings-font-weight;
208 background-color: $gray-300;
209
210 &::before {
211 content: '';
212 position: absolute;
213 top: 0;
214 bottom: 0;
215 left: 0;
216 width: 4px;
217 background-color: $primary;
218 }
Derick Montague42c19892020-01-17 16:10:34 -0600219}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800220
221.nav-container {
222 position: fixed;
223 width: $navigation-width;
224 top: $header-height;
225 bottom: 0;
226 left: 0;
227 z-index: $zindex-fixed;
228 overflow-y: auto;
229 background-color: $gray-200;
230 transform: translateX(-$navigation-width);
231 transition: transform $exit-easing--productive $duration--moderate-02;
232
233 &.open {
234 transform: translateX(0);
235 transition-timing-function: $entrance-easing--productive;
236 }
237
238 @include media-breakpoint-up($responsive-layout-bp) {
239 transition-duration: $duration--fast-01;
240 transform: translateX(0);
241 }
242}
243
244.nav-overlay {
245 position: fixed;
246 top: $header-height;
247 bottom: 0;
248 left: 0;
249 right: 0;
250 z-index: $zindex-fixed - 1;
251 background-color: $black;
252 opacity: 0.5;
253
254 &.fade-enter-active {
255 transition: opacity $duration--moderate-02 $entrance-easing--productive;
256 }
257
258 &.fade-leave-active {
259 transition: opacity $duration--fast-02 $exit-easing--productive;
260 }
261
262 &.fade-enter,
263 &.fade-leave-to {
264 opacity: 0;
265 }
266
267 @include media-breakpoint-up($responsive-layout-bp) {
268 display: none;
269 }
270}
Derick Montague42c19892020-01-17 16:10:34 -0600271</style>