1318d9707SAndrew Geissler# OpenBMC Web User Interface Development 2318d9707SAndrew Geissler 3318d9707SAndrew Geissler**Document Purpose:** How to customize, build, and run the OpenBMC Web UI 4318d9707SAndrew Geissler 5*d8eb503aSDixsie Wolmers**Audience:** Developer familiar with HTML, CSS and JS 6318d9707SAndrew Geissler 7318d9707SAndrew Geissler**Prerequisites:** Current Linux, Mac, or Windows system 8318d9707SAndrew Geissler 9*d8eb503aSDixsie Wolmers# Webui-vue 10318d9707SAndrew Geissler 11*d8eb503aSDixsie WolmersThe [webui-vue](https://github.com/openbmc/webui-vue) repository 12*d8eb503aSDixsie Wolmerswill replace phosphor-webui once it is deprecated. Webui-vue uses the 13*d8eb503aSDixsie Wolmers[Vue.js](https://vuejs.org/) framework to interact with the BMC via the 14*d8eb503aSDixsie WolmersRedfish API. 15318d9707SAndrew Geissler 16*d8eb503aSDixsie WolmersVisit [README.md](https://github.com/openbmc/webui-vue/blob/master/README.md) to 17*d8eb503aSDixsie Wolmerslearn more about why the Vue.js application was created, features needed to reach parity and why it is 18*d8eb503aSDixsie Wolmersreplacing the Angular.JS application. 19318d9707SAndrew Geissler 20*d8eb503aSDixsie WolmersVisit [CONTRIBUTING.md](https://github.com/openbmc/webui-vue/blob/master/CONTRIBUTING.md) 21*d8eb503aSDixsie Wolmersto find information on project set-up, design information, and contributing processes. 22318d9707SAndrew Geissler 23*d8eb503aSDixsie WolmersVisit the [OpenBMC Web UI Style Guide](https://openbmc.github.io/webui-vue/) 24*d8eb503aSDixsie Wolmersto find information on: 25318d9707SAndrew Geissler 26*d8eb503aSDixsie Wolmers- Coding Standards 27*d8eb503aSDixsie Wolmers- Guidelines 28*d8eb503aSDixsie Wolmers- Unit Testing 29*d8eb503aSDixsie Wolmers- Components Usage 30*d8eb503aSDixsie Wolmers- Quick Start References 31318d9707SAndrew Geissler 32*d8eb503aSDixsie WolmersVisit the [OpenBMC Web UI Themes Guide - How to customize](https://openbmc.github.io/webui-vue/themes/customize.html) 33*d8eb503aSDixsie Wolmersto learn how to create custom builds to meet your branding and customization 34*d8eb503aSDixsie Wolmersneeds for: 35*d8eb503aSDixsie Wolmers 36*d8eb503aSDixsie Wolmers- Routing 37*d8eb503aSDixsie Wolmers- Navigation 38*d8eb503aSDixsie Wolmers- State Store 39*d8eb503aSDixsie Wolmers- Theming 40*d8eb503aSDixsie Wolmers 41*d8eb503aSDixsie Wolmers## Load Web UI against QEMU 42*d8eb503aSDixsie Wolmers 43*d8eb503aSDixsie WolmersConnect to Web UI in QEMU 44*d8eb503aSDixsie Wolmers 45*d8eb503aSDixsie Wolmers1. You will need the QEMU session running per instructions in the 46*d8eb503aSDixsie Wolmers "Download and Start QEMU Session" section of 47*d8eb503aSDixsie Wolmers [dev-environment](https://github.com/openbmc/docs/blob/master/development/dev-environment.md). 48*d8eb503aSDixsie Wolmers 49*d8eb503aSDixsie Wolmers2. Assuming you used the default of 2443 for the HTTPS port in your QEMU 50318d9707SAndrew Geissler session, you will point your web browser to https://localhost:2443. 51*d8eb503aSDixsie Wolmers 52*d8eb503aSDixsie Wolmers3. Login with default username and password and verify basic Web UI features are 53318d9707SAndrew Geissler working as expected. 54318d9707SAndrew Geissler 55318d9707SAndrew Geissler**Note** You will need to approve the security exception in your browser to 56*d8eb503aSDixsie Wolmersconnect. OpenBMC is running with a self-signed SSL certificate. 57318d9707SAndrew Geissler 58*d8eb503aSDixsie Wolmers# Phosphor-webui 59*d8eb503aSDixsie Wolmers 60*d8eb503aSDixsie WolmersThe [phosphor-webui](https://github.com/openbmc/phosphor-webui) repository 61*d8eb503aSDixsie Wolmersprovides a web-based interface for an OpenBMC. It uses the 62*d8eb503aSDixsie Wolmers[AngularJS](https://angularjs.org/) framework to interact with the BMC via REST API calls. It allows users 63*d8eb503aSDixsie Wolmersto view hardware information, update firmware, set network settings, and much 64*d8eb503aSDixsie Wolmersmore. 65*d8eb503aSDixsie Wolmers 66*d8eb503aSDixsie WolmersSee directions below to learn [how to customize 67*d8eb503aSDixsie Wolmersphosphor-webui](#customize-phosphor-webui). 68*d8eb503aSDixsie Wolmers 69*d8eb503aSDixsie WolmersPhosphor-webui was built on AngularJS and AngularJS goes End of Life June 30, 70*d8eb503aSDixsie Wolmers2021. 71*d8eb503aSDixsie Wolmers 72*d8eb503aSDixsie Wolmers## Customize Phosphor-webui 73318d9707SAndrew Geissler 74318d9707SAndrew Geissler1. Clone the repository 75318d9707SAndrew Geissler 76318d9707SAndrew Geissler ``` 77318d9707SAndrew Geissler git clone https://github.com/openbmc/phosphor-webui.git 78318d9707SAndrew Geissler ``` 79318d9707SAndrew Geissler 80318d9707SAndrew Geissler2. Install appropriate packages and start web UI 81318d9707SAndrew Geissler 82318d9707SAndrew Geissler Follow the directions in the phosphor-webui [README](https://github.com/openbmc/phosphor-webui/blob/master/README.md) 83318d9707SAndrew Geissler to install the required packages and start the web UI. You can use the 84318d9707SAndrew Geissler development environment created in [dev-environment](https://github.com/openbmc/docs/blob/master/development/dev-environment.md) 85318d9707SAndrew Geissler or your own system assuming you install the required packages noted in the 86318d9707SAndrew Geissler README. 87318d9707SAndrew Geissler 88318d9707SAndrew Geissler3. Customize the web UI login screen and verify 89318d9707SAndrew Geissler 90318d9707SAndrew Geissler Kill your npm run from the previous step using Ctrl^C. Grab a png that you 91318d9707SAndrew Geissler will use to represent your customized version of OpenBMC. Feel free to use 92318d9707SAndrew Geissler any .png you wish for this step. 93*d8eb503aSDixsie Wolmers 94318d9707SAndrew Geissler ``` 95318d9707SAndrew Geissler wget http://www.pngmart.com/files/3/Free-PNG-Transparent-Image.png 96318d9707SAndrew Geissler ``` 97318d9707SAndrew Geissler 98318d9707SAndrew Geissler Copy your new .png into the appropriate directory 99*d8eb503aSDixsie Wolmers 100318d9707SAndrew Geissler ``` 101318d9707SAndrew Geissler cp Free-PNG-Transparent-Image.png app/assets/images/ 102318d9707SAndrew Geissler ``` 103318d9707SAndrew Geissler 104318d9707SAndrew Geissler Point to that new image in the web UI HTML 105*d8eb503aSDixsie Wolmers 106318d9707SAndrew Geissler ``` 107318d9707SAndrew Geissler vi app/login/controllers/login-controller.html 108318d9707SAndrew Geissler # Replace the logo.svg near the top with Free-PNG-Transparent-Image.png 109318d9707SAndrew Geissler <img src="../../assets/images/Free-PNG-Transparent-Image.png" class="login__logo" alt="OpenBMC logo" role="img"/> 110318d9707SAndrew Geissler ``` 111318d9707SAndrew Geissler 112318d9707SAndrew Geissler Start up the server with your change 113*d8eb503aSDixsie Wolmers 114318d9707SAndrew Geissler ``` 115318d9707SAndrew Geissler npm run-script server 116318d9707SAndrew Geissler ``` 117318d9707SAndrew Geissler 118318d9707SAndrew Geissler Load web browser at https://localhost:8080 and verify your new image is on 119318d9707SAndrew Geissler the login screen. 120318d9707SAndrew Geissler 121318d9707SAndrew Geissler Kill your npm run using Ctrl^C. 122318d9707SAndrew Geissler 123318d9707SAndrew Geissler4. Customize the header with the new image and verify 124318d9707SAndrew Geissler The header is on every page in the web UI. It has a smaller version of the 125318d9707SAndrew Geissler logo in it which we are changing with this step. 126318d9707SAndrew Geissler 127318d9707SAndrew Geissler Similar to the previous step, modify the appropriate HTML for the header: 128*d8eb503aSDixsie Wolmers 129318d9707SAndrew Geissler ``` 130318d9707SAndrew Geissler vi app/common/directives/app-header.html 131318d9707SAndrew Geissler # Replace logo.svg with Free-PNG-Transparent-Image.png again 132318d9707SAndrew Geissler <div class="logo__wrapper"><img src="../../assets/images/Free-PNG-Transparent-Image.png" class="header__logo" alt="company logo"/></div> 133318d9707SAndrew Geissler ``` 134318d9707SAndrew Geissler 135318d9707SAndrew Geissler Start up the server with your change 136*d8eb503aSDixsie Wolmers 137318d9707SAndrew Geissler ``` 138318d9707SAndrew Geissler npm run-script server 139318d9707SAndrew Geissler ``` 140*d8eb503aSDixsie Wolmers 141318d9707SAndrew Geissler Browse to https://localhost:8080 and verify your new image is on the header. 142*d8eb503aSDixsie Wolmers 143318d9707SAndrew Geissler Note that you will need to log in to view the header. Point the web UI to your 144318d9707SAndrew Geissler QEMU session by typing the QEMU session (e.g. localhost:2443) in the "BMC HOST 145318d9707SAndrew Geissler OR BMC IP ADDRESS" field. 146318d9707SAndrew Geissler 147318d9707SAndrew Geissler Note that in the HTML where you're replacing the images, there is also the 148318d9707SAndrew Geissler corresponding text that goes with the images. Changing the text to match 149318d9707SAndrew Geissler with your logo is also something you can easily do to customize your creation 150318d9707SAndrew Geissler of an OpenBMC system. 151318d9707SAndrew Geissler 152*d8eb503aSDixsie Wolmers And that's it! You've downloaded, customized, and run the OpenBMC 153*d8eb503aSDixsie Wolmers phosphor-webui code! 154