mirror of
https://gitlab.silvrtree.co.uk/martind2000/mdot_server.git
synced 2025-02-05 04:40:14 +00:00
new graph
This commit is contained in:
parent
3cfa66268b
commit
a77d458eac
@ -29,6 +29,9 @@
|
|||||||
console.log('model:all',d);
|
console.log('model:all',d);
|
||||||
this.temporal = {low: 0,high: 0};
|
this.temporal = {low: 0,high: 0};
|
||||||
});
|
});
|
||||||
|
this.on('remove', function(){
|
||||||
|
$('#output').empty();
|
||||||
|
});
|
||||||
|
|
||||||
this.on('add',function() {
|
this.on('add',function() {
|
||||||
this.processAdded();
|
this.processAdded();
|
||||||
@ -122,8 +125,9 @@
|
|||||||
_.bindAll(this, 'render', 'refresh', 'update');
|
_.bindAll(this, 'render', 'refresh', 'update');
|
||||||
this.collection.bind('change reset add remove', this.render, this);
|
this.collection.bind('change reset add remove', this.render, this);
|
||||||
|
|
||||||
this.template = _.template($('#list-template').html());
|
//this.template = _.template($('#list-template').html());
|
||||||
this.render();
|
this.template = _.template($('#loaded-template').html());
|
||||||
|
//this.render();
|
||||||
}, refresh: function() {
|
}, refresh: function() {
|
||||||
|
|
||||||
}, update: function() {
|
}, update: function() {
|
||||||
@ -136,8 +140,11 @@
|
|||||||
|
|
||||||
}, render: function() {
|
}, render: function() {
|
||||||
console.log('MDOT:render');
|
console.log('MDOT:render');
|
||||||
|
$('#output').empty();
|
||||||
var that = this;
|
var that = this;
|
||||||
|
that.$el.append(this.template);
|
||||||
|
|
||||||
|
/* var that = this;
|
||||||
this.$el.empty();
|
this.$el.empty();
|
||||||
this.collection.each(function(model) {
|
this.collection.each(function(model) {
|
||||||
var events = model.get('events');
|
var events = model.get('events');
|
||||||
@ -147,7 +154,7 @@
|
|||||||
that.$el.append(e);
|
that.$el.append(e);
|
||||||
|
|
||||||
});
|
});
|
||||||
console.log('bah');
|
console.log('bah');*/
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -208,6 +215,7 @@
|
|||||||
// this.collection.url = '/api/mdot/' + this.model.get('device');
|
// this.collection.url = '/api/mdot/' + this.model.get('device');
|
||||||
this.collection.url = '/apiv2/mdot/' + this.model.get('device');
|
this.collection.url = '/apiv2/mdot/' + this.model.get('device');
|
||||||
// this.collection.url = 'http://127.0.0.1:5984/mdot/_design/getDevice/_view/getDevice';
|
// this.collection.url = 'http://127.0.0.1:5984/mdot/_design/getDevice/_view/getDevice';
|
||||||
|
|
||||||
this.collection.fetch(fetchObj);
|
this.collection.fetch(fetchObj);
|
||||||
} else {
|
} else {
|
||||||
console.error('Nothing to get!');
|
console.error('Nothing to get!');
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<div id="graph">
|
<div id="graph">
|
||||||
</div>
|
</div>
|
||||||
|
<div id="output"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mui-col-md-9">
|
<div class="mui-col-md-9">
|
||||||
@ -37,7 +37,10 @@
|
|||||||
|
|
||||||
<!--<div id="main"></div>-->
|
<!--<div id="main"></div>-->
|
||||||
<!--<div id="graph"></div>-->
|
<!--<div id="graph"></div>-->
|
||||||
<div id="output"></div>
|
|
||||||
|
<script type="text/template" id="loaded-template">
|
||||||
|
<div style="background-color: darkred;color: white;font-weight: 900;text-align: center">Loaded</div>
|
||||||
|
</script>
|
||||||
<script type="text/template" id="main-template">
|
<script type="text/template" id="main-template">
|
||||||
<div class="mui-container">
|
<div class="mui-container">
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user