Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 1 | <template> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 2 | <div> |
| 3 | <div class="nav-container" :class="{ open: isNavigationOpen }"> |
Derick Montague | 6859203 | 2020-04-04 14:02:34 -0500 | [diff] [blame] | 4 | <nav ref="nav" :aria-label="$t('appNavigation.primaryNavigation')"> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 5 | <b-nav vertical> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 6 | <b-nav-item to="/"> |
| 7 | <icon-overview /> |
| 8 | {{ $t('appNavigation.overview') }} |
| 9 | </b-nav-item> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 10 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 11 | <li class="nav-item"> |
| 12 | <b-button v-b-toggle.health-menu variant="link"> |
Yoshie Muranaka | 9fc3f90 | 2020-03-04 10:36:57 -0800 | [diff] [blame] | 13 | <icon-health /> |
| 14 | {{ $t('appNavigation.health') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 15 | <icon-expand class="icon-expand" /> |
| 16 | </b-button> |
| 17 | <b-collapse id="health-menu" tag="ul" class="nav-item__nav"> |
Yoshie Muranaka | 6f10234 | 2020-05-05 09:45:39 -0700 | [diff] [blame] | 18 | <b-nav-item to="/health/event-logs"> |
| 19 | {{ $t('appNavigation.eventLogs') }} |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 20 | </b-nav-item> |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 21 | <b-nav-item to="/health/hardware-status"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 22 | {{ $t('appNavigation.hardwareStatus') }} |
| 23 | </b-nav-item> |
Yoshie Muranaka | 30abccb | 2020-03-11 12:44:24 -0700 | [diff] [blame] | 24 | <b-nav-item to="/health/sensors"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 25 | {{ $t('appNavigation.sensors') }} |
| 26 | </b-nav-item> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 27 | </b-collapse> |
| 28 | </li> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 29 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 30 | <li class="nav-item"> |
| 31 | <b-button v-b-toggle.control-menu variant="link"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 32 | <icon-control /> |
| 33 | {{ $t('appNavigation.control') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 34 | <icon-expand class="icon-expand" /> |
| 35 | </b-button> |
| 36 | <b-collapse id="control-menu" tag="ul" class="nav-item__nav"> |
Sukanya Pandey | 9055d98 | 2020-03-31 17:37:53 +0530 | [diff] [blame] | 37 | <b-nav-item to="/control/manage-power-usage"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 38 | {{ $t('appNavigation.managePowerUsage') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 39 | </b-nav-item> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 40 | <b-nav-item to="/control/reboot-bmc"> |
| 41 | {{ $t('appNavigation.rebootBmc') }} |
| 42 | </b-nav-item> |
Sukanya Pandey | 96f69ca | 2020-05-20 15:32:57 +0530 | [diff] [blame] | 43 | <b-nav-item to="/control/serial-over-lan"> |
| 44 | {{ $t('appNavigation.serialOverLan') }} |
| 45 | </b-nav-item> |
SurenNeware | 090c2d4 | 2020-04-01 14:07:27 +0530 | [diff] [blame] | 46 | <b-nav-item to="/control/server-led"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 47 | {{ $t('appNavigation.serverLed') }} |
| 48 | </b-nav-item> |
Yoshie Muranaka | fa1512b | 2020-02-25 15:54:07 -0800 | [diff] [blame] | 49 | <b-nav-item to="/control/server-power-operations"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 50 | {{ $t('appNavigation.serverPowerOperations') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 51 | </b-nav-item> |
| 52 | </b-collapse> |
| 53 | </li> |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 54 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 55 | <li class="nav-item"> |
| 56 | <b-button v-b-toggle.configuration-menu variant="link"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 57 | <icon-configuration /> |
| 58 | {{ $t('appNavigation.configuration') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 59 | <icon-expand class="icon-expand" /> |
| 60 | </b-button> |
| 61 | <b-collapse id="configuration-menu" tag="ul" class="nav-item__nav"> |
Dixsie Wolmers | 739e459 | 2020-06-05 07:00:06 -0500 | [diff] [blame^] | 62 | <b-nav-item to="/configuration/date-time-settings"> |
| 63 | {{ $t('appNavigation.dateTimeSettings') }} |
| 64 | </b-nav-item> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 65 | <b-nav-item href="javascript:void(0)"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 66 | {{ $t('appNavigation.firmware') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 67 | </b-nav-item> |
Dixsie Wolmers | bb81d55 | 2020-02-26 19:52:28 -0600 | [diff] [blame] | 68 | <b-nav-item to="/configuration/network-settings"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 69 | {{ $t('appNavigation.networkSettings') }} |
| 70 | </b-nav-item> |
| 71 | <b-nav-item href="javascript:void(0)"> |
| 72 | {{ $t('appNavigation.snmpSettings') }} |
| 73 | </b-nav-item> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 74 | </b-collapse> |
| 75 | </li> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 76 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 77 | <li class="nav-item"> |
| 78 | <b-button v-b-toggle.access-control-menu variant="link"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 79 | <icon-access-control /> |
| 80 | {{ $t('appNavigation.accessControl') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 81 | <icon-expand class="icon-expand" /> |
| 82 | </b-button> |
| 83 | <b-collapse id="access-control-menu" tag="ul" class="nav-item__nav"> |
Yoshie Muranaka | c4e38ab | 2020-04-09 12:41:27 -0700 | [diff] [blame] | 84 | <b-nav-item to="/access-control/ldap"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 85 | {{ $t('appNavigation.ldap') }} |
| 86 | </b-nav-item> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 87 | <b-nav-item to="/access-control/local-user-management"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 88 | {{ $t('appNavigation.localUserManagement') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 89 | </b-nav-item> |
Yoshie Muranaka | 3739381 | 2020-03-24 15:25:24 -0700 | [diff] [blame] | 90 | <b-nav-item to="/access-control/ssl-certificates"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 91 | {{ $t('appNavigation.sslCertificates') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 92 | </b-nav-item> |
| 93 | </b-collapse> |
| 94 | </li> |
| 95 | </b-nav> |
| 96 | </nav> |
| 97 | </div> |
| 98 | <transition name="fade"> |
| 99 | <div |
| 100 | v-if="isNavigationOpen" |
Derick Montague | ad2ceb6 | 2020-04-24 18:11:04 -0500 | [diff] [blame] | 101 | id="nav-overlay" |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 102 | class="nav-overlay" |
| 103 | @click="toggleIsOpen" |
| 104 | ></div> |
| 105 | </transition> |
| 106 | </div> |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 107 | </template> |
| 108 | |
| 109 | <script> |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 110 | import IconAnalytics from '@carbon/icons-vue/es/analytics/16'; |
| 111 | import IconDataCheck from '@carbon/icons-vue/es/data--check/16'; |
| 112 | import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16'; |
| 113 | import IconSettings from '@carbon/icons-vue/es/settings/16'; |
| 114 | import IconPassword from '@carbon/icons-vue/es/password/16'; |
| 115 | import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16'; |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 116 | |
| 117 | export default { |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 118 | name: 'AppNavigation', |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 119 | components: { |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 120 | iconOverview: IconAnalytics, |
| 121 | iconHealth: IconDataCheck, |
| 122 | iconControl: IconSettingsAdjust, |
| 123 | iconConfiguration: IconSettings, |
| 124 | iconAccessControl: IconPassword, |
| 125 | iconExpand: IconChevronUp |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 126 | }, |
| 127 | data() { |
| 128 | return { |
| 129 | isNavigationOpen: false |
| 130 | }; |
| 131 | }, |
| 132 | watch: { |
| 133 | $route: function() { |
| 134 | this.isNavigationOpen = false; |
| 135 | }, |
| 136 | isNavigationOpen: function(isNavigationOpen) { |
| 137 | this.$root.$emit('change:isNavigationOpen', isNavigationOpen); |
| 138 | } |
| 139 | }, |
| 140 | mounted() { |
| 141 | this.$root.$on('toggle:navigation', () => this.toggleIsOpen()); |
| 142 | }, |
| 143 | methods: { |
| 144 | toggleIsOpen() { |
| 145 | this.isNavigationOpen = !this.isNavigationOpen; |
| 146 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 147 | } |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 148 | }; |
| 149 | </script> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 150 | |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 151 | <style scoped lang="scss"> |
Derick Montague | 4086572 | 2020-04-13 17:01:19 -0500 | [diff] [blame] | 152 | @import 'src/assets/styles/helpers'; |
| 153 | |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 154 | svg { |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 155 | fill: currentColor; |
| 156 | height: 1.2rem; |
| 157 | width: 1.2rem; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 158 | margin-left: 0 !important; //!important overriding button specificity |
| 159 | vertical-align: text-bottom; |
| 160 | &:not(.icon-expand) { |
| 161 | margin-right: $spacer; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | .nav { |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 166 | padding-top: $spacer / 4; |
| 167 | @include media-breakpoint-up($responsive-layout-bp) { |
| 168 | padding-top: $spacer; |
| 169 | } |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | .nav-item__nav { |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 173 | list-style: none; |
| 174 | padding-left: 0; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 175 | margin-left: 0; |
| 176 | |
Yoshie Muranaka | 85358ed | 2020-05-18 10:05:36 -0700 | [diff] [blame] | 177 | .nav-item { |
| 178 | outline: none; |
| 179 | } |
| 180 | |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 181 | .nav-link { |
| 182 | padding-left: $spacer * 4; |
Yoshie Muranaka | 85358ed | 2020-05-18 10:05:36 -0700 | [diff] [blame] | 183 | outline: none; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 184 | |
| 185 | &:not(.nav-link--current) { |
| 186 | font-weight: normal; |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | .btn-link { |
| 192 | width: 100%; |
| 193 | text-align: left; |
| 194 | text-decoration: none !important; |
| 195 | border-radius: 0; |
| 196 | |
| 197 | &.collapsed { |
| 198 | .icon-expand { |
| 199 | transform: rotate(180deg); |
| 200 | } |
| 201 | } |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | .icon-expand { |
| 205 | float: right; |
| 206 | margin-top: $spacer / 4; |
| 207 | } |
| 208 | |
| 209 | .btn-link, |
| 210 | .nav-link { |
| 211 | position: relative; |
| 212 | font-weight: $headings-font-weight; |
| 213 | padding-left: $spacer; // defining consistent padding for links and buttons |
| 214 | padding-right: $spacer; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 215 | color: $secondary; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 216 | |
| 217 | &:hover { |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 218 | background-color: $primary-nav-hover; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 219 | color: $dark; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 220 | } |
Yoshie Muranaka | 9f5cea8 | 2020-02-04 09:30:00 -0800 | [diff] [blame] | 221 | |
| 222 | &:focus { |
| 223 | box-shadow: $btn-focus-box-shadow; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 224 | color: $dark; |
Yoshie Muranaka | 9f5cea8 | 2020-02-04 09:30:00 -0800 | [diff] [blame] | 225 | } |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 226 | } |
| 227 | |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 228 | .nav-link--current, |
| 229 | .nav-link--current:hover, |
| 230 | .nav-link--current:focus { |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 231 | font-weight: $headings-font-weight; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 232 | background-color: $secondary; |
| 233 | color: $light; |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 234 | cursor: default; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 235 | |
| 236 | &::before { |
| 237 | content: ''; |
| 238 | position: absolute; |
| 239 | top: 0; |
| 240 | bottom: 0; |
| 241 | left: 0; |
| 242 | width: 4px; |
| 243 | background-color: $primary; |
| 244 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 245 | } |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 246 | |
| 247 | .nav-container { |
| 248 | position: fixed; |
| 249 | width: $navigation-width; |
| 250 | top: $header-height; |
| 251 | bottom: 0; |
| 252 | left: 0; |
| 253 | z-index: $zindex-fixed; |
| 254 | overflow-y: auto; |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 255 | background-color: $container-bgd; |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 256 | transform: translateX(-$navigation-width); |
| 257 | transition: transform $exit-easing--productive $duration--moderate-02; |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 258 | @include media-breakpoint-down(md) { |
| 259 | z-index: $zindex-fixed + 2; |
| 260 | } |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 261 | |
Derick Montague | 74466b8 | 2020-06-28 10:17:32 -0500 | [diff] [blame] | 262 | &.open, |
| 263 | &:focus-within { |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 264 | transform: translateX(0); |
| 265 | transition-timing-function: $entrance-easing--productive; |
| 266 | } |
| 267 | |
| 268 | @include media-breakpoint-up($responsive-layout-bp) { |
| 269 | transition-duration: $duration--fast-01; |
| 270 | transform: translateX(0); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | .nav-overlay { |
| 275 | position: fixed; |
| 276 | top: $header-height; |
| 277 | bottom: 0; |
| 278 | left: 0; |
| 279 | right: 0; |
SurenNeware | 057232b | 2020-06-08 20:53:26 +0530 | [diff] [blame] | 280 | z-index: $zindex-fixed + 1; |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 281 | background-color: $black; |
| 282 | opacity: 0.5; |
| 283 | |
| 284 | &.fade-enter-active { |
| 285 | transition: opacity $duration--moderate-02 $entrance-easing--productive; |
| 286 | } |
| 287 | |
| 288 | &.fade-leave-active { |
| 289 | transition: opacity $duration--fast-02 $exit-easing--productive; |
| 290 | } |
| 291 | |
| 292 | &.fade-enter, |
| 293 | &.fade-leave-to { |
| 294 | opacity: 0; |
| 295 | } |
| 296 | |
| 297 | @include media-breakpoint-up($responsive-layout-bp) { |
| 298 | display: none; |
| 299 | } |
| 300 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 301 | </style> |