Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Add dashboard templates, version 0.1.0 without server functionality #40

Closed
wants to merge 26 commits into from

Conversation

Kappuccino111
Copy link
Collaborator

This commit adds the basic dashboard templates for the various dashboards. It also adds a new endpoint for temperature data and updates the URL configuration accordingly.

server/django/sensordata/templates/base.html Outdated Show resolved Hide resolved
server/django/server/urls.py Show resolved Hide resolved
server/django/sensordata/templates/base.html Show resolved Hide resolved
@jonas-rem
Copy link
Member

AdminLTE looks good and looks like it's actively maintained.

Their License hint is a little concerning, but I don't think that the risk of a re-licensing to a proprietary license is high. I have not seen them using Contributor License Agreements (CLAs) for contributors, so they would have to get the permission from all contributors (which hold the copyright) in case of a future license change. So all good from my side:

AdminLTE is an open source project by AdminLTE.io that is licensed under MIT. AdminLTE.io reserves the right to change the license of future releases.

This commit adds the basic dashboard templates for
the various dashboards. Also adds a new endpoint
for temperature data.

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>

Fix failing tests

This commit tries to fix the failing tests

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>

Remove unused imports

This commit removes trailing whitespaces and
removes unused imports

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>

Removing Trailing Whitespaces

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>

Minor Fix

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
This commit introduces the license page to the project, along with
an About dropdown menu.

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
@Kappuccino111
Copy link
Collaborator Author

@jonas-rem made all the changes as requested. The base frontend is good to go 👍

@Kappuccino111
Copy link
Collaborator Author

I am attaching a few screenshots here for easier review:

image image image image

@Kappuccino111 Kappuccino111 mentioned this pull request Jul 4, 2024
4 tasks
@jonas-rem
Copy link
Member

jonas-rem commented Jul 4, 2024

@Kappuccino111 as discussed, I merged the backend PRs that have been open. As those renamed some database resources (e.g. device -> endpoint) you have to rebase this PR and update the references.

@Kappuccino111
Copy link
Collaborator Author

@jonas-rem Yep, I now have some active conflicts to resolve after merging of other PRs. I will resolve them along with the additional implementation as discussed😁👍

@jonas-rem jonas-rem mentioned this pull request Jul 21, 2024
11 tasks
This commit merges all the changes from the main
branch into the frontend branch.

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
This commit fixes all tests and also finishes
integrating the new API schemes/serializers
with the frontend

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
This commit finishes all the frontend changes that
were discussed in the previous meeting. Should be
the first beta version of the frontend.

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
@Kappuccino111
Copy link
Collaborator Author

@jonas-rem the following changes have been made in this PR for the first version of the frontend.

  • Have a minimalist login page
  • Have the footer only in the licenses page
  • Update the logo to the latest design
  • Add a serialiser file that allows to configure a general mapping for the graph dashboard
  • Update any and all iterations according to the latest changes in the main branch

This should be merge-ready now 👍😄

@Kappuccino111 Kappuccino111 changed the title frontend: Add dashboard templates, temp-endpoint frontend: Add dashboard templates, version 1 without server functionality Aug 1, 2024
@Kappuccino111
Copy link
Collaborator Author

The server-side functionality (such as buttons for OTA, graph updates, and selection) will be implemented in the next PR. However, that PR can only be reviewed once we address the testing issue with POSIX frameworks, which currently prevents running the simulation.py script.

Copy link
Member

@jonas-rem jonas-rem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general mock up the dashboard look really good now. It looks very clean. I reviewed and marked the things that should be fixed before we merge.

But I think for future revisions we should soon switch to a second django app exclusively for the frontend so have a better separation of concerns. And have you thought about using the Django Rest Framework as an interface to the database. This could be more performant and allow dynamic updates easier.

For me the temerature/humidity graph demo does not work. I get the following error. Can look into it and test.

django-1 | WARNING log: Not Found: /data/temperature/

