Sha256: 547c4ab24e834c291ed825299ef97b8cb930b19461be7bba4104c649314d5f28

Contents?: true

Size: 1.9 KB

Versions: 7

Compression:

Stored size: 1.9 KB

Contents

!!!	
%html

  %head
    %title Fnordmetric Dashboard

    %script(type="text/javascript" src="#{path_prefix}/vendor/jquery-1.6.1.min.js")
    %script(type="text/javascript" src="#{path_prefix}/vendor/highcharts.js")

    %script(type="text/javascript" src="#{path_prefix}/fnordmetric.js")
    %link(type="text/css" rel="stylesheet" href="#{path_prefix}/fnordmetric.css")

    :javascript
      FnordMetric.p = '#{path_prefix}';

  %body
    .topbar{:class => namespaces.count > 1 ? 'shown' : 'hidden'}
      %ul
        -namespaces.each do |key,namespace|
          %li{:class => namespace.token == current_namespace.token ? 'active' : nil}
            %a{:href=>"/#{namespace.token}"}=h namespace.token

    #wrap
      #tabs
        %ul
          %li.active.sessions
            .picto.piechart
            Active Users

          -current_namespace.dashboards.each do |key,dashboard|
            %li.dashboard{:rel => dashboard.token}
              .picto.piechart
              =h dashboard.title

      #viewport
        .viewport_inner.clearfix
            

:javascript
  $(document).ready(function(){

    FnordMetric.init('#{current_namespace.token}', $('.viewport_inner'));

    $('#tabs li.dashboard').click(function(){
      FnordMetric.renderDashboard($(this).attr('rel'));
      window.location.hash = $(this).attr('rel');
    });

    $('#tabs li.sessions').click(function(){
      FnordMetric.renderSessionView();
      window.location.hash = '';
    });

    $('#tabs li').click(function(){
      $(this).addClass('active').siblings().removeClass('active');
    });

    function resizeViewport(){ 
      var viewport_width = window.innerWidth-220
      $('#viewport').width(viewport_width); 
      FnordMetric.resizeView();
    }

    resizeViewport();
    $(window).resize(resizeViewport);

    if(window.location.hash){
      $('#tabs li.dashboard[rel="'+window.location.hash.slice(1)+'"]').trigger('click');
    }

  });



Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fnordmetric-0.6.2 haml/app.haml
fnordmetric-0.6.1 haml/app.haml
fnordmetric-0.6.0 haml/app.haml
fnordmetric-0.5.9 haml/app.haml
fnordmetric-0.5.8 haml/app.haml
fnordmetric-0.5.7 haml/app.haml
fnordmetric-0.5.6 haml/app.haml