Skip to content

JDLanyon/IFB399_BeeAware_Hive_Inspections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

IFB399_BeeAware_Hive_Inspections

This is a hive inspection module for the base app for BeeAware The module provides 4 front end tables that allow for directly interracting with the backend tables.

Description

Instructions on how to use this as a user are outlined on the landing page.

image

Within this module, the two main javascript functions to note are;

hip_resyncTable(table) which makes get requests to pull all data from the specified table and rewrites the html table with the returned data.

hip_uploadTable(table) overwrites the existing backend table with information in the html table.

There are no robust checks for datatypes or null entries, so using the "upload table" button may not show a success alert.

Setup

Intended method

Using the base app found here, upload this module's .zip file.

image image

Manual install

In the event where the upload module functionality isn't working on the base app, you can manually add the module.

Editing table entries

For the module to be recognised, it must be referenced within glb_SecMod.

image

INSERT INTO glb_SecMod VALUES('hip', 'HInspect', 'Hive Inspections Module', 2);

Where 2 is the security level needed to access the module.

Adding files

From the hip.zip file, move all files to the base app following the file structure below.

BeeAware
├───Modules
│   ├───Controllers
│   │   └───hip
│   │           hip_Controller.cs
│   │
│   └───Models
│       └───hip
│               hip_Model.cs
│
└───wwwroot
    └───Modules
        ├───Css
        │       hip.css
        │
        ├───Html
        │       hip.html
        │
        └───Js
                hip.js

Known Issues

These will be explored further within the report.

onload event

Since the modules are added dynamically, window.onload() does not execute. This prevents loading relevant data once leaving tables to be updated everytime the user switches screens.

User IDs

When adding a row, the UserID is always set to 1

    ...
    <th>1</th> <!-- UserID -->
    ...

Rather than writing a GET request for the user id, it is already provided on the base app upon login

function login(event) {
    ...
        .then(response => {
            response.json().then(data => {
                if (response.status == 202) {
                    currentUser = data // <-- here
                    updateUserTab(currentUser)
                    switchPage('mainPage')
                    switchInnerPage('mainInnerPage')
                    ModuleCheck();
                    ModuleList();
    ...

currentUser should be accessed across modules for cases like updating the rows to have the correct userID, when uploading to the backend tables, security checks, etc.

Entries can be edited with devtools

There are only front-end preventions from users adding whatever data they desire. All datachecks and column restrictions are made via html but should also be checked before posting to tables.

This is quite an urgent issue as anyone can provide whatever data they wish.

Lack of security checks

The security level values aren't utilized within this module, allowing for users with any security level to add and remove any entires in the 5 provided tables.

SQLBinary

There is no front-end handling of this datatype. Ideally the user would be able to upload and preview images.

As a result a "Not available" is displayed under image columns and sections for this are commented out. The HiveInspectionNotes table has also been removed as a result of this as the table proves useless without handling the SQLBinary datatype.

Null entries appear as string "null" upon resync

No checks for NULL types are made before pushing entries to the html table, resulting in "null" rather than NULL in tables.


This is a public repository, however pull requests may not be accepted as this is a capstone project for QUT.