-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added Last Seen stat - Changed Styling to fit a 1080p screen - Added tests
- Loading branch information
Showing
16 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
app/controllers/mission_control/servers/dashboards/last_seens_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module MissionControl::Servers | ||
class Dashboards::LastSeensController < ApplicationController | ||
def show | ||
@project = MissionControl::Servers::Project.find_by(token: params[:project_id]) | ||
@hostname = params[:hostname] | ||
@service = @project.services.where(hostname: @hostname).last | ||
end | ||
end | ||
end |
4 changes: 4 additions & 0 deletions
4
app/helpers/mission_control/servers/dashboards/last_connecteds_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module MissionControl::Servers | ||
module Dashboards::LastConnectedsHelper | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/views/mission_control/servers/dashboards/last_seens/show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<%= turbo_frame_tag dom_id(@project, [@hostname, :last_seen].join('-')) do %> | ||
<div class="progress-bar bg-gray-300" style="height: 5px; width: 100%;"> | ||
<div class="progress bg-blue-500" data-refresh-target="progressBar" style="height: 100%; width: 100%;"></div> | ||
</div> | ||
<div class="flex flex-col bg-gray-400/5 p-8"> | ||
<dd class="card-heading">Last Seen</dd> | ||
<dt class="connected-chart"> | ||
<%= @service.created_at.strftime("%Y-%-m-%-d") %><br><br> | ||
<%= @service.created_at.strftime("%I:%M:%S %p") %> | ||
</dt> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module MissionControl | ||
module Servers | ||
VERSION = "0.1.5" | ||
VERSION = "0.1.6" | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
test/controllers/mission_control/servers/dashboards/last_seens_controller_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require "test_helper" | ||
|
||
module MissionControl::Servers | ||
class Dashboards::LastSeensControllerTest < ActionDispatch::IntegrationTest | ||
include Engine.routes.url_helpers | ||
|
||
include Engine.routes.url_helpers | ||
|
||
setup do | ||
@project = mission_control_servers_projects(:one) | ||
end | ||
|
||
test "should get show" do | ||
get project_dashboards_last_seen_path(@project.token, hostname: "HOST") | ||
assert_response :success | ||
end | ||
end | ||
end |