Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IoTSmartMeter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kristian.tan
IoTSmartMeter
Commits
b7f3427f
Commit
b7f3427f
authored
Nov 14, 2019
by
Kristian Tan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
styling
parent
267b0eb6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
81 deletions
+78
-81
main.html
templates/main.html
+78
-81
No files found.
templates/main.html
View file @
b7f3427f
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
</head>
</head>
<div
class=
"heading"
>
<div
class=
"heading"
>
<h1>
IoT Smart Meter and Lighting Control
</h1>
<h1
>
IoT Smart Meter and Lighting Control
</h1>
</div>
</div>
<body>
<body>
<div
class=
"containerRows"
>
<div
class=
"containerRows"
>
<div
class=
"device_list"
>
<div
class=
"device_list"
>
<h3
class=
"device_list_title"
>
Device Listing and Status
</h3>
<h3
class=
"device_list_title"
>
Device Listing and Status
</h3>
...
@@ -19,21 +19,17 @@
...
@@ -19,21 +19,17 @@
<p>
<p>
{{ pins[pin].name }} :
{{ pins[pin].name }} :
{% if pins[pin].state == true %}
{% if pins[pin].state == true %}
(
<a
href=
"/toggle/{{
pin
}}"
>
turn off
</a>
)
(
<a
href=
"/toggle/{{
pin
}}"
>
turn off
</a>
)
(
<a
href=
"/remove/{{
pin
}}"
>
remove
</a>
)
(
<a
href=
"/remove/{{
pin
}}"
>
remove
</a>
)
{% else %}
{% else %}
(
<a
href=
"/toggle/{{
pin
}}"
>
turn on
</a>
)
(
<a
href=
"/toggle/{{
pin
}}"
>
turn on
</a>
)
(
<a
href=
"/remove/{{ pin
}}"
>
remove
</a>
)
(
<a
href=
"/remove/{{pin
}}"
>
remove
</a>
)
</p>
</p>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
<p><a
href=
"/devices/add_device"
>
Add device
</a></p>
<p
class=
"add_device"
><a
href=
"/devices/add_device"
>
Add device
</a></p>
</div>
<div
class=
"inputs"
>
{% if display_change_kWh == True %}
{% if display_change_kWh == True %}
<form
action=
"{{ url_for('handle_change_kWh') }}"
method=
"post"
>
<form
action=
"{{ url_for('handle_change_kWh') }}"
method=
"post"
>
Change cost per kWh:
<input
type=
"text"
name=
"kWhprice"
required
>
Change cost per kWh:
<input
type=
"text"
name=
"kWhprice"
required
>
...
@@ -50,11 +46,12 @@
...
@@ -50,11 +46,12 @@
</form>
</form>
</div>
</div>
{% endif %}
{% endif %}
</div>
</div>
<div
class=
"smart_meter"
>
<div
class=
"smart_meter"
>
<div
class=
"smart_meter_info"
>
<div
class=
"smart_meter_info"
>
{# Implement some way to display "No devices" message if none are in use#}
{# Implement some way to display "No devices" message if none are in use#}
<p>
Cost per kWh: £{{ cost_per_kWh }}
<a
href=
"/update_info/kWh"
>
(Update)
</a></p>
<p>
Cost per kWh: £{{ cost_per_kWh }}
<a
href=
"/update_info/kWh"
>
(Update)
</a></p>
<p>
Total energy used today: {{ daily_total }} kWh.
</p>
<p>
Total energy used today: {{ daily_total }} kWh.
</p>
<p>
Total cost of today's energy usage: £{{ todays_cost }}
</p>
<p>
Total cost of today's energy usage: £{{ todays_cost }}
</p>
...
@@ -68,22 +65,22 @@
...
@@ -68,22 +65,22 @@
{% endfor %}
{% endfor %}
</ul>
</ul>
{#
<div
class=
"chart"
>
#}
{#
<div
class=
"chart"
>
#}
<h3
class=
"chart_title"
>
Last weeks usage
</h3>
<h3
class=
"chart_title"
>
Last weeks usage
</h3>
<canvas
id=
"chart"
class=
"chart"
></canvas>
<canvas
id=
"chart"
class=
"chart"
></canvas>
<script>
<script>
// bar chart data
// bar chart data
var
barData
=
{
var
barData
=
{
labels
:
[
labels
:
[
{
%
for
item
in
labels
%
}
{
%
for
item
in
labels
%
}
"
{{ item }}
"
,
"
{{ item }}
"
,
{
%
endfor
%
}
{
%
endfor
%
}
],
],
datasets
:
[{
datasets
:
[{
fillColor
:
"
rgba(151,187,205,0.2)
"
,
fillColor
:
"
rgba(151,187,205,0.2)
"
,
strokeColor
:
"
rgba(151,187,205,1)
"
,
strokeColor
:
"
rgba(151,187,205,1)
"
,
pointColor
:
"
rgba(151,187,205,1)
"
,
pointColor
:
"
rgba(151,187,205,1)
"
,
data
:
[
data
:
[
{
%
for
item
in
values
%
}
{
%
for
item
in
values
%
}
"
{{ item }}
"
,
"
{{ item }}
"
,
{
%
endfor
%
}
{
%
endfor
%
}
...
@@ -102,16 +99,16 @@
...
@@ -102,16 +99,16 @@
scaleStepWidth
:
Math
.
ceil
(
max
/
steps
),
scaleStepWidth
:
Math
.
ceil
(
max
/
steps
),
scaleStartValue
:
0
,
scaleStartValue
:
0
,
scaleShowVerticalLines
:
true
,
scaleShowVerticalLines
:
true
,
scaleShowGridLines
:
true
,
scaleShowGridLines
:
true
,
barShowStroke
:
true
,
barShowStroke
:
true
,
scaleShowLabels
:
true
scaleShowLabels
:
true
}
}
);
);
</script>
</script>
{#
</div>
#}
{#
</div>
#}
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment