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

Reactive subscription #495

Merged
merged 2 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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