Commit Graph

23 Commits

Author SHA1 Message Date
Tobias Urdin 59cd5de78b web: add dark mode and theme selection
This adds a theme selection in the preferences in the
config modal and adds a new dark theme.

Removes the line.png image and instead uses CSS
linear-gradient that is available in all browsers
since around 2018, also fixes the 15 pixels spacing
issue that is there today.

You can select between three different themes.

Auto will use your system preference to choose either the
light or dark theme, changes dynamically based on your
system preference.

Light is the current theme.

Dark is the theme added by this patch series.

The UX this changes is that if somebody has their system
preferences set to dark, for example in Mac OS X that is
in System Settings -> Appearance -> Dark the user will
get the Zuul web UI in dark by default and same for the
opposite.

This uses a poor man's dark mode for swagger-ui
as per the comment in [1].

[1] https://github.com/swagger-api/swagger-ui/issues/5327#issuecomment-742375520

Change-Id: I01cf32f3decdb885307a76eb79d644667bbbf9a3
2023-04-21 11:23:56 +00:00
Felix Edel 8f8f4f1898 Switch to ZooKeeper backed NodesProvisionedEvents
This puts the NodesProvisionedEvents into ZooKeeper. With this, all
result events are now in ZooKeeper.

To make the NodesProvisionedEvent serializable, we cannot store the
whole NodeRequest object in the event anymore. Instead we are using the
request.id, job name and the buildset UUID to look up the corresponding
NodeRequest object from the buildset when the NodesProvisionedEvent is
handled.

As a result of this we have to find a way to return the NodeSet even in
case the NodeRequest or the buildset cannot be found anymore (e.g. due
to a gate reset). In this case we look up the NodeRequest directly from
ZooKeeper and provide a faked NodeSet which allows us to retrieve the
node information from Zookeeper (via the update mechanism of the
NodeRequest in the Nodepool client).

Finally, we can get rid of the local result event queue in the scheduler
as now all result events are in ZooKeeper. Together with that the
`zuul.scheduler.eventqueues.result` gauge was also removed.

Change-Id: Ib5e0f13d25a21ebad908d38f0201e92b704a1c85
2021-07-13 14:57:01 -07:00
Zuul 213b1867f5 Merge "web: store status filter in the location hash" 2020-11-23 06:17:23 +00:00
Sorin Sbarnea ebad14f1f9 Consolidate js/jsx indentation
Previously indentation was not checked at all and in order to avoid
reviewers time with style checks, we can enforce it with eslint.

Current js/jsx changes were made by: yarn lint-fix

Note this this change can easily become outdated so we need to
coordinate and merge it quickly as each rebase would loose previous
votes.

Change-Id: I85883fc8db924ad4ce9acad5acdd42aed7e4d0e4
2020-11-20 09:39:31 +00:00
Tristan Cacqueray 75173d7b6b web: store status filter in the location hash
This change replaces the localStorage by the location hash to
store search filter so that different filter can be used on
different tabs.

Change-Id: I949adc4e1df4dfd26eb8d66b7f87e0e3ef1f28f8
2020-10-27 23:01:10 +00:00
James E. Blair 8ed696f626 Correct visibility check in web JS
A recent change to introduce user preferences in the client-side
web app had an error when detecting the case where a user switched
from having auto-reload of the status page disabled to enabled.
It only checked that the autoreload setting was enabled and there
was no timer currently set; if that was true, then it would force
a refresh.  This check was performed every time the component was
updated, so each time a status update happened, the component would
naturally be updated as part of the process, run this check, see
that autoreload was enabled, and then force an update regardless
of the visibility setting.

This change ensures the forced update only happens in the specific
case that the user has changed the autoreload setting, thereby
breaking the loop described above.

Change-Id: Ie7ef175536bb20033cede5e93748cda08c3d918d
2020-09-11 13:27:44 -07:00
Sorin Sbarnea 1ecbe58474 Add user preferences dialog
In order to avoid cluttering Zuul UI with user preferences in various
places, we introduce a simple config dialog.

This moves "auto reload" option to the preferences panel.

Change-Id: I7201d9e021c99f8e5a936dc98efe3c9d563fbcbc
Co-Authored-By: James E. Blair <jeblair@redhat.com>
2020-07-30 13:51:09 +01:00
Felix Edel ed9d0446d5
PF4: Update "fetching info ..." and refresh animation
Currently the "refresh" animations look quite different depending on the
page and the type of event (refresh button, initial page load, ...).

This tries to make a start by updating the "Fetching info ..." animation
(shown on initial page load) with Patternfly's "empty state" pattern [1]
in combination with an animated spinner.

For "Refreshable" pages, a similar animation is used in the upper right
corner (like before) but with an updated spinner and icon. By using a
dedicated React component rather than a base class, the "refresh" button
can be more nicely integrated into the layout of the page/container and
it doesn't look "out of scope" for the refreshable component.

For the API page I've removed the refresh completely since it wasn't
implemented at all.

[1] https://www.patternfly.org/v4/documentation/react/components/emptystate

Change-Id: I2274c212f14aece27ff49bfc7900d9b1a0fd01d0
2020-07-10 15:18:04 +02:00
Felix Edel 65653bcd01
Introduce Patternfly 4
Since Patternfly 4 (PF4) is a complete rewrite of the framework that
doesn't require bootstrap and comes with a new npm package, it's
possible to include both side-by-side in a project.

This change includes the necessary PF4 packages and updates the header,
navbar, drawer (shows the config errors) and global page layout with PF4
components. Once this is done, we should be able to update the other
components step by step to PF4.

Points to keep in mind for the migration phase:
  1. Some Patternfly 3 CSS rules are overridden by Patternfly 4
     wildcards, mostly (re)setting the padding and margin of various
     elements to 0.

     To fix this unwanted behaviour, there is a pf4-migration.css file
     included were we can keep track on those rules and ensure that the
     old padding and margin values are re-applied after Patternfly 4 is
     imported.

Change-Id: I77b81fa0f97fe718207ba5a506cee300371c693b
2020-07-07 11:16:48 +02:00
Sorin Sbarnea 70a7997197 Replace cookie use with localStorage
Avoid use of cookies which are always sent to the server, so they
are subject to privacy laws. Instead it makes use of browser local
storage, something that is persistent and not exposed to the
server side.

Change-Id: I8be5c87267e366f0cf152145002c3d3f541add80
2020-07-06 14:16:58 +01:00
Zuul c04a8b1983 Merge "Update to create-react-app 3.4.1" 2020-05-22 14:37:55 +00:00
Tristan Cacqueray ff0e878865 web: remove status page componentDidUpdate implementation
It is not necessary to loadState when the timezone change as
this is already managed by react engine.
Moreover this method introduced a bug by shadowing the parent
Refreshable, which is in charge of fetching status page when
the tenant change.

Change-Id: I9fd35446c7fe98ce4bbb992983ec1ab56f3d32c5
2020-05-21 20:21:59 +00:00
Monty Taylor 36de1dd85b Update to create-react-app 3.4.1
While trying to figure out why the ansi patch wouldn't
build it emerged that we're now 2 major releases behind
on create-react-app.

Update create-react-app to the latest 3.4.1. This also updates
react to 16.13, and updates eslint globals processing so that
we don't have to declare globals in headers when we've
declared them already in the eslint file.

Finally, although this doesn't do it, create-react-app 3
has support for typescript, so if we want we can start migrating
files to .ts or .tsx extensions and start doing typing in
them.

Pin nanoid to v2 until such a time as create-react-app can be
updated to 3.4.2 which is needed ot handle .cjs extensions
being used by nanoid.

