-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from whiteinge/morphdom
Add Morphdom
- Loading branch information
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var render = function () { | ||
|
||
var databases = ENV.generateData().toArray(); | ||
|
||
var html = '<div><table class="table table-striped latest-data"><tbody>'; | ||
for (var index = 0; index < databases.length; index++) { | ||
var db = databases[index]; | ||
html += '<tr><td class="dbname">' + db.dbname + '</td>'; | ||
html += '<td class="query-count">'; | ||
html += '<span class="' + db.lastSample.countClassName + '">' + db.lastSample.nbQueries + '</span></td>'; | ||
|
||
for (var indexQ = 0; indexQ < db.lastSample.topFiveQueries.length; indexQ++) { | ||
var q = db.lastSample.topFiveQueries[indexQ]; | ||
html += '<td class="' + q.elapsedClassName + '">'; | ||
html += q.formatElapsed || ''; | ||
html += '<div class="popover left">'; | ||
html += '<div class="popover-content">'; | ||
html += q.query || ''; | ||
html += '</div>'; | ||
html += '<div class="arrow"></div>'; | ||
html += '</div>'; | ||
html += '</td>'; | ||
} | ||
html += '</tr>'; | ||
} | ||
|
||
html += '</tbody></table></div>'; | ||
|
||
var el = document.getElementById("app"); | ||
morphdom(el, html, {childrenOnly: true}); | ||
|
||
Monitoring.renderRate.ping(); | ||
setTimeout(render, ENV.timeout); | ||
}; | ||
|
||
render(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta name="description" content="DBMON NOT REACT" /> | ||
<link href="../lib/bootstrap.min.css" rel="stylesheet" type="text/css" /> | ||
<link href="../styles.css" rel="stylesheet" type="text/css" /> | ||
<title>dbmon</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="../ENV.js"></script> | ||
<script src="../lib/memory-stats.js"></script> | ||
<script src="../lib/monitor.js"></script> | ||
<script src="../lib/morphdom-umd.min.js"></script> | ||
<script src="./app.js"></script> | ||
<script src="../ga.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters