mirror of
https://github.com/beestat/app.git
synced 2025-06-03 21:57:32 -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 = [
|
pages = [
|
||||||
{
|
{
|
||||||
'layer': 'dashboard',
|
'layer': 'detail',
|
||||||
'text': 'Dashboard',
|
'text': 'Detail',
|
||||||
'icon': 'tablet_dashboard'
|
'icon': 'eye_circle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'layer': 'sensors',
|
'layer': 'analyze',
|
||||||
'text': 'Sensors',
|
'text': 'Analyze',
|
||||||
'icon': 'signal_variant'
|
'icon': 'home_search'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'layer': 'comparisons',
|
'layer': 'compare',
|
||||||
'text': 'Comparisons',
|
'text': 'Compare',
|
||||||
'icon': 'home_group'
|
'icon': 'earth'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
/**
|
/**
|
||||||
* Sensors layer.
|
* Analyze layer.
|
||||||
*/
|
*/
|
||||||
beestat.layer.sensors = function() {
|
beestat.layer.analyze = function() {
|
||||||
beestat.layer.apply(this, arguments);
|
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
|
* Set the overflow on the body so the scrollbar is always present so
|
||||||
* highcharts graphs render properly.
|
* highcharts graphs render properly.
|
||||||
@ -17,7 +19,7 @@ beestat.layer.sensors.prototype.decorate_ = function(parent) {
|
|||||||
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
||||||
});
|
});
|
||||||
|
|
||||||
(new beestat.component.header('sensors')).render(parent);
|
(new beestat.component.header('analyze')).render(parent);
|
||||||
|
|
||||||
// All the cards
|
// All the cards
|
||||||
var cards = [];
|
var cards = [];
|
||||||
@ -33,15 +35,17 @@ beestat.layer.sensors.prototype.decorate_ = function(parent) {
|
|||||||
|
|
||||||
cards.push([
|
cards.push([
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.sensors(),
|
'card': new beestat.component.card.runtime_thermostat_summary(
|
||||||
|
thermostat.thermostat_id
|
||||||
|
),
|
||||||
'size': 12
|
'size': 12
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
cards.push([
|
cards.push([
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.runtime_sensor_detail(
|
'card': new beestat.component.card.temperature_profiles(
|
||||||
beestat.setting('thermostat_id')
|
thermostat.thermostat_id
|
||||||
),
|
),
|
||||||
'size': 12
|
'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.
|
* Detail layer.
|
||||||
*/
|
*/
|
||||||
beestat.layer.dashboard = function() {
|
beestat.layer.detail = function() {
|
||||||
beestat.layer.apply(this, arguments);
|
beestat.layer.apply(this, arguments);
|
||||||
};
|
};
|
||||||
beestat.extend(beestat.layer.dashboard, beestat.layer);
|
beestat.extend(beestat.layer.detail, beestat.layer);
|
||||||
|
|
||||||
beestat.layer.dashboard.prototype.decorate_ = function(parent) {
|
beestat.layer.detail.prototype.decorate_ = function(parent) {
|
||||||
/*
|
/*
|
||||||
* Set the overflow on the body so the scrollbar is always present so
|
* Set the overflow on the body so the scrollbar is always present so
|
||||||
* highcharts graphs render properly.
|
* highcharts graphs render properly.
|
||||||
*/
|
*/
|
||||||
$('body').style({
|
$('body').style({
|
||||||
'overflow-y': 'scroll',
|
'overflow-y': 'scroll',
|
||||||
'background': beestat.style.color.bluegray.light,
|
'background': beestat.style.color.bluegray.light,
|
||||||
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
'padding': '0 ' + beestat.style.size.gutter + 'px'
|
||||||
});
|
});
|
||||||
|
|
||||||
(new beestat.component.header('dashboard')).render(parent);
|
(new beestat.component.header('detail')).render(parent);
|
||||||
|
|
||||||
// All the cards
|
// All the cards
|
||||||
var cards = [];
|
var cards = [];
|
||||||
|
|
||||||
if (window.is_demo === true) {
|
if (window.is_demo === true) {
|
||||||
cards.push([
|
cards.push([
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.demo(),
|
'card': new beestat.component.card.demo(),
|
||||||
'size': 12
|
'size': 12
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cards.push([
|
cards.push([
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.system(),
|
'card': new beestat.component.card.system(),
|
||||||
'size': 4
|
'size': 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.sensors(),
|
'card': new beestat.component.card.sensors(),
|
||||||
'size': 4
|
'size': 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.alerts(),
|
'card': new beestat.component.card.alerts(),
|
||||||
'size': 4
|
'size': 4
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (beestat.component.card.patreon.should_show() === true) {
|
if (beestat.component.card.patreon.should_show() === true) {
|
||||||
cards.push([
|
cards.push([
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.patreon(),
|
'card': new beestat.component.card.patreon(),
|
||||||
'size': 12
|
'size': 12
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cards.push([
|
cards.push([
|
||||||
{
|
{
|
||||||
'card': new beestat.component.card.runtime_thermostat_detail(
|
'card': new beestat.component.card.runtime_thermostat_detail(
|
||||||
beestat.setting('thermostat_id')
|
beestat.setting('thermostat_id')
|
||||||
),
|
),
|
||||||
'size': 12
|
'size': 12
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
cards.push([
|
|
||||||
{
|
cards.push([
|
||||||
'card': new beestat.component.card.runtime_thermostat_summary(
|
{
|
||||||
beestat.setting('thermostat_id')
|
'card': new beestat.component.card.runtime_sensor_detail(
|
||||||
),
|
beestat.setting('thermostat_id')
|
||||||
'size': 12
|
),
|
||||||
}
|
'size': 12
|
||||||
]);
|
}
|
||||||
cards.push([
|
]);
|
||||||
{
|
|
||||||
'card': new beestat.component.card.footer(),
|
cards.push([
|
||||||
'size': 12
|
{
|
||||||
}
|
'card': new beestat.component.card.footer(),
|
||||||
]);
|
'size': 12
|
||||||
|
}
|
||||||
(new beestat.component.layout(cards)).render(parent);
|
]);
|
||||||
};
|
|
||||||
|
(new beestat.component.layout(cards)).render(parent);
|
||||||
|
};
|
@ -206,7 +206,7 @@ beestat.layer.load.prototype.decorate_ = function(parent) {
|
|||||||
// Enable polling for live updates
|
// Enable polling for live updates
|
||||||
beestat.enable_poll();
|
beestat.enable_poll();
|
||||||
|
|
||||||
(new beestat.layer.dashboard()).render();
|
(new beestat.layer.detail()).render();
|
||||||
|
|
||||||
beestat.ecobee.notify_if_down();
|
beestat.ecobee.notify_if_down();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user