Merge pull request #1027 from tivac/legacy-dbmon
Add mithril@0.2.x version for comparison
This commit is contained in:
commit
3666aa747e
3 changed files with 2251 additions and 0 deletions
44
examples/dbmonster/mithril-0.2.x/app.js
Normal file
44
examples/dbmonster/mithril-0.2.x/app.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
"use strict"
|
||||
|
||||
var data = []
|
||||
|
||||
var root = document.getElementById("app")
|
||||
update()
|
||||
|
||||
function update() {
|
||||
data = ENV.generateData().toArray()
|
||||
|
||||
Monitoring.renderRate.ping()
|
||||
|
||||
m.redraw();
|
||||
|
||||
setTimeout(update, ENV.timeout)
|
||||
}
|
||||
|
||||
m.mount(root, {
|
||||
view : function() {
|
||||
return m("div", [
|
||||
m("table", { className: "table table-striped latest-data" }, [
|
||||
m("tbody",
|
||||
data.map(function(db) {
|
||||
return m("tr", {key: db.dbname}, [
|
||||
m("td", { className: "dbname" }, db.dbname),
|
||||
m("td", { className: "query-count" }, [
|
||||
m("span", { className: db.lastSample.countClassName }, db.lastSample.nbQueries)
|
||||
]),
|
||||
db.lastSample.topFiveQueries.map(function(query) {
|
||||
return m("td", { className: query.elapsedClassName }, [
|
||||
m("span", query.formatElapsed),
|
||||
m("div", { className: "popover left" }, [
|
||||
m("div", { className: "popover-content" }, query.query),
|
||||
m("div", { className: "arrow" })
|
||||
])
|
||||
])
|
||||
})
|
||||
])
|
||||
})
|
||||
)
|
||||
])
|
||||
])
|
||||
}
|
||||
});
|
||||
17
examples/dbmonster/mithril-0.2.x/index.html
Normal file
17
examples/dbmonster/mithril-0.2.x/index.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="description" content="DBMON Mithril 0.2.x" />
|
||||
<meta charset="utf-8">
|
||||
<link href="../styles.css" rel="stylesheet" type="text/css" />
|
||||
<title>dbmon (Mithril 0.2.x)</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="./mithril-0.2.4.js"></script>
|
||||
<script src="../ENV.js"></script>
|
||||
<script src="../memory-stats.js"></script>
|
||||
<script src="../monitor.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
2190
examples/dbmonster/mithril-0.2.x/mithril-0.2.4.js
Normal file
2190
examples/dbmonster/mithril-0.2.x/mithril-0.2.4.js
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue