Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
357 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.11 on 2019-11-29 21:31 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('gravity', '0004_BrewersFriend_Support'), | ||
('external_push', '0003_BrewersFriend_Support'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='BrewfatherPushTarget', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('status', models.CharField(choices=[('active', 'Active'), ('disabled', 'Disabled'), ('error', 'Error')], default='active', help_text='Status of this push target', max_length=24)), | ||
('push_frequency', models.IntegerField(choices=[(901, '15 minutes'), (1801, '30 minutes'), (3601, '1 hour')], default=900, help_text='How often to push data to the target')), | ||
('logging_url', models.CharField(default='', help_text='Brewfather Logging URL', max_length=256)), | ||
('error_text', models.TextField(blank=True, default='', help_text='The error (if any) encountered on the last push attempt', null=True)), | ||
('last_triggered', models.DateTimeField(auto_now_add=True, help_text='The last time we pushed data to this target')), | ||
('gravity_sensor_to_push', models.ForeignKey(help_text='Gravity Sensor to push (create one push target per sensor to push)', on_delete=django.db.models.deletion.CASCADE, related_name='brewfather_push_target', to='gravity.GravitySensor')), | ||
], | ||
options={ | ||
'verbose_name': 'Brewfather Push Target', | ||
'verbose_name_plural': 'Brewfather Push Targets', | ||
}, | ||
), | ||
migrations.AlterField( | ||
model_name='brewersfriendpushtarget', | ||
name='gravity_sensor_to_push', | ||
field=models.ForeignKey(help_text='Gravity Sensor to push (create one push target per sensor to push)', on_delete=django.db.models.deletion.CASCADE, related_name='brewers_friend_push_target', to='gravity.GravitySensor'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
external_push/templates/external_push/brewfather_push_target_add.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% extends "sitewide/flat_ui_template.html" %} | ||
{% load custom_tags %} | ||
|
||
|
||
{% block title %}Add Brewfather Push Target{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h1 class="page-header">Add Brewfather Push Target</h1> | ||
{% if form.errors %} | ||
<div class="text-danger">Please correct the error {{ form.errors }} below.</div> | ||
{% endif %} | ||
<p> | ||
<form action="{% url "external_push_brewfather_target_add" %}" class="form-horizontal" method="post"> | ||
{% csrf_token %} | ||
|
||
<div id="pushTargetSection"> | ||
<h3 class="form-header">Push Target Settings</h3> | ||
{% form_generic form.push_frequency %} | ||
{% form_generic form.logging_url %} | ||
{% form_generic form.gravity_sensor_to_push %} | ||
</div> | ||
|
||
<input type="submit" value="Add Push Target" class="btn btn-primary" /> | ||
</form> | ||
</p> | ||
|
||
|
||
{% endblock %} | ||
|
||
{% block scripts %} | ||
<script> | ||
|
||
$(function () { | ||
$('[data-toggle="tooltip"]').tooltip() | ||
}) | ||
|
||
</script> | ||
|
||
{% endblock %} | ||
|
46 changes: 46 additions & 0 deletions
46
external_push/templates/external_push/brewfather_push_target_view.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{% extends "sitewide/flat_ui_template.html" %} | ||
{% load custom_tags %} | ||
|
||
|
||
{% block title %}Brewfather Push Target {{ push_target }}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h1 class="page-header">{{ push_target }}</h1> | ||
{% if form.errors %} | ||
<div class="text-danger">Please correct the error {{ form.errors }} below.</div> | ||
{% endif %} | ||
<p> | ||
<form action="{% url "external_push_brewfather_view" push_target.id %}" class="form-horizontal" method="post"> | ||
{% csrf_token %} | ||
|
||
<div id="pushTargetSection"> | ||
<h3 class="form-header">Push Target Settings</h3> | ||
{% form_generic form.push_frequency %} | ||
{% form_generic form.logging_url %} | ||
{% form_generic form.gravity_sensor_to_push %} | ||
</div> | ||
|
||
<input type="submit" value="Update Push Target" class="btn btn-primary" /> | ||
</form> | ||
</p> | ||
|
||
|
||
<p> | ||
<a href="{% url 'external_push_brewfather_delete' push_target.id %}" class="btn btn-large btn-lg btn-danger">Delete Push Target</a> | ||
</p> | ||
|
||
|
||
{% endblock %} | ||
|
||
{% block scripts %} | ||
<script> | ||
|
||
$(function () { | ||
$('[data-toggle="tooltip"]').tooltip() | ||
}) | ||
|
||
</script> | ||
|
||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.