Code Monkey home page Code Monkey logo

pvinfo's Introduction

PV Info

Node Builds Docker Build

Web interface to the EPICS Channel Finder database. This interface allows users to query for PVs by wildcard name searches as well as querying by PV meta-data such as IOC name, record type, etc.

PV Info also integrates with several other EPICS high level services:

  • PV Web Socket is used to show live PV data including the value, alarm status/severity, alarm limits, etc.
  • Phoebus OLOG allows you to display any log entries that contain the specific PV name on the PV "details" page.
  • Phoebus Alarm Logger displays the alarm history for a specific PV on it's "details" page.
  • Archiver Appliance Web Viewer is used to show the archived history of PVs. Since this is simply an external link in PV Info to the archiver web viewer, other archive engines and their own web viewers can easily be used.

It is important to note that only the Channel Finder integration is required to use PV Info. PV Info Arch

This repository is under active development and is currently in production at the Advanced Light Source (ALS). Effort has been made to make PV Info non-ALS specific and configurable for any site using Channel Finder but things might have been missed. So please report any bugs you might find, any new features which could be useful, and any feedback on configuring/installing/using PV Info.

Required Packages

Configuration

Version 1.x.x vs. Version 2.x.x

In version 2.0.0 the PV Info build tool was changed from Create React App to Vite. Create React App has been deprecated by Facebook and is no longer maintained. This can cause some issues with security vulnerabilities and isn't good for the long term so we have switched to Vite. Vite is mostly a drop-in replacement but see here for differences in PV Info 1.x.x and 2.x.x - Version 2 notes.

It is important to delete the node_modules directory and do an npm install to regenerate all the dependencies when converting an existing application to version 2.0.0.

React Environment Variables

There are many React environment variables avaiable to configure PV Info for your site. Several variables will most definately need to be updated for PV Info to work. These variables are containted in .env file:

  • REACT_APP_ENDPOINT
  • REACT_APP_DOMAIN
  • REACT_APP_HTTP_PROTOCOL
  • REACT_APP_CF_URL
  • REACT_APP_PVWS_URL
  • REACT_APP_AA_URL
  • REACT_APP_OLOG_URL
  • REACT_APP_AL_URL

The only required service is Channel Finder. To turn off PV Web Socket, Archiver Web Viewer, or OLOG:

  • REACT_APP_USE_PVWS=false
  • REACT_APP_USE_AA=false
  • REACT_APP_USE_OLOG=false
  • REACT_APP_USE_AL=false

Other interesting variables are the channel finder properties that you can configure to show as searchable on the homepage:

  • REACT_APP_CF_RECORD_TYPE
  • REACT_APP_CF_RECORD_DESC
  • REACT_APP_CF_ALIAS
  • REACT_APP_EXTRA_PROP
  • REACT_APP_SECOND_EXTRA_PROP

Logos and Colors

  • Update src/theme.js with the colors and fonts you want
  • Place your own logo in src/assets
  • Place your own favicons in public

Initial Setup and Running Locally

npm install

Installs the needed NPM modules into node_modules directory. Run this the first time you clone the repository.

npm start

Runs the app in the development mode.
Open http://localhost:3000 or possibly http://localhost:3000/pvinfo to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Building Production Bundle

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

React Routing Configuration

Since React routing is done on the client side, direct links to sub pages of PV Info might not load (i.e. https://myhost/pvinfo/pv/mypv). To solve this, something like this can be added to .htaccess for apache setups to always route through the index endpoint:

$ cat .htaccess
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

https://stackoverflow.com/questions/27928372/react-router-urls-dont-work-when-refreshing-or-writing-manually/46035346#46035346

Screenshots

Monitor All

See more screenshots here: example.md

pvinfo's People

Contributors

dependabot[bot] avatar mitchfrauenheim avatar nusaqib avatar tynanford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pvinfo's Issues

update MUI themes to v5

adaptV4Theme.js:8 MUI: adaptV4Theme() is deprecated.
Follow the upgrade guide on https://mui.com/r/migration-v4#theme.

Warning message in the console

horizontal scroll bar appearing in some browsers for no reason

It's been noticed that some browsers add a horizontal scroll bar in PV info whenever the vertical scroll bar is (correctly) added.

Testing so far shows this behavior on:

Windows - Firefox, Chrome, Edge
Linux - Chrome

And not this issue (no horizontal scroll bar) on:
Mac- Firefox, Brave, Chrome
Linux - Firefox

image

PV value precision formatting

for the home page: when live monitor box is checked, update the toExponential() call to use only 2 digits since space is limited

For a single PV details page: if the PV precision value from web socket is not blank and not zero, use that to round PV value. Otherwise, show full value from web socket

Alternative plugin for archiver?

I am very interested in deploying pvinfo for our accelerator. While we are currently setting up our Phoebus based environment including ChannelFinder, we are using a different archiver interface ( https://oss.aquenos.com/cassandra-pv-archiver/docs/3.2.6/manual/html/apbs03.html )

Support for our archiver interface has been already merged in the Phoebus client ( ControlSystemStudio/phoebus#2961 ).

Can you roughly outline where we would need to adjust/extend the code to allow for a different archiver interface?

And similar question would also be to use a different logbook system, but this is currently only in evaluation ( https://github.com/wanglin86769/clog2 )

PV web monitoring warn/block limits

create 2 new environment variables:

REACT_APP_LIVE_MONITOR_WARN=50
REACT_APP_LIVE_MONITOR_MAX=100

When the first limit is hit it should throw the yellow warning message to user. When the second limit is hit then the app shouldn't allow any more connections

investigate displaying alarm history from phoebus alarm logger API

https://control-system-studio.readthedocs.io/en/latest/services/alarm-logger/doc/index.html?highlight=alarm%20logger

https://github.com/ControlSystemStudio/phoebus/tree/master/services/alarm-logger

https://github.com/ControlSystemStudio/phoebus/blob/master/services/alarm-logger/src/main/java/org/phoebus/alarm/logging/rest/SearchController.java

Now that the alarm logger has a http API this could be another interesting service to integrate for the details screen for a specific PV. Would be opt-in and show the past alarm history for a configurable number of past events

Explore options for more responsive results table

Currently, the PV Name and Description fields will get cut off when the screen size gets too small. Especially for the PV Name field, we should prioritize showing the full name and forcing users to scroll to see more content.

I also wonder if MUI has some better ways to show tables with lots of columns with small screen sizes. Maybe we could auto-hide some options on small screen sizes and allow users to re-show the columns with the "Columns" button if needed

add env option to limit channel finder PV results on query

New variable - REACT_APP_CF_MAX_RESULTS to give the option to limit the number of results.

If the variable doesn't exist or is left blank, we should just leave the ~size argument off of the CF query

API call example - /ChannelFinder/resources/channels?~name=*&~size=5

Add extraPropA and extraPropB to details page

should show extraPropA and extraPropB if they are enabled in the table on the details page.

The table also changes widths when PV monitoring is turned on/off. Would be nice to keep the widths the same so the table doesn't change appearance to user when toggling checkbox

standard / free form button can set standardSearch=null

If you open PV Info homepage and click the "Standard" search left button (even though you are already on standard search) the input boxes will switch to the free form query. If you test type a query in the free form box and search, you will see standardSearch=null in the URL and the input boxes will come back.

Add option for "free form" CF search

toggle on home page which switches from current input boxes based on settings to one input box where a free form search like

"* iocName=exampleIOC Acc=SR"

can be done. Like how the phoebus channel table works

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.