Make different variable types print prettier.
parent
69be5f52b9
commit
402b4d8652
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue