Skip to content

Add footer and review doc to customize UI#182

Open
PaulinCharliquart wants to merge 3 commits intoovh:masterfrom
PaulinCharliquart:add_footer
Open

Add footer and review doc to customize UI#182
PaulinCharliquart wants to merge 3 commits intoovh:masterfrom
PaulinCharliquart:add_footer

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 <paulincharliquart@gmail.com>
Signed-off-by: Paulin Charliquart <paulincharliquart@gmail.com>
Signed-off-by: Paulin Charliquart <paulincharliquart@gmail.com>
@ncrocfer ncrocfer self-assigned this Feb 23, 2023
Copy link
Contributor

@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 ;)

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

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
Contributor

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 ;)

</v-card>
</v-dialog>
<!-- Definitions Ends -->
<v-footer padless>
Copy link
Contributor

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).

env = Env()
env.read_env(env_path)

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

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
Contributor

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