Changeset 1362

Show
Ignore:
Timestamp:
03/24/08 16:51:59 (6 months ago)
Author:
mbriggs
Message:

Various interface improvements/fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hive/trunk/data_webapp/app/controllers/data_controller.rb

    r1304 r1362  
    55  # List the latest client data 
    66  def index 
    7     @clients = Client.paginate(:order => 'compromise DESC',:page => params[:page],:per_page => 10) 
     7    @statuses = [''] 
     8    @statuses += Client.find(:all,:select=>"DISTINCT(status)").map(&:status).to_a 
     9    if request.post? 
     10      @status = params[:client][:status] 
     11    elsif not params[:status].nil? 
     12      @status = params[:status] 
     13    else 
     14      @status = nil 
     15    end 
     16    if @status.nil? 
     17      @clients = Client.paginate(:order => 'compromise DESC,start DESC',:page => params[:page],:per_page => 10) 
     18    else 
     19      @clients = Client.paginate(:conditions => {:status => @status},:order => 'compromise DESC,start DESC',:page => params[:page],:per_page => 10) 
     20    end 
    821  end 
    922   
  • hive/trunk/data_webapp/app/helpers/data_helper.rb

    r1295 r1362  
    11module DataHelper 
     2 
    23  def column_value(model,column) 
    34    model.send(column) 
     
    110111  def fingerprint_data_row(instance) 
    111112    display_fields = %w(name event) 
     113    microfields = %w(time_at created) 
    112114    if instance.nil? 
    113115      return 
     
    121123      elsif c.name == "false_positive" 
    122124        row_def += %{ class="} + (instance.send(c.name) == false ? %{positive} : %{falsePositive}) + %{"} 
     125      elsif microfields.include?(c.name) 
     126        row_def += %{ title="#{ microseconds_to_string(instance.send(c.name)) }"} 
    123127      end 
    124128    end 
  • hive/trunk/data_webapp/app/models/client.rb

    r1299 r1362  
    3434 
    3535  def self.last_url(id) 
    36     last = HistoryUrl.find(:first,:conditions => {:client_id => id}, :order => "time_at DESC", :limit => 1) 
     36    last = HistoryUrl.find(:first,:select => "url", :conditions => {:client_id => id}, :order => "time_at DESC", :limit => 1) 
    3737    if last.nil? 
    3838      "" 
    3939    else 
    40       last.url() 
     40      URI.parse(last.url()).host() 
    4141    end 
    4242  end 
  • hive/trunk/data_webapp/app/models/fingerprint.rb

    r1300 r1362  
    11class Fingerprint < ActiveRecord::Base 
    22  belongs_to :client 
    3   has_many :os_processes 
     3  has_many :os_processes, :order => 'created ASC' 
    44   
    55  validates_presence_of :checksum 
  • hive/trunk/data_webapp/app/models/process_file.rb

    r1111 r1362  
    11class ProcessFile < ActiveRecord::Base 
    2   belongs_to :os_process, :counter_cache => :process_file_count 
     2  belongs_to :os_process, :counter_cache => :process_file_count, :order => "time_at ASC" 
    33  belongs_to :file_content, :dependent => true 
    44 
  • hive/trunk/data_webapp/app/models/regkey.rb

    r1111 r1362  
    11class Regkey < ActiveRecord::Base 
    2   belongs_to :os_process, :counter_cache => :regkey_count 
     2  belongs_to :os_process, :counter_cache => :regkey_count, :order => "time_at ASC" 
    33 
    44  validates_presence_of :name 
  • hive/trunk/data_webapp/app/views/data/details.rhtml

    r1295 r1362  
    2020      </table> 
    2121  <% for p in @client.fingerprint.os_processes %> 
     22        <p/> 
    2223        <table border="1" width="100%"> 
    2324        <tbody> 
     
    4041            <table class="details" cellspacing="1" width="100%"> 
    4142              <%= fingerprint_header_row(Regkey) %> 
    42             <% for r in p.regkeys%> 
     43            <% for r in p.regkeys %> 
    4344              <%= fingerprint_data_row(r) %> 
    4445            <% end %> 
  • hive/trunk/data_webapp/app/views/data/index.rhtml

    r1304 r1362  
    11<h2>Client data</h2> 
    2 <p>Ordered by the most recent compromise time</p> 
     2<div style="display:block;"> 
     3View Clients of type: 
     4<% if not @statuses.nil? %> 
     5  <% form_for :client, :html => {:style => "display:inline"} do |f| %> 
     6    <%= f.select('status',@statuses,{:selected => @status},{:onchange => "submit()"}) %> 
     7  <% end %> 
     8<% end %> 
     9</div> 
     10<p/> 
    311<div id="data"> 
    412<table class="details"> 
     
    917    <th>Start Time</th> 
    1018    <th>Compromise Time</th> 
    11     <th>Last Url</th> 
     19    <th>Last Domain</th> 
    1220    <th>&nbsp;</th> 
    1321  </tr> 
     
    2836 
    2937<br/> 
    30 <%= will_paginate @clients, :inner_window => 10, :outer_window => 10 %> 
     38<%= will_paginate @clients, :params => {:status => @status}, :inner_window => 10, :outer_window => 10 %>