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

graph/index.html: Add onclick listener to fix navbar #51

Merged
merged 2 commits into from
Mar 14, 2025

Conversation

c4rt0
Copy link
Member

@c4rt0 c4rt0 commented Jan 27, 2025

@c4rt0 c4rt0 requested a review from jbtrystram January 27, 2025 18:03
@dustymabe
Copy link
Member

I don't think we should hardcode the URL in this file.. we should try to use relative URLs when possible (i.e. for one it makes development easier):

Something like this gets me closer but I really shouldn't have the index.html in there

diff --git a/graph/index.html b/graph/index.html
index 51c0057..4520b56 100644
--- a/graph/index.html
+++ b/graph/index.html
@@ -59,7 +59,7 @@ function zeroStream() {
 <!-- Navbar -->
 <nav class="navbar is-light" role="navigation" aria-label="main navigation">
   <div class="navbar-brand">
-    <a class="navbar-item" href="https://builds.coreos.fedoraproject.org/graph?stream=stable&basearch=x86_64"><img src="https://fedoraproject.org/assets/images/coreos-logo-light.png"/></a>
+    <a class="navbar-item" href="."><img src="https://fedoraproject.org/assets/images/coreos-logo-light.png"/></a>
   </div>
 
   <div class="navbar-end">
@@ -171,7 +171,7 @@ document.querySelectorAll('.navbar-item.has-dropdown a').forEach(item => {
 });
 
 function navigateToLink() {
-  const url = `https://builds.coreos.fedoraproject.org/graph?stream=${selectedStream}&basearch=x86_64&infra=prod`;
+  const url = `./index.html?stream=${selectedStream}&basearch=x86_64&infra=prod`;
   window.location.href = url; // executes the above and goes to the URL
 }
 // Return Cincinnati URL.

@dustymabe
Copy link
Member

is it possible to make the architecture selectable too?

Copy link
Contributor

@jbtrystram jbtrystram left a comment

Choose a reason for hiding this comment

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

thanks for tackling that ! Can you update the others selectors as well, like arch and add one for oci ?

Copy link
Contributor

@jbtrystram jbtrystram left a comment

Choose a reason for hiding this comment

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

thanks for tackling that ! Can you update the others selectors as well, like arch and add one for oci ?

@c4rt0
Copy link
Member Author

c4rt0 commented Feb 5, 2025

is it possible to make the architecture selectable too?

Sure! Implemented in 82ff875

@c4rt0 c4rt0 marked this pull request as draft February 5, 2025 11:53
@c4rt0
Copy link
Member Author

c4rt0 commented Mar 14, 2025

I don't think we should hardcode the URL in this file.. we should try to use relative URLs when possible (i.e. for one it makes development easier):
Something like this gets me closer but I really shouldn't have the index.html in there

  • const url = ./index.html?stream=${selectedStream}&basearch=x86_64&infra=prod;
    window.location.href = url; // executes the above and goes to the URL
    }

Removed the index.html entirely, this way it works, without specifying any files

  • a class="navbar-item" href="."><img src=...

I actually passed some values here, otherwise the link wouldn't work and we would get an error after clicking the coreos logo.

thanks for tackling that ! Can you update the others selectors as well, like arch and add one for oci ?

NP! Done.

@c4rt0 c4rt0 marked this pull request as ready for review March 14, 2025 16:57
@c4rt0 c4rt0 requested review from jbtrystram and dustymabe March 14, 2025 16:58
@dustymabe
Copy link
Member

LGTM - this is working great!

maybe in a followup PR we can add a selector for adding &oci=true to the URL

@dustymabe dustymabe merged commit 162742f into coreos:main Mar 14, 2025
1 check passed
@dustymabe
Copy link
Member

Can you copy this into place so the changes take effect at https://builds.coreos.fedoraproject.org/graph ?

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.

Broken navbar menu on the browser for FCOS update graph
3 participants