Change-Id: Ibc69bef605a62e4fdd2ebba33d9d1b822e7dfeba
2020-05-21 10:55:29 -05:00
Andy Ladjadj 86eba8b05d Add new timezone selector in web interface
- the default value keep UTC
 - the timezone is saved in cookie in zuul_timezone_string
 - the render format is YYYY-MM-DD HH:mm:ss

Change-Id: Ib4ac2af4194ac2722c5574577661f4ddda8cc398
2020-05-20 16:54:54 -05:00
Monty Taylor 72625b9af8 Tie status filter text to pathname
When switching between https://zuul.opendev.org/t/zuul/status
and https://zuul.opendev.org/t/openstack/status, the filter-text
comes with me. However, the zuul tenant does not have a system-config
repo nor does the openstack tenant have a nodepool repo, so it's
a little silly.

We don't use these values anywhere else, so scope them to a path.

Change-Id: I8eeb3132298d4803481388ed7f4200cbb003b990
2020-05-06 08:02:46 -05:00
Tristan Cacqueray 00f4de3c51 web: prevent status update loop in background
When leaving the status page while it is waiting for status data,
the callback happens when the status page is not mounted,
resulting in the update loop timer not being cleared.

This change prevents that by setting the visible attribute to false
when leaving the page, so that the update is not scheduled when
the page is not visible.

Change-Id: I9f3db68bb77c52d0f477b8322bbf52bd3cc81fe1
2019-02-12 14:14:08 +00:00
Jonathan Herlin 8627a85edf Add spacing to Queue lengths line
Add some spaces to the comma separated line in Zuul status page.

Change-Id: I847ed57fbd95da0618029facbb84d81ea4a411ff
2018-12-10 15:28:35 +00:00
Tristan Cacqueray 833dbd257b web: refactor status page to use a reducer
This change updates the status page component to use a fetchStatusAction
instead of direct axios call. This enables using the generic error reducers.
This change also refactors the refresh button into a parent component to
enable re-use on the other pages.

Change-Id: Iac8a317263f84f14f28d2ea015f918268b903407
2018-12-02 09:55:37 +00:00
Tobias Henkel 1aba9d1d5d
Do only one status request at a time
Currently we wait 5 seconds from the start of the request to do the
next request. On openstack the request can take more than 5 seconds so
we end up doing more requests in parallel. To fix this we should set
the timer for the next request when receiving the response data.

Change-Id: I543149f7f82cdd208cc50c30d1e29ea9a4cd453a
2018-10-11 18:14:14 +02:00
Tristan Cacqueray b57c95ae29 web: prevent filter being cleaned on status reload
This change fixes the status page to prevent reseting the filter
value on page refresh.

Story: 2004032
Task: 27028
Change-Id: I5379f25ccaaca07fba8ad627aefe79c569a1c20d
2018-10-10 03:05:46 +00:00
Tristan Cacqueray 68d1189871
Revert "Revert "web: rewrite interface in react""
This reverts commit 3dba813c64.

Change-Id: I233797a9b4e3485491c49675da2c2efbdba59449
2018-10-06 10:42:31 -05:00
James E. Blair 3dba813c64 Revert "web: rewrite interface in react"
Revert "Fix publish-openstack-javascript-content"

This reverts commit ca199eb9db.
This reverts commit 1082faae95.

This appears to remove the tarball publishing system that we rely on.

Change-Id: Id746fb826dfc01b157c5b772adc1d2991ddcd93a
2018-09-29 11:51:43 -07:00
Tristan Cacqueray 1082faae95 web: rewrite interface in react
This change rewrites the web interface using React:
http://lists.zuul-ci.org/pipermail/zuul-discuss/2018-August/000528.html

Depends-On: https://review.openstack.org/591964
Change-Id: Ic6c33102ac3da69ebd0b8e9c6c8b431d51f3cfd4
Co-Authored-By: Monty Taylor <mordred@inaugust.com>
Co-Authored-By: James E. Blair <jeblair@redhat.com>
2018-09-27 02:14:46 +00:00