@deix/paganini-ui
v4.2.2
Published
This repository contains react components to display and manage jobs through [paganini](https://github.com/deix-ai/paganini).
Readme
Paganini UI
This repository contains react components to display and manage jobs through paganini.
React components usage
The two main components are JobsTabe, which displays the list of jobs and
JobDetails which desplays details of a particular job:
JobsTable
<JobsTable
paganiniURL='http://localhost:7000/paganini'
onJobSelect={(job) => console.log(job)}
filters={{ command_name: 'etl' }}
/>Props
paganiniURL(string): base url where paganini endpoints are reachableonJobSelectfunction: callback that receives the selected job when a row is clickedfilterQuery{ [key: string]: string }: any additional query params to be passed to paganini
JobDetails
<JobDetails
paganiniURL='http://localhost:7000/paganini'
id='ed12987e-da38-43f1-acf5-e2ff7fdb8da9'
jobDetailBasePath='/jobs'
/>Props
id(string): job idshowInputData(boolean): enable viewing the input datashowOutputData(boolean): enable viewing the output dataenableDarkLogsTheme(boolean): display logs with a dark backgroundpaganiniURL(string): base url where paganini endpoints are reachable
FileUploadJobButton
<FileUploadJobButton
commandName='etl'
buttonLabel={{ it: 'Carica e Procedi', en: 'Upload and Run' }}
onSubmit={() => console.log('Job submitted')}
/>Props
commandName(string): name of the Paganini command to executebuttonLabel(StringTranslation, optional): label for the button in multiple languages (default:{ it: 'Carica e Procedi', en: 'Upload and Run' })onSubmit(function, optional): callback executed after successful job submission
This component provides a file upload button that:
- Allows users to select one or more files
- Reads files via FileReader and converts them to base64
- Submits them to Paganini as a job with files in the
input_data.filesarray
Environment Variables
PAGANINI_URL(required): Base URL where Paganini endpoints are reachableENABLE_FILES_UPLOAD(optional): Set to true to enable file upload buttons for specific commands. They will be added to the home page. It automatically retrieves commands related to jobs withfilesas unique input key.ENABLE_SUBMIT_DEV(optional): Set to'true'to enable the submit-dev development page for testing job submissions
Example .env.local:
PAGANINI_URL=http://localhost:7000/api/
ENABLE_FILES_UPLOAD=true
ENABLE_SUBMIT_DEV='true'Usage as a docker image
docker run -d \
-e PAGANINI_URL=http://localhost:7000/paganini \
-e ENABLE_FILES_UPLOAD=true \
-p 3000:3000 \
quay.io/deix/paganini-ui