Skip to content

Commit

Permalink
Merge pull request #10 from vuejs/master
Browse files Browse the repository at this point in the history
add vue implementation
  • Loading branch information
mathieuancelin committed Jun 4, 2015
2 parents 1fa1f94 + 0075880 commit 52adbae
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<li><a href="./canvas">DBMON canvas</a></li>
<li><a href="./react-canvas">DBMON react-canvas</a></li>
<li><a href="./sammy">DBMON sammy</a></li>
<li><a href="./vue">DBMON Vue.js</a></li>
</ul>
<br/>
<span>
Expand All @@ -79,7 +80,6 @@
<br/>
<br/>
<ul>
<li><a href="#">DBMON Vue.js</a></li>
<li><a href="#">DBMON Backbone</a></li>
<li><a href="#">DBMON Knockout</a></li>
<li><a href="#">DBMON Aurelia</a></li>
Expand Down
8 changes: 8 additions & 0 deletions lib/vue.min.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions vue/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var app = new Vue({
el: '#app',
data: {
databases: []
}
})

function loadSamples() {
app.databases = ENV.generateData().toArray();
Monitoring.renderRate.ping();
setTimeout(loadSamples, ENV.timeout);
}

loadSamples()
36 changes: 36 additions & 0 deletions vue/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="dbmon vue" />
<link href="../lib/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../styles.css" rel="stylesheet" type="text/css" />
<title>dbmon (Vue)</title>
</head>
<body>
<div id="app">
<table class="table table-striped lastest-data">
<tbody>
<tr v-repeat="db: databases" track-by="$index">
<td class="dbname">{{db.dbname}}</td>
<td class="query-count">
<span class="{{db.lastSample.countClassName}}">{{db.lastSample.queries.length}}</span>
</td>
<td v-repeat="q: db.lastSample.topFiveQueries" track-by="$index" class="Query {{q.elapsedClassName}}">
{{q.formatElapsed}}
<div class="popover left">
<div class="popover-content">{{q.query}}</div>
<div class="arrow"></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>

<script src="../ENV.js"></script>
<script src="../lib/memory-stats.js"></script>
<script src="../lib/monitor.js"></script>
<script src="../lib/vue.min.js"></script>
<script src="./app.js"></script>
</body>
</html>

0 comments on commit 52adbae

Please sign in to comment.