Merge pull request #378 from metamx/upgrade-jquery

Update jquery to the latest version
This commit is contained in:
fjy 2014-01-31 12:38:25 -08:00
commit 63aacc71e3
17 changed files with 70 additions and 9509 deletions

View File

@ -29,7 +29,7 @@
<style type="text/css">@import "css/demo_table.css";</style> <style type="text/css">@import "css/demo_table.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables-1.8.2.js"></script> <script type="text/javascript" src="js/jquery.dataTables-1.8.2.js"></script>
<script type="text/javascript" src="js/druidTable-0.0.1.js"></script> <script type="text/javascript" src="js/druidTable-0.0.1.js"></script>
<script type="text/javascript" src="js/tablehelper-0.0.2.js"></script> <script type="text/javascript" src="js/tablehelper-0.0.2.js"></script>

View File

@ -263,7 +263,8 @@ public class DatabaseRuleManager
public List<Rule> getRules(final String dataSource) public List<Rule> getRules(final String dataSource)
{ {
return rules.get().get(dataSource); List<Rule> retVal = rules.get().get(dataSource);
return retVal == null ? Lists.<Rule>newArrayList() : retVal;
} }
public List<Rule> getRulesWithDefault(final String dataSource) public List<Rule> getRulesWithDefault(final String dataSource)

View File

