Skip to content

[P_UI] Added django settings for p_ui - #5343

Merged
SchrodingersGat merged 14 commits into
inventree:masterfrom
wolflu05:pui/server-settings
Aug 10, 2023
Merged

SchrodingersGat merged 14 commits into
inventree:masterfrom
wolflu05:pui/server-settings

Conversation

@wolflu05

@wolflu05 wolflu05 commented Jul 25, 2023 •

Copy link
Copy Markdown
Member

This PR improves a few things:

  • adds the ability to define normal Django settings that can be used in P_UI
  • adds the proxy option to the vite config, that way we the api and vite dev server run on the same url
  • added current url als default server
  • make host list configurable via Django settings
  • added option to don't render the host list edit button
  • use polling only for wsl

@wolflu05 wolflu05 added the User Interface Related to the frontend / User Interface label Jul 25, 2023

@matmair matmair left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread InvenTree/config_template.yaml Resolved
Comment thread src/frontend/vite.config.ts Resolved
@matmair matmair mentioned this pull request Jul 25, 2023
72 tasks done
Comment thread src/frontend/src/main.tsx Resolved
@wolflu05

wolflu05 commented Jul 27, 2023 •

Copy link
Copy Markdown
Member Author

@matmair Can you help me here with the remaining requests from your comments?

@netlify

netlify Bot commented Jul 27, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree ready!

Name Link
🔨 Latest commit 4b61a34
🔍 Latest deploy log https://app.netlify.com/sites/inventree/deploys/64c2dfc3680ff0000872a3a3
😎 Deploy Preview https://deploy-preview-5343--inventree.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment thread src/frontend/src/main.tsx Resolved
@wolflu05

wolflu05 commented Jul 27, 2023 •

Copy link
Copy Markdown
Member Author

Would be ready for merge from my POV, I added the translating commands to the netlify build process so that the ui previews correctly translated.

@matmair

matmair commented Aug 5, 2023

Copy link
Copy Markdown
Member

@SchrodingersGat this would be ready for review and merge

@wolflu05

Copy link
Copy Markdown
Member Author

@SchrodingersGat just a gently ping on this pr.

@SchrodingersGat

Copy link
Copy Markdown
Member

@wolflu05 thanks for the reminder :)

Can you run me through how the settings get from .py to .ts? Are they simply rendered into the index.html page?

If so, does this get rendered "live" by the server? What happens if the backend settings change?

@wolflu05

Copy link
Copy Markdown
Member Author

Are they simply rendered into the index.html page?

Yes, they get rendered into the index.html page accessible on the global window object.

If so, does this get rendered "live" by the server? What happens if the backend settings change?

Settings change in the config file/env variable requires a server restart until the new settings are available. Due to the implementation from @matmair the server list settings only get changed if they are not already saved in the local storage. So you need to clean your local storage until the new server list takes affect or use a new private tab for testing each time.

@SchrodingersGat

Copy link
Copy Markdown
Member

Ok, happy with that. Thanks for getting this up and running :)

@SchrodingersGat
SchrodingersGat merged commit 89795f6 into inventree:master Aug 10, 2023
@wolflu05
wolflu05 deleted the pui/server-settings branch August 10, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants