blob: 09c1eb8b7d48ebb9a69f368eb671b7b67eb91cce [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>
SurenNeware090c2d42020-04-01 14:07:27 +053043 <b-nav-item to="/control/server-led">
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>
Dixsie Wolmersbb81d552020-02-26 19:52:28 -060062 <b-nav-item to="/configuration/network-settings">
Yoshie Muranakae0b76c32020-02-28 14:18:20 -080063 {{ $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
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700168 .nav-item {
169 outline: none;
170 }
171
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800172 .nav-link {
173 padding-left: $spacer * 4;
Yoshie Muranaka85358ed2020-05-18 10:05:36 -0700174 outline: none;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800175
176 &:not(.nav-link--current) {
177 font-weight: normal;
178 }
179 }
180}
181
182.btn-link {
183 width: 100%;
184 text-align: left;
185 text-decoration: none !important;
186 border-radius: 0;
187
188 &.collapsed {
189 .icon-expand {
190 transform: rotate(180deg);
191 }
192 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800193}
194
195.icon-expand {
196 float: right;
197 margin-top: $spacer / 4;
198}
199
200.btn-link,
201.nav-link {
202 position: relative;
203 font-weight: $headings-font-weight;
204 padding-left: $spacer; // defining consistent padding for links and buttons
205 padding-right: $spacer;
Derick Montague7f970a12020-03-02 17:56:09 -0600206 color: $secondary;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800207
208 &:hover {
Derick Montague66f903f2020-02-28 11:22:31 -0600209 background-color: $primary-nav-hover;
Derick Montague7f970a12020-03-02 17:56:09 -0600210 color: $dark;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800211 }
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800212
213 &:focus {
214 box-shadow: $btn-focus-box-shadow;
Derick Montague7f970a12020-03-02 17:56:09 -0600215 color: $dark;
Yoshie Muranaka9f5cea82020-02-04 09:30:00 -0800216 }
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800217}
218
Derick Montague66f903f2020-02-28 11:22:31 -0600219.nav-link--current,
220.nav-link--current:hover,
221.nav-link--current:focus {
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800222 font-weight: $headings-font-weight;
Derick Montague7f970a12020-03-02 17:56:09 -0600223 background-color: $secondary;
224 color: $light;
Derick Montague66f903f2020-02-28 11:22:31 -0600225 cursor: default;
Yoshie Muranaka71ac2302019-12-26 11:43:36 -0800226
227 &::before {
228 content: '';
229 position: absolute;
230 top: 0;
231 bottom: 0;
232 left: 0;
233 width: 4px;
234 background-color: $primary;
235 }
Derick Montague42c19892020-01-17 16:10:34 -0600236}
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800237
238.nav-container {
239 position: fixed;
240 width: $navigation-width;
241 top: $header-height;
242 bottom: 0;
243 left: 0;
244 z-index: $zindex-fixed;
245 overflow-y: auto;
Derick Montague66f903f2020-02-28 11:22:31 -0600246 background-color: $container-bgd;
Yoshie Muranaka74f86872020-02-10 12:28:37 -0800247 transform: translateX(-$navigation-width);
248 transition: transform $exit-easing--productive $duration--moderate-02;
249
250 &.open {
251 transform: translateX(0);
252 transition-timing-function: $entrance-easing--productive;
253 }
254
255 @include media-breakpoint-up($responsive-layout-bp) {
256 transition-duration: $duration--fast-01;
257 transform: translateX(0);
258 }
259}
260
261.nav-overlay {
262 position: fixed;
263 top: $header-height;
264 bottom: 0;
265 left: 0;
266 right: 0;
267 z-index: $zindex-fixed - 1;
268 background-color: $black;
269 opacity: 0.5;
270
271 &.fade-enter-active {
272 transition: opacity $duration--moderate-02 $entrance-easing--productive;
273 }
274
275 &.fade-leave-active {
276 transition: opacity $duration--fast-02 $exit-easing--productive;
277 }
278
279 &.fade-enter,
280 &.fade-leave-to {
281 opacity: 0;
282 }
283
284 @include media-breakpoint-up($responsive-layout-bp) {
285 display: none;
286 }
287}
Derick Montague42c19892020-01-17 16:10:34 -0600288</style>