-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rob Baynes
committed
Jun 19, 2018
1 parent
57f64b0
commit e922156
Showing
15 changed files
with
158 additions
and
12 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,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.4 on 2018-06-19 15:00 | ||
from __future__ import unicode_literals | ||
|
||
import django.contrib.postgres.fields.jsonb | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app', '0005_statemodel_iot'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='statemodel', | ||
name='resource', | ||
field=django.contrib.postgres.fields.jsonb.JSONField(default=''), | ||
preserve_default=False, | ||
), | ||
] |
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
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,21 @@ | ||
{% extends 'base.html' %} | ||
{% block content %} | ||
<html> | ||
<body> | ||
<div class="resource"> | ||
<div class="card"> | ||
<b>Resources</b> | ||
<ul> | ||
<li><b>Status:</b> {{ status }} | ||
<li><b>Available disk space:</b> {{ available_disk_space }} | ||
<li><b>Free memory:</b> {{ free_memory }} | ||
|
||
{% if error != None %} | ||
<li><b>Error:</b> {{ error }} | ||
{% endif %} | ||
</ul> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
{% 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
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
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,27 @@ | ||
#!/bin/bash | ||
|
||
# Get the latest code | ||
git pull | ||
|
||
# Install any new python modules | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
|
||
# Recreate a fresh (empty) database | ||
echo 'Recreating database...' | ||
if [[ "$OSTYPE" == "linux"* ]]; then | ||
sudo -u postgres psql -c "DROP DATABASE openag_brain;" | ||
sudo -u postgres psql -c "CREATE DATABASE openag_brain OWNER openag;" | ||
else # we are on OSX | ||
psql postgres -c "DROP DATABASE openag_brain;" | ||
psql postgres -c "CREATE DATABASE openag_brain OWNER openag;" | ||
fi | ||
|
||
# Load our models | ||
echo 'Creating the django/postgres database...' | ||
python manage.py migrate | ||
|
||
# Clean up any files we don't need | ||
rm logs/*.log logs/peripherals/*.log images/*.png | ||
|
||
|