Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Management Portal #372

Closed
wants to merge 133 commits into from
Closed

Conversation

gill876
Copy link
Contributor

@gill876 gill876 commented Sep 1, 2020

The unit tests and documentation are on their way.

So far:

  • Able to disable any user
  • Able to disable any agent
  • View datapoints for an agent
  • Able to disable any datapoint for an agent
  • More visual changes
  • Ability to login
  • Ability to purge data
  • Make into a system daemon
  • Add system daemon to installation

Pending:

  • Login specifically for admin or regular user
  • Unit tests for Flask routes

# Block access if no user was found in session
return response

response = {'data':{'message': 'Query did not run'}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Initialize response at beginning

# number of days
oldestDay = (datetime.datetime.fromtimestamp((_difference / 1000))).day

response = {'data':{'oldestDay': oldestDay, 'message': 'Query ran'}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Add code number to response. Possibly as a separate field.


# Define the AGENTS global variable
USERS = Blueprint('USERS', __name__)

Copy link
Contributor

Choose a reason for hiding this comment

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

Two spaces.

# Define the AGENTS global variable
AGENTS = Blueprint('AGENTS', __name__)

@AGENTS.route('/api/agent', methods=['GET'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Two spaces


# Define the AGENTS global variable
DATAPOINTS = Blueprint('DATAPOINTS', __name__)

Copy link
Contributor

Choose a reason for hiding this comment

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

Two spaces

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

  1. Documentation needs to be improved greatly.
  2. It would be good for your Flask API results to return a status code along with the message. Or no message at all. For example a blank dict if nothing found, or a 404 if invalid.
  3. There are number of cases where variables should be initialized earlier.

Generally much better than the previous PR. Congrats.


# Define the PANEL global variable
PANEL = Blueprint('PANEL', __name__)

Copy link
Contributor

Choose a reason for hiding this comment

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

Two spaces

password,
role))
print(
'\n\nUsername: {}\nPassword: {}\nRole: {} '
Copy link
Contributor

Choose a reason for hiding this comment

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

Use triple quoting and you won't need to insert the \n values.

'''\

Username: {}
Password: {}
Role: {}
'''.format(username, password, role)

@gill876 gill876 closed this Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants