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