server/django/sensordata/templates/base_license.html Outdated Show resolved Hide resolved
server/django/sensordata/templates/base_license.html Outdated Show resolved Hide resolved
server/django/sensordata/templates/graph_dashboard.html Outdated Show resolved Hide resolved
server/django/sensordata/views.py Outdated Show resolved Hide resolved
server/django/sensordata/templates/base.html Outdated Show resolved Hide resolved
server/django/sensordata/templates/base_license.html Outdated Show resolved Hide resolved
server/django/sensordata/templates/base_license.html Outdated Show resolved Hide resolved
This commit updates all necessary files for
release 0.1.0.

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
@Kappuccino111
Copy link
Collaborator Author

@jonas-rem the graph functionality now works according to the latest schema. However, since the initial frontend PR was limited to a single client configuration, I have restricted the current setup to filter only based on resource_name, which doesn’t account for different clients.

Should be ready to merge.... Lesss goooo 😁🎉

@Kappuccino111 Kappuccino111 changed the title frontend: Add dashboard templates, version 1 without server functionality frontend: Add dashboard templates, version 0.1.0 without server functionality Aug 4, 2024
Kappuccino111 and others added 20 commits August 4, 2024 18:43
This commit updates the license.html file

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
This commit updates all instances of FlowNexus to
flownexus

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
Minor Update from Flow Nexus to flownexus

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Replace the former name lwm2m_server with the new official name
flownexus.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Add humidity sensor. Change default sensor to SHT40. If there is no
actual temperature sensor (e.g. for Simulation) temp/hum values will be
simulated randomly.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
LwM2M defines Execute Operations. Execute operations do not have a
payload and are send to Leshan via POST request instead of PUT request.

The LwM2M specification (Appendix C. Data Types) states that "none" "it
exclusively concerns Executable Resource". Therefore to distinguish
between execute operation and write operation the data type can be used.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Resource types are added through an initial database list. This list had
an issue and was not compliant with the LwM2M Specification.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Enable firmware update by:
- adding a FirmwareUpdate list to the database model. The FirmwareUpdate
  list is keeping track of the execution of firmware updates for each
  endpoint. It adds references to the two required resources from server
  to endpoint (Send URI, execute Update). Furthermore it adds a field
  for the State and the Result of an update.
- minor formatting improvements in models.py
- Implement business logic that initiates an OTA (send PackageURI).
- Implement remaining business logic in the base serializer. Django
  reacts on incoming Status/Result updates of the Update Object and
  updates the FirmwareUpdate representation. In addition it executes the
  update by default once the endpoint has downloaded the binary and
  notified django.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Some modules have been missing when I tested several things. The easiest
way is to just import all modules. The download time is reasonable, so
there are no major disadvantages.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
The download server for OTA updates could be different from the regular
server. The ota update does not send a complete URL, but only a path.
The host of the url is fixed in firmware.

This is a security feature to make sure the clients can never download
firmware from another than the specified server domain.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
- Add support for TLS Encryption (via Let's Enrypt Root CA)
   - Server has to support TLS_RSA_WITH_AES_128_GCM_SHA256
   - Future versions will move to self-signed certificates
- Add support for WIFI (if client supports)
- Implement http Download client
- Move to lwm2m update client functions (instead of registering lwm2m
  paths)

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
Add TLS support via Kconfig option as a default. TLS is currently only
used for OTA updates, not yet for LwM2M.

Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
This commit is to fix some basic formatting.

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
This commit fixes failing tests

Signed-off-by: Akarshan Kapoor <data.akarshan@icloud.com>
@Kappuccino111
Copy link
Collaborator Author

@jonas-rem The branch should be good for merging and release now. Squashing all commits into one would have been quite challenging, as it would require resolving conflicts from previous merges, so I left the history as it is. I have fixed all the failing tests and pushed the latest changes. The lines of code are now back to 1300. Everything is good to go! 👍😄

@Kappuccino111
Copy link
Collaborator Author

@jonas-rem merging this would successfully finish all tasks for release v0.1.0. Less gooo 🎉🎉

@Kappuccino111
Copy link
Collaborator Author

Closing. Please catch updates on #68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants