Skip to content

Commit

Permalink
systemd: Warn if not connected to Insights
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer authored and martinpitt committed Sep 9, 2019
1 parent 22825df commit 85df0ec
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/systemd/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,22 @@ PageServer.prototype = {
refresh_os_updates_state();
});

var insights_client_timer = service.proxy("insights-client.timer");

function refresh_insights_status() {
if (insights_client_timer.exists && !insights_client_timer.enabled) {
$("#insights_icon").attr("class", "pficon pficon-warning-triangle-o");
set_page_link("#insights_text", "subscriptions",
_("Not connected to Insights"));

This comment has been minimized.

Copy link
@stefwalter

stefwalter Sep 9, 2019

Contributor

@andreasn Should this be similar text to what we display in motd?

This comment has been minimized.

Copy link
@andreasn

andreasn Sep 10, 2019

Contributor

Oh yeah, the whole connected vs. registered. I've been on the fence about that one, but decided to go for connected for now.
We went for, since registered felt like it was confusing in the context of the subscription registration dialog. Like, you register your system, but also register to insights. But it's not ideal :/

$("#insights_icon, #insights_text").show();
} else {
$("#insights_icon, #insights_text").hide();
}
}

$(insights_client_timer).on("changed", refresh_insights_status);
refresh_insights_status();

// Only link from graphs to available pages
set_page_link("#link-disk", "storage", _("Disk I/O"));
set_page_link("#link-network", "network", _("Network Traffic"));
Expand Down
7 changes: 7 additions & 0 deletions pkg/systemd/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,15 @@
<span id="system_information_os_text"></span>

<div role="group" class="system-information-updates">
<div>
<span id="system_information_updates_icon" hidden></span>
<span id="system_information_updates_text"></span>
</div>
<br>
<div>
<span id="insights_icon"></span>
<span id="insights_text"></span>
</div>
</div>

<label class="control-label" for="system-ssh-keys-link" translatable="yes">Secure Shell Keys</label>
Expand Down
20 changes: 20 additions & 0 deletions test/verify/check-subscriptions
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,32 @@ insecure_connection=True
b.click(dialog_register_button_sel)
b.wait_not_present(dialog_register_button_sel)

b.switch_to_top()
b.click("a[href='/system']")
b.enter_page("/system")

b.wait_text("#insights_text", "Not connected to Insights")

b.switch_to_top()
b.click("a[href='/subscriptions']")
b.enter_page("/subscriptions")

b.click("label:contains('Insights') a:contains('Not connected')")
b.wait_present('.modal-body:contains("This system is not connected")')
b.click('.modal-footer button.apply')
with b.wait_timeout(360):
b.wait_not_present('.modal-dialog')

b.switch_to_top()
b.click("a[href='/system']")
b.enter_page("/system")

b.wait_not_visible("#insights_text")

b.switch_to_top()
b.click("a[href='/subscriptions']")
b.enter_page("/subscriptions")

b.click("label:contains('Insights') a:contains('Connected to Insights')")
b.wait_present('.modal-body:contains("Next Insights data upload")')
b.wait_present('.modal-body:contains("Last Insights data upload")')
Expand Down

0 comments on commit 85df0ec

Please sign in to comment.