Skip to content

Commit

Permalink
Merge pull request #22 from tenbits/master
Browse files Browse the repository at this point in the history
add (MaskJS)
  • Loading branch information
mathieuancelin committed Sep 29, 2015
2 parents 30c9c5d + fa01184 commit e1d1feb
Show file tree
Hide file tree
Showing 8 changed files with 20,894 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.DS_Store
/node_modules
.idea
node_modules/**/*


!node_modules/maskjs
!node_modules/maskjs/lib
!node_modules/maskjs/lib/mask.js
2 changes: 2 additions & 0 deletions library-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
{ type: 'naive', id: 'backbone', url: './backbone', label: 'DBMON Backbone' },
{ type: 'naive', id: 'knockout', url: './knockout', label: 'DBMON Knockout' },
{ type: 'naive', id: 'regularjs', url: './regularjs', label: 'DBMON Regularjs' },
{ type: 'naive', id: 'maskjs', url: './mask/index.html', label: 'DBMON MaskJS' },
{ type: 'optimized', id: 'angular', url: './angular/opt.html', label: 'DBMON Angular' },
{ type: 'optimized', id: 'angular-light', url: './angular-light/opt.html', label: 'DBMON Angular Light' },
{ type: 'optimized', id: 'angular2', url: './angular2/opt.html', label: 'DBMON Angular 2.0 Alpha' },
{ type: 'optimized', id: 'angular-track-by', url: './angular-track-by', label: 'DBMON Angular with track by $index' },
{ type: 'optimized', id: 'vanilla', url: './vanilla-optimized', label: 'DBMON vanilla' },
{ type: 'optimized', id: 'maskjs', url: './mask/index_opt.html', label: 'DBMON MaskJS' },
];

function Library() {
Expand Down
37 changes: 37 additions & 0 deletions mask/DbMon.mask
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
define DbMon {

table.table.table-striped.latest-data > tbody > +each (databases) > tr {
td.dbname > '~dbname'
td.query-count >
span.~[lastSample.countClassName] >
'~lastSample.nbQueries'

each (lastSample.topFiveQueries) > td.~[elapsedClassName] {

'~formatElapsed'

.popover.left {
.popover-content > '~query'
.arrow;
}
}
}


function onRenderStart () {
this.tick = this.tick.bind(this);
this.model = {
databases: ENV.generateData().toArray()
};
}

slot domInsert () {
this.tick();
}

function tick () {
this.model.databases = ENV.generateData().toArray();
Monitoring.renderRate.ping();
setTimeout(this.tick, ENV.timeout);
}
}
35 changes: 35 additions & 0 deletions mask/DbMon_opt.mask
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
define DbMon {

table.table.table-striped.latest-data > tbody > +each (databases) > tr {
td.dbname > '~[bind: dbname]'
td.query-count >
span.~[bind: lastSample.countClassName] >
'~[bind: lastSample.nbQueries]'

each (lastSample.topFiveQueries) > td.~[bind: elapsedClassName] {
'~[bind: formatElapsed]'

.popover.left {
.popover-content > '~[bind: query]'
.arrow;
}
}
}

function onRenderStart () {
this.tick = this.tick.bind(this);
this.model = {
databases: ENV.generateData().toArray()
};
}

slot domInsert () {
this.tick();
}

function tick () {
this.model.databases = ENV.generateData(true).toArray();
Monitoring.renderRate.ping();
setTimeout(this.tick, ENV.timeout);
}
}
23 changes: 23 additions & 0 deletions mask/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!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">
<script type="text/mask" data-run="auto">
import DbMon from 'DbMon';

DbMon;
</script>
</div>
<script src="../ENV.js"></script>
<script src="../lib/memory-stats.js"></script>
<script src="../lib/monitor.js"></script>
<script src="../node_modules/maskjs/lib/mask.js"></script>
<script src="../ga.js"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions mask/index_opt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!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">
<script type="text/mask" data-run="auto">
import DbMon from 'DbMon_opt';

DbMon;
</script>
</div>
<script src="../ENV.js"></script>
<script src="../lib/memory-stats.js"></script>
<script src="../lib/monitor.js"></script>
<script src="../node_modules/maskjs/lib/mask.js"></script>
<script src="../ga.js"></script>
</body>
</html>
Loading

0 comments on commit e1d1feb

Please sign in to comment.