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

Improve local mode #361

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Improve local mode #361

merged 3 commits into from
Apr 2, 2024

Conversation

MikeShi42
Copy link
Contributor

Makes a number of improvements to local mode:

  • Allows for custom port overwrites
  • Hides irrelevant UI such as logout and log patterns in local mode
  • Improve docs

General changes:

  • Fix NEXT_PUBLIC_SERVER_URL typo in docker-compose (and standardize constant name exported from config)
  • Make log patterns button more visible and more intuitive wording
  • Allows for dynamic API server overrides without rebuilding the frontend (fixes Not able to override app env variables #12), though probably need some documentation.

@MikeShi42 MikeShi42 requested a review from wrn14897 April 2, 2024 04:58
Copy link

changeset-bot bot commented Apr 2, 2024

⚠️ No Changeset found

Latest commit: e71bd14

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -37,6 +42,7 @@ ENABLE_GO_PARSER="false" \
GO_PARSER_API_URL="http://go-parser:7777" \
ENABLE_TOKEN_MATCHING_CHECK="false" \
vector \
-qq \
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: imo it would be more readable to use VECTOR_LOG

try {
const url = new URL(_jsonData.apiServerUrl);
if (url != null) {
apiConfigs.prefixUrl = url.toString().replace(/\/$/, '');
Copy link
Contributor

Choose a reason for hiding this comment

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

oh I see. So the hack is we reset this apiConfigs global var

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well the real hack is that we force everything to read the config on every request as opposed to having it pre-baked in the ky server instance hah

@@ -699,20 +719,20 @@ const api = {
},
useInstallation() {
return useQuery<any, HTTPError>(`installation`, () =>
server(`installation`).json(),
hdxServer(`installation`).json(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the default method is GET

@@ -20,7 +20,7 @@ export default function PasswordResetPage({
<div>
<Form
className="text-start"
action={`${API_SERVER_URL}/password-reset`}
action={`${SERVER_URL}/password-reset`}
Copy link
Contributor

Choose a reason for hiding this comment

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

double check that this url won't be updated dynamically, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh this is true, though this isn't important in local mode...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll likely want to wrap this in a context and pull it from there in the future, but that's out of scope for this PR for now.

@MikeShi42 MikeShi42 merged commit c0ee0e1 into main Apr 2, 2024
4 checks passed
@MikeShi42 MikeShi42 deleted the mikeshi/improve-local-mode branch April 2, 2024 05:42
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.

Not able to override app env variables
2 participants