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

partial Fix # 11 url query params #25

Merged
merged 49 commits into from
Feb 16, 2022
Merged

partial Fix # 11 url query params #25

merged 49 commits into from
Feb 16, 2022

Conversation

jacovinus
Copy link
Collaborator

@jacovinus jacovinus commented Feb 11, 2022

  • fix : get parameters from query params
  • fix: update query params when update parameters
  • get URL with query params when "Share Link" button is pressed

Usage

  • Url params will be generated as you change the paramters inside UI

Available params:

query: the cLoki query , example: query=%7Btype%3D"clickhouse"%7D
limit: the query Limit. limit=100 (default 1000)
start: query start ts nanosec start=
end: query end ts nanosec end=
step: query step in sec or milisec step=5s
apiUrl: the API URL to Make current request apiUrl=http:localhost:3100

sample URL : http://localhost:3000/#query=%7Btype%3D"clickhouse"%7D&limit=1000&apiUrl=http%3A%2F%2Flocalhost%3A3100&step=100&start=1644594696494000&end=1644594996495000

  • Copy link button for sharing link with exact params

@jacovinus jacovinus marked this pull request as draft February 11, 2022 17:44
@Dletta
Copy link
Contributor

Dletta commented Feb 15, 2022

Small Issue here:

  • You can still use Hotkey (CTRL-ENTER) to submit an invalid query, even if 'Show Logs' button is inactive

@Dletta
Copy link
Contributor

Dletta commented Feb 15, 2022

Another small item:

  • When the page loads, it initially tries to load labels from the default, even if the user has changed the API URL

Error in console

XHR GET http://127.0.0.1:8080/loki/api/v1/labels 404

Even though API URL is set and labels are collected from
127.0.0.1:3100

It appears the /ValuesList.js useEffect() for querying labels is called once with default state, once with new state

@Dletta
Copy link
Contributor

Dletta commented Feb 15, 2022

On loading defaults in updateStateFromQueryParams.js, apiUrl is not copied into the hash.

Looks like the culprit is on L#165, we set an empty string instead of the value we have already dispatched to store

@Dletta Dletta mentioned this pull request Feb 15, 2022
@jacovinus jacovinus marked this pull request as ready for review February 15, 2022 22:29
@jacovinus
Copy link
Collaborator Author

Small Issue here:

  • You can still use Hotkey (CTRL-ENTER) to submit an invalid query, even if 'Show Logs' button is inactive

fixed with 4253c93

@jacovinus
Copy link
Collaborator Author

Initial State is now set by url parameters. This fixes most issues with errors in console

Outstanding items:

  • Load Query after page loads (if the query is there and it's a valid query, execute query)
  • Share Link button to add

fixed load logs on every query change with b44fa6f

@Dletta
Copy link
Contributor

Dletta commented Feb 16, 2022

Tested Final Result, working well

@Dletta Dletta merged commit 23ea51d into main Feb 16, 2022
@Dletta Dletta deleted the jacovinus-url-params branch February 16, 2022 20:41
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