mirror of https://github.com/apache/druid.git
Merge branch 'master' of github.com:metamx/druid
This commit is contained in:
commit
bbed862b0b
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
<artifactId>druid-services</artifactId>
|
||||
<name>druid-services</name>
|
||||
<description>druid-services</description>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid-examples</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid-examples</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -23,7 +23,7 @@
|
|||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
<name>druid</name>
|
||||
<description>druid</description>
|
||||
<scm>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<parent>
|
||||
<groupId>com.metamx</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>0.3.23-SNAPSHOT</version>
|
||||
<version>0.3.24-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -55,16 +55,24 @@ var DruidTable = function() {
|
|||
// build table header
|
||||
html += "<thead>";
|
||||
|
||||
// find all unique field names
|
||||
var fieldNames = {};
|
||||
for (var row in this.getRows()) {
|
||||
for (var field in this.getRow(row)) {
|
||||
fieldNames[field] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// build table header filters
|
||||
html += "<tr>";
|
||||
for (var field in this.getRow(0)) {
|
||||
for (var field in fieldNames) {
|
||||
html += "<td><input type = \"text\" name=\"" + field + "\" value=\"" + field + "\" class=\"search_init\"/></td>";
|
||||
}
|
||||
html += "</tr>";
|
||||
|
||||
// build table header column headings
|
||||
html += "<tr>";
|
||||
for (var field in this.getRow(0)) {
|
||||
for (var field in fieldNames) {
|
||||
html += "<th>" + field + "</th>";
|
||||
}
|
||||
html += "</tr>";
|
||||
|
@ -74,8 +82,13 @@ var DruidTable = function() {
|
|||
html += "<tbody>";
|
||||
for (var r in this.getRows()) {
|
||||
html += "<tr>";
|
||||
for (var field in this.getRow(r)) {
|
||||
html += "<td " + "class=\"" + field.replace(' ', '_').toLowerCase() + "\">" + this.getCell(r, field) + "</td>";
|
||||
for (var field in fieldNames) {
|
||||
var row = this.getRow(r);
|
||||
if (row.hasOwnProperty(field)) {
|
||||
html += "<td " + "class=\"" + field.replace(' ', '_').toLowerCase() + "\">" + this.getCell(r, field) + "</td>";
|
||||
} else {
|
||||
html += "<td></td>";
|
||||
}
|
||||
}
|
||||
html += "</tr>";
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ function buildTable(data, el, dontDisplay, table, row) {
|
|||
|
||||
// parse JSON
|
||||
for (var item in data) {
|
||||
setTable(data[item], el, dontDisplay, table, row);
|
||||
setTable(data[item], el, dontDisplay, table, row, "");
|
||||
row++;
|
||||
}
|
||||
|
||||
|
@ -26,16 +26,16 @@ function buildTable(data, el, dontDisplay, table, row) {
|
|||
initDataTable(el);
|
||||
}
|
||||
|
||||
function setTable(data, el, dontDisplay, table, row) {
|
||||
function setTable(data, el, dontDisplay, table, row, fieldNamespace) {
|
||||
for (var field in data) {
|
||||
if (_.contains(dontDisplay, field)) {
|
||||
// do nothing
|
||||
} else if (Array.isArray(data[field])) {
|
||||
table.setCell(row, field, JSON.stringify(data[field]));
|
||||
table.setCell(row, fieldNamespace + field, JSON.stringify(data[field]));
|
||||
} else if (!(data[field] instanceof Object)) {
|
||||
table.setCell(row, field, data[field]);
|
||||
table.setCell(row, fieldNamespace + field, data[field]);
|
||||
} else {
|
||||
setTable(data[field], el, dontDisplay, table, row);
|
||||
setTable(data[field], el, dontDisplay, table, row, fieldNamespace + field + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue