A report editor plugin that is powered by an LSP
Project description
inventree-report-lsp-plugin
A report editor plugin that is powered by django-template-lsp.
⚙️ Installation
- Install the
inventree-report-lsp-pluginfrom the Admin Center > Plugins > Install plugin. (Make sure the user interface plugin integration is enabled.) - Now the LSP server needs to be started separately via the
inventree-report-lspcmd and the requests to/plugins/report-lsp/wsneed to be proxied to it. If you're using the official docker stack, follow the guide below:
[!IMPORTANT] At least InvenTree v0.18.0 is required to use this plugin.
🐳 Docker
Add this extra container to the docker-compose.yml file:
inventree-report-lsp:
image: inventree/inventree:${INVENTREE_TAG:-stable}
container_name: inventree-report-lsp
command: /bin/ash -c "invoke plugins && inventree-report-lsp"
env_file:
- .env
volumes:
- ${INVENTREE_EXT_VOLUME}:/home/inventree/data:z
restart: unless-stopped
Add this proxy_route to the Caddyfile:
forward_auth {$INVENTREE_SERVER:"http://inventree-server:8000"} {
uri /auth/
}
}
+ reverse_proxy /plugin/report-lsp/ws "http://inventree-report-lsp:8765"
# All other requests are proxied to the InvenTree server
reverse_proxy {$INVENTREE_SERVER:"http://inventree-server:8000"} {
🏃 Usage
Goto the Admin Center > Label Templates or Report Templates. Click on any in the table and select the "Report Editor". For the first load, this can take some time (up to ~30s) until the data is collected. The status bar at the bottom should show LSP Running (Connected) when its ready.
🧑💻 Development
For this plugin to work in development, the inventree source has to be patched temporary:
-
Add this to the InvenTree
vite.config.ts:proxy: { '/media': { target: 'http://localhost:8000', changeOrigin: true, secure: true }, + '/static/plugins/report-lsp/dist/': { + target: 'http://localhost:5212', + changeOrigin: true, + secure: true, + ws: true + }, + "/plugin/report-lsp/ws": { + target: "http://localhost:8765", + changeOrigin: true, + secure: true, + ws: true, + } },
-
Remove Strict Mode temporary from
src/frontend/src/main.tsx:ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - <React.StrictMode> <MainView /> - </React.StrictMode> );
-
Set the
INVENTREE_REPORT_LSP_DEVtoTruebefore starting the dev server -
Install this package as editable pip package into your venv via
pip install -e path/to/the/inventree-report-lsp-plugin
-
Install frontend dependencies via
cd frontend && npm ci -
Run the LSP in the background by invoking the
inventree-report-lspcommand in a terminal where the venv is activated. (If you want to use a custom djlsp instance because you want to do changes there, you need to specify theINVENTREE_DJANGO_LSP_SERVER_CMDenv variable. E.g./path/to/django-template-lsp/env/bin/djlsp) -
Run the Frontend dev server via
cd frontend && npm run dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inventree_report_lsp_plugin-0.1.0.tar.gz.
File metadata
- Download URL: inventree_report_lsp_plugin-0.1.0.tar.gz
- Upload date:
- Size: 10.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64d14c38db322c7a1a3dd274f1ac9308ba8a520a4a0bd2cc5950c0390b0f3f21
|
|
| MD5 |
d5b0e3ecdc1d77631b8d232ff3246718
|
|
| BLAKE2b-256 |
b06669454587a07351a97781f0599779fc1724ff17561c5426d15f14ec25c08b
|
Provenance
The following attestation bundles were made for inventree_report_lsp_plugin-0.1.0.tar.gz:
Publisher:
ci.yml on wolflu05/inventree-report-lsp-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inventree_report_lsp_plugin-0.1.0.tar.gz -
Subject digest:
64d14c38db322c7a1a3dd274f1ac9308ba8a520a4a0bd2cc5950c0390b0f3f21 - Sigstore transparency entry: 196576165
- Sigstore integration time:
-
Permalink:
wolflu05/inventree-report-lsp-plugin@0d3b80ff73966587d6ea39edd0f325a10a573904 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/wolflu05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0d3b80ff73966587d6ea39edd0f325a10a573904 -
Trigger Event:
release
-
Statement type:
File details
Details for the file inventree_report_lsp_plugin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: inventree_report_lsp_plugin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e872319bddcb854763eddc14a9677b418dfbe27371878f3aebecfec33dee221b
|
|
| MD5 |
6250a628443d392c15861cee56045481
|
|
| BLAKE2b-256 |
0f75d698372ddab277c9a98b1405696febc396433a8b4f76ee3cd649047c0ae9
|
Provenance
The following attestation bundles were made for inventree_report_lsp_plugin-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on wolflu05/inventree-report-lsp-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inventree_report_lsp_plugin-0.1.0-py3-none-any.whl -
Subject digest:
e872319bddcb854763eddc14a9677b418dfbe27371878f3aebecfec33dee221b - Sigstore transparency entry: 196576166
- Sigstore integration time:
-
Permalink:
wolflu05/inventree-report-lsp-plugin@0d3b80ff73966587d6ea39edd0f325a10a573904 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/wolflu05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0d3b80ff73966587d6ea39edd0f325a10a573904 -
Trigger Event:
release
-
Statement type: