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
20a654b9
Commit
20a654b9
authored
Nov 13, 2019
by
Kristian Tan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put graph in smart meter box
parent
3736be77
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
40 deletions
+47
-40
main.css
static/css/main.css
+5
-0
main.html
templates/main.html
+42
-40
No files found.
static/css/main.css
View file @
20a654b9
...
@@ -54,3 +54,8 @@ body {
...
@@ -54,3 +54,8 @@ body {
.smart_meter_info
{
.smart_meter_info
{
margin-left
:
5%
;
margin-left
:
5%
;
}
}
.chart
{
width
:
600px
;
height
:
400px
;
}
\ No newline at end of file
templates/main.html
View file @
20a654b9
...
@@ -46,30 +46,9 @@
...
@@ -46,30 +46,9 @@
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</ul>
</div>
</div>
</div>
<div
class=
"inputs"
>
{% if display_change_kWh == True %}
<form
action=
"{{ url_for('handle_change_kWh') }}"
method=
"post"
>
Change cost per kWh:
<input
type=
"text"
name=
"kWhprice"
required
>
<input
type=
"submit"
>
</form>
{% endif %}
{% if display_new_device_form == True %}
<div
class=
".add_new_device_form"
>
<form
action=
"{{ url_for('handle_new_device') }}"
method=
"post"
>
New device name:
<input
type=
"text"
name=
"new_device_name"
required
>
<br>
New device wattage:
<input
type=
"number"
name=
"new_device_wattage"
required
>
<br>
<input
type=
"submit"
>
</form>
</div>
{% endif %}
</div>
<canvas
id=
"chart"
width=
"600"
height=
"400"
></canvas>
{#
<div
class=
"chart"
>
#}
<canvas
class=
"chart"
></canvas>
<script>
<script>
// bar chart data
// bar chart data
var
barData
=
{
var
barData
=
{
...
@@ -108,5 +87,28 @@
...
@@ -108,5 +87,28 @@
);
);
</script>
</script>
{#
</div>
#}
</div>
</div>
</div>
<div
class=
"inputs"
>
{% if display_change_kWh == True %}
<form
action=
"{{ url_for('handle_change_kWh') }}"
method=
"post"
>
Change cost per kWh:
<input
type=
"text"
name=
"kWhprice"
required
>
<input
type=
"submit"
>
</form>
{% endif %}
{% if display_new_device_form == True %}
<div
class=
".add_new_device_form"
>
<form
action=
"{{ url_for('handle_new_device') }}"
method=
"post"
>
New device name:
<input
type=
"text"
name=
"new_device_name"
required
>
<br>
New device wattage:
<input
type=
"number"
name=
"new_device_wattage"
required
>
<br>
<input
type=
"submit"
>
</form>
</div>
{% endif %}
</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