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

Added a web ui to render intended configurations #827

Merged
merged 7 commits into from
Nov 13, 2024

Conversation

gsnider2195
Copy link
Contributor

@gsnider2195 gsnider2195 commented Nov 6, 2024

This is a web ui wrapper for the REST API implemented in #824

UI Light mode

generate-intended-config-ui

UI Dark mode

generate-intended-config-ui-dark

Nav menu

image

Docs

image

…gurations from templates in an arbitrary git repository.
)
git_repository = forms.DynamicModelChoiceField(
queryset=GitRepository.objects.all(),
required=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking out loud.. can we make this not required and if not set figure out what the default git repo is this device is?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the majority of cases, I don't think people will need to switch this.

Copy link
Member

Choose a reason for hiding this comment

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

Because different devices can have different golden config settings, and different golden config settings can have different git repositories, we would have no way of showing the user in this view what repo was used to generate the template.

Either:

  • They would have to back-solve which golden config setting applied and then which git repository
  • We will have to enhance the API response to provide more information than it does today

"""View to generate the intended configuration."""

template_name = "nautobot_golden_config/generate_intended_config.html"
permission_required = ["dcim.view_device", "extras.view_gitrepository"]
Copy link
Contributor

@smk4664 smk4664 Nov 6, 2024

Choose a reason for hiding this comment

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

Should we not also check permissions for GoldenConfig? If I am not mistaken, a user would need to have view permissions for Golden Config in order to see the Intended Configuration.

Suggested change
permission_required = ["dcim.view_device", "extras.view_gitrepository"]
permission_required = ["dcim.view_device", "extras.view_gitrepository", "nautobot_golden_config.view_goldenconfig"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could see a user wanting to require a permission to use this but I don't think view_goldenconfig is the correct permission. Perhaps we need to implement a new permission similar to run_job?

@gsnider2195
Copy link
Contributor Author

Implemented feedback:

@gsnider2195 gsnider2195 merged commit e14792f into develop Nov 13, 2024
15 checks passed
@gsnider2195 gsnider2195 deleted the u/gas-zh174-generate-intended-config-view branch November 13, 2024 17:19
This was referenced Nov 27, 2024
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.

5 participants