Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add footer and review doc to customize UI #182

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PaulinCharliquart
Copy link
Contributor

@PaulinCharliquart PaulinCharliquart commented Feb 22, 2023

  1. add a footer with Celery Director version. It can be overwritten by DIRECTOR_VERSION

image

  1. Update doc to customize UI

  2. Remove usage of DIRECTOR_API_URL by using Flask template feature

Signed-off-by: Paulin Charliquart <[email protected]>
Signed-off-by: Paulin Charliquart <[email protected]>
Signed-off-by: Paulin Charliquart <[email protected]>
@ncrocfer ncrocfer self-assigned this Feb 23, 2023
Copy link
Member

@ncrocfer ncrocfer left a comment

Choose a reason for hiding this comment

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

Hi @PaulinCharliquart,
Thanks for this PR ! I let you make the changes I suggest before checking it again ;)

</v-app>
</div>
<script type="text/javascript">
const HISTORY_MODE =%% config.ENABLE_HISTORY_MODE | int %%;
const API_URL = "%% config.API_URL %%";
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure simply concatenating request.url_root and api is a really good idea. My feedling is we can have some problems if a user is behind a reverse proxy or something like that.

By allowing him to fully customize its API_URL, we're safe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @ncrocfer,

Or do you think it can work with this js code?
const API_URL = window.location.origin + "/api"

regards,

Copy link
Member

Choose a reason for hiding this comment

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

No, I insist: don't concatenate please. A single API_URL is enough to customize the url ;)

@@ -730,11 +730,19 @@
</v-card>
</v-dialog>
<!-- Definitions Ends -->
<v-footer padless>
Copy link
Member

Choose a reason for hiding this comment

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

The idea of having the version displayed in the UI is nice but unfortunately the rendering is not really good:
image

Can you simply add this information somewhere else? Maybe at the bottom of the navigation menu?

image

It seems you can use the append slot of vuetify for that: https://vuetifyjs.com/en/components/navigation-drawers/#misc (didn't try it).

@@ -35,12 +34,12 @@ def __init__(self, home_path=None, config_path=None):
env = Env()
env.read_env(env_path)

self.VERSION = env.str("DIRECTOR_VERSION", version)
Copy link
Member

Choose a reason for hiding this comment

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

Why would you like to let the user override the installed version value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @ncrocfer,
It will allow user to customize the footer. For my case, I can pass GIT_TAG from my CI/CD pipeline and see it in the UI.
regards,

Copy link
Member

Choose a reason for hiding this comment

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

Ok I see, indeed it seems to be a very good use case ! You can for instance reference celery-director==x.y.z in your own requirements.txt file, then display your hash commit or git tag in the footer.

But I'm not sure the DIRECTOR_VERSION is a good name for that (because the real director version doesn't change, so it brings confusion). I will check what is done by other similar tools for this kind of needs and I will answer you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants