Quickstart - Bundle Serial-Over-Lan Control¶
This document shows how to:
- Run the SOL control in development enviroment
- Create a bundle for SOL control
- Add bundle to a sample HTML file
Prerequisites¶
In order to deploy and make changes, the following tools and application has to be installed on your development machine
- Git
- Visual Studio Code or any other IDE
- Node.js
- Chrome* Browser
- MPS Server with an AMT Device Connected
Download and Install UI Toolkit¶
-
Open a Terminal (Linux) or Command Prompt (Windows) and navigate to a directory of your choice for development.
-
Clone the UI-Toolkit Repository.
git clone https://github.com/open-amt-cloud-toolkit/ui-toolkit --branch v1.3.0
-
Change to the
ui-toolkit
directory.cd ui_toolkit
-
Install the dependencies.
npm install
Run in Development Environment¶
To add and test new changes before bundling the control, use a webpack dev server.
-
Start the server.
npm start
-
Open a Chrome* browser and navigate to the following link to see changes.
http://localhost:8080/sol.htm?deviceId=[AMT-Device-GUID]&mpsServer=https://[MPS-Server-IP-Address]:3000
Note
By default, the webpack dev server runs on port 8080. If port 8080 is already in use, webpack automatically runs on the next immediate available port.
Create Bundle¶
-
To bundle, navigate to the
ui-toolkit
directory in a Terminal (Linux) or Command Prompt (Windows). -
Remove or rename the existing sol.core.min.js in the
ui-toolkit/dist/
directory before building. -
Build the bundle.
npm run build
A new kvm.core.min.js will be created in the
ui-toolkit/dist/
directory.Note
To bundle the Serial-Over-LAN control without node_modules, run the following build command instead.
The bundle generated using the build-ext command can be used in react apps as an independent controlnpm run built-ext
Add to Sample HTML Page¶
-
Add the following code snippet to sampleSOL.htm in the
ui-toolkit/src/sample/
directory using an editor of your choice.<body> <div id="sol"></div> <script src="../../dist/sol.core.min.js" crossorigin></script> </body>
-
In a Terminal (Linux) or Command Prompt (Windows), navigate to the
ui-toolkit
directory. -
Serve the HTML page.
npx serve
-
Open a new Chrome* browser and navigate to the following URL:
http://localhost:5000/src/sample/sampleSOL.htm?deviceId=[AMT-Device-GUID]&mpsServer=https://[MPS-Server-IP-Address]:3000
You will see errors in the following scenarios:
- UI-toolkit was not downloaded and installed into your react app
- MPS Server is not running
- MPS Server is running but the device is not connected