@ -84,8 +84,7 @@ public class DatasourcesResource
@Produces("application/json") @Produces("application/json")
public Response getQueryableDataSources( public Response getQueryableDataSources(
@QueryParam("full") String full, @QueryParam("full") String full,
@QueryParam("simple") String simple, @QueryParam("simple") String simple
@QueryParam("gran") String gran
) )
{ {
Response.ResponseBuilder builder = Response.status(Response.Status.OK); Response.ResponseBuilder builder = Response.status(Response.Status.OK);
@ -107,9 +106,6 @@ public class DatasourcesResource
) )
) )
).build(); ).build();
} else if (gran != null) {
IndexGranularity granularity = IndexGranularity.fromString(gran);
// TODO
} }
return builder.entity( return builder.entity(
@ -131,6 +127,7 @@ public class DatasourcesResource
@DELETE @DELETE
@Path("/{dataSourceName}") @Path("/{dataSourceName}")
@Produces("application/json")
public Response deleteDataSource( public Response deleteDataSource(
@PathParam("dataSourceName") final String dataSourceName, @PathParam("dataSourceName") final String dataSourceName,
@QueryParam("kill") final String kill, @QueryParam("kill") final String kill,
@ -138,10 +135,22 @@ public class DatasourcesResource
) )
{ {
if (indexingServiceClient == null) { if (indexingServiceClient == null) {
return Response.status(Response.Status.OK).entity(ImmutableMap.of("error", "no indexing service found")).build(); return Response.ok().entity(ImmutableMap.of("error", "no indexing service found")).build();
} }
if (kill != null && Boolean.valueOf(kill)) { if (kill != null && Boolean.valueOf(kill)) {
indexingServiceClient.killSegments(dataSourceName, new Interval(interval)); try {
indexingServiceClient.killSegments(dataSourceName, new Interval(interval));
}
catch (Exception e) {
return Response.status(Response.Status.NOT_FOUND)
.entity(
ImmutableMap.of(
"error",
"Exception occurred. Are you sure you have an indexing service?"
)
)
.build();
}
} else { } else {
if (!databaseSegmentManager.removeDatasource(dataSourceName)) { if (!databaseSegmentManager.removeDatasource(dataSourceName)) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();

View File

@ -21,13 +21,17 @@ package io.druid.server.http;
import com.google.inject.Inject; import com.google.inject.Inject;
import io.druid.db.DatabaseRuleManager; import io.druid.db.DatabaseRuleManager;
import io.druid.server.coordinator.rules.Rule;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.PathParam; import javax.ws.rs.PathParam;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.List;
/** /**
*/ */
@ -67,4 +71,18 @@ public class RulesResource
return Response.ok(databaseRuleManager.getRules(dataSourceName)) return Response.ok(databaseRuleManager.getRules(dataSourceName))
.build(); .build();
} }
@POST
@Path("/{dataSourceName}")
@Consumes("application/json")
public Response setDatasourceRules(
@PathParam("dataSourceName") final String dataSourceName,
final List<Rule> rules
)
{
if (databaseRuleManager.overrideRule(dataSourceName, rules)) {
return Response.ok().build();
}
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
} }

View File

@ -29,7 +29,7 @@
<style type="text/css">@import "css/demo_table.css";</style> <style type="text/css">@import "css/demo_table.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables-1.8.2.js"></script> <script type="text/javascript" src="js/jquery.dataTables-1.8.2.js"></script>
<script type="text/javascript" src="js/druidTable-0.0.1.js"></script> <script type="text/javascript" src="js/druidTable-0.0.1.js"></script>
<script type="text/javascript" src="js/init-0.0.2.js"></script> <script type="text/javascript" src="js/init-0.0.2.js"></script>

View File

@ -30,9 +30,9 @@
<style type="text/css">@import "css/config.css";</style> <style type="text/css">@import "css/config.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script> <script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script>
<script type="text/javascript" src="js/config-0.0.1.js"></script> <script type="text/javascript" src="js/config-0.0.2.js"></script>
</head> </head>
<body> <body>
<div class="container"> <div class="container">

View File

@ -30,7 +30,7 @@
<style type="text/css">@import "css/enable.css";</style> <style type="text/css">@import "css/enable.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script> <script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script>
<script type="text/javascript" src="js/enable-0.0.1.js"></script> <script type="text/javascript" src="js/enable-0.0.1.js"></script>
</head> </head>

View File

@ -20,7 +20,7 @@ function domToConfig(configDiv) {
} }
function getConfigs() { function getConfigs() {
$.getJSON("/coordinator/config", function(data) { $.getJSON("/druid/coordinator/v1/config", function(data) {
$('#config_list').empty(); $('#config_list').empty();
$.each(data, function (key, value) { $.each(data, function (key, value) {
@ -72,10 +72,10 @@ $(document).ready(function() {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url:'/coordinator/config', url:'/druid/coordinator/v1/config',
data: JSON.stringify(configs), data: JSON.stringify(configs),
contentType:"application/json; charset=utf-8", contentType:"application/json; charset=utf-8",
dataType:"json", dataType:"text",
error: function(xhr, status, error) { error: function(xhr, status, error) {
$("#update_dialog").dialog("close"); $("#update_dialog").dialog("close");
$("#error_dialog").html(xhr.responseText); $("#error_dialog").html(xhr.responseText);

View File

@ -24,7 +24,7 @@ $(document).ready(function() {
url:'/druid/coordinator/v1/datasources/' + selected, url:'/druid/coordinator/v1/datasources/' + selected,
data: JSON.stringify(selected), data: JSON.stringify(selected),
contentType:"application/json; charset=utf-8", contentType:"application/json; charset=utf-8",
dataType:"json", dataType:"text",
error: function(xhr, status, error) { error: function(xhr, status, error) {
$("#enable_dialog").dialog("close"); $("#enable_dialog").dialog("close");
$("#error_dialog").html(xhr.responseText); $("#error_dialog").html(xhr.responseText);
@ -53,7 +53,7 @@ $(document).ready(function() {
url:'/druid/coordinator/v1/datasources/' + selected, url:'/druid/coordinator/v1/datasources/' + selected,
data: JSON.stringify(selected), data: JSON.stringify(selected),
contentType:"application/json; charset=utf-8", contentType:"application/json; charset=utf-8",
dataType:"json", dataType:"text",
error: function(xhr, status, error) { error: function(xhr, status, error) {
$("#disable_dialog").dialog("close"); $("#disable_dialog").dialog("close");
$("#error_dialog").html(xhr.responseText); $("#error_dialog").html(xhr.responseText);
@ -81,12 +81,11 @@ $(document).ready(function() {
$('#disabled_datasources').append($('<li>' + datasource + '</li>')); $('#disabled_datasources').append($('<li>' + datasource + '</li>'));
}); });
$.each(db_datasources, function(index, datasource) { $.each(db_datasources, function(index, datasource) {
$('#datasources').append($('<option></option>').attr("value", datasource).text(datasource)); $('#datasources').append($('<option></option>').val(datasource).text(datasource));
}); });
}); });
}); });
$("#enable").click(function() { $("#enable").click(function() {
$("#enable_dialog").dialog("open"); $("#enable_dialog").dialog("open");
}); });

View File

@ -3,11 +3,12 @@
$(document).ready(function() { $(document).ready(function() {
var basePath = "/druid/coordinator/v1/"; var basePath = "/druid/coordinator/v1/";
var type = $('#select_type').attr('value') + ''; var type = $('#select_type').val() + '';
var view = $('#select_view').attr('value') + ''; var view = $('#select_view').val() + '';
function handleTable(dontDisplay) function handleTable(dontDisplay)
{ {
console.log(type);
$.get(basePath + type + '?full', function(data) { $.get(basePath + type + '?full', function(data) {
buildTable(data, $('#result_table'), dontDisplay); buildTable(data, $('#result_table'), dontDisplay);
@ -75,8 +76,9 @@ $(document).ready(function() {
} }
$('#view_button').click(function() { $('#view_button').click(function() {
type = $('#select_type').attr('value') + ''; console.log("here");
view = $('#select_view').attr('value') + ''; type = $('#select_type').val() + '';
view = $('#select_view').val() + '';
resetViews(); resetViews();

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ $(document).ready(function() {
type: 'DELETE', type: 'DELETE',
url:'/druid/coordinator/v1/datasources/' + selected +'?kill=true&interval=' + interval, url:'/druid/coordinator/v1/datasources/' + selected +'?kill=true&interval=' + interval,
contentType:"application/json; charset=utf-8", contentType:"application/json; charset=utf-8",
dataType:"json", dataType:"text",
error: function(xhr, status, error) { error: function(xhr, status, error) {
$("#confirm_dialog").dialog("close"); $("#confirm_dialog").dialog("close");
$("#error_dialog").html(xhr.responseText); $("#error_dialog").html(xhr.responseText);
@ -43,7 +43,7 @@ $(document).ready(function() {
$.getJSON("/druid/coordinator/v1/db/datasources?includeDisabled", function(data) { $.getJSON("/druid/coordinator/v1/db/datasources?includeDisabled", function(data) {
$.each(data, function(index, datasource) { $.each(data, function(index, datasource) {
$('#datasources').append($('<option></option>').attr("value", datasource).text(datasource)); $('#datasources').append($('<option></option>').val(datasource).text(datasource));
}); });
}); });

View File

@ -243,7 +243,7 @@ $(document).ready(function() {
url:'/druid/coordinator/v1/rules/' + selected, url:'/druid/coordinator/v1/rules/' + selected,
data: JSON.stringify(rules), data: JSON.stringify(rules),
contentType:"application/json; charset=utf-8", contentType:"application/json; charset=utf-8",
dataType:"json", dataType:"text",
error: function(xhr, status, error) { error: function(xhr, status, error) {
$("#update_dialog").dialog("close"); $("#update_dialog").dialog("close");
$("#error_dialog").html(xhr.responseText); $("#error_dialog").html(xhr.responseText);
@ -266,9 +266,9 @@ $(document).ready(function() {
$.getJSON("/druid/coordinator/v1/db/datasources", function(data) { $.getJSON("/druid/coordinator/v1/db/datasources", function(data) {
$.each(data, function(index, datasource) { $.each(data, function(index, datasource) {
$('#datasources').append($('<option></option>').attr("value", datasource).text(datasource)); $('#datasources').append($('<option></option>').val(datasource).text(datasource));
}); });
$('#datasources').append($('<option></option>').attr("value", defaultDatasource).text(defaultDatasource)); $('#datasources').append($('<option></option>').val(defaultDatasource).text(defaultDatasource));
}); });
$("#datasources").change(function(event) { $("#datasources").change(function(event) {
@ -276,7 +276,7 @@ $(document).ready(function() {
$("#rules").show(); $("#rules").show();
}); });
$(".rule_dropdown_types").live("change", function(event) { $(document).on("change", '.rule_dropdown_types', null, function(event) {
var newRule = { var newRule = {
"type" : $(event.target).val() "type" : $(event.target).val()
}; };
@ -284,11 +284,11 @@ $(document).ready(function() {
ruleBody.replaceWith(makeRuleBody(newRule)); ruleBody.replaceWith(makeRuleBody(newRule));
}); });
$(".delete_rule").live("click", function(event) { $(document).on("click", '.delete_rule', null, function(event) {
$(event.target).parent(".rule").remove(); $(event.target).parent(".rule").remove();
}); });
$(".add_tier").live("click", function(event) { $(document).on("click", '.add_tier', null, function(event) {
$(event.target).parent().append(makeTierLoad(null, 0)); $(event.target).parent().append(makeTierLoad(null, 0));
}); });

View File

@ -29,7 +29,7 @@
<style type="text/css">@import "css/jquery-ui-1.9.2.css";</style> <style type="text/css">@import "css/jquery-ui-1.9.2.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script> <script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script>
<script type="text/javascript" src="js/kill-0.0.1.js"></script> <script type="text/javascript" src="js/kill-0.0.1.js"></script>
</head> </head>

View File

@ -30,9 +30,9 @@
<style type="text/css">@import "css/rules.css";</style> <style type="text/css">@import "css/rules.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script> <script type="text/javascript" src="js/jquery-ui-1.9.2.js"></script>
<script type="text/javascript" src="js/rules-0.0.1.js"></script> <script type="text/javascript" src="js/rules-0.0.2.js"></script>
</head> </head>
<body> <body>
<div class="container"> <div class="container">

View File

@ -30,11 +30,11 @@
<style type="text/css">@import "css/index.css";</style> <style type="text/css">@import "css/index.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables-1.8.2.js"></script> <script type="text/javascript" src="js/jquery.dataTables-1.8.2.js"></script>
<script type="text/javascript" src="js/druidTable-0.0.1.js"></script> <script type="text/javascript" src="js/druidTable-0.0.1.js"></script>
<script type="text/javascript" src="js/tablehelper-0.0.2.js"></script> <script type="text/javascript" src="js/tablehelper-0.0.2.js"></script>
<script type="text/javascript" src="js/handlers-0.0.1.js"></script> <script type="text/javascript" src="js/handlers-0.0.2.js"></script>
</head> </head>
<body> <body>