Settings Page, API Stations List Call for Scraping System
Hey! Here is what I have been up to…
Settings Page:
This is a Admin only page (will pop up in nav bar when admin) that configures, deletes, creates, the main functionalities. This includes stations and users. After every function is run a error/success message will show with detailed intomation depending on the function.
These Functions include:
- Modify User: Change role, username, password
- Register User: Create
- Delete User
- Read User Assigned Stations: Choose a station, the page will reload and show all stations the user can access.
- Grant User Access: Choose a user, and give them access to a station. This is view only by default
- Revoke Access: Remove User access to a specific station. On reload after choosing a user it will show any assigned stations
- Update User Access: Choose a user, on reload it wil show all available stations and when selected, will show what access it has. You then check/uncheck the access you want it to have and submit.
- Modify Station: Currently only allows to change station name.
- Create Station: Enter new id and name as well as options to be public and in maintenance mode (default off).
- Delete Station: Deletes station only from the current stations. Does not delete data. I need to rewrite this to make it so it stops collecting data instead.
- Read all Stations: Lists all stations and if they are in maintenance or not
API Stations List Call
I realized around 11 at night that I did something very dumb. All of the stations in the configs for the Weather and Status scrapers were hard coded values and were NOT synced with the current stations database. To combat this, I added a new column to the Stations database table. This column was called collect_active or something of the sort. I plan to migrate the delete function to turning off the collection. I then changed the scrapers to pull a new current list at every run and used that as their truth. I finished this around 3 AM last night 😭 .
If you guys have any other ideas, let me know!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.