Allows monitoring of instrument PVs via a web page.
Frontend: NextJS using React, Tailwind CSS
Backend: pvws
Install NodeJS - we are using nvm-windows
for installing on windows, and the lts
version of node.
To install all dependencies, use:
npm install
This web dashboard relies on a PVWS instance to forward EPICS data via a websocket. #30 should mean that there is a central instance running which will be used for production, but you may point your web dashboard at a local instance for dev work.
Running PVWS locally for development
To run a PVWS instance locally, the Tomcat 9 binaries need to be downloaded. After this:
- Download the nightly webapp
pvws.war
from the PVWS homepage and place it inwebapps\
of your tomcat download - Create a file called
setenv.bat
in thebin\
folder of tomcat with yourEPICS_CA_ADDR_LIST
andEPICS_CA_AUTO_ADDR_LIST
(you can get these by doingset EPICS_CA
in anepicsterm.bat
) ie this, where 1.2.3.4 is your CA gateway address:
set EPICS_CA_ADDR_LIST=127.255.255.255 1.2.3.4
set EPICS_CA_AUTO_ADDR_LIST=NO
cd
tobin\
and runcatalina.bat start
to start the tomcat server. you can verify this is working by going tohttp://localhost:8080/pvws/
- you should see a summary webpage.- Create an
.env.local
file withNEXT_PUBLIC_WS_URL
set to the pvws URL you are using. For example:
NEXT_PUBLIC_WS_URL=ws://<hostname>:<port>/pvws/pv
To start in dev mode, use:
npm run dev
To build and start in prod mode, use:
npm run build && npx serve@latest out
Note
Images will not work properly here as a basePath has not been injected (as per the CI actions)
To run dev mode in containerd instead, run nerdctl compose -f compose.yaml up
. This will mount your current directory as a volume in the container which means any changes will make nextjs re-compile pages. This also means that anything in the dotenv
files are picked up, including the PVWS URL.
For a production build, run npm run build
. To start this build natively, use npm run start
.