Skip to content

Commit

Permalink
LOGSTASH-494: use relative URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
fetep committed Jun 22, 2012
1 parent acfe12c commit e28f2f9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/logstash/web/public/js/logstash.js
Expand Up @@ -30,12 +30,12 @@
/* Check for history.pushState */ /* Check for history.pushState */


var display_query = query.replace("<", "&lt;").replace(">", "&gt;") var display_query = query.replace("<", "&lt;").replace(">", "&gt;")
$("#querystatus, #results h1").html("Loading query '" + display_query + "' (offset:" + logstash.params.offset + ", count:" + logstash.params.count + ") <img class='throbber' src='/media/throbber.gif'>") $("#querystatus, #results h1").html("Loading query '" + display_query + "' (offset:" + logstash.params.offset + ", count:" + logstash.params.count + ") <img class='throbber' src='media/throbber.gif'>")
//console.log(logstash.params) //console.log(logstash.params)
logstash.params.q = query; logstash.params.q = query;


/* Load the search results */ /* Load the search results */
$("#results").load("/api/search?format=html", logstash.params, $("#results").load("api/search?format=html", logstash.params,
function(response, status, xhr) { function(response, status, xhr) {
if (status == "error") { if (status == "error") {
/* We still return HTML on error, it's just an error message */ /* We still return HTML on error, it's just an error message */
Expand Down Expand Up @@ -64,7 +64,7 @@
* This won't likely survive 1.0, but it's fun for now... * This won't likely survive 1.0, but it's fun for now...
* TODO(sissel): Replace with a 'loading' or something icon. */ * TODO(sissel): Replace with a 'loading' or something icon. */


var throbber = $("<center><img src='/media/throbber.gif'><center>") var throbber = $("<center><img src='media/throbber.gif'><center>")
throbber.attr("id", "throbber") throbber.attr("id", "throbber")
throbber.css("margin", "-100px"); throbber.css("margin", "-100px");
$("#visual #throbber").remove(); $("#visual #throbber").remove();
Expand All @@ -73,7 +73,7 @@
tries = 4; /* default tries */ tries = 4; /* default tries */
} }


jQuery.getJSON("/api/histogram", logstash.params, function(histogram, text, jqxhr) { jQuery.getJSON("api/histogram", logstash.params, function(histogram, text, jqxhr) {
/* Load the data into the graph */ /* Load the data into the graph */
var flot_data = []; var flot_data = [];
// histogram is an array of { "key": ..., "count": ... } // histogram is an array of { "key": ..., "count": ... }
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/web/server.rb
Expand Up @@ -111,7 +111,7 @@ def initialize(settings)
end # /style.css end # /style.css


get '/' do get '/' do
redirect "/search" redirect "search"
end # '/' end # '/'


get '/*' do get '/*' do
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/web/views/header.haml
@@ -1,7 +1,7 @@
.logo .logo
logstash. logstash.
.search .search
%form.search{ :action => "/search" } %form.search{ :action => "search" }
%label{ :for => "q" } Query: %label{ :for => "q" } Query:
%input.query{ :id => "query", :type => "text", :name => "q", :value => params[:q], %input.query{ :id => "query", :type => "text", :name => "q", :value => params[:q],
:size => 60 } :size => 60 }
Expand Down
8 changes: 4 additions & 4 deletions lib/logstash/web/views/layout.haml
Expand Up @@ -3,10 +3,10 @@


%head %head
%title= @title || "logstash" %title= @title || "logstash"
%link{ :rel => "stylesheet", :href => "/style.css", :type => "text/css" } %link{ :rel => "stylesheet", :href => "style.css", :type => "text/css" }
%link{ :rel => "stylesheet", :href => "/css/smoothness/jquery-ui-1.8.5.custom.css", :type => "text/css" } %link{ :rel => "stylesheet", :href => "css/smoothness/jquery-ui-1.8.5.custom.css", :type => "text/css" }
%script{ :src => "/js/jquery-1.6.1.min.js", :type => "text/javascript" } %script{ :src => "js/jquery-1.6.1.min.js", :type => "text/javascript" }
%script{ :src => "/js/jquery-ui-1.8.13.min.js", :type => "text/javascript" } %script{ :src => "js/jquery-ui-1.8.13.min.js", :type => "text/javascript" }
%script{ :src => "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js", %script{ :src => "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js",
:type => "text/javascript" } :type => "text/javascript" }
%script{ :src => "js/jquery.tmpl.min.js", :type => "text/javascript" } %script{ :src => "js/jquery.tmpl.min.js", :type => "text/javascript" }
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/web/views/main/index.haml
@@ -1,4 +1,4 @@
%form.search{ :action => "/search" } %form.search{ :action => "search" }
%label{ :for => "q" } %label{ :for => "q" }
%input.query{ :type => "text", :name => "q" } %input.query{ :type => "text", :name => "q" }
%input{ :type => "submit" } %input{ :type => "submit" }
Expand Down

0 comments on commit e28f2f9

Please sign in to comment.