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 }"> |
| 4 | <nav ref="nav"> |
| 5 | <b-nav vertical> |
| 6 | <b-nav-item to="/"><icon-overview />Overview</b-nav-item> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 7 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame^] | 8 | <li class="nav-item"> |
| 9 | <b-button v-b-toggle.health-menu variant="link"> |
| 10 | <icon-health />Health |
| 11 | <icon-expand class="icon-expand" /> |
| 12 | </b-button> |
| 13 | <b-collapse id="health-menu" tag="ul" class="nav-item__nav"> |
| 14 | <b-nav-item href="javascript:void(0)">Event Log</b-nav-item> |
| 15 | <b-nav-item href="javascript:void(0)">Hardware Status</b-nav-item> |
| 16 | <b-nav-item href="javascript:void(0)">Sensors</b-nav-item> |
| 17 | </b-collapse> |
| 18 | </li> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 19 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame^] | 20 | <li class="nav-item"> |
| 21 | <b-button v-b-toggle.control-menu variant="link"> |
| 22 | <icon-control />Control |
| 23 | <icon-expand class="icon-expand" /> |
| 24 | </b-button> |
| 25 | <b-collapse id="control-menu" tag="ul" class="nav-item__nav"> |
| 26 | <b-nav-item href="javascript:void(0)"> |
| 27 | Manage power usage |
| 28 | </b-nav-item> |
| 29 | <b-nav-item href="javascript:void(0)">Server LED</b-nav-item> |
| 30 | <b-nav-item href="javascript:void(0)"> |
| 31 | Server power operations |
| 32 | </b-nav-item> |
| 33 | </b-collapse> |
| 34 | </li> |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 35 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame^] | 36 | <li class="nav-item"> |
| 37 | <b-button v-b-toggle.configuration-menu variant="link"> |
| 38 | <icon-configuration />Configuration |
| 39 | <icon-expand class="icon-expand" /> |
| 40 | </b-button> |
| 41 | <b-collapse id="configuration-menu" tag="ul" class="nav-item__nav"> |
| 42 | <b-nav-item href="javascript:void(0)">Firmware</b-nav-item> |
| 43 | <b-nav-item href="javascript:void(0)"> |
| 44 | Network settings |
| 45 | </b-nav-item> |
| 46 | <b-nav-item href="javascript:void(0)">SNMP settings</b-nav-item> |
| 47 | </b-collapse> |
| 48 | </li> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 49 | |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame^] | 50 | <li class="nav-item"> |
| 51 | <b-button v-b-toggle.access-control-menu variant="link"> |
| 52 | <icon-access-control />Access Control |
| 53 | <icon-expand class="icon-expand" /> |
| 54 | </b-button> |
| 55 | <b-collapse id="access-control-menu" tag="ul" class="nav-item__nav"> |
| 56 | <b-nav-item href="javascript:void(0)">LDAP</b-nav-item> |
| 57 | <b-nav-item to="/access-control/local-user-management"> |
| 58 | Local user management |
| 59 | </b-nav-item> |
| 60 | <b-nav-item href="javascript:void(0)"> |
| 61 | SSL Certificates |
| 62 | </b-nav-item> |
| 63 | </b-collapse> |
| 64 | </li> |
| 65 | </b-nav> |
| 66 | </nav> |
| 67 | </div> |
| 68 | <transition name="fade"> |
| 69 | <div |
| 70 | v-if="isNavigationOpen" |
| 71 | class="nav-overlay" |
| 72 | @click="toggleIsOpen" |
| 73 | ></div> |
| 74 | </transition> |
| 75 | </div> |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 76 | </template> |
| 77 | |
| 78 | <script> |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 79 | import IconAnalytics from '@carbon/icons-vue/es/analytics/16'; |
| 80 | import IconDataCheck from '@carbon/icons-vue/es/data--check/16'; |
| 81 | import IconSettingsAdjust from '@carbon/icons-vue/es/settings--adjust/16'; |
| 82 | import IconSettings from '@carbon/icons-vue/es/settings/16'; |
| 83 | import IconPassword from '@carbon/icons-vue/es/password/16'; |
| 84 | import IconChevronUp from '@carbon/icons-vue/es/chevron--up/16'; |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 85 | |
| 86 | export default { |
Derick Montague | e2fd156 | 2019-12-20 13:26:53 -0600 | [diff] [blame] | 87 | name: 'AppNavigation', |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 88 | components: { |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 89 | iconOverview: IconAnalytics, |
| 90 | iconHealth: IconDataCheck, |
| 91 | iconControl: IconSettingsAdjust, |
| 92 | iconConfiguration: IconSettings, |
| 93 | iconAccessControl: IconPassword, |
| 94 | iconExpand: IconChevronUp |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame^] | 95 | }, |
| 96 | data() { |
| 97 | return { |
| 98 | isNavigationOpen: false |
| 99 | }; |
| 100 | }, |
| 101 | watch: { |
| 102 | $route: function() { |
| 103 | this.isNavigationOpen = false; |
| 104 | }, |
| 105 | isNavigationOpen: function(isNavigationOpen) { |
| 106 | this.$root.$emit('change:isNavigationOpen', isNavigationOpen); |
| 107 | } |
| 108 | }, |
| 109 | mounted() { |
| 110 | this.$root.$on('toggle:navigation', () => this.toggleIsOpen()); |
| 111 | }, |
| 112 | methods: { |
| 113 | toggleIsOpen() { |
| 114 | this.isNavigationOpen = !this.isNavigationOpen; |
| 115 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 116 | } |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 117 | }; |
| 118 | </script> |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 119 | |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 120 | <style scoped lang="scss"> |
| 121 | svg { |
| 122 | fill: $gray-900; |
| 123 | margin-left: 0 !important; //!important overriding button specificity |
| 124 | vertical-align: text-bottom; |
| 125 | &:not(.icon-expand) { |
| 126 | margin-right: $spacer; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | .nav { |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 131 | padding-top: $spacer; |
| 132 | } |
| 133 | |
| 134 | .nav-item__nav { |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 135 | list-style: none; |
| 136 | padding-left: 0; |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 137 | margin-left: 0; |
| 138 | |
| 139 | .nav-link { |
| 140 | padding-left: $spacer * 4; |
| 141 | |
| 142 | &:not(.nav-link--current) { |
| 143 | font-weight: normal; |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | .btn-link { |
| 149 | width: 100%; |
| 150 | text-align: left; |
| 151 | text-decoration: none !important; |
| 152 | border-radius: 0; |
| 153 | |
| 154 | &.collapsed { |
| 155 | .icon-expand { |
| 156 | transform: rotate(180deg); |
| 157 | } |
| 158 | } |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | .icon-expand { |
| 162 | float: right; |
| 163 | margin-top: $spacer / 4; |
| 164 | } |
| 165 | |
| 166 | .btn-link, |
| 167 | .nav-link { |
| 168 | position: relative; |
| 169 | font-weight: $headings-font-weight; |
| 170 | padding-left: $spacer; // defining consistent padding for links and buttons |
| 171 | padding-right: $spacer; |
| 172 | color: $gray-900 !important; //using important to avoid styling states |
| 173 | |
| 174 | &:hover { |
| 175 | background-color: $gray-300; |
| 176 | } |
Yoshie Muranaka | 9f5cea8 | 2020-02-04 09:30:00 -0800 | [diff] [blame] | 177 | |
| 178 | &:focus { |
| 179 | box-shadow: $btn-focus-box-shadow; |
| 180 | } |
Yoshie Muranaka | 71ac230 | 2019-12-26 11:43:36 -0800 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | .nav-link--current { |
| 184 | font-weight: $headings-font-weight; |
| 185 | background-color: $gray-300; |
| 186 | |
| 187 | &::before { |
| 188 | content: ''; |
| 189 | position: absolute; |
| 190 | top: 0; |
| 191 | bottom: 0; |
| 192 | left: 0; |
| 193 | width: 4px; |
| 194 | background-color: $primary; |
| 195 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 196 | } |
Yoshie Muranaka | 74f8687 | 2020-02-10 12:28:37 -0800 | [diff] [blame^] | 197 | |
| 198 | .nav-container { |
| 199 | position: fixed; |
| 200 | width: $navigation-width; |
| 201 | top: $header-height; |
| 202 | bottom: 0; |
| 203 | left: 0; |
| 204 | z-index: $zindex-fixed; |
| 205 | overflow-y: auto; |
| 206 | background-color: $gray-200; |
| 207 | transform: translateX(-$navigation-width); |
| 208 | transition: transform $exit-easing--productive $duration--moderate-02; |
| 209 | |
| 210 | &.open { |
| 211 | transform: translateX(0); |
| 212 | transition-timing-function: $entrance-easing--productive; |
| 213 | } |
| 214 | |
| 215 | @include media-breakpoint-up($responsive-layout-bp) { |
| 216 | transition-duration: $duration--fast-01; |
| 217 | transform: translateX(0); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | .nav-overlay { |
| 222 | position: fixed; |
| 223 | top: $header-height; |
| 224 | bottom: 0; |
| 225 | left: 0; |
| 226 | right: 0; |
| 227 | z-index: $zindex-fixed - 1; |
| 228 | background-color: $black; |
| 229 | opacity: 0.5; |
| 230 | |
| 231 | &.fade-enter-active { |
| 232 | transition: opacity $duration--moderate-02 $entrance-easing--productive; |
| 233 | } |
| 234 | |
| 235 | &.fade-leave-active { |
| 236 | transition: opacity $duration--fast-02 $exit-easing--productive; |
| 237 | } |
| 238 | |
| 239 | &.fade-enter, |
| 240 | &.fade-leave-to { |
| 241 | opacity: 0; |
| 242 | } |
| 243 | |
| 244 | @include media-breakpoint-up($responsive-layout-bp) { |
| 245 | display: none; |
| 246 | } |
| 247 | } |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 248 | </style> |