Skip to content

Commit

Permalink
Reactive subscription (#495)
Browse files Browse the repository at this point in the history
* Move host subscriptions section to the end of the page

* Make subscriptions reactive
  • Loading branch information
fabriziosestito authored May 5, 2022
1 parent 61102fe commit 74f0961
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
14 changes: 7 additions & 7 deletions assets/js/components/HostDetails/HostDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ const HostDetails = () => {
</div>
</div>

<div className="mt-8">
<div>
<h2 className="text-2xl font-bold">SAP instances</h2>
</div>
<Table config={sapInstancesTableConfiguration} data={sapSystems} />
</div>

<div className="mt-16">
<div className="flex flex-direction-row">
<img src={SuseLogo} className="h-12" />
Expand All @@ -121,13 +128,6 @@ const HostDetails = () => {
data={host.sles_subscriptions}
/>
</div>

<div className="mt-8">
<div>
<h2 className="text-2xl font-bold">SAP instances</h2>
</div>
<Table config={sapInstancesTableConfiguration} data={sapSystems} />
</div>
</div>
);
};
Expand Down
15 changes: 15 additions & 0 deletions lib/trento/application/projectors/sles_subscriptions_projector.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,19 @@ defmodule Trento.SlesSubscriptionsProjector do
end)
end
)

def after_update(
%SlesSubscriptionsUpdated{host_id: id, subscriptions: subscriptions},
_,
_
) do
TrentoWeb.Endpoint.broadcast(
"monitoring:hosts",
"host_details_updated",
%{
id: id,
sles_subscriptions: subscriptions
}
)
end
end

0 comments on commit 74f0961

Please sign in to comment.