Make different variable types print prettier.

pull/3236/head
Todd Persen 2015-07-04 14:47:41 -07:00
parent 69be5f52b9
commit 402b4d8652
1 changed files with 16 additions and 2 deletions

View File

@ -286,14 +286,28 @@ var TableBody = React.createClass({
var TableRow = React.createClass({
render: function() {
var tableData = this.props.data.map(function (data) {
return React.createElement("td", null, data)
var tableData = this.props.data.map(function (data, index) {
if (index == 0) {
return React.createElement("td", {className: "timestamp"}, null, data);
} else {
return React.createElement("td", null, pretty(data));
}
});
return React.createElement("tr", null, tableData);
}
});
var pretty = function(val) {
if (typeof val == 'string') {
return "\"" + val + "\"";
} else if (typeof val == 'boolean' ){
return val.toString();
} else {
return val;
}
}
var chooseDatabase = function (databaseName) {
currentlySelectedDatabase = databaseName;
document.getElementById("content-current-database").innerHTML = currentlySelectedDatabase;