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

feat: read only view for UI #1628

Merged
merged 4 commits into from
Apr 3, 2024
Merged

Conversation

veds-g
Copy link
Contributor

@veds-g veds-g commented Apr 2, 2024

  • Added support to toggle Read Only View for Numaflow UI
  • Update boolean server.readonly in numaflow-cmd-params-config to toggle view
  • Added new endpoint - /api/v1/readonlyinfo to be used in the UI

image
image
image

Signed-off-by: veds-g <[email protected]>
@whynowy
Copy link
Member

whynowy commented Apr 2, 2024

How to enable/disable it?

@veds-g
Copy link
Contributor Author

veds-g commented Apr 2, 2024

How to enable/disable it?

today, default behaviour - current UI(edit), package(read). We need to modify a boolean variable in App.tsx component as mentioned in description above to enable/disable. Later, I am thinking of setting it up by accepting a variable from backend via API call, and set it up.

@whynowy
Copy link
Member

whynowy commented Apr 2, 2024

How to enable/disable it?

today, default behaviour - current UI(edit), package(read). We need to modify a boolean variable in App.tsx component as mentioned in description above to enable/disable. Later, I am thinking of setting it up by accepting a variable from backend via API call, and set it up.

Maybe do it with an approach similar to the localPath?

@veds-g veds-g force-pushed the toggle-interactions branch from cde838e to 3adee1e Compare April 3, 2024 05:36
@veds-g
Copy link
Contributor Author

veds-g commented Apr 3, 2024

Maybe do it with an approach similar to the localPath?

I tried doing it that way but I realised this approach won't work for the package. For localPath we create a script with config and directly inject it into the UI server. This works for standalone Numaflow but to solve both cases I'm thinking of writing a separate API. wdyt?

@veds-g veds-g changed the title feat: crud toggle for UI feat: read only view for UI Apr 3, 2024
Signed-off-by: veds-g <[email protected]>
@veds-g veds-g marked this pull request as ready for review April 3, 2024 15:01
@veds-g veds-g requested review from whynowy and vigith as code owners April 3, 2024 15:01
@veds-g veds-g requested a review from mshakira April 3, 2024 15:02
Copy link
Contributor

@mshakira mshakira left a comment

Choose a reason for hiding this comment

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

looks good

@mshakira mshakira merged commit 0c68cd4 into numaproj:main Apr 3, 2024
23 checks passed
yhl25 pushed a commit that referenced this pull request Apr 3, 2024
@@ -69,6 +71,7 @@ func NewServerCommand() *cobra.Command {
command.Flags().BoolVar(&namespaced, "namespaced", sharedutil.LookupEnvBoolOr("NUMAFLOW_SERVER_NAMESPACED", false), "Whether to run in namespaced scope, defaults to false.")
command.Flags().StringVar(&managedNamespace, "managed-namespace", sharedutil.LookupEnvStringOr("NUMAFLOW_SERVER_MANAGED_NAMESPACE", sharedutil.LookupEnvStringOr("NAMESPACE", "numaflow-system")), "The namespace that the server watches when \"--namespaced\" is \"true\".")
command.Flags().StringVar(&baseHref, "base-href", sharedutil.LookupEnvStringOr("NUMAFLOW_SERVER_BASE_HREF", "/"), "Base href for Numaflow server, defaults to '/'.")
command.Flags().BoolVar(&readOnly, "readonly", sharedutil.LookupEnvBoolOr("NUMAFLOW_SERVER_READONLY", true), "Whether to enable read only view for the UX server, defaults to false.")
Copy link
Member

Choose a reason for hiding this comment

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

This means default is true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo, should be false

@@ -152,6 +156,7 @@ func UrlRewrite(r *gin.Engine) gin.HandlerFunc {
func CreateAuthRouteMap(baseHref string) authz.RouteMap {
return authz.RouteMap{
"GET:" + baseHref + "api/v1/sysinfo": authz.NewRouteInfo(authz.ObjectPipeline, false),
"GET:" + baseHref + "api/v1/readonlyinfo": authz.NewRouteInfo(authz.ObjectEvents, false),
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to put it into sysinfo and use that API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can be done, let me make that change

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.

3 participants