Sha256: 4a3f62d47cf4128732204a8fe8ea63b7ad9a4738af4cff696adf08b618dd3933

Contents?: true

Size: 1.71 KB

Versions: 4

Compression:

Stored size: 1.71 KB

Contents

- profile_name = @profile.options[:profile_name]
- page_title(profile_name)
- require_js "builder"

%a{:href=>"#edit", :id => "edit"} edit profile
%div#chart-builder-slider
  = haml :builder_form

:javascript
  window.addEvent('domready', function() {
    var builder = new ChartBuilder('chart-builder', {
      hosts:   ['#{@profile.options[:hosts].join("','")   }'],
      metrics: ['#{@profile.options[:metrics].join("','") }']
    });

    $('chart-builder-slider').fade('hide').setStyle('height', '0');

    $('edit').addEvent('click', function(e) {
      e.stop();
      $('chart-builder-slider').setStyle('height', 'auto').fade('in');
      e.target.destroy();
    });
  });

%div#profile
  %h2#name= profile_name
  %div#graphs
    - @profile.graphs.each do |graph|
      - id       = URI.escape(graph.id)
      - host     = URI.escape(graph.host)
      - plugin   = URI.escape(graph.plugin)
      - instance = URI.escape(graph.instances.join(','))
      %div{:id => id, :class => 'graph'}
        %img{:src => link_to("/images/loader.gif")}
        :javascript
          window.addEvent('domready', function() {
            var graph = new VisageGraph('#{id}', '#{host}', '#{plugin}', {
              pluginInstance: '#{instance}',
              #{ "baseurl: '" + ENV['BASE_URL'].gsub(/^\//, '') if ENV['BASE_URL'] }
            });
          });
    - if @profile.graphs.size == 0
      %div.graph
        %h4.error Oops! Looks like there aren't any graphs matching the specified patterns.
        %p These are the patterns:
        %pre
          :preserve
            Host:    #{@profile.options[:hosts]}
            Metrics: #{@profile.options[:metrics]}

  %div#bottom_nav
    %a{:href => link_to("/profiles")} ← Back to profiles



Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
visage-app-2.0.5 lib/visage-app/views/profile.haml
visage-app-2.0.4 lib/visage-app/views/profile.haml
visage-app-2.0.2 lib/visage-app/views/profile.haml
visage-app-2.0.0 lib/visage-app/views/profile.haml