xref: /openbmc/docs/development/web-ui.md (revision f4febd002df578bad816239b70950f84ea4567e8)
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
5d8eb503aSDixsie Wolmers**Audience:** Developer familiar with HTML, CSS and JS
6318d9707SAndrew Geissler
7318d9707SAndrew Geissler**Prerequisites:** Current Linux, Mac, or Windows system
8318d9707SAndrew Geissler
9d8eb503aSDixsie Wolmers# Webui-vue
10318d9707SAndrew Geissler
11*f4febd00SPatrick WilliamsThe [webui-vue](https://github.com/openbmc/webui-vue) repository will replace
12*f4febd00SPatrick Williamsphosphor-webui once it is deprecated. Webui-vue uses the
13*f4febd00SPatrick Williams[Vue.js](https://vuejs.org/) framework to interact with the BMC via the Redfish
14*f4febd00SPatrick WilliamsAPI.
15318d9707SAndrew Geissler
16d8eb503aSDixsie WolmersVisit [README.md](https://github.com/openbmc/webui-vue/blob/master/README.md) to
17*f4febd00SPatrick Williamslearn more about why the Vue.js application was created, features needed to
18*f4febd00SPatrick Williamsreach parity and why it is replacing the Angular.JS application.
19318d9707SAndrew Geissler
20*f4febd00SPatrick WilliamsVisit
21*f4febd00SPatrick Williams[CONTRIBUTING.md](https://github.com/openbmc/webui-vue/blob/master/CONTRIBUTING.md)
22*f4febd00SPatrick Williamsto find information on project set-up, design information, and contributing
23*f4febd00SPatrick Williamsprocesses.
24318d9707SAndrew Geissler
25*f4febd00SPatrick WilliamsVisit the [OpenBMC Web UI Style Guide](https://openbmc.github.io/webui-vue/) to
26*f4febd00SPatrick Williamsfind information on:
27318d9707SAndrew Geissler
28d8eb503aSDixsie Wolmers- Coding Standards
29d8eb503aSDixsie Wolmers- Guidelines
30d8eb503aSDixsie Wolmers- Unit Testing
31d8eb503aSDixsie Wolmers- Components Usage
32d8eb503aSDixsie Wolmers- Quick Start References
33318d9707SAndrew Geissler
34*f4febd00SPatrick WilliamsVisit the
35*f4febd00SPatrick Williams[OpenBMC Web UI Themes Guide - How to customize](https://openbmc.github.io/webui-vue/themes/customize.html)
36d8eb503aSDixsie Wolmersto learn how to create custom builds to meet your branding and customization
37d8eb503aSDixsie Wolmersneeds for:
38d8eb503aSDixsie Wolmers
39d8eb503aSDixsie Wolmers- Routing
40d8eb503aSDixsie Wolmers- Navigation
41d8eb503aSDixsie Wolmers- State Store
42d8eb503aSDixsie Wolmers- Theming
43d8eb503aSDixsie Wolmers
44d8eb503aSDixsie Wolmers## Load Web UI against QEMU
45d8eb503aSDixsie Wolmers
46d8eb503aSDixsie WolmersConnect to Web UI in QEMU
47d8eb503aSDixsie Wolmers
48*f4febd00SPatrick Williams1. You will need the QEMU session running per instructions in the "Download and
49*f4febd00SPatrick Williams   Start QEMU Session" section of
50d8eb503aSDixsie Wolmers   [dev-environment](https://github.com/openbmc/docs/blob/master/development/dev-environment.md).
51d8eb503aSDixsie Wolmers
52d8eb503aSDixsie Wolmers2. Assuming you used the default of 2443 for the HTTPS port in your QEMU
53318d9707SAndrew Geissler   session, you will point your web browser to https://localhost:2443.
54d8eb503aSDixsie Wolmers
55d8eb503aSDixsie Wolmers3. Login with default username and password and verify basic Web UI features are
56318d9707SAndrew Geissler   working as expected.
57318d9707SAndrew Geissler
58318d9707SAndrew Geissler**Note** You will need to approve the security exception in your browser to
59d8eb503aSDixsie Wolmersconnect. OpenBMC is running with a self-signed SSL certificate.
60318d9707SAndrew Geissler
61d8eb503aSDixsie Wolmers# Phosphor-webui
62d8eb503aSDixsie Wolmers
63d8eb503aSDixsie WolmersThe [phosphor-webui](https://github.com/openbmc/phosphor-webui) repository
64d8eb503aSDixsie Wolmersprovides a web-based interface for an OpenBMC. It uses the
65*f4febd00SPatrick Williams[AngularJS](https://angularjs.org/) framework to interact with the BMC via REST
66*f4febd00SPatrick WilliamsAPI calls. It allows users to view hardware information, update firmware, set
67*f4febd00SPatrick Williamsnetwork settings, and much more.
68d8eb503aSDixsie Wolmers
69*f4febd00SPatrick WilliamsSee directions below to learn
70*f4febd00SPatrick Williams[how to customize phosphor-webui](#customize-phosphor-webui).
71d8eb503aSDixsie Wolmers
72*f4febd00SPatrick WilliamsPhosphor-webui was built on AngularJS and AngularJS goes End of Life June
73*f4febd00SPatrick Williams30, 2021.
74d8eb503aSDixsie Wolmers
75d8eb503aSDixsie Wolmers## Customize Phosphor-webui
76318d9707SAndrew Geissler
77318d9707SAndrew Geissler1. Clone the repository
78318d9707SAndrew Geissler
79318d9707SAndrew Geissler   ```
80318d9707SAndrew Geissler   git clone https://github.com/openbmc/phosphor-webui.git
81318d9707SAndrew Geissler   ```
82318d9707SAndrew Geissler
83318d9707SAndrew Geissler2. Install appropriate packages and start web UI
84318d9707SAndrew Geissler
85*f4febd00SPatrick Williams   Follow the directions in the phosphor-webui
86*f4febd00SPatrick Williams   [README](https://github.com/openbmc/phosphor-webui/blob/master/README.md) to
87*f4febd00SPatrick Williams   install the required packages and start the web UI. You can use the
88*f4febd00SPatrick Williams   development environment created in
89*f4febd00SPatrick Williams   [dev-environment](https://github.com/openbmc/docs/blob/master/development/dev-environment.md)
90318d9707SAndrew Geissler   or your own system assuming you install the required packages noted in the
91318d9707SAndrew Geissler   README.
92318d9707SAndrew Geissler
93318d9707SAndrew Geissler3. Customize the web UI login screen and verify
94318d9707SAndrew Geissler
95318d9707SAndrew Geissler   Kill your npm run from the previous step using Ctrl^C. Grab a png that you
96318d9707SAndrew Geissler   will use to represent your customized version of OpenBMC. Feel free to use
97318d9707SAndrew Geissler   any .png you wish for this step.
98d8eb503aSDixsie Wolmers
99318d9707SAndrew Geissler   ```
100318d9707SAndrew Geissler   wget http://www.pngmart.com/files/3/Free-PNG-Transparent-Image.png
101318d9707SAndrew Geissler   ```
102318d9707SAndrew Geissler
103318d9707SAndrew Geissler   Copy your new .png into the appropriate directory
104d8eb503aSDixsie Wolmers
105318d9707SAndrew Geissler   ```
106318d9707SAndrew Geissler   cp Free-PNG-Transparent-Image.png app/assets/images/
107318d9707SAndrew Geissler   ```
108318d9707SAndrew Geissler
109318d9707SAndrew Geissler   Point to that new image in the web UI HTML
110d8eb503aSDixsie Wolmers
111318d9707SAndrew Geissler   ```
112318d9707SAndrew Geissler   vi app/login/controllers/login-controller.html
113318d9707SAndrew Geissler   # Replace the logo.svg near the top with Free-PNG-Transparent-Image.png
114318d9707SAndrew Geissler   <img src="../../assets/images/Free-PNG-Transparent-Image.png" class="login__logo" alt="OpenBMC logo" role="img"/>
115318d9707SAndrew Geissler   ```
116318d9707SAndrew Geissler
117318d9707SAndrew Geissler   Start up the server with your change
118d8eb503aSDixsie Wolmers
119318d9707SAndrew Geissler   ```
120318d9707SAndrew Geissler   npm run-script server
121318d9707SAndrew Geissler   ```
122318d9707SAndrew Geissler
123318d9707SAndrew Geissler   Load web browser at https://localhost:8080 and verify your new image is on
124318d9707SAndrew Geissler   the login screen.
125318d9707SAndrew Geissler
126318d9707SAndrew Geissler   Kill your npm run using Ctrl^C.
127318d9707SAndrew Geissler
128*f4febd00SPatrick Williams4. Customize the header with the new image and verify The header is on every
129*f4febd00SPatrick Williams   page in the web UI. It has a smaller version of the logo in it which we are
130*f4febd00SPatrick Williams   changing with this step.
131318d9707SAndrew Geissler
132318d9707SAndrew Geissler   Similar to the previous step, modify the appropriate HTML for the header:
133d8eb503aSDixsie Wolmers
134318d9707SAndrew Geissler   ```
135318d9707SAndrew Geissler   vi app/common/directives/app-header.html
136318d9707SAndrew Geissler   # Replace logo.svg with Free-PNG-Transparent-Image.png again
137318d9707SAndrew Geissler   <div class="logo__wrapper"><img src="../../assets/images/Free-PNG-Transparent-Image.png" class="header__logo" alt="company logo"/></div>
138318d9707SAndrew Geissler   ```
139318d9707SAndrew Geissler
140318d9707SAndrew Geissler   Start up the server with your change
141d8eb503aSDixsie Wolmers
142318d9707SAndrew Geissler   ```
143318d9707SAndrew Geissler   npm run-script server
144318d9707SAndrew Geissler   ```
145d8eb503aSDixsie Wolmers
146318d9707SAndrew Geissler   Browse to https://localhost:8080 and verify your new image is on the header.
147d8eb503aSDixsie Wolmers
148*f4febd00SPatrick Williams   Note that you will need to log in to view the header. Point the web UI to
149*f4febd00SPatrick Williams   your QEMU session by typing the QEMU session (e.g. localhost:2443) in the
150*f4febd00SPatrick Williams   "BMC HOST OR BMC IP ADDRESS" field.
151318d9707SAndrew Geissler
152318d9707SAndrew Geissler   Note that in the HTML where you're replacing the images, there is also the
153*f4febd00SPatrick Williams   corresponding text that goes with the images. Changing the text to match with
154*f4febd00SPatrick Williams   your logo is also something you can easily do to customize your creation of
155*f4febd00SPatrick Williams   an OpenBMC system.
156318d9707SAndrew Geissler
157d8eb503aSDixsie Wolmers   And that's it! You've downloaded, customized, and run the OpenBMC
158d8eb503aSDixsie Wolmers   phosphor-webui code!
159