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 | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 18 | <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 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"> |
| 37 | <b-nav-item href="javascript:void(0)"> |
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> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 43 | <b-nav-item href="javascript:void(0)"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 44 | {{ $t('appNavigation.serverLed') }} |
| 45 | </b-nav-item> |
Yoshie Muranaka | fa1512b | 2020-02-25 15:54:07 -0800 | [diff] [blame] | 46 | <b-nav-item to="/control/server-power-operations"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 47 | {{ $t('appNavigation.serverPowerOperations') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 48 | </b-nav-item> |
| 49 | </b-collapse> |
| 50 | </li> |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 51 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 52 | <li class="nav-item"> |
| 53 | <b-button v-b-toggle.configuration-menu variant="link"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 54 | <icon-configuration /> |
| 55 | {{ $t('appNavigation.configuration') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 56 | <icon-expand class="icon-expand" /> |
| 57 | </b-button> |
| 58 | <b-collapse id="configuration-menu" tag="ul" class="nav-item__nav"> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 59 | <b-nav-item href="javascript:void(0)"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 60 | {{ $t('appNavigation.firmware') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 61 | </b-nav-item> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 62 | <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 Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 68 | </b-collapse> |
| 69 | </li> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 70 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 71 | <li class="nav-item"> |
| 72 | <b-button v-b-toggle.access-control-menu variant="link"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 73 | <icon-access-control /> |
| 74 | {{ $t('appNavigation.accessControl') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 75 | <icon-expand class="icon-expand" /> |
| 76 | </b-button> |
| 77 | <b-collapse id="access-control-menu" tag="ul" class="nav-item__nav"> |
Yoshie Muranaka | c4e38ab | 2020-04-09 12:41:27 -0700 | [diff] [blame] | 78 | <b-nav-item to="/access-control/ldap"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 79 | {{ $t('appNavigation.ldap') }} |
| 80 | </b-nav-item> |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 81 | <b-nav-item to="/access-control/local-user-management"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 82 | {{ $t('appNavigation.localUserManagement') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 83 | </b-nav-item> |
Yoshie Muranaka | 3739381 | 2020-03-24 15:25:24 -0700 | [diff] [blame] | 84 | <b-nav-item to="/access-control/ssl-certificates"> |
Yoshie Muranaka | e0b76c3 | 2020-02-28 14:18:20 -0800 | [diff] [blame] | 85 | {{ $t('appNavigation.sslCertificates') }} |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 86 | </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 Montague | ad2ceb6 | 2020-04-24 18:11:04 -0500 | [diff] [blame^] | 95 | id="nav-overlay" |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 96 | class="nav-overlay" |
| 97 | @click="toggleIsOpen" |
| 98 | ></div> |
| 99 | </transition> |
| 100 | </div> |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 101 | </template> |
| 102 | |
| 103 | <script> |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 104 | import IconAnalytics from '@carbon/icons-vue/es/analytics/16'; |
| 105 | import IconDataCheck from '@carbon/icons-vue/es/data--check/16'; |
| 106 | import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16'; |
| 107 | import IconSettings from '@carbon/icons-vue/es/settings/16'; |
| 108 | import IconPassword from '@carbon/icons-vue/es/password/16'; |
| 109 | import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16'; |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 110 | |
| 111 | export default { |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 112 | name: 'AppNavigation', |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 113 | components: { |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 114 | iconOverview: IconAnalytics, |
| 115 | iconHealth: IconDataCheck, |
| 116 | iconControl: IconSettingsAdjust, |
| 117 | iconConfiguration: IconSettings, |
| 118 | iconAccessControl: IconPassword, |
| 119 | iconExpand: IconChevronUp |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 120 | }, |
| 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 Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 141 | } |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 142 | }; |
| 143 | </script> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 144 | |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 145 | <style scoped lang="scss"> |
Derick Montague | 4086572 | 2020-04-13 17:01:19 -0500 | [diff] [blame] | 146 | @import 'src/assets/styles/helpers'; |
| 147 | |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 148 | svg { |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 149 | fill: currentColor; |
| 150 | height: 1.2rem; |
| 151 | width: 1.2rem; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 152 | 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 Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 160 | padding-top: $spacer; |
| 161 | } |
| 162 | |
| 163 | .nav-item__nav { |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 164 | list-style: none; |
| 165 | padding-left: 0; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 166 | margin-left: 0; |
| 167 | |
| 168 | .nav-link { |
| 169 | padding-left: $spacer * 4; |
| 170 | |
| 171 | &:not(.nav-link--current) { |
| 172 | font-weight: normal; |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | .btn-link { |
| 178 | width: 100%; |
| 179 | text-align: left; |
| 180 | text-decoration: none !important; |
| 181 | border-radius: 0; |
| 182 | |
| 183 | &.collapsed { |
| 184 | .icon-expand { |
| 185 | transform: rotate(180deg); |
| 186 | } |
| 187 | } |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | .icon-expand { |
| 191 | float: right; |
| 192 | margin-top: $spacer / 4; |
| 193 | } |
| 194 | |
| 195 | .btn-link, |
| 196 | .nav-link { |
| 197 | position: relative; |
| 198 | font-weight: $headings-font-weight; |
| 199 | padding-left: $spacer; // defining consistent padding for links and buttons |
| 200 | padding-right: $spacer; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 201 | color: $secondary; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 202 | |
| 203 | &:hover { |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 204 | background-color: $primary-nav-hover; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 205 | color: $dark; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 206 | } |
Yoshie Muranaka | 9f5cea8 | 2020-02-04 09:30:00 -0800 | [diff] [blame] | 207 | |
| 208 | &:focus { |
| 209 | box-shadow: $btn-focus-box-shadow; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 210 | color: $dark; |
Yoshie Muranaka | 9f5cea8 | 2020-02-04 09:30:00 -0800 | [diff] [blame] | 211 | } |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 212 | } |
| 213 | |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 214 | .nav-link--current, |
| 215 | .nav-link--current:hover, |
| 216 | .nav-link--current:focus { |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 217 | font-weight: $headings-font-weight; |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 218 | background-color: $secondary; |
| 219 | color: $light; |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 220 | cursor: default; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 221 | |
| 222 | &::before { |
| 223 | content: ''; |
| 224 | position: absolute; |
| 225 | top: 0; |
| 226 | bottom: 0; |
| 227 | left: 0; |
| 228 | width: 4px; |
| 229 | background-color: $primary; |
| 230 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 231 | } |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 232 | |
| 233 | .nav-container { |
| 234 | position: fixed; |
| 235 | width: $navigation-width; |
| 236 | top: $header-height; |
| 237 | bottom: 0; |
| 238 | left: 0; |
| 239 | z-index: $zindex-fixed; |
| 240 | overflow-y: auto; |
Derick Montague | 66f903f | 2020-02-28 11:22:31 -0600 | [diff] [blame] | 241 | background-color: $container-bgd; |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame] | 242 | transform: translateX(-$navigation-width); |
| 243 | transition: transform $exit-easing--productive $duration--moderate-02; |
| 244 | |
| 245 | &.open { |
| 246 | transform: translateX(0); |
| 247 | transition-timing-function: $entrance-easing--productive; |
| 248 | } |
| 249 | |
| 250 | @include media-breakpoint-up($responsive-layout-bp) { |
| 251 | transition-duration: $duration--fast-01; |
| 252 | transform: translateX(0); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | .nav-overlay { |
| 257 | position: fixed; |
| 258 | top: $header-height; |
| 259 | bottom: 0; |
| 260 | left: 0; |
| 261 | right: 0; |
| 262 | z-index: $zindex-fixed - 1; |
| 263 | background-color: $black; |
| 264 | opacity: 0.5; |
| 265 | |
| 266 | &.fade-enter-active { |
| 267 | transition: opacity $duration--moderate-02 $entrance-easing--productive; |
| 268 | } |
| 269 | |
| 270 | &.fade-leave-active { |
| 271 | transition: opacity $duration--fast-02 $exit-easing--productive; |
| 272 | } |
| 273 | |
| 274 | &.fade-enter, |
| 275 | &.fade-leave-to { |
| 276 | opacity: 0; |
| 277 | } |
| 278 | |
| 279 | @include media-breakpoint-up($responsive-layout-bp) { |
| 280 | display: none; |
| 281 | } |
| 282 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 283 | </style> |