Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Remove puppetlabs references (#384)
Browse files Browse the repository at this point in the history
* Replace puppetlabs references with working links to the open source project

* Create a help controller to display help pages

The help icon above the node status block was pointing to a non-existing
url for a long time now. Luckily this page was in the converted docs.

I integrated the page directly as a help overlay with the colorbox which
is already used for the file diff view.
  • Loading branch information
ZeroPointEnergy authored and sodabrew committed Dec 10, 2018
1 parent 2abd76d commit ec194e2
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 7 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ function display_file_popup(url) {
jQuery.colorbox({href: url, width: '80%', height: '80%', iframe: true});
}

function help_overlay(content) {
jQuery.colorbox({href: content, width: '60%', height: '80%'})
}

function init_sidebar_links() {
jQuery( '.node_summary .primary tr' ).each( function() {
jQuery( this )
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def safe_get(url)
if e.response.code == "403"
text = "<p>Connection not authorized: #{e}</p>
<p>You may not have generated your certificates.
<a target=\"_blank\" href=\"http://links.puppetlabs.com/dashboard_generating_certs\">View documentation</a></p>"
<a target=\"_blank\" href=\"https://github.com/sodabrew/puppet-dashboard/blob/master/docs/manual/configuring.markdown#generating-certs-and-connecting-to-the-puppet-master\">View documentation</a></p>"
else
text = "<p>File contents not available: #{e}</p>
<p>Your agents may not be submitting files to a central filebucket.
<a target=\"_blank\" href=\"http://links.puppetlabs.com/enabling_the_filebucket_viewer\">View documentation</a></p>"
<a target=\"_blank\" href=\"https://github.com/sodabrew/puppet-dashboard/blob/master/docs/manual/configuring.markdown#enabling-the-filebucket-viewer\">View documentation</a></p>"
end
render html: ActionController::Base.helpers.sanitize(text), status: e.response.code
rescue Errno::ECONNREFUSED => e
Expand Down
7 changes: 7 additions & 0 deletions app/controllers/help_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class HelpController < ApplicationController
def node_status
respond_to do |format|
format.html { render(partial: 'node_status') }
end
end
end
5 changes: 5 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,9 @@ def generate_unique_id
def add_body_class(klass)
(@body_classes ||= []).push(klass).uniq!
end

def help_overlay(action)
url = url_for controller: :help, action: action
link_to 'Help', '#', onclick: "help_overlay('#{url}'); return false;", class: 'popup-md5'
end
end
19 changes: 19 additions & 0 deletions app/views/help/_node_status.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
%h2= 'In Puppet Dashboard, every node is in one of six states:'

%span{style: 'font-family: Helvetica, Arial, Verdana; font-size: larger; color: #888;'}= 'Unresponsive:'
%p= "This node hasn't reported to the puppet master recently; something may be wrong. The cutoff for considering a node unresponsive defaults to one hour, and can be configured in `settings.yml` with the `no_longer_reporting_cutoff` setting."

%span{style: 'font-family: Helvetica, Arial, Verdana; font-size: larger; color: #c21;'}= 'Failed:'
%p= "During its last Puppet run, this node encountered some error from which it couldn't recover. Something is probably wrong, and investigation is recommended."

%span{style: 'font-family: Helvetica, Arial, Verdana; font-size: larger; color: #e72;'}= 'Pending:'
%p= "During its last Puppet run, this node _would_ have made changes, but it was either running in no-op mode or found a discrepancy in a resource whose `noop` metaparameter was set to `true`."

%span{style: 'font-family: Helvetica, Arial, Verdana; font-size: larger; color: #069;'}= 'Changed:'
%p= "This node's last Puppet run was successful, and changes were made to bring the node into compliance."

%span{style: 'font-family: Helvetica, Arial, Verdana; font-size: larger; color: #093;'}= 'Unchanged:'
%p= "This node's last Puppet run was successful, and it was fully compliant; no changes were necessary."

%span{style: 'font-family: Helvetica, Arial, Verdana; font-size: larger; color: #aaa;'}= 'Unreported:'
%p= "Although Dashboard is aware of this node's existence, it has never submitted a Puppet report. It may be a newly-commissioned node, it may have never come online, or its copy of Puppet may not be configured correctly."
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
= yield
#footer
%p
= link_to raw("&copy; Copyright #{Time.now.year} Puppet Labs"), 'http://puppetlabs.com/'
= link_to raw("Puppet Dashboard"), 'https://github.com/sodabrew/puppet-dashboard'
&mdash;
= link_to h(APP_VERSION), APP_VERSION_LINK
3 changes: 1 addition & 2 deletions app/views/shared/_node_manager_sidebar.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
.group
%h3{:class => active_if(controller_name == "nodes" && action_name == "index")}= link_to "Nodes", nodes_path
%p.help
%a{ :href => 'http://links.puppetlabs.com/dashboard1.2_node_summary_help', :target => '_blank' }
Help
= help_overlay('node_status')
.node_summary
%table.primary
- node_summary = Node.count_by_status
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/app_version_init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_app_version_link
if File.exists?(Rails.root.join('VERSION_LINK'))
return File.read(Rails.root.join('VERSION_LINK')).strip
else
return "https://github.com/puppetlabs/puppet-dashboard/commits/#{APP_VERSION.sub(/.*?g([0-9a-f]*)/, "\\1")}"
return "https://github.com/sodabrew/puppet-dashboard/commits/#{APP_VERSION.sub(/.*?g([0-9a-f]*)/, "\\1")}"
end
end

Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@
get 'release_notes', to: 'pages#release_notes'

get 'radiator(.:format)', to: 'radiator#index'

get 'help/node_status', to: 'help#node_status'
end
2 changes: 1 addition & 1 deletion docs/manual/bootstrapping.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ On Debian-based systems, install Puppet Dashboard via Apt:

If you're unable to use the Dashboard packages on your system, the next best way to install Dashboard is from the Puppet Labs Git repo. In the directory where you want Dashboard installed (we suggest `/opt/` or `/usr/share/`), run:

git clone git://github.com/puppetlabs/puppet-dashboard.git
git clone git://github.com/sodabrew/puppet-dashboard.git
cd puppet-dashboard
git checkout v1.2.0

Expand Down

0 comments on commit ec194e2

Please sign in to comment.