mirror of
https://github.com/beestat/app.git
synced 2025-05-24 02:14:03 -04:00
Changed page configuration to be detail, analyze, and compare
This commit is contained in:
parent
96403884f7
commit
38ad5e1a0f
@ -28,19 +28,19 @@ beestat.component.header.prototype.decorate_ = function(parent) {
|
||||
|
||||
pages = [
|
||||
{
|
||||
'layer': 'dashboard',
|
||||
'text': 'Dashboard',
|
||||
'icon': 'tablet_dashboard'
|
||||
'layer': 'detail',
|
||||
'text': 'Detail',
|
||||
'icon': 'eye_circle'
|
||||
},
|
||||
{
|
||||
'layer': 'sensors',
|
||||
'text': 'Sensors',
|
||||
'icon': 'signal_variant'
|
||||
'layer': 'analyze',
|
||||
'text': 'Analyze',
|
||||
'icon': 'home_search'
|
||||
},
|
||||
{
|
||||
'layer': 'comparisons',
|
||||
'text': 'Comparisons',
|
||||
'icon': 'home_group'
|
||||
'layer': 'compare',
|
||||
'text': 'Compare',
|
||||
'icon': 'earth'
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -1,12 +1,14 @@
|
||||
/**
|
||||
* Sensors layer.
|
||||
* Analyze layer.
|
||||
*/
|
||||
beestat.layer.sensors = function() {
|
||||
beestat.layer.analyze = function() {
|
||||
beestat.layer.apply(this, arguments);
|
||||
};
|
||||
beestat.extend(beestat.layer.sensors, beestat.layer);
|
||||
beestat.extend(beestat.layer.analyze, beestat.layer);
|
||||
|
||||
beestat.layer.analyze.prototype.decorate_ = function(parent) {
|
||||
const thermostat = beestat.cache.thermostat[beestat.setting('thermostat_id')];
|
||||
|
||||
beestat.layer.sensors.prototype.decorate_ = function(parent) {
|
||||
/*
|
||||
* Set the overflow on the body so the scrollbar is always present so
|
||||
* highcharts graphs render properly.
|
||||
@ -17,7 +19,7 @@ beestat.layer.sensors.prototype.decorate_ = function(parent) {
|
||||
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
||||
});
|
||||
|
||||
(new beestat.component.header('sensors')).render(parent);
|
||||
(new beestat.component.header('analyze')).render(parent);
|
||||
|
||||
// All the cards
|
||||
var cards = [];
|
||||
@ -33,15 +35,17 @@ beestat.layer.sensors.prototype.decorate_ = function(parent) {
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.sensors(),
|
||||
'card': new beestat.component.card.runtime_thermostat_summary(
|
||||
thermostat.thermostat_id
|
||||
),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.runtime_sensor_detail(
|
||||
beestat.setting('thermostat_id')
|
||||
'card': new beestat.component.card.temperature_profiles(
|
||||
thermostat.thermostat_id
|
||||
),
|
||||
'size': 12
|
||||
}
|
76
js/layer/compare.js
Normal file
76
js/layer/compare.js
Normal file
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* Compare layer.
|
||||
*/
|
||||
beestat.layer.compare = function() {
|
||||
beestat.layer.apply(this, arguments);
|
||||
};
|
||||
beestat.extend(beestat.layer.compare, beestat.layer);
|
||||
|
||||
beestat.layer.compare.prototype.decorate_ = function(parent) {
|
||||
/*
|
||||
* Set the overflow on the body so the scrollbar is always present so
|
||||
* highcharts graphs render properly.
|
||||
*/
|
||||
$('body').style({
|
||||
'overflow-y': 'scroll',
|
||||
'background': beestat.style.color.bluegray.light,
|
||||
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
||||
});
|
||||
|
||||
(new beestat.component.header('compare')).render(parent);
|
||||
|
||||
const thermostat = beestat.cache.thermostat[beestat.setting('thermostat_id')];
|
||||
|
||||
// All the cards
|
||||
const cards = [];
|
||||
|
||||
if (window.is_demo === true) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.demo(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.compare_notification(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.comparison_settings(
|
||||
thermostat.thermostat_id
|
||||
),
|
||||
'size': 6
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.my_home(
|
||||
thermostat.thermostat_id
|
||||
),
|
||||
'size': 6
|
||||
}
|
||||
]);
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.metrics(
|
||||
thermostat.thermostat_id
|
||||
),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
// Footer
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.footer(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
(new beestat.component.layout(cards)).render(parent);
|
||||
};
|
@ -1,105 +0,0 @@
|
||||
/**
|
||||
* Home comparisons layer.
|
||||
*/
|
||||
beestat.layer.comparisons = function() {
|
||||
beestat.layer.apply(this, arguments);
|
||||
};
|
||||
beestat.extend(beestat.layer.comparisons, beestat.layer);
|
||||
|
||||
beestat.layer.comparisons.prototype.decorate_ = function(parent) {
|
||||
/*
|
||||
* Set the overflow on the body so the scrollbar is always present so
|
||||
* highcharts graphs render properly.
|
||||
*/
|
||||
$('body').style({
|
||||
'overflow-y': 'scroll',
|
||||
'background': beestat.style.color.bluegray.light,
|
||||
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
||||
});
|
||||
|
||||
(new beestat.component.header('comparisons')).render(parent);
|
||||
|
||||
var thermostat = beestat.cache.thermostat[beestat.setting('thermostat_id')];
|
||||
var thermostat_group = beestat.cache.thermostat_group[thermostat.thermostat_group_id];
|
||||
|
||||
// All the cards
|
||||
var cards = [];
|
||||
|
||||
if (window.is_demo === true) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.demo(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.comparison_settings(),
|
||||
'size': 6
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.my_home(),
|
||||
'size': 6
|
||||
}
|
||||
]);
|
||||
|
||||
// Scores and graph
|
||||
if (thermostat_group.temperature_profile !== null) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.score.heat(),
|
||||
'size': 4
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.score.cool(),
|
||||
'size': 4
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.score.resist(),
|
||||
'size': 4
|
||||
}
|
||||
]);
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.temperature_profiles(thermostat_group.thermostat_group_id),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
if (thermostat_group.profile !== null) {
|
||||
if (beestat.user.has_early_access() === true) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.early_access(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.metrics(thermostat_group.thermostat_group_id),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.temperature_profiles_new(thermostat_group.thermostat_group_id),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Footer
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.footer(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
(new beestat.component.layout(cards)).render(parent);
|
||||
};
|
@ -1,82 +1,84 @@
|
||||
/**
|
||||
* Dashboard layer.
|
||||
*/
|
||||
beestat.layer.dashboard = function() {
|
||||
beestat.layer.apply(this, arguments);
|
||||
};
|
||||
beestat.extend(beestat.layer.dashboard, beestat.layer);
|
||||
|
||||
beestat.layer.dashboard.prototype.decorate_ = function(parent) {
|
||||
/*
|
||||
* Set the overflow on the body so the scrollbar is always present so
|
||||
* highcharts graphs render properly.
|
||||
*/
|
||||
$('body').style({
|
||||
'overflow-y': 'scroll',
|
||||
'background': beestat.style.color.bluegray.light,
|
||||
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
||||
});
|
||||
|
||||
(new beestat.component.header('dashboard')).render(parent);
|
||||
|
||||
// All the cards
|
||||
var cards = [];
|
||||
|
||||
if (window.is_demo === true) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.demo(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.system(),
|
||||
'size': 4
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.sensors(),
|
||||
'size': 4
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.alerts(),
|
||||
'size': 4
|
||||
}
|
||||
]);
|
||||
|
||||
if (beestat.component.card.patreon.should_show() === true) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.patreon(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.runtime_thermostat_detail(
|
||||
beestat.setting('thermostat_id')
|
||||
),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.runtime_thermostat_summary(
|
||||
beestat.setting('thermostat_id')
|
||||
),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.footer(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
(new beestat.component.layout(cards)).render(parent);
|
||||
};
|
||||
/**
|
||||
* Detail layer.
|
||||
*/
|
||||
beestat.layer.detail = function() {
|
||||
beestat.layer.apply(this, arguments);
|
||||
};
|
||||
beestat.extend(beestat.layer.detail, beestat.layer);
|
||||
|
||||
beestat.layer.detail.prototype.decorate_ = function(parent) {
|
||||
/*
|
||||
* Set the overflow on the body so the scrollbar is always present so
|
||||
* highcharts graphs render properly.
|
||||
*/
|
||||
$('body').style({
|
||||
'overflow-y': 'scroll',
|
||||
'background': beestat.style.color.bluegray.light,
|
||||
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
||||
});
|
||||
|
||||
(new beestat.component.header('detail')).render(parent);
|
||||
|
||||
// All the cards
|
||||
var cards = [];
|
||||
|
||||
if (window.is_demo === true) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.demo(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.system(),
|
||||
'size': 4
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.sensors(),
|
||||
'size': 4
|
||||
},
|
||||
{
|
||||
'card': new beestat.component.card.alerts(),
|
||||
'size': 4
|
||||
}
|
||||
]);
|
||||
|
||||
if (beestat.component.card.patreon.should_show() === true) {
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.patreon(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.runtime_thermostat_detail(
|
||||
beestat.setting('thermostat_id')
|
||||
),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.runtime_sensor_detail(
|
||||
beestat.setting('thermostat_id')
|
||||
),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
cards.push([
|
||||
{
|
||||
'card': new beestat.component.card.footer(),
|
||||
'size': 12
|
||||
}
|
||||
]);
|
||||
|
||||
(new beestat.component.layout(cards)).render(parent);
|
||||
};
|
@ -206,7 +206,7 @@ beestat.layer.load.prototype.decorate_ = function(parent) {
|
||||
// Enable polling for live updates
|
||||
beestat.enable_poll();
|
||||
|
||||
(new beestat.layer.dashboard()).render();
|
||||
(new beestat.layer.detail()).render();
|
||||
|
||||
beestat.ecobee.notify_if_down